@lightningjs/renderer 2.2.0 → 2.3.1

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.
Files changed (136) hide show
  1. package/dist/src/common/IAnimationController.d.ts +1 -1
  2. package/dist/src/core/CoreNode.d.ts +17 -0
  3. package/dist/src/core/CoreNode.js +18 -5
  4. package/dist/src/core/CoreNode.js.map +1 -1
  5. package/dist/src/core/Stage.d.ts +1 -0
  6. package/dist/src/core/Stage.js +8 -3
  7. package/dist/src/core/Stage.js.map +1 -1
  8. package/dist/src/core/animations/CoreAnimationController.js +3 -2
  9. package/dist/src/core/animations/CoreAnimationController.js.map +1 -1
  10. package/dist/src/core/renderers/CoreRenderer.d.ts +1 -0
  11. package/dist/src/core/renderers/CoreRenderer.js.map +1 -1
  12. package/dist/src/core/renderers/webgl/WebGlCoreRenderer.js +1 -1
  13. package/dist/src/core/renderers/webgl/WebGlCoreRenderer.js.map +1 -1
  14. package/dist/src/core/renderers/webgl/WebGlCoreShader.js +0 -9
  15. package/dist/src/core/renderers/webgl/WebGlCoreShader.js.map +1 -1
  16. package/dist/src/core/utils.d.ts +1 -1
  17. package/dist/src/main-api/Inspector.js +9 -0
  18. package/dist/src/main-api/Inspector.js.map +1 -1
  19. package/dist/src/main-api/Renderer.d.ts +10 -0
  20. package/dist/src/main-api/Renderer.js +2 -0
  21. package/dist/src/main-api/Renderer.js.map +1 -1
  22. package/dist/src/main-api/RendererMain.js +1 -1
  23. package/dist/src/main-api/RendererMain.js.map +1 -1
  24. package/dist/src/main-api/texture-usage-trackers/ManualCountTextureUsageTracker.js.map +1 -1
  25. package/dist/src/render-drivers/main/MainCoreDriver.js.map +1 -1
  26. package/dist/src/render-drivers/main/MainOnlyNode.js.map +1 -1
  27. package/dist/src/render-drivers/main/MainOnlyTextNode.js.map +1 -1
  28. package/dist/src/render-drivers/threadx/ThreadXCoreDriver.js.map +1 -1
  29. package/dist/src/render-drivers/threadx/ThreadXMainAnimationController.d.ts +8 -4
  30. package/dist/src/render-drivers/threadx/ThreadXMainAnimationController.js +53 -24
  31. package/dist/src/render-drivers/threadx/ThreadXMainAnimationController.js.map +1 -1
  32. package/dist/src/render-drivers/threadx/ThreadXMainNode.js.map +1 -1
  33. package/dist/src/render-drivers/threadx/ThreadXMainTextNode.js.map +1 -1
  34. package/dist/src/render-drivers/threadx/worker/ThreadXRendererNode.js +6 -0
  35. package/dist/src/render-drivers/threadx/worker/ThreadXRendererNode.js.map +1 -1
  36. package/dist/src/render-drivers/threadx/worker/renderer.js.map +1 -1
  37. package/dist/src/render-drivers/utils.js +6 -1
  38. package/dist/src/render-drivers/utils.js.map +1 -1
  39. package/dist/src/utils.d.ts +1 -1
  40. package/dist/src/utils.js +2 -2
  41. package/dist/src/utils.js.map +1 -1
  42. package/dist/tsconfig.dist.tsbuildinfo +1 -1
  43. package/dist/tsconfig.tsbuildinfo +1 -0
  44. package/package.json +1 -1
  45. package/src/common/IAnimationController.ts +5 -1
  46. package/src/core/CoreNode.test.ts +1 -0
  47. package/src/core/CoreNode.ts +39 -7
  48. package/src/core/Stage.ts +15 -2
  49. package/src/core/animations/CoreAnimationController.ts +3 -2
  50. package/src/core/renderers/CoreRenderer.ts +1 -0
  51. package/src/core/renderers/webgl/WebGlCoreRenderer.ts +5 -1
  52. package/src/core/renderers/webgl/WebGlCoreShader.ts +0 -11
  53. package/src/main-api/Inspector.ts +12 -0
  54. package/src/main-api/Renderer.ts +13 -0
  55. package/src/utils.ts +2 -1
  56. package/dist/src/core/Matrix2DContext.d.ts +0 -15
  57. package/dist/src/core/Matrix2DContext.js +0 -45
  58. package/dist/src/core/Matrix2DContext.js.map +0 -1
  59. package/dist/src/core/lib/SpatialHash.d.ts +0 -38
  60. package/dist/src/core/lib/SpatialHash.js +0 -93
  61. package/dist/src/core/lib/SpatialHash.js.map +0 -1
  62. package/dist/src/core/lib/glm/common.d.ts +0 -162
  63. package/dist/src/core/lib/glm/common.js +0 -81
  64. package/dist/src/core/lib/glm/common.js.map +0 -1
  65. package/dist/src/core/lib/glm/index.d.ts +0 -11
  66. package/dist/src/core/lib/glm/index.js +0 -30
  67. package/dist/src/core/lib/glm/index.js.map +0 -1
  68. package/dist/src/core/lib/glm/mat2.d.ts +0 -219
  69. package/dist/src/core/lib/glm/mat2.js +0 -396
  70. package/dist/src/core/lib/glm/mat2.js.map +0 -1
  71. package/dist/src/core/lib/glm/mat2d.d.ts +0 -237
  72. package/dist/src/core/lib/glm/mat2d.js +0 -442
  73. package/dist/src/core/lib/glm/mat2d.js.map +0 -1
  74. package/dist/src/core/lib/glm/mat3.d.ts +0 -283
  75. package/dist/src/core/lib/glm/mat3.js +0 -680
  76. package/dist/src/core/lib/glm/mat3.js.map +0 -1
  77. package/dist/src/core/lib/glm/mat4.d.ts +0 -550
  78. package/dist/src/core/lib/glm/mat4.js +0 -1802
  79. package/dist/src/core/lib/glm/mat4.js.map +0 -1
  80. package/dist/src/core/lib/glm/quat.d.ts +0 -363
  81. package/dist/src/core/lib/glm/quat.js +0 -693
  82. package/dist/src/core/lib/glm/quat.js.map +0 -1
  83. package/dist/src/core/lib/glm/quat2.d.ts +0 -356
  84. package/dist/src/core/lib/glm/quat2.js +0 -754
  85. package/dist/src/core/lib/glm/quat2.js.map +0 -1
  86. package/dist/src/core/lib/glm/vec2.d.ts +0 -365
  87. package/dist/src/core/lib/glm/vec2.js +0 -569
  88. package/dist/src/core/lib/glm/vec2.js.map +0 -1
  89. package/dist/src/core/lib/glm/vec3.d.ts +0 -406
  90. package/dist/src/core/lib/glm/vec3.js +0 -720
  91. package/dist/src/core/lib/glm/vec3.js.map +0 -1
  92. package/dist/src/core/lib/glm/vec4.d.ts +0 -330
  93. package/dist/src/core/lib/glm/vec4.js +0 -608
  94. package/dist/src/core/lib/glm/vec4.js.map +0 -1
  95. package/dist/src/core/lib/renderToTexture.d.ts +0 -1
  96. package/dist/src/core/lib/renderToTexture.js +0 -2
  97. package/dist/src/core/lib/renderToTexture.js.map +0 -1
  98. package/dist/src/core/lib/textcompression-utils.d.ts +0 -1
  99. package/dist/src/core/lib/textcompression-utils.js +0 -2
  100. package/dist/src/core/lib/textcompression-utils.js.map +0 -1
  101. package/dist/src/core/lib/txcompression-utils.d.ts +0 -1
  102. package/dist/src/core/lib/txcompression-utils.js +0 -2
  103. package/dist/src/core/lib/txcompression-utils.js.map +0 -1
  104. package/dist/src/core/renderers/webgl/WebGlRenderTexture.d.ts +0 -29
  105. package/dist/src/core/renderers/webgl/WebGlRenderTexture.js +0 -86
  106. package/dist/src/core/renderers/webgl/WebGlRenderTexture.js.map +0 -1
  107. package/dist/src/core/renderers/webgl/shaders/DistortShader.d.ts +0 -44
  108. package/dist/src/core/renderers/webgl/shaders/DistortShader.js +0 -172
  109. package/dist/src/core/renderers/webgl/shaders/DistortShader.js.map +0 -1
  110. package/dist/src/core/renderers/webgl/shaders/RefractionShader.d.ts +0 -78
  111. package/dist/src/core/renderers/webgl/shaders/RefractionShader.js +0 -172
  112. package/dist/src/core/renderers/webgl/shaders/RefractionShader.js.map +0 -1
  113. package/dist/src/core/scene/Scene.d.ts +0 -59
  114. package/dist/src/core/scene/Scene.js +0 -106
  115. package/dist/src/core/scene/Scene.js.map +0 -1
  116. package/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/makeRenderWindow.d.ts +0 -20
  117. package/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/makeRenderWindow.js +0 -55
  118. package/dist/src/core/text-rendering/renderers/SdfTextRenderer/internal/makeRenderWindow.js.map +0 -1
  119. package/dist/src/main-api/IRenderDriver.d.ts +0 -20
  120. package/dist/src/main-api/IRenderDriver.js +0 -20
  121. package/dist/src/main-api/IRenderDriver.js.map +0 -1
  122. package/dist/src/main-api/IShaderController.d.ts +0 -14
  123. package/dist/src/main-api/IShaderController.js +0 -30
  124. package/dist/src/main-api/IShaderController.js.map +0 -1
  125. package/dist/src/render-drivers/main/MainOnlyShaderController.d.ts +0 -6
  126. package/dist/src/render-drivers/main/MainOnlyShaderController.js +0 -15
  127. package/dist/src/render-drivers/main/MainOnlyShaderController.js.map +0 -1
  128. package/dist/src/render-drivers/main/MainRenderDriver.d.ts +0 -17
  129. package/dist/src/render-drivers/main/MainRenderDriver.js +0 -88
  130. package/dist/src/render-drivers/main/MainRenderDriver.js.map +0 -1
  131. package/dist/src/render-drivers/threadx/ThreadXMainShaderController.d.ts +0 -6
  132. package/dist/src/render-drivers/threadx/ThreadXMainShaderController.js +0 -15
  133. package/dist/src/render-drivers/threadx/ThreadXMainShaderController.js.map +0 -1
  134. package/dist/src/render-drivers/threadx/ThreadXRenderDriver.d.ts +0 -21
  135. package/dist/src/render-drivers/threadx/ThreadXRenderDriver.js +0 -198
  136. package/dist/src/render-drivers/threadx/ThreadXRenderDriver.js.map +0 -1
