@math.gl/core 4.0.0-alpha.2 → 4.0.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@ import { vec2_transformMat4AsVector, vec3_transformMat4AsVector } from "../lib/g
4
4
  import { fromQuat as mat4_fromQuat, frustum as mat4_frustum, lookAt as mat4_lookAt, ortho as mat4_ortho, perspective as mat4_perspective, determinant as mat4_determinant, transpose as mat4_transpose, invert as mat4_invert, multiply as mat4_multiply, rotateX as mat4_rotateX, rotateY as mat4_rotateY, rotateZ as mat4_rotateZ, rotate as mat4_rotate, scale as mat4_scale, translate as mat4_translate } from "../gl-matrix/mat4.js";
5
5
  import { transformMat4 as vec2_transformMat4 } from "../gl-matrix/vec2.js";
6
6
  import { transformMat4 as vec3_transformMat4 } from "../gl-matrix/vec3.js";
7
- import { transformMat4 as vec4_transformMat4 } from "../gl-matrix/vec3.js";
7
+ import { transformMat4 as vec4_transformMat4 } from "../gl-matrix/vec4.js";
8
8
  var INDICES;
9
9
 
10
10
  (function (INDICES) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/classes/matrix4.ts"],"names":["Matrix","checkVector","vec2_transformMat4AsVector","vec3_transformMat4AsVector","fromQuat","mat4_fromQuat","frustum","mat4_frustum","lookAt","mat4_lookAt","ortho","mat4_ortho","perspective","mat4_perspective","determinant","mat4_determinant","transpose","mat4_transpose","invert","mat4_invert","multiply","mat4_multiply","rotateX","mat4_rotateX","rotateY","mat4_rotateY","rotateZ","mat4_rotateZ","rotate","mat4_rotate","scale","mat4_scale","translate","mat4_translate","transformMat4","vec2_transformMat4","vec3_transformMat4","vec4_transformMat4","INDICES","DEFAULT_FOVY","Math","PI","DEFAULT_ASPECT","DEFAULT_NEAR","DEFAULT_FAR","IDENTITY_MATRIX","Object","freeze","Matrix4","IDENTITY","getIdentityMatrix","ZERO","getZeroMatrix","ELEMENTS","RANK","constructor","array","arguments","length","Array","isArray","copy","identity","check","set","m00","m10","m20","m30","m01","m11","m21","m31","m02","m12","m22","m32","m03","m13","m23","m33","setRowMajor","toRowMajor","result","fromObject","object","fromQuaternion","quaternion","view","left","right","bottom","top","near","far","Infinity","computeInfinitePerspectiveOffCenter","eye","center","up","orthographic","fovy","aspect","focalDistance","checkRadians","halfY","tan","getScale","sqrt","getTranslation","getRotation","scaleResult","inverseScale0","inverseScale1","inverseScale2","getRotationMatrix3","multiplyLeft","a","multiplyRight","radians","rotateXYZ","angleXYZ","rotateAxis","axis","factor","vector","transform","transformAsPoint","out","Error","transformAsVector","transformPoint","transformVector","transformDirection","makeRotationX","makeTranslation","x","y","z","possiblyDegrees","column0Row0","column1Row1","column2Row0","column2Row1","column2Row2","column2Row3","column3Row2"],"mappings":"SAIQA,M;SACAC,W;SAGAC,0B,EAA4BC,0B;SAGlCC,QAAQ,IAAIC,a,EACZC,OAAO,IAAIC,Y,EACXC,MAAM,IAAIC,W,EACVC,KAAK,IAAIC,U,EACTC,WAAW,IAAIC,gB,EACfC,WAAW,IAAIC,gB,EACfC,SAAS,IAAIC,c,EACbC,MAAM,IAAIC,W,EACVC,QAAQ,IAAIC,a,EACZC,OAAO,IAAIC,Y,EACXC,OAAO,IAAIC,Y,EACXC,OAAO,IAAIC,Y,EACXC,MAAM,IAAIC,W,EACVC,KAAK,IAAIC,U,EACTC,SAAS,IAAIC,c;SAEPC,aAAa,IAAIC,kB;SACjBD,aAAa,IAAIE,kB;SACjBF,aAAa,IAAIG,kB;IAEpBC,O;;WAAAA,O;AAAAA,EAAAA,O,CAAAA,O;AAAAA,EAAAA,O,CAAAA,O;AAAAA,EAAAA,O,CAAAA,O;AAAAA,EAAAA,O,CAAAA,O;AAAAA,EAAAA,O,CAAAA,O;AAAAA,EAAAA,O,CAAAA,O;AAAAA,EAAAA,O,CAAAA,O;AAAAA,EAAAA,O,CAAAA,O;AAAAA,EAAAA,O,CAAAA,O;AAAAA,EAAAA,O,CAAAA,O;AAAAA,EAAAA,O,CA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D,IAAzB;AACAV,EAAAA,MAAM,CAAC,CAAD,CAAN,GAAYyD,WAAZ;AACAzD,EAAAA,MAAM,CAAC,CAAD,CAAN,GAAY,CAAZ;AACAA,EAAAA,MAAM,CAAC,CAAD,CAAN,GAAY,CAAZ;AACAA,EAAAA,MAAM,CAAC,CAAD,CAAN,GAAY,CAAZ;AACAA,EAAAA,MAAM,CAAC,CAAD,CAAN,GAAY,CAAZ;AACAA,EAAAA,MAAM,CAAC,CAAD,CAAN,GAAY0D,WAAZ;AACA1D,EAAAA,MAAM,CAAC,CAAD,CAAN,GAAY,CAAZ;AACAA,EAAAA,MAAM,CAAC,CAAD,CAAN,GAAY,CAAZ;AACAA,EAAAA,MAAM,CAAC,CAAD,CAAN,GAAY2D,WAAZ;AACA3D,EAAAA,MAAM,CAAC,CAAD,CAAN,GAAY4D,WAAZ;AACA5D,EAAAA,MAAM,CAAC,EAAD,CAAN,GAAa6D,WAAb;AACA7D,EAAAA,MAAM,CAAC,EAAD,CAAN,GAAa8D,WAAb;AACA9D,EAAAA,MAAM,CAAC,EAAD,CAAN,GAAa,CAAb;AACAA,EAAAA,MAAM,CAAC,EAAD,CAAN,GAAa,CAAb;AACAA,EAAAA,MAAM,CAAC,EAAD,CAAN,GAAa+D,WAAb;AACA/D,EAAAA,MAAM,CAAC,EAAD,CAAN,GAAa,CAAb;AACA,SAAOA,MAAP;AACD","sourcesContent":["// Copyright (c) 2017 Uber Technologies, Inc.\n// MIT License\n\nimport {NumericArray} from '@math.gl/types';\nimport {Matrix} from './base/matrix';\nimport {checkVector} from '../lib/validators';\n\n/* eslint-disable camelcase */\nimport {vec2_transformMat4AsVector, vec3_transformMat4AsVector} from '../lib/gl-matrix-extras';\n// @ts-ignore gl-matrix types...\nimport {\n fromQuat as mat4_fromQuat,\n frustum as mat4_frustum,\n lookAt as mat4_lookAt,\n ortho as mat4_ortho,\n perspective as mat4_perspective,\n determinant as mat4_determinant,\n transpose as mat4_transpose,\n invert as mat4_invert,\n multiply as mat4_multiply,\n rotateX as mat4_rotateX,\n rotateY as mat4_rotateY,\n rotateZ as mat4_rotateZ,\n rotate as mat4_rotate,\n scale as mat4_scale,\n translate as mat4_translate\n} from '../gl-matrix/mat4';\nimport {transformMat4 as vec2_transformMat4} from '../gl-matrix/vec2';\nimport {transformMat4 as vec3_transformMat4} from '../gl-matrix/vec3';\nimport {transformMat4 as vec4_transformMat4} from '../gl-matrix/vec3';\n\nenum INDICES {\n COL0ROW0 = 0,\n COL0ROW1 = 1,\n COL0ROW2 = 2,\n COL0ROW3 = 3,\n COL1ROW0 = 4,\n COL1ROW1 = 5,\n COL1ROW2 = 6,\n COL1ROW3 = 7,\n COL2ROW0 = 8,\n COL2ROW1 = 9,\n COL2ROW2 = 10,\n COL2ROW3 = 11,\n COL3ROW0 = 12,\n COL3ROW1 = 13,\n COL3ROW2 = 14,\n COL3ROW3 = 15\n}\n\nconst DEFAULT_FOVY = (45 * Math.PI) / 180;\nconst DEFAULT_ASPECT = 1;\nconst DEFAULT_NEAR = 0.1;\nconst DEFAULT_FAR = 500;\n\nconst IDENTITY_MATRIX = Object.freeze([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);\n\n/** 4x4 matrix */\nexport class Matrix4 extends Matrix {\n static get IDENTITY(): Readonly<Matrix4> {\n return getIdentityMatrix();\n }\n\n static get ZERO(): Readonly<Matrix4> {\n return getZeroMatrix();\n }\n\n get ELEMENTS(): number {\n return 16;\n }\n\n get RANK(): number {\n return 4;\n }\n\n get INDICES(): typeof INDICES {\n return INDICES;\n }\n\n constructor(array?: Readonly<NumericArray>) {\n // PERF NOTE: initialize elements as double precision numbers\n super(-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0);\n if (arguments.length === 1 && Array.isArray(array)) {\n this.copy(array);\n } else {\n this.identity();\n }\n }\n\n copy(array: Readonly<NumericArray>): this {\n this[0] = array[0];\n this[1] = array[1];\n this[2] = array[2];\n this[3] = array[3];\n this[4] = array[4];\n this[5] = array[5];\n this[6] = array[6];\n this[7] = array[7];\n this[8] = array[8];\n this[9] = array[9];\n this[10] = array[10];\n this[11] = array[11];\n this[12] = array[12];\n this[13] = array[13];\n this[14] = array[14];\n this[15] = array[15];\n return this.check();\n }\n\n // eslint-disable-next-line max-params\n set(\n m00: number,\n m10: number,\n m20: number,\n m30: number,\n m01: number,\n m11: number,\n m21: number,\n m31: number,\n m02: number,\n m12: number,\n m22: number,\n m32: number,\n m03: number,\n m13: number,\n m23: number,\n m33: number\n ): this {\n this[0] = m00;\n this[1] = m10;\n this[2] = m20;\n this[3] = m30;\n this[4] = m01;\n this[5] = m11;\n this[6] = m21;\n this[7] = m31;\n this[8] = m02;\n this[9] = m12;\n this[10] = m22;\n this[11] = m32;\n this[12] = m03;\n this[13] = m13;\n this[14] = m23;\n this[15] = m33;\n return this.check();\n }\n\n // accepts row major order, stores as column major\n // eslint-disable-next-line max-params\n setRowMajor(\n m00: number,\n m01: number,\n m02: number,\n m03: number,\n m10: number,\n m11: number,\n m12: number,\n m13: number,\n m20: number,\n m21: number,\n m22: number,\n m23: number,\n m30: number,\n m31: number,\n m32: number,\n m33: number\n ): this {\n this[0] = m00;\n this[1] = m10;\n this[2] = m20;\n this[3] = m30;\n this[4] = m01;\n this[5] = m11;\n this[6] = m21;\n this[7] = m31;\n this[8] = m02;\n this[9] = m12;\n this[10] = m22;\n this[11] = m32;\n this[12] = m03;\n this[13] = m13;\n this[14] = m23;\n this[15] = m33;\n return this.check();\n }\n\n toRowMajor(result: NumericArray): NumericArray {\n result[0] = this[0];\n result[1] = this[4];\n result[2] = this[8];\n result[3] = this[12];\n result[4] = this[1];\n result[5] = this[5];\n result[6] = this[9];\n result[7] = this[13];\n result[8] = this[2];\n result[9] = this[6];\n result[10] = this[10];\n result[11] = this[14];\n result[12] = this[3];\n result[13] = this[7];\n result[14] = this[11];\n result[15] = this[15];\n return result;\n }\n\n // Constructors\n\n /** Set to identity matrix */\n identity(): this {\n return this.copy(IDENTITY_MATRIX);\n }\n\n /**\n *\n * @param object\n * @returns self\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n fromObject(object: {[key: string]: any}): this {\n return this.check();\n }\n\n /**\n * Calculates a 4x4 matrix from the given quaternion\n * @param quaternion Quaternion to create matrix from\n * @returns self\n */\n fromQuaternion(quaternion: Readonly<NumericArray>): this {\n mat4_fromQuat(this, quaternion);\n return this.check();\n }\n\n /**\n * Generates a frustum matrix with the given bounds\n * @param view.left - Left bound of the frustum\n * @param view.right - Right bound of the frustum\n * @param view.bottom - Bottom bound of the frustum\n * @param view.top - Top bound of the frustum\n * @param view.near - Near bound of the frustum\n * @param view.far - Far bound of the frustum. Can be set to Infinity.\n * @returns self\n */\n frustum(view: {\n left: number;\n right: number;\n bottom: number;\n top: number;\n near: number;\n far?: number;\n }): this {\n const {left, right, bottom, top, near = DEFAULT_NEAR, far = DEFAULT_FAR} = view;\n if (far === Infinity) {\n computeInfinitePerspectiveOffCenter(this, left, right, bottom, top, near);\n } else {\n mat4_frustum(this, left, right, bottom, top, near, far);\n }\n return this.check();\n }\n\n /**\n * Generates a look-at matrix with the given eye position, focal point,\n * and up axis\n * @param view.eye - (vector) Position of the viewer\n * @param view.center - (vector) Point the viewer is looking at\n * @param view.up - (vector) Up axis\n * @returns self\n */\n lookAt(view: {\n eye: Readonly<NumericArray>;\n center?: Readonly<NumericArray>;\n up?: Readonly<NumericArray>;\n }): this {\n const {eye, center = [0, 0, 0], up = [0, 1, 0]} = view;\n mat4_lookAt(this, eye, center, up);\n return this.check();\n }\n\n /**\n * Generates a orthogonal projection matrix with the given bounds\n * from \"traditional\" view space parameters\n * @param view.left - Left bound of the frustum\n * @param view.right number Right bound of the frustum\n * @param view.bottom - Bottom bound of the frustum\n * @param view.top number Top bound of the frustum\n * @param view.near - Near bound of the frustum\n * @param view.far number Far bound of the frustum\n * @returns self\n */\n ortho(view: {\n left: number;\n right: number;\n bottom: number;\n top: number;\n near?: number;\n far?: number;\n }): this {\n const {left, right, bottom, top, near = DEFAULT_NEAR, far = DEFAULT_FAR} = view;\n mat4_ortho(this, left, right, bottom, top, near, far);\n return this.check();\n }\n\n /**\n * Generates an orthogonal projection matrix with the same parameters\n * as a perspective matrix (plus focalDistance)\n * @param view.fovy Vertical field of view in radians\n * @param view.aspect Aspect ratio. Typically viewport width / viewport height\n * @param view.focalDistance Distance in the view frustum used for extent calculations\n * @param view.near Near bound of the frustum\n * @param view.far Far bound of the frustum\n * @returns self\n */\n orthographic(view: {\n fovy?: number;\n aspect?: number;\n focalDistance?: number;\n near?: number;\n far?: number;\n }): this {\n const {\n fovy = DEFAULT_FOVY,\n aspect = DEFAULT_ASPECT,\n focalDistance = 1,\n near = DEFAULT_NEAR,\n far = DEFAULT_FAR\n } = view;\n\n checkRadians(fovy);\n\n const halfY = fovy / 2;\n const top = focalDistance * Math.tan(halfY); // focus_plane is the distance from the camera\n const right = top * aspect;\n\n return this.ortho({\n left: -right,\n right,\n bottom: -top,\n top,\n near,\n far\n });\n }\n\n /**\n * Generates a perspective projection matrix with the given bounds\n * @param view.fovy Vertical field of view in radians\n * @param view.aspect Aspect ratio. typically viewport width/height\n * @param view.near Near bound of the frustum\n * @param view.far Far bound of the frustum\n * @returns self\n */\n perspective(view: {fovy: number; aspect?: number; near?: number; far?: number}): this {\n const {fovy = (45 * Math.PI) / 180, aspect = 1, near = 0.1, far = 500} = view;\n checkRadians(fovy);\n mat4_perspective(this, fovy, aspect, near, far);\n return this.check();\n }\n\n // Accessors\n\n determinant(): number {\n return mat4_determinant(this);\n }\n\n /**\n * Extracts the non-uniform scale assuming the matrix is an affine transformation.\n * The scales are the \"lengths\" of the column vectors in the upper-left 3x3 matrix.\n * @param result\n * @returns self\n */\n getScale(result: NumericArray = [-0, -0, -0]): NumericArray {\n // explicit is faster than hypot...\n result[0] = Math.sqrt(this[0] * this[0] + this[1] * this[1] + this[2] * this[2]);\n result[1] = Math.sqrt(this[4] * this[4] + this[5] * this[5] + this[6] * this[6]);\n result[2] = Math.sqrt(this[8] * this[8] + this[9] * this[9] + this[10] * this[10]);\n // result[0] = Math.hypot(this[0], this[1], this[2]);\n // result[1] = Math.hypot(this[4], this[5], this[6]);\n // result[2] = Math.hypot(this[8], this[9], this[10]);\n return result;\n }\n\n /**\n * Gets the translation portion, assuming the matrix is a affine transformation matrix.\n * @param result\n * @returns self\n */\n getTranslation(result: NumericArray = [-0, -0, -0]): NumericArray {\n result[0] = this[12];\n result[1] = this[13];\n result[2] = this[14];\n return result;\n }\n\n /**\n * Gets upper left 3x3 pure rotation matrix (non-scaling), assume affine transformation matrix\n * @param result\n * @param scaleResult\n * @returns self\n */\n getRotation(result?: NumericArray, scaleResult?: NumericArray): NumericArray {\n result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0];\n scaleResult = scaleResult || [-0, -0, -0];\n const scale = this.getScale(scaleResult);\n const inverseScale0 = 1 / scale[0];\n const inverseScale1 = 1 / scale[1];\n const inverseScale2 = 1 / scale[2];\n result[0] = this[0] * inverseScale0;\n result[1] = this[1] * inverseScale1;\n result[2] = this[2] * inverseScale2;\n result[3] = 0;\n result[4] = this[4] * inverseScale0;\n result[5] = this[5] * inverseScale1;\n result[6] = this[6] * inverseScale2;\n result[7] = 0;\n result[8] = this[8] * inverseScale0;\n result[9] = this[9] * inverseScale1;\n result[10] = this[10] * inverseScale2;\n result[11] = 0;\n result[12] = 0;\n result[13] = 0;\n result[14] = 0;\n result[15] = 1;\n return result;\n }\n\n /**\n *\n * @param result\n * @param scaleResult\n * @returns self\n */\n getRotationMatrix3(result?: NumericArray, scaleResult?: NumericArray): NumericArray {\n result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0];\n scaleResult = scaleResult || [-0, -0, -0];\n const scale = this.getScale(scaleResult);\n const inverseScale0 = 1 / scale[0];\n const inverseScale1 = 1 / scale[1];\n const inverseScale2 = 1 / scale[2];\n result[0] = this[0] * inverseScale0;\n result[1] = this[1] * inverseScale1;\n result[2] = this[2] * inverseScale2;\n result[3] = this[4] * inverseScale0;\n result[4] = this[5] * inverseScale1;\n result[5] = this[6] * inverseScale2;\n result[6] = this[8] * inverseScale0;\n result[7] = this[9] * inverseScale1;\n result[8] = this[10] * inverseScale2;\n return result;\n }\n\n // Modifiers\n\n transpose(): this {\n mat4_transpose(this, this);\n return this.check();\n }\n\n invert(): this {\n mat4_invert(this, this);\n return this.check();\n }\n\n // Operations\n\n multiplyLeft(a: Readonly<NumericArray>): this {\n mat4_multiply(this, a, this);\n return this.check();\n }\n\n multiplyRight(a: Readonly<NumericArray>): this {\n mat4_multiply(this, this, a);\n return this.check();\n }\n\n // Rotates a matrix by the given angle around the X axis\n rotateX(radians: number): this {\n mat4_rotateX(this, this, radians);\n // mat4_rotate(this, this, radians, [1, 0, 0]);\n return this.check();\n }\n\n // Rotates a matrix by the given angle around the Y axis.\n rotateY(radians: number): this {\n mat4_rotateY(this, this, radians);\n // mat4_rotate(this, this, radians, [0, 1, 0]);\n return this.check();\n }\n\n /**\n * Rotates a matrix by the given angle around the Z axis.\n * @param radians\n * @returns self\n */\n rotateZ(radians: number): this {\n mat4_rotateZ(this, this, radians);\n // mat4_rotate(this, this, radians, [0, 0, 1]);\n return this.check();\n }\n\n /**\n *\n * @param param0\n * @returns self\n */\n rotateXYZ(angleXYZ: Readonly<NumericArray>): this {\n return this.rotateX(angleXYZ[0]).rotateY(angleXYZ[1]).rotateZ(angleXYZ[2]);\n }\n\n /**\n *\n * @param radians\n * @param axis\n * @returns self\n */\n rotateAxis(radians: number, axis: Readonly<NumericArray>): this {\n mat4_rotate(this, this, radians, axis);\n return this.check();\n }\n\n /**\n *\n * @param factor\n * @returns self\n */\n override scale(factor: number | Readonly<NumericArray>): this {\n mat4_scale(this, this, Array.isArray(factor) ? factor : [factor, factor, factor]);\n return this.check();\n }\n\n /**\n *\n * @param vec\n * @returns self\n */\n translate(vector: Readonly<NumericArray>): this {\n mat4_translate(this, this, vector);\n return this.check();\n }\n\n // Transforms\n\n /**\n * Transforms any 2, 3 or 4 element vector. 2 and 3 elements are treated as points\n * @param vector\n * @param result\n * @returns self\n */\n transform(vector: Readonly<NumericArray>, result?: NumericArray): NumericArray {\n if (vector.length === 4) {\n result = vec4_transformMat4(result || [-0, -0, -0, -0], vector, this) as NumericArray;\n checkVector(result, 4);\n return result;\n }\n return this.transformAsPoint(vector, result);\n }\n\n /**\n * Transforms any 2 or 3 element array as point (w implicitly 1)\n * @param vector\n * @param result\n * @returns self\n */\n transformAsPoint(vector: Readonly<NumericArray>, result?: NumericArray): NumericArray {\n const {length} = vector;\n let out: NumericArray;\n switch (length) {\n case 2:\n out = vec2_transformMat4(result || [-0, -0], vector, this) as NumericArray;\n break;\n case 3:\n out = vec3_transformMat4(result || [-0, -0, -0], vector, this) as NumericArray;\n break;\n default:\n throw new Error('Illegal vector');\n }\n checkVector(out, vector.length);\n return out;\n }\n\n /**\n * Transforms any 2 or 3 element array as vector (w implicitly 0)\n * @param vector\n * @param result\n * @returns self\n */\n transformAsVector(vector: Readonly<NumericArray>, result?: NumericArray): NumericArray {\n let out: NumericArray;\n switch (vector.length) {\n case 2:\n out = vec2_transformMat4AsVector(result || [-0, -0], vector, this);\n break;\n case 3:\n out = vec3_transformMat4AsVector(result || [-0, -0, -0], vector, this);\n break;\n default:\n throw new Error('Illegal vector');\n }\n checkVector(out, vector.length);\n return out;\n }\n\n /** @deprecated */\n transformPoint(vector: Readonly<NumericArray>, result?: NumericArray): NumericArray {\n return this.transformAsPoint(vector, result);\n }\n\n /** @deprecated */\n transformVector(vector: Readonly<NumericArray>, result?: NumericArray): NumericArray {\n return this.transformAsPoint(vector, result);\n }\n\n /** @deprecated */\n transformDirection(vector: Readonly<NumericArray>, result?: NumericArray): NumericArray {\n return this.transformAsVector(vector, result);\n }\n\n // three.js math API compatibility\n\n makeRotationX(radians: number): this {\n return this.identity().rotateX(radians);\n }\n\n makeTranslation(x: number, y: number, z: number): this {\n return this.identity().translate([x, y, z]);\n }\n}\n\n// TODO initializing static members directly is an option, but make sure no tree-shaking issues\nlet ZERO: Matrix4;\nlet IDENTITY: Matrix4;\n\nfunction getZeroMatrix(): Readonly<Matrix4> {\n if (!ZERO) {\n ZERO = new Matrix4([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);\n Object.freeze(ZERO);\n }\n return ZERO;\n}\n\nfunction getIdentityMatrix(): Matrix4 {\n if (!IDENTITY) {\n IDENTITY = new Matrix4();\n Object.freeze(IDENTITY);\n }\n return IDENTITY;\n}\n\n// HELPER FUNCTIONS\n\nfunction checkRadians(possiblyDegrees: number) {\n if (possiblyDegrees > Math.PI * 2) {\n throw Error('expected radians');\n }\n}\n\n// eslint-disable-next-line max-params\nfunction computeInfinitePerspectiveOffCenter(\n result: NumericArray,\n left: number,\n right: number,\n bottom: number,\n top: number,\n near: number\n): NumericArray {\n const column0Row0 = (2 * near) / (right - left);\n const column1Row1 = (2 * near) / (top - bottom);\n const column2Row0 = (right + left) / (right - left);\n const column2Row1 = (top + bottom) / (top - bottom);\n const column2Row2 = -1;\n const column2Row3 = -1;\n const column3Row2 = -2 * near;\n result[0] = column0Row0;\n result[1] = 0;\n result[2] = 0;\n result[3] = 0;\n result[4] = 0;\n result[5] = column1Row1;\n result[6] = 0;\n result[7] = 0;\n result[8] = column2Row0;\n result[9] = column2Row1;\n result[10] = column2Row2;\n result[11] = column2Row3;\n result[12] = 0;\n result[13] = 0;\n result[14] = column3Row2;\n result[15] = 0;\n return result;\n}\n"],"file":"matrix4.js"}
1
+ {"version":3,"sources":["../../src/classes/matrix4.ts"],"names":["Matrix","checkVector","vec2_transformMat4AsVector","vec3_transformMat4AsVector","fromQuat","mat4_fromQuat","frustum","mat4_frustum","lookAt","mat4_lookAt","ortho","mat4_ortho","perspective","mat4_perspective","determinant","mat4_determinant","transpose","mat4_transpose","invert","mat4_invert","multiply","mat4_multiply","rotateX","mat4_rotateX","rotateY","mat4_rotateY","rotateZ","mat4_rotateZ","rotate","mat4_rotate","scale","mat4_scale","translate","mat4_translate","transformMat4","vec2_transformMat4","vec3_transformMat4","vec4_transformMat4","INDICES","DEFAULT_FOVY","Math","PI","DEFAULT_ASPECT","DEFAULT_NEAR","DEFAULT_FAR","IDENTITY_MATRIX","Object","freeze","Matrix4","IDENTITY","getIdentityMatrix","ZERO","getZeroMatrix","ELEMENTS","RANK","constructor","array","arguments","length","Array","isArray","copy","identity","check","set","m00","m10","m20","m30","m01","m11","m21","m31","m02","m12","m22","m32","m03","m13","m23","m33","setRowMajor","toRowMajor","result","fromObject","object","fromQuaternion","quaternion","view","left","right","bottom","top","near","far","Infinity","computeInfinitePerspectiveOffCenter","eye","center","up","orthographic","fovy","aspect","focalDistance","checkRadians","halfY","tan","getScale","sqrt","getTranslation","getRotation","scaleResult","inverseScale0","inverseScale1","inverseScale2","getRotationMatrix3","multiplyLeft","a","multiplyRight","radians","rotateXYZ","angleXYZ","rotateAxis","axis","factor","vector","transform","transformAsPoint","out","Error","transformAsVector","transformPoint","transformVector","transformDirection","makeRotationX","makeTranslation","x","y","z","possiblyDegrees","column0Row0","column1Row1","column2Row0","column2Row1","column2Row2","column2Row3","column3Row2"],"mappings":"SAIQA,M;SACAC,W;SAGAC,0B,EAA4BC,0B;SAGlCC,QAAQ,IAAIC,a,EACZC,OAAO,IAAIC,Y,EACXC,MAAM,IAAIC,W,EACVC,KAAK,IAAIC,U,EACTC,WAAW,IAAIC,gB,EACfC,WAAW,IAAIC,gB,EACfC,SAAS,IAAIC,c,EACbC,MAAM,IAAIC,W,EACVC,QAAQ,IAAIC,a,EACZC,OAAO,IAAIC,Y,EACXC,OAAO,IAAIC,Y,EACXC,OAAO,IAAIC,Y,EACXC,MAAM,IAAIC,W,EACVC,KAAK,IAAIC,U,EACTC,SAAS,IAAIC,c;SAEPC,aAAa,IAAIC,kB;SACjBD,aAAa,IAAIE,kB;SACjBF,aAAa,IAAIG,kB;IAEpBC,O;;WAAAA,O;AAAAA,EAAAA,O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AAG,CAACpD,KAAK,GAAGD,IAAT,KAAkBC,KAAK,GAAGD,IAA1B,CAApB;AACA,QAAMsD,WAAW,GAAG,CAACnD,GAAG,GAAGD,MAAP,KAAkBC,GAAG,GAAGD,MAAxB,CAApB;AACA,QAAMqD,WAAW,GAAG,CAAC,CAArB;AACA,QAAMC,WAAW,GAAG,CAAC,CAArB;AACA,QAAMC,WAAW,GAAG,CAAC,CAAD,GAAKrD,IAAzB;AACAV,EAAAA,MAAM,CAAC,CAAD,CAAN,GAAYyD,WAAZ;AACAzD,EAAAA,MAAM,CAAC,CAAD,CAAN,GAAY,CAAZ;AACAA,EAAAA,MAAM,CAAC,CAAD,CAAN,GAAY,CAAZ;AACAA,EAAAA,MAAM,CAAC,CAAD,CAAN,GAAY,CAAZ;AACAA,EAAAA,MAAM,CAAC,CAAD,CAAN,GAAY,CAAZ;AACAA,EAAAA,MAAM,CAAC,CAAD,CAAN,GAAY0D,WAAZ;AACA1D,EAAAA,MAAM,CAAC,CAAD,CAAN,GAAY,CAAZ;AACAA,EAAAA,MAAM,CAAC,CAAD,CAAN,GAAY,CAAZ;AACAA,EAAAA,MAAM,CAAC,CAAD,CAAN,GAAY2D,WAAZ;AACA3D,EAAAA,MAAM,CAAC,CAAD,CAAN,GAAY4D,WAAZ;AACA5D,EAAAA,MAAM,CAAC,EAAD,CAAN,GAAa6D,WAAb;AACA7D,EAAAA,MAAM,CAAC,EAAD,CAAN,GAAa8D,WAAb;AACA9D,EAAAA,MAAM,CAAC,EAAD,CAAN,GAAa,CAAb;AACAA,EAAAA,MAAM,CAAC,EAAD,CAAN,GAAa,CAAb;AACAA,EAAAA,MAAM,CAAC,EAAD,CAAN,GAAa+D,WAAb;AACA/D,EAAAA,MAAM,CAAC,EAAD,CAAN,GAAa,CAAb;AACA,SAAOA,MAAP;AACD","sourcesContent":["// Copyright (c) 2017 Uber Technologies, Inc.\n// MIT License\n\nimport {NumericArray} from '@math.gl/types';\nimport {Matrix} from './base/matrix';\nimport {checkVector} from '../lib/validators';\n\n/* eslint-disable camelcase */\nimport {vec2_transformMat4AsVector, vec3_transformMat4AsVector} from '../lib/gl-matrix-extras';\n// @ts-ignore gl-matrix types...\nimport {\n fromQuat as mat4_fromQuat,\n frustum as mat4_frustum,\n lookAt as mat4_lookAt,\n ortho as mat4_ortho,\n perspective as mat4_perspective,\n determinant as mat4_determinant,\n transpose as mat4_transpose,\n invert as mat4_invert,\n multiply as mat4_multiply,\n rotateX as mat4_rotateX,\n rotateY as mat4_rotateY,\n rotateZ as mat4_rotateZ,\n rotate as mat4_rotate,\n scale as mat4_scale,\n translate as mat4_translate\n} from '../gl-matrix/mat4';\nimport {transformMat4 as vec2_transformMat4} from '../gl-matrix/vec2';\nimport {transformMat4 as vec3_transformMat4} from '../gl-matrix/vec3';\nimport {transformMat4 as vec4_transformMat4} from '../gl-matrix/vec4';\n\nenum INDICES {\n COL0ROW0 = 0,\n COL0ROW1 = 1,\n COL0ROW2 = 2,\n COL0ROW3 = 3,\n COL1ROW0 = 4,\n COL1ROW1 = 5,\n COL1ROW2 = 6,\n COL1ROW3 = 7,\n COL2ROW0 = 8,\n COL2ROW1 = 9,\n COL2ROW2 = 10,\n COL2ROW3 = 11,\n COL3ROW0 = 12,\n COL3ROW1 = 13,\n COL3ROW2 = 14,\n COL3ROW3 = 15\n}\n\nconst DEFAULT_FOVY = (45 * Math.PI) / 180;\nconst DEFAULT_ASPECT = 1;\nconst DEFAULT_NEAR = 0.1;\nconst DEFAULT_FAR = 500;\n\nconst IDENTITY_MATRIX = Object.freeze([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);\n\n/** 4x4 matrix */\nexport class Matrix4 extends Matrix {\n static get IDENTITY(): Readonly<Matrix4> {\n return getIdentityMatrix();\n }\n\n static get ZERO(): Readonly<Matrix4> {\n return getZeroMatrix();\n }\n\n get ELEMENTS(): number {\n return 16;\n }\n\n get RANK(): number {\n return 4;\n }\n\n get INDICES(): typeof INDICES {\n return INDICES;\n }\n\n constructor(array?: Readonly<NumericArray>) {\n // PERF NOTE: initialize elements as double precision numbers\n super(-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0);\n if (arguments.length === 1 && Array.isArray(array)) {\n this.copy(array);\n } else {\n this.identity();\n }\n }\n\n copy(array: Readonly<NumericArray>): this {\n this[0] = array[0];\n this[1] = array[1];\n this[2] = array[2];\n this[3] = array[3];\n this[4] = array[4];\n this[5] = array[5];\n this[6] = array[6];\n this[7] = array[7];\n this[8] = array[8];\n this[9] = array[9];\n this[10] = array[10];\n this[11] = array[11];\n this[12] = array[12];\n this[13] = array[13];\n this[14] = array[14];\n this[15] = array[15];\n return this.check();\n }\n\n // eslint-disable-next-line max-params\n set(\n m00: number,\n m10: number,\n m20: number,\n m30: number,\n m01: number,\n m11: number,\n m21: number,\n m31: number,\n m02: number,\n m12: number,\n m22: number,\n m32: number,\n m03: number,\n m13: number,\n m23: number,\n m33: number\n ): this {\n this[0] = m00;\n this[1] = m10;\n this[2] = m20;\n this[3] = m30;\n this[4] = m01;\n this[5] = m11;\n this[6] = m21;\n this[7] = m31;\n this[8] = m02;\n this[9] = m12;\n this[10] = m22;\n this[11] = m32;\n this[12] = m03;\n this[13] = m13;\n this[14] = m23;\n this[15] = m33;\n return this.check();\n }\n\n // accepts row major order, stores as column major\n // eslint-disable-next-line max-params\n setRowMajor(\n m00: number,\n m01: number,\n m02: number,\n m03: number,\n m10: number,\n m11: number,\n m12: number,\n m13: number,\n m20: number,\n m21: number,\n m22: number,\n m23: number,\n m30: number,\n m31: number,\n m32: number,\n m33: number\n ): this {\n this[0] = m00;\n this[1] = m10;\n this[2] = m20;\n this[3] = m30;\n this[4] = m01;\n this[5] = m11;\n this[6] = m21;\n this[7] = m31;\n this[8] = m02;\n this[9] = m12;\n this[10] = m22;\n this[11] = m32;\n this[12] = m03;\n this[13] = m13;\n this[14] = m23;\n this[15] = m33;\n return this.check();\n }\n\n toRowMajor(result: NumericArray): NumericArray {\n result[0] = this[0];\n result[1] = this[4];\n result[2] = this[8];\n result[3] = this[12];\n result[4] = this[1];\n result[5] = this[5];\n result[6] = this[9];\n result[7] = this[13];\n result[8] = this[2];\n result[9] = this[6];\n result[10] = this[10];\n result[11] = this[14];\n result[12] = this[3];\n result[13] = this[7];\n result[14] = this[11];\n result[15] = this[15];\n return result;\n }\n\n // Constructors\n\n /** Set to identity matrix */\n identity(): this {\n return this.copy(IDENTITY_MATRIX);\n }\n\n /**\n *\n * @param object\n * @returns self\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n fromObject(object: {[key: string]: any}): this {\n return this.check();\n }\n\n /**\n * Calculates a 4x4 matrix from the given quaternion\n * @param quaternion Quaternion to create matrix from\n * @returns self\n */\n fromQuaternion(quaternion: Readonly<NumericArray>): this {\n mat4_fromQuat(this, quaternion);\n return this.check();\n }\n\n /**\n * Generates a frustum matrix with the given bounds\n * @param view.left - Left bound of the frustum\n * @param view.right - Right bound of the frustum\n * @param view.bottom - Bottom bound of the frustum\n * @param view.top - Top bound of the frustum\n * @param view.near - Near bound of the frustum\n * @param view.far - Far bound of the frustum. Can be set to Infinity.\n * @returns self\n */\n frustum(view: {\n left: number;\n right: number;\n bottom: number;\n top: number;\n near: number;\n far?: number;\n }): this {\n const {left, right, bottom, top, near = DEFAULT_NEAR, far = DEFAULT_FAR} = view;\n if (far === Infinity) {\n computeInfinitePerspectiveOffCenter(this, left, right, bottom, top, near);\n } else {\n mat4_frustum(this, left, right, bottom, top, near, far);\n }\n return this.check();\n }\n\n /**\n * Generates a look-at matrix with the given eye position, focal point,\n * and up axis\n * @param view.eye - (vector) Position of the viewer\n * @param view.center - (vector) Point the viewer is looking at\n * @param view.up - (vector) Up axis\n * @returns self\n */\n lookAt(view: {\n eye: Readonly<NumericArray>;\n center?: Readonly<NumericArray>;\n up?: Readonly<NumericArray>;\n }): this {\n const {eye, center = [0, 0, 0], up = [0, 1, 0]} = view;\n mat4_lookAt(this, eye, center, up);\n return this.check();\n }\n\n /**\n * Generates a orthogonal projection matrix with the given bounds\n * from \"traditional\" view space parameters\n * @param view.left - Left bound of the frustum\n * @param view.right number Right bound of the frustum\n * @param view.bottom - Bottom bound of the frustum\n * @param view.top number Top bound of the frustum\n * @param view.near - Near bound of the frustum\n * @param view.far number Far bound of the frustum\n * @returns self\n */\n ortho(view: {\n left: number;\n right: number;\n bottom: number;\n top: number;\n near?: number;\n far?: number;\n }): this {\n const {left, right, bottom, top, near = DEFAULT_NEAR, far = DEFAULT_FAR} = view;\n mat4_ortho(this, left, right, bottom, top, near, far);\n return this.check();\n }\n\n /**\n * Generates an orthogonal projection matrix with the same parameters\n * as a perspective matrix (plus focalDistance)\n * @param view.fovy Vertical field of view in radians\n * @param view.aspect Aspect ratio. Typically viewport width / viewport height\n * @param view.focalDistance Distance in the view frustum used for extent calculations\n * @param view.near Near bound of the frustum\n * @param view.far Far bound of the frustum\n * @returns self\n */\n orthographic(view: {\n fovy?: number;\n aspect?: number;\n focalDistance?: number;\n near?: number;\n far?: number;\n }): this {\n const {\n fovy = DEFAULT_FOVY,\n aspect = DEFAULT_ASPECT,\n focalDistance = 1,\n near = DEFAULT_NEAR,\n far = DEFAULT_FAR\n } = view;\n\n checkRadians(fovy);\n\n const halfY = fovy / 2;\n const top = focalDistance * Math.tan(halfY); // focus_plane is the distance from the camera\n const right = top * aspect;\n\n return this.ortho({\n left: -right,\n right,\n bottom: -top,\n top,\n near,\n far\n });\n }\n\n /**\n * Generates a perspective projection matrix with the given bounds\n * @param view.fovy Vertical field of view in radians\n * @param view.aspect Aspect ratio. typically viewport width/height\n * @param view.near Near bound of the frustum\n * @param view.far Far bound of the frustum\n * @returns self\n */\n perspective(view: {fovy: number; aspect?: number; near?: number; far?: number}): this {\n const {fovy = (45 * Math.PI) / 180, aspect = 1, near = 0.1, far = 500} = view;\n checkRadians(fovy);\n mat4_perspective(this, fovy, aspect, near, far);\n return this.check();\n }\n\n // Accessors\n\n determinant(): number {\n return mat4_determinant(this);\n }\n\n /**\n * Extracts the non-uniform scale assuming the matrix is an affine transformation.\n * The scales are the \"lengths\" of the column vectors in the upper-left 3x3 matrix.\n * @param result\n * @returns self\n */\n getScale(result: NumericArray = [-0, -0, -0]): NumericArray {\n // explicit is faster than hypot...\n result[0] = Math.sqrt(this[0] * this[0] + this[1] * this[1] + this[2] * this[2]);\n result[1] = Math.sqrt(this[4] * this[4] + this[5] * this[5] + this[6] * this[6]);\n result[2] = Math.sqrt(this[8] * this[8] + this[9] * this[9] + this[10] * this[10]);\n // result[0] = Math.hypot(this[0], this[1], this[2]);\n // result[1] = Math.hypot(this[4], this[5], this[6]);\n // result[2] = Math.hypot(this[8], this[9], this[10]);\n return result;\n }\n\n /**\n * Gets the translation portion, assuming the matrix is a affine transformation matrix.\n * @param result\n * @returns self\n */\n getTranslation(result: NumericArray = [-0, -0, -0]): NumericArray {\n result[0] = this[12];\n result[1] = this[13];\n result[2] = this[14];\n return result;\n }\n\n /**\n * Gets upper left 3x3 pure rotation matrix (non-scaling), assume affine transformation matrix\n * @param result\n * @param scaleResult\n * @returns self\n */\n getRotation(result?: NumericArray, scaleResult?: NumericArray): NumericArray {\n result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0, -0];\n scaleResult = scaleResult || [-0, -0, -0];\n const scale = this.getScale(scaleResult);\n const inverseScale0 = 1 / scale[0];\n const inverseScale1 = 1 / scale[1];\n const inverseScale2 = 1 / scale[2];\n result[0] = this[0] * inverseScale0;\n result[1] = this[1] * inverseScale1;\n result[2] = this[2] * inverseScale2;\n result[3] = 0;\n result[4] = this[4] * inverseScale0;\n result[5] = this[5] * inverseScale1;\n result[6] = this[6] * inverseScale2;\n result[7] = 0;\n result[8] = this[8] * inverseScale0;\n result[9] = this[9] * inverseScale1;\n result[10] = this[10] * inverseScale2;\n result[11] = 0;\n result[12] = 0;\n result[13] = 0;\n result[14] = 0;\n result[15] = 1;\n return result;\n }\n\n /**\n *\n * @param result\n * @param scaleResult\n * @returns self\n */\n getRotationMatrix3(result?: NumericArray, scaleResult?: NumericArray): NumericArray {\n result = result || [-0, -0, -0, -0, -0, -0, -0, -0, -0];\n scaleResult = scaleResult || [-0, -0, -0];\n const scale = this.getScale(scaleResult);\n const inverseScale0 = 1 / scale[0];\n const inverseScale1 = 1 / scale[1];\n const inverseScale2 = 1 / scale[2];\n result[0] = this[0] * inverseScale0;\n result[1] = this[1] * inverseScale1;\n result[2] = this[2] * inverseScale2;\n result[3] = this[4] * inverseScale0;\n result[4] = this[5] * inverseScale1;\n result[5] = this[6] * inverseScale2;\n result[6] = this[8] * inverseScale0;\n result[7] = this[9] * inverseScale1;\n result[8] = this[10] * inverseScale2;\n return result;\n }\n\n // Modifiers\n\n transpose(): this {\n mat4_transpose(this, this);\n return this.check();\n }\n\n invert(): this {\n mat4_invert(this, this);\n return this.check();\n }\n\n // Operations\n\n multiplyLeft(a: Readonly<NumericArray>): this {\n mat4_multiply(this, a, this);\n return this.check();\n }\n\n multiplyRight(a: Readonly<NumericArray>): this {\n mat4_multiply(this, this, a);\n return this.check();\n }\n\n // Rotates a matrix by the given angle around the X axis\n rotateX(radians: number): this {\n mat4_rotateX(this, this, radians);\n // mat4_rotate(this, this, radians, [1, 0, 0]);\n return this.check();\n }\n\n // Rotates a matrix by the given angle around the Y axis.\n rotateY(radians: number): this {\n mat4_rotateY(this, this, radians);\n // mat4_rotate(this, this, radians, [0, 1, 0]);\n return this.check();\n }\n\n /**\n * Rotates a matrix by the given angle around the Z axis.\n * @param radians\n * @returns self\n */\n rotateZ(radians: number): this {\n mat4_rotateZ(this, this, radians);\n // mat4_rotate(this, this, radians, [0, 0, 1]);\n return this.check();\n }\n\n /**\n *\n * @param param0\n * @returns self\n */\n rotateXYZ(angleXYZ: Readonly<NumericArray>): this {\n return this.rotateX(angleXYZ[0]).rotateY(angleXYZ[1]).rotateZ(angleXYZ[2]);\n }\n\n /**\n *\n * @param radians\n * @param axis\n * @returns self\n */\n rotateAxis(radians: number, axis: Readonly<NumericArray>): this {\n mat4_rotate(this, this, radians, axis);\n return this.check();\n }\n\n /**\n *\n * @param factor\n * @returns self\n */\n override scale(factor: number | Readonly<NumericArray>): this {\n mat4_scale(this, this, Array.isArray(factor) ? factor : [factor, factor, factor]);\n return this.check();\n }\n\n /**\n *\n * @param vec\n * @returns self\n */\n translate(vector: Readonly<NumericArray>): this {\n mat4_translate(this, this, vector);\n return this.check();\n }\n\n // Transforms\n\n /**\n * Transforms any 2, 3 or 4 element vector. 2 and 3 elements are treated as points\n * @param vector\n * @param result\n * @returns self\n */\n transform(vector: Readonly<NumericArray>, result?: NumericArray): NumericArray {\n if (vector.length === 4) {\n result = vec4_transformMat4(result || [-0, -0, -0, -0], vector, this) as NumericArray;\n checkVector(result, 4);\n return result;\n }\n return this.transformAsPoint(vector, result);\n }\n\n /**\n * Transforms any 2 or 3 element array as point (w implicitly 1)\n * @param vector\n * @param result\n * @returns self\n */\n transformAsPoint(vector: Readonly<NumericArray>, result?: NumericArray): NumericArray {\n const {length} = vector;\n let out: NumericArray;\n switch (length) {\n case 2:\n out = vec2_transformMat4(result || [-0, -0], vector, this) as NumericArray;\n break;\n case 3:\n out = vec3_transformMat4(result || [-0, -0, -0], vector, this) as NumericArray;\n break;\n default:\n throw new Error('Illegal vector');\n }\n checkVector(out, vector.length);\n return out;\n }\n\n /**\n * Transforms any 2 or 3 element array as vector (w implicitly 0)\n * @param vector\n * @param result\n * @returns self\n */\n transformAsVector(vector: Readonly<NumericArray>, result?: NumericArray): NumericArray {\n let out: NumericArray;\n switch (vector.length) {\n case 2:\n out = vec2_transformMat4AsVector(result || [-0, -0], vector, this);\n break;\n case 3:\n out = vec3_transformMat4AsVector(result || [-0, -0, -0], vector, this);\n break;\n default:\n throw new Error('Illegal vector');\n }\n checkVector(out, vector.length);\n return out;\n }\n\n /** @deprecated */\n transformPoint(vector: Readonly<NumericArray>, result?: NumericArray): NumericArray {\n return this.transformAsPoint(vector, result);\n }\n\n /** @deprecated */\n transformVector(vector: Readonly<NumericArray>, result?: NumericArray): NumericArray {\n return this.transformAsPoint(vector, result);\n }\n\n /** @deprecated */\n transformDirection(vector: Readonly<NumericArray>, result?: NumericArray): NumericArray {\n return this.transformAsVector(vector, result);\n }\n\n // three.js math API compatibility\n\n makeRotationX(radians: number): this {\n return this.identity().rotateX(radians);\n }\n\n makeTranslation(x: number, y: number, z: number): this {\n return this.identity().translate([x, y, z]);\n }\n}\n\n// TODO initializing static members directly is an option, but make sure no tree-shaking issues\nlet ZERO: Matrix4;\nlet IDENTITY: Matrix4;\n\nfunction getZeroMatrix(): Readonly<Matrix4> {\n if (!ZERO) {\n ZERO = new Matrix4([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);\n Object.freeze(ZERO);\n }\n return ZERO;\n}\n\nfunction getIdentityMatrix(): Matrix4 {\n if (!IDENTITY) {\n IDENTITY = new Matrix4();\n Object.freeze(IDENTITY);\n }\n return IDENTITY;\n}\n\n// HELPER FUNCTIONS\n\nfunction checkRadians(possiblyDegrees: number) {\n if (possiblyDegrees > Math.PI * 2) {\n throw Error('expected radians');\n }\n}\n\n// eslint-disable-next-line max-params\nfunction computeInfinitePerspectiveOffCenter(\n result: NumericArray,\n left: number,\n right: number,\n bottom: number,\n top: number,\n near: number\n): NumericArray {\n const column0Row0 = (2 * near) / (right - left);\n const column1Row1 = (2 * near) / (top - bottom);\n const column2Row0 = (right + left) / (right - left);\n const column2Row1 = (top + bottom) / (top - bottom);\n const column2Row2 = -1;\n const column2Row3 = -1;\n const column3Row2 = -2 * near;\n result[0] = column0Row0;\n result[1] = 0;\n result[2] = 0;\n result[3] = 0;\n result[4] = 0;\n result[5] = column1Row1;\n result[6] = 0;\n result[7] = 0;\n result[8] = column2Row0;\n result[9] = column2Row1;\n result[10] = column2Row2;\n result[11] = column2Row3;\n result[12] = 0;\n result[13] = 0;\n result[14] = column3Row2;\n result[15] = 0;\n return result;\n}\n"],"file":"matrix4.js"}
package/dist/index.cjs CHANGED
@@ -2161,6 +2161,134 @@ function lookAt(out, eye, center, up) {
2161
2161
  return out;
2162
2162
  }
2163
2163
 
2164
+ // src/gl-matrix/vec4.js
2165
+ function create4() {
2166
+ const out = new ARRAY_TYPE(4);
2167
+ if (ARRAY_TYPE != Float32Array) {
2168
+ out[0] = 0;
2169
+ out[1] = 0;
2170
+ out[2] = 0;
2171
+ out[3] = 0;
2172
+ }
2173
+ return out;
2174
+ }
2175
+ function add(out, a, b) {
2176
+ out[0] = a[0] + b[0];
2177
+ out[1] = a[1] + b[1];
2178
+ out[2] = a[2] + b[2];
2179
+ out[3] = a[3] + b[3];
2180
+ return out;
2181
+ }
2182
+ function scale3(out, a, b) {
2183
+ out[0] = a[0] * b;
2184
+ out[1] = a[1] * b;
2185
+ out[2] = a[2] * b;
2186
+ out[3] = a[3] * b;
2187
+ return out;
2188
+ }
2189
+ function length2(a) {
2190
+ const x = a[0];
2191
+ const y = a[1];
2192
+ const z = a[2];
2193
+ const w = a[3];
2194
+ return Math.sqrt(x * x + y * y + z * z + w * w);
2195
+ }
2196
+ function squaredLength(a) {
2197
+ const x = a[0];
2198
+ const y = a[1];
2199
+ const z = a[2];
2200
+ const w = a[3];
2201
+ return x * x + y * y + z * z + w * w;
2202
+ }
2203
+ function normalize2(out, a) {
2204
+ const x = a[0];
2205
+ const y = a[1];
2206
+ const z = a[2];
2207
+ const w = a[3];
2208
+ let len2 = x * x + y * y + z * z + w * w;
2209
+ if (len2 > 0) {
2210
+ len2 = 1 / Math.sqrt(len2);
2211
+ }
2212
+ out[0] = x * len2;
2213
+ out[1] = y * len2;
2214
+ out[2] = z * len2;
2215
+ out[3] = w * len2;
2216
+ return out;
2217
+ }
2218
+ function dot2(a, b) {
2219
+ return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];
2220
+ }
2221
+ function lerp2(out, a, b, t) {
2222
+ const ax = a[0];
2223
+ const ay = a[1];
2224
+ const az = a[2];
2225
+ const aw = a[3];
2226
+ out[0] = ax + t * (b[0] - ax);
2227
+ out[1] = ay + t * (b[1] - ay);
2228
+ out[2] = az + t * (b[2] - az);
2229
+ out[3] = aw + t * (b[3] - aw);
2230
+ return out;
2231
+ }
2232
+ function transformMat43(out, a, m) {
2233
+ const x = a[0];
2234
+ const y = a[1];
2235
+ const z = a[2];
2236
+ const w = a[3];
2237
+ out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;
2238
+ out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;
2239
+ out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;
2240
+ out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;
2241
+ return out;
2242
+ }
2243
+ function transformQuat2(out, a, q) {
2244
+ const x = a[0];
2245
+ const y = a[1];
2246
+ const z = a[2];
2247
+ const qx = q[0];
2248
+ const qy = q[1];
2249
+ const qz = q[2];
2250
+ const qw = q[3];
2251
+ const ix = qw * x + qy * z - qz * y;
2252
+ const iy = qw * y + qz * x - qx * z;
2253
+ const iz = qw * z + qx * y - qy * x;
2254
+ const iw = -qx * x - qy * y - qz * z;
2255
+ out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;
2256
+ out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;
2257
+ out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;
2258
+ out[3] = a[3];
2259
+ return out;
2260
+ }
2261
+ var forEach3 = function() {
2262
+ const vec = create4();
2263
+ return function(a, stride, offset, count, fn, arg) {
2264
+ let i;
2265
+ let l;
2266
+ if (!stride) {
2267
+ stride = 4;
2268
+ }
2269
+ if (!offset) {
2270
+ offset = 0;
2271
+ }
2272
+ if (count) {
2273
+ l = Math.min(count * stride + offset, a.length);
2274
+ } else {
2275
+ l = a.length;
2276
+ }
2277
+ for (i = offset; i < l; i += stride) {
2278
+ vec[0] = a[i];
2279
+ vec[1] = a[i + 1];
2280
+ vec[2] = a[i + 2];
2281
+ vec[3] = a[i + 3];
2282
+ fn(vec, vec, arg);
2283
+ a[i] = vec[0];
2284
+ a[i + 1] = vec[1];
2285
+ a[i + 2] = vec[2];
2286
+ a[i + 3] = vec[3];
2287
+ }
2288
+ return a;
2289
+ };
2290
+ }();
2291
+
2164
2292
  // src/classes/matrix4.ts