@@ -246,6 +246,18 @@ export class Inspector {
246
246
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any
247
247
  (node as any).div = div;
248
248
 
249
+ node.on('inViewport', () => {
250
+ div.setAttribute('state', 'inViewport');
251
+ });
252
+
253
+ node.on('inBounds', () => {
254
+ div.setAttribute('state', 'inBounds');
255
+ });
256
+
257
+ node.on('outOfBounds', () => {
258
+ div.setAttribute('state', 'outOfBounds');
259
+ });
260
+
249
261
  return this.createProxy(node, div);
250
262
  }
251
263
 
@@ -245,6 +245,17 @@ export interface RendererMainSettings {
245
245
  *
246
246
  */
247
247
  fontEngines: (typeof SdfTextRenderer | typeof CanvasTextRenderer)[];
248
+
249
+ /**
250
+ * Force WebGL2
251
+ *
252
+ * @remarks
253
+ * Force the renderer to use WebGL2. This can be used to force the renderer to
254
+ * use WebGL2 even if the browser supports WebGL1.
255
+ *
256
+ * @defaultValue `false`
257
+ */
258
+ forceWebGL2?: boolean;
248
259
  }
249
260
 
250
261
  /**
@@ -330,6 +341,7 @@ export class RendererMain extends EventEmitter {
330
341
  numImageWorkers:
331
342
  settings.numImageWorkers !== undefined ? settings.numImageWorkers : 2,
332
343
  enableContextSpy: settings.enableContextSpy ?? false,
344
+ forceWebGL2: settings.forceWebGL2 ?? false,
333
345
  inspector: settings.inspector ?? false,
334
346
  renderEngine: settings.renderEngine,
335
347
  quadBufferSize: settings.quadBufferSize ?? 4 * 1024 * 1024,
@@ -366,6 +378,7 @@ export class RendererMain extends EventEmitter {
366
378
  deviceLogicalPixelRatio: this.settings.deviceLogicalPixelRatio,
367
379
  devicePhysicalPixelRatio: this.settings.devicePhysicalPixelRatio,
368
380
  enableContextSpy: this.settings.enableContextSpy,
381
+ forceWebGL2: this.settings.forceWebGL2,
369
382
  fpsUpdateInterval: this.settings.fpsUpdateInterval,
370
383
  numImageWorkers: this.settings.numImageWorkers,
371
384
  renderEngine: this.settings.renderEngine,
package/src/utils.ts CHANGED
@@ -21,6 +21,7 @@ import type { ContextSpy } from './core/lib/ContextSpy.js';
21
21
 
22
22
  export function createWebGLContext(
23
23
  canvas: HTMLCanvasElement | OffscreenCanvas,
24
+ forceWebGL2 = false,
24
25
  contextSpy: ContextSpy | null,
25
26
  ): WebGLRenderingContext {
26
27
  const config: WebGLContextAttributes = {
@@ -38,7 +39,7 @@ export function createWebGLContext(
38
39
  const gl =
39
40
  // TODO: Remove this assertion once this issue is fixed in TypeScript
40
41
  // https://github.com/microsoft/TypeScript/issues/53614
41
- (canvas.getContext('webgl', config) ||
42
+ (canvas.getContext(forceWebGL2 ? 'webgl2' : 'webgl', config) ||
42
43
  canvas.getContext(
43
44
  'experimental-webgl' as 'webgl',
44
45
  config,
@@ -1,15 +0,0 @@
1
- /**
2
- * Represents a 2D transformation context, providing a 2x2 matrix for transformations.
3
- */
4
- export declare class Matrix2DContext {
5
- alpha: number;
6
- px: number;
7
- py: number;
8
- ta: number;
9
- tb: number;
10
- tc: number;
11
- td: number;
12
- isIdentity(): boolean;
13
- isIdentityMatrix(): boolean;
14
- isSquare(): boolean;
15
- }
@@ -1,45 +0,0 @@
1
- /*
2
- * If not stated otherwise in this file or this component's LICENSE file the
3
- * following copyright and licenses apply:
4
- *
5
- * Copyright 2023 Comcast Cable Communications Management, LLC.
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the License);
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
18
- */
19
- /**
20
- * Represents a 2D transformation context, providing a 2x2 matrix for transformations.
21
- */
22
- export class Matrix2DContext {
23
- // world alpha
24
- alpha = 1;
25
- // world position
26
- px = 0;
27
- py = 0;
28
- ta = 1;
29
- tb = 0;
30
- tc = 0;
31
- td = 1;
32
- isIdentity() {
33
- return (this.alpha === 1 &&
34
- this.px === 0 &&
35
- this.py === 0 &&
36
- this.isIdentityMatrix());
37
- }
38
- isIdentityMatrix() {
39
- return this.ta === 1 && this.tb === 0 && this.tc === 0 && this.td === 1;
40
- }
41
- isSquare() {
42
- return this.tb === 0 && this.tc === 0;
43
- }
44
- }
45
- //# sourceMappingURL=Matrix2DContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Matrix2DContext.js","sourceRoot":"","sources":["../../../src/core/Matrix2DContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH;;GAEG;AACH,MAAM,OAAO,eAAe;IAC1B,cAAc;IACd,KAAK,GAAG,CAAC,CAAC;IAEV,iBAAiB;IACjB,EAAE,GAAG,CAAC,CAAC;IACP,EAAE,GAAG,CAAC,CAAC;IAEP,EAAE,GAAG,CAAC,CAAC;IACP,EAAE,GAAG,CAAC,CAAC;IACP,EAAE,GAAG,CAAC,CAAC;IACP,EAAE,GAAG,CAAC,CAAC;IAEP,UAAU;QACR,OAAO,CACL,IAAI,CAAC,KAAK,KAAK,CAAC;YAChB,IAAI,CAAC,EAAE,KAAK,CAAC;YACb,IAAI,CAAC,EAAE,KAAK,CAAC;YACb,IAAI,CAAC,gBAAgB,EAAE,CACxB,CAAC;IACJ,CAAC;IAED,gBAAgB;QACd,OAAO,IAAI,CAAC,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;IAC1E,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;IACxC,CAAC;CACF"}
@@ -1,38 +0,0 @@
1
- /**
2
- * Spatial hash class to divide 2d space into a grid to store references to nodes
3
- */
4
- import type { CoreNode } from '../CoreNode.js';
5
- export declare class SpatialHash {
6
- private cellSize;
7
- private grid;
8
- private dirty;
9
- private locations;
10
- constructor(cellSize: number);
11
- /**
12
- * Map world coordinates to grid coordinates
13
- */
14
- private getHash;
15
- /**
16
- * Add Node to spatial Grid
17
- * @param node
18
- */
19
- insert(node: CoreNode): void;
20
- /**
21
- * Remove node from gridcell
22
- * @param node
23
- */
24
- remove(node: CoreNode, x?: number | undefined, y?: number | undefined): void;
25
- /**
26
- * Flag nodes as dirty that have a changed local transformation
27
- * @param node
28
- */
29
- flagDirty(node: CoreNode): void;
30
- /**
31
- * Lazy update new nodes
32
- * @param node
33
- */
34
- syncDirtyNodes(): void;
35
- update(node: CoreNode, oldX: number, oldY: number): void;
36
- query(x: number, y: number): Array<CoreNode>;
37
- private getCenter;
38
- }
@@ -1,93 +0,0 @@
1
- /**
2
- * Spatial hash class to divide 2d space into a grid to store references to nodes
3
- */
4
- export class SpatialHash {
5
- cellSize;
6
- grid;
7
- dirty;
8
- locations;
9
- constructor(cellSize) {
10
- this.cellSize = cellSize;
11
- this.grid = new Map();
12
- this.dirty = new Set();
13
- this.locations = new WeakMap();
14
- }
15
- /**
16
- * Map world coordinates to grid coordinates
17
- */
18
- getHash(x, y) {
19
- const gridXLocation = Math.floor(x / this.cellSize);
20
- const gridYLocation = Math.floor(y / this.cellSize);
21
- return `${gridXLocation},${gridYLocation}`;
22
- }
23
- /**
24
- * Add Node to spatial Grid
25
- * @param node
26
- */
27
- insert(node) {
28
- const point = this.getCenter(node);
29
- const hash = this.getHash(point.x, point.x);
30
- console.log(point);
31
- if (this.grid.has(hash) === false) {
32
- this.grid.set(hash, []);
33
- }
34
- this.grid.get(hash)?.push(node);
35
- this.locations.set(node, { x: point.x, y: point.y });
36
- }
37
- /**
38
- * Remove node from gridcell
39
- * @param node
40
- */
41
- remove(node, x = undefined, y = undefined) {
42
- const hash = this.getHash(x || node.absX, y || node.absY);
43
- const cell = this.grid.get(hash);
44
- if (cell !== undefined) {
45
- const index = cell.indexOf(node);
46
- if (index > -1) {
47
- cell.splice(index, 1);
48
- }
49
- }
50
- }
51
- /**
52
- * Flag nodes as dirty that have a changed local transformation
53
- * @param node
54
- */
55
- flagDirty(node) {
56
- this.dirty.add(node);
57
- }
58
- /**
59
- * Lazy update new nodes
60
- * @param node
61
- */
62
- syncDirtyNodes() {
63
- this.dirty.forEach((node) => {
64
- const location = this.locations.get(node);
65
- if (location) {
66
- const { x, y } = location;
67
- this.update(node, x, y);
68
- }
69
- });
70
- this.dirty.clear();
71
- }
72
- update(node, oldX, oldY) {
73
- // Remove node from old cell
74
- this.remove(node, oldX, oldY);
75
- // insert intro new cell
76
- this.insert(node);
77
- }
78
- query(x, y) {
79
- if (this.dirty.size > 0) {
80
- this.syncDirtyNodes();
81
- }
82
- const hash = this.getHash(x, y);
83
- return this.grid.get(hash) || [];
84
- }
85
- getCenter(node) {
86
- const { absX, absY, width, height } = node;
87
- return {
88
- x: absX + ~~(width / 2),
89
- y: absY + ~~(height / 2),
90
- };
91
- }
92
- }
93
- //# sourceMappingURL=SpatialHash.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SpatialHash.js","sourceRoot":"","sources":["../../../../src/core/lib/SpatialHash.ts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AAI,EAAE,IAAI,CAAC,CAAC;QAC9B,wBAAwB;QACxB,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IAEM,KAAK,CAAC,CAAS,EAAE,CAAS;QAC/B,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,EAAE;YACvB,IAAI,CAAC,cAAc,EAAE,CAAC;SACvB;QAED,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAChC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACnC,CAAC;IAEO,SAAS,CAAC,IAAc;QAC9B,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QAC3C,OAAO;YACL,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;YACvB,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;SACzB,CAAC;IACJ,CAAC;CACF"}
@@ -1,162 +0,0 @@
1
- export declare const EPSILON = 0.00001;
2
- export declare const RANDOM: () => number;
3
- export declare const ANGLE_ORDER = "zyx";
4
- export type ConversionOrder = 'xyz' | 'xzy' | 'yxz' | 'yzx' | 'zxy' | 'zyx';
5
- type RemoveIndex<T> = {
6
- [K in keyof T as number extends K ? never : K]: T[K];
7
- };
8
- export type Float32ArrayLen2 = RemoveIndex<Float32Array> & {
9
- 0: number;
10
- 1: number;
11
- length: 2;
12
- };
13
- export type NumberArrayLen2 = [number, number];
14
- export type Float32ArrayLen3 = RemoveIndex<Float32Array> & {
15
- 0: number;
16
- 1: number;
17
- 2: number;
18
- length: 3;
19
- };
20
- export type NumberArrayLen3 = [number, number, number];
21
- export type Float32ArrayLen4 = RemoveIndex<Float32Array> & {
22
- 0: number;
23
- 1: number;
24
- 2: number;
25
- 3: number;
26
- length: 4;
27
- };
28
- export type NumberArrayLen4 = [number, number, number, number];
29
- export type Float32ArrayLen6 = RemoveIndex<Float32Array> & {
30
- 0: number;
31
- 1: number;
32
- 2: number;
33
- 3: number;
34
- 4: number;
35
- 5: number;
36
- length: 6;
37
- };
38
- export type NumberArrayLen6 = [number, number, number, number, number, number];
39
- export type Float32ArrayLen8 = RemoveIndex<Float32Array> & {
40
- 0: number;
41
- 1: number;
42
- 2: number;
43
- 3: number;
44
- 4: number;
45
- 5: number;
46
- 6: number;
47
- 7: number;
48
- length: 8;
49
- };
50
- export type NumberArrayLen8 = [
51
- number,
52
- number,
53
- number,
54
- number,
55
- number,
56
- number,
57
- number,
58
- number
59
- ];
60
- export type Float32ArrayLen9 = RemoveIndex<Float32Array> & {
61
- 0: number;
62
- 1: number;
63
- 2: number;
64
- 3: number;
65
- 4: number;
66
- 5: number;
67
- 6: number;
68
- 7: number;
69
- 8: number;
70
- length: 9;
71
- };
72
- export type NumberArrayLen9 = [
73
- number,
74
- number,
75
- number,
76
- number,
77
- number,
78
- number,
79
- number,
80
- number,
81
- number
82
- ];
83
- export type Float32ArrayLen16 = RemoveIndex<Float32Array> & {
84
- 0: number;
85
- 1: number;
86
- 2: number;
87
- 3: number;
88
- 4: number;
89
- 5: number;
90
- 6: number;
91
- 7: number;
92
- 8: number;
93
- 9: number;
94
- 10: number;
95
- 11: number;
96
- 12: number;
97
- 13: number;
98
- 14: number;
99
- 15: number;
100
- length: 16;
101
- };
102
- export type NumberArrayLen16 = [
103
- number,
104
- number,
105
- number,
106
- number,
107
- number,
108
- number,
109
- number,
110
- number,
111
- number,
112
- number,
113
- number,
114
- number,
115
- number,
116
- number,
117
- number,
118
- number
119
- ];
120
- export interface FOV {
121
- upDegrees: number;
122
- downDegrees: number;
123
- leftDegrees: number;
124
- rightDegrees: number;
125
- }
126
- /**
127
- * Sets array type to be used.
128
- *
129
- * @param {number} size of matrix type
130
- * @returns {FloatArray} matrix type
131
- */
132
- export declare function setMatrixArrayType(type: Float32Array | number[]): void;
133
- /**
134
- * Return array type to be used.
135
- *
136
- * @param {number} size of matrix type
137
- * @returns {FloatArray} matrix type
138
- */
139
- export declare function getMatrixArrayType(size?: number): Float32Array | number[];
140
- /**
141
- * Convert Angle in Degrees To Radians
142
- *
143
- * @param {number} angle is an Angle in Degrees
144
- */
145
- export declare function toRadians(angle: number): number;
146
- /**
147
- * Convert Angle in Radians To an Angle in Radians
148
- *
149
- * @param {number} angle is an Angle in Radians
150
- */
151
- export declare function toDegrees(angle: number): number;
152
- /**
153
- * Tests whether or not the arguments have approximately the same value, within an absolute
154
- * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less
155
- * than or equal to 1.0, and a relative tolerance is used for larger values)
156
- *
157
- * @param {number} a The first number to test.
158
- * @param {number} b The second number to test.
159
- * @returns {boolean} True if the numbers are approximately equal, false otherwise.
160
- */
161
- export declare function equals(a: number, b: number): boolean;
162
- export {};
@@ -1,81 +0,0 @@
1
- /*
2
- * If not stated otherwise in this file or this component's LICENSE file the
3
- * following copyright and licenses apply:
4
- *
5
- * Copyright 2023 Comcast Cable Communications Management, LLC.
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the License);
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
18
- */
19
- export const EPSILON = 0.00001;
20
- export const RANDOM = Math.random;
21
- export const ANGLE_ORDER = 'zyx';
22
- let useFloat32Arrays = true;
23
- /**
24
- * Sets array type to be used.
25
- *
26
- * @param {number} size of matrix type
27
- * @returns {FloatArray} matrix type
28
- */
29
- export function setMatrixArrayType(type) {
30
- useFloat32Arrays = type instanceof Float32Array;
31
- }
32
- /**
33
- * Return array type to be used.
34
- *
35
- * @param {number} size of matrix type
36
- * @returns {FloatArray} matrix type
37
- */
38
- export function getMatrixArrayType(size) {
39
- if (useFloat32Arrays && typeof Float32Array !== 'undefined') {
40
- return size ? new Float32Array(size) : new Float32Array();
41
- }
42
- return [];
43
- }
44
- /**
45
- * Convert Angle in Degrees To Radians
46
- *
47
- * @param {number} angle is an Angle in Degrees
48
- */
49
- export function toRadians(angle) {
50
- return angle * (Math.PI / 180);
51
- }
52
- /**
53
- * Convert Angle in Radians To an Angle in Radians
54
- *
55
- * @param {number} angle is an Angle in Radians
56
- */
57
- export function toDegrees(angle) {
58
- return angle * (180 / Math.PI);
59
- }
60
- /**
61
- * Tests whether or not the arguments have approximately the same value, within an absolute
62
- * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less
63
- * than or equal to 1.0, and a relative tolerance is used for larger values)
64
- *
65
- * @param {number} a The first number to test.
66
- * @param {number} b The second number to test.
67
- * @returns {boolean} True if the numbers are approximately equal, false otherwise.
68
- */
69
- export function equals(a, b) {
70
- return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));
71
- }
72
- if (!Math.hypot)
73
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
74
- Math.hypot = function (...args) {
75
- let y = 0, i = arguments.length;
76
- while (i--) {
77
- y += args[i] * args[i];
78
- }
79
- return Math.sqrt(y);
80
- };
81
- //# sourceMappingURL=common.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../../src/core/lib/glm/common.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC;AAC/B,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;AAClC,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC;AA6IjC,IAAI,gBAAgB,GAAG,IAAI,CAAC;AAE5B;;;;;GAKG;AAC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CAAC,CAAC;IACtB,CAAC,CAAC"}
@@ -1,11 +0,0 @@
1
- import * as glMatrix from './common.js';
2
- import * as mat2 from './mat2.js';
3
- import * as mat2d from './mat2d.js';
4
- import * as mat3 from './mat3.js';
5
- import * as mat4 from './mat4.js';
6
- import * as quat from './quat.js';
7
- import * as quat2 from './quat2.js';
8
- import * as vec2 from './vec2.js';
9
- import * as vec3 from './vec3.js';
10
- import * as vec4 from './vec4.js';
11
- export { glMatrix, mat2, mat2d, mat3, mat4, quat, quat2, vec2, vec3, vec4 };
@@ -1,30 +0,0 @@
1
- /*
2
- * If not stated otherwise in this file or this component's LICENSE file the
3
- * following copyright and licenses apply:
4
- *
5
- * Copyright 2023 Comcast Cable Communications Management, LLC.
6
- *
7
- * Licensed under the Apache License, Version 2.0 (the License);
8
- * you may not use this file except in compliance with the License.
9
- * You may obtain a copy of the License at
10
- *
11
- * http://www.apache.org/licenses/LICENSE-2.0
12
- *
13
- * Unless required by applicable law or agreed to in writing, software
14
- * distributed under the License is distributed on an "AS IS" BASIS,
15
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
- * See the License for the specific language governing permissions and
17
- * limitations under the License.
18
- */
19
- import * as glMatrix from './common.js';
20
- import * as mat2 from './mat2.js';
21
- import * as mat2d from './mat2d.js';
22
- import * as mat3 from './mat3.js';
23
- import * as mat4 from './mat4.js';
24
- import * as quat from './quat.js';
25
- import * as quat2 from './quat2.js';
26
- import * as vec2 from './vec2.js';
27
- import * as vec3 from './vec3.js';
28
- import * as vec4 from './vec4.js';
29
- export { glMatrix, mat2, mat2d, mat3, mat4, quat, quat2, vec2, vec3, vec4 };
30
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/core/lib/glm/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,QAAQ,MAAM,aAAa,CAAC;AACxC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC"}