2165
2293
  var INDICES2 = /* @__PURE__ */ ((INDICES3) => {
2166
2294
  INDICES3[INDICES3["COL0ROW0"] = 0] = "COL0ROW0";
@@ -2445,7 +2573,7 @@ var Matrix4 = class extends Matrix {
2445
2573
  }
2446
2574
  transform(vector, result) {
2447
2575
  if (vector.length === 4) {
2448
- result = transformMat42(result || [-0, -0, -0, -0], vector, this);
2576
+ result = transformMat43(result || [-0, -0, -0, -0], vector, this);
2449
2577
  checkVector(result, 4);
2450
2578
  return result;
2451
2579
  }
@@ -2546,123 +2674,6 @@ function computeInfinitePerspectiveOffCenter(result, left, right, bottom, top, n
2546
2674
  return result;
2547
2675
  }
2548
2676
 
2549
- // src/gl-matrix/vec4.js
2550
- function create4() {
2551
- const out = new ARRAY_TYPE(4);
2552
- if (ARRAY_TYPE != Float32Array) {
2553
- out[0] = 0;
2554
- out[1] = 0;
2555
- out[2] = 0;
2556
- out[3] = 0;
2557
- }
2558
- return out;
2559
- }
2560
- function add(out, a, b) {
2561
- out[0] = a[0] + b[0];
2562
- out[1] = a[1] + b[1];
2563
- out[2] = a[2] + b[2];
2564
- out[3] = a[3] + b[3];
2565
- return out;
2566
- }
2567
- function scale3(out, a, b) {
2568
- out[0] = a[0] * b;
2569
- out[1] = a[1] * b;
2570
- out[2] = a[2] * b;
2571
- out[3] = a[3] * b;
2572
- return out;
2573
- }
2574
- function length2(a) {
2575
- const x = a[0];
2576
- const y = a[1];
2577
- const z = a[2];
2578
- const w = a[3];
2579
- return Math.sqrt(x * x + y * y + z * z + w * w);
2580
- }
2581
- function squaredLength(a) {
2582
- const x = a[0];
2583
- const y = a[1];
2584
- const z = a[2];
2585
- const w = a[3];
2586
- return x * x + y * y + z * z + w * w;
2587
- }
2588
- function normalize2(out, a) {
2589
- const x = a[0];
2590
- const y = a[1];
2591
- const z = a[2];
2592
- const w = a[3];
2593
- let len2 = x * x + y * y + z * z + w * w;
2594
- if (len2 > 0) {
2595
- len2 = 1 / Math.sqrt(len2);
2596
- }
2597
- out[0] = x * len2;
2598
- out[1] = y * len2;
2599
- out[2] = z * len2;
2600
- out[3] = w * len2;
2601
- return out;
2602
- }
2603
- function dot2(a, b) {
2604
- return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];
2605
- }
2606
- function lerp2(out, a, b, t) {
2607
- const ax = a[0];
2608
- const ay = a[1];
2609
- const az = a[2];
2610
- const aw = a[3];
2611
- out[0] = ax + t * (b[0] - ax);
2612
- out[1] = ay + t * (b[1] - ay);
2613
- out[2] = az + t * (b[2] - az);
2614
- out[3] = aw + t * (b[3] - aw);
2615
- return out;
2616
- }
2617
- function transformQuat2(out, a, q) {
2618
- const x = a[0];
2619
- const y = a[1];
2620
- const z = a[2];
2621
- const qx = q[0];
2622
- const qy = q[1];
2623
- const qz = q[2];
2624
- const qw = q[3];
2625
- const ix = qw * x + qy * z - qz * y;
2626
- const iy = qw * y + qz * x - qx * z;
2627
- const iz = qw * z + qx * y - qy * x;
2628
- const iw = -qx * x - qy * y - qz * z;
2629
- out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;
2630
- out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;
2631
- out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;
2632
- out[3] = a[3];
2633
- return out;
2634
- }
2635
- var forEach3 = function() {
2636
- const vec = create4();
2637
- return function(a, stride, offset, count, fn, arg) {
2638
- let i;
2639
- let l;
2640
- if (!stride) {
2641
- stride = 4;
2642
- }
2643
- if (!offset) {
2644
- offset = 0;
2645
- }
2646
- if (count) {
2647
- l = Math.min(count * stride + offset, a.length);
2648
- } else {
2649
- l = a.length;
2650
- }
2651
- for (i = offset; i < l; i += stride) {
2652
- vec[0] = a[i];
2653
- vec[1] = a[i + 1];
2654
- vec[2] = a[i + 2];
2655
- vec[3] = a[i + 3];
2656
- fn(vec, vec, arg);
2657
- a[i] = vec[0];
2658
- a[i + 1] = vec[1];
2659
- a[i + 2] = vec[2];
2660
- a[i + 3] = vec[3];
2661
- }
2662
- return a;
2663
- };
2664
- }();
2665
-
2666
2677
  // src/gl-matrix/quat.ts
2667
2678
  function create5() {
2668
2679
  const out = new ARRAY_TYPE(4);
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "publishConfig": {
7
7
  "access": "public"
8
8
  },
9
- "version": "4.0.0-alpha.2",
9
+ "version": "4.0.0-alpha.4",
10
10
  "keywords": [
11
11
  "webgl",
12
12
  "javascript",
@@ -30,6 +30,13 @@
30
30
  "types": "dist/index.d.ts",
31
31
  "main": "dist/index.cjs",
32
32
  "module": "dist/index.js",
33
+ "exports": {
34
+ ".": {
35
+ "import": "./dist/index.js",
36
+ "require": "./dist/index.cjs",
37
+ "types": "./dist/index.d.ts"
38
+ }
39
+ },
33
40
  "files": [
34
41
  "dist",
35
42
  "src"
@@ -39,7 +46,7 @@
39
46
  ],
40
47
  "dependencies": {
41
48
  "@babel/runtime": "^7.12.0",
42
- "@math.gl/types": "4.0.0-alpha.2"
49
+ "@math.gl/types": "4.0.0-alpha.4"
43
50
  },
44
- "gitHead": "2e693639e3cf898fee8e323c93efdd07be7c2ca7"
51
+ "gitHead": "c58e63bfb9c25cd5a4fb2599b2b52c272ed55c67"
45
52
  }
@@ -27,7 +27,7 @@ import {
27
27
  } from '../gl-matrix/mat4';
28
28
  import {transformMat4 as vec2_transformMat4} from '../gl-matrix/vec2';
29
29
  import {transformMat4 as vec3_transformMat4} from '../gl-matrix/vec3';
30
- import {transformMat4 as vec4_transformMat4} from '../gl-matrix/vec3';
30
+ import {transformMat4 as vec4_transformMat4} from '../gl-matrix/vec4';
31
31
 
32
32
  enum INDICES {
33
33
  COL0ROW0 = 0,