@loaders.gl/math 3.1.0-alpha.4 → 3.1.0-beta.3

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 (92) hide show
  1. package/dist/es5/geometry/attributes/compute-bounding-box.js +17 -34
  2. package/dist/es5/geometry/attributes/compute-bounding-box.js.map +1 -1
  3. package/dist/es5/geometry/attributes/compute-vertex-normals.js +30 -45
  4. package/dist/es5/geometry/attributes/compute-vertex-normals.js.map +1 -1
  5. package/dist/es5/geometry/attributes/convert-to-non-indexed.js +14 -29
  6. package/dist/es5/geometry/attributes/convert-to-non-indexed.js.map +1 -1
  7. package/dist/es5/geometry/attributes/get-attribute-from-geometry.js +4 -2
  8. package/dist/es5/geometry/attributes/get-attribute-from-geometry.js.map +1 -1
  9. package/dist/es5/geometry/attributes/normalize.js +2 -4
  10. package/dist/es5/geometry/attributes/normalize.js.map +1 -1
  11. package/dist/es5/geometry/colors/rgb565.js +7 -8
  12. package/dist/es5/geometry/colors/rgb565.js.map +1 -1
  13. package/dist/es5/geometry/compression/attribute-compression.js +39 -41
  14. package/dist/es5/geometry/compression/attribute-compression.js.map +1 -1
  15. package/dist/es5/geometry/constants.js +6 -15
  16. package/dist/es5/geometry/constants.js.map +1 -1
  17. package/dist/es5/geometry/gl/gl-type.js +63 -79
  18. package/dist/es5/geometry/gl/gl-type.js.map +1 -1
  19. package/dist/es5/geometry/is-geometry.js +1 -5
  20. package/dist/es5/geometry/is-geometry.js.map +1 -1
  21. package/dist/es5/geometry/iterators/attribute-iterator.js +9 -38
  22. package/dist/es5/geometry/iterators/attribute-iterator.js.map +1 -1
  23. package/dist/es5/geometry/iterators/primitive-iterator.js +75 -116
  24. package/dist/es5/geometry/iterators/primitive-iterator.js.map +1 -1
  25. package/dist/es5/geometry/typed-arrays/typed-array-utils.js +8 -9
  26. package/dist/es5/geometry/typed-arrays/typed-array-utils.js.map +1 -1
  27. package/dist/es5/index.js +24 -24
  28. package/dist/esm/geometry/compression/attribute-compression.js +1 -1
  29. package/dist/esm/geometry/compression/attribute-compression.js.map +1 -1
  30. package/dist/esm/geometry/utils/assert.js +1 -1
  31. package/dist/esm/geometry/utils/assert.js.map +1 -1
  32. package/dist/geometry/attributes/compute-bounding-box.d.ts +10 -0
  33. package/dist/geometry/attributes/compute-bounding-box.d.ts.map +1 -0
  34. package/dist/geometry/attributes/compute-bounding-box.js +44 -0
  35. package/dist/geometry/attributes/compute-bounding-sphere.d.ts +29 -0
  36. package/dist/geometry/attributes/compute-bounding-sphere.d.ts.map +1 -0
  37. package/dist/geometry/attributes/compute-bounding-sphere.js +30 -0
  38. package/dist/geometry/attributes/compute-tangents.d.ts +1 -0
  39. package/dist/geometry/attributes/compute-tangents.d.ts.map +1 -0
  40. package/dist/geometry/attributes/compute-tangents.js +146 -0
  41. package/dist/geometry/attributes/compute-vertex-normals.d.ts +17 -0
  42. package/dist/geometry/attributes/compute-vertex-normals.d.ts.map +1 -0
  43. package/dist/geometry/attributes/compute-vertex-normals.js +48 -0
  44. package/dist/geometry/attributes/convert-to-non-indexed.d.ts +11 -0
  45. package/dist/geometry/attributes/convert-to-non-indexed.d.ts.map +1 -0
  46. package/dist/geometry/attributes/convert-to-non-indexed.js +33 -0
  47. package/dist/geometry/attributes/get-attribute-from-geometry.d.ts +8 -0
  48. package/dist/geometry/attributes/get-attribute-from-geometry.d.ts.map +1 -0
  49. package/dist/geometry/attributes/get-attribute-from-geometry.js +34 -0
  50. package/dist/geometry/attributes/normalize.d.ts +8 -0
  51. package/dist/geometry/attributes/normalize.d.ts.map +1 -0
  52. package/dist/geometry/attributes/normalize.js +20 -0
  53. package/dist/geometry/colors/rgb565.d.ts +14 -0
  54. package/dist/geometry/colors/rgb565.d.ts.map +1 -0
  55. package/dist/geometry/colors/rgb565.js +31 -0
  56. package/dist/geometry/compression/attribute-compression.d.ts +160 -0
  57. package/dist/geometry/compression/attribute-compression.d.ts.map +1 -0
  58. package/dist/geometry/compression/attribute-compression.js +352 -0
  59. package/dist/geometry/constants.d.ts +44 -0
  60. package/dist/geometry/constants.d.ts.map +1 -0
  61. package/dist/geometry/constants.js +34 -0
  62. package/dist/geometry/gl/gl-type.d.ts +38 -0
  63. package/dist/geometry/gl/gl-type.d.ts.map +1 -0
  64. package/dist/geometry/gl/gl-type.js +112 -0
  65. package/dist/geometry/is-geometry.d.ts +6 -0
  66. package/dist/geometry/is-geometry.d.ts.map +1 -0
  67. package/dist/geometry/is-geometry.js +14 -0
  68. package/dist/geometry/iterators/attribute-iterator.d.ts +7 -0
  69. package/dist/geometry/iterators/attribute-iterator.d.ts.map +1 -0
  70. package/dist/geometry/iterators/attribute-iterator.js +19 -0
  71. package/dist/geometry/iterators/primitive-iterator.d.ts +16 -0
  72. package/dist/geometry/iterators/primitive-iterator.d.ts.map +1 -0
  73. package/dist/geometry/iterators/primitive-iterator.js +88 -0
  74. package/dist/geometry/primitives/modes.d.ts +22 -0
  75. package/dist/geometry/primitives/modes.d.ts.map +1 -0
  76. package/dist/geometry/primitives/modes.js +71 -0
  77. package/dist/geometry/typed-arrays/typed-array-utils.d.ts +7 -0
  78. package/dist/geometry/typed-arrays/typed-array-utils.d.ts.map +1 -0
  79. package/dist/geometry/typed-arrays/typed-array-utils.js +25 -0
  80. package/dist/geometry/types.d.ts +13 -0
  81. package/dist/geometry/types.d.ts.map +1 -0
  82. package/dist/geometry/types.js +2 -0
  83. package/dist/geometry/utils/assert.d.ts +7 -0
  84. package/dist/geometry/utils/assert.d.ts.map +1 -0
  85. package/dist/geometry/utils/assert.js +14 -0
  86. package/dist/index.d.ts +11 -0
  87. package/dist/index.d.ts.map +1 -0
  88. package/dist/index.js +46 -0
  89. package/dist/utils/assert.d.ts +2 -0
  90. package/dist/utils/assert.d.ts.map +1 -0
  91. package/dist/utils/assert.js +12 -0
  92. package/package.json +5 -5
@@ -0,0 +1,88 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.makePrimitiveIterator = void 0;
4
+ const constants_1 = require("../constants");
5
+ const modes_1 = require("../primitives/modes");
6
+ const loader_utils_1 = require("@loaders.gl/loader-utils");
7
+ /**
8
+ * Will iterate over each primitive, expanding (dereferencing) indices
9
+ * @param indices
10
+ * @param attributes
11
+ * @param mode
12
+ * @param start
13
+ * @param end
14
+ */
15
+ // eslint-disable-next-line complexity
16
+ function* makePrimitiveIterator(indices, attributes = {}, mode, start = 0, end) {
17
+ // support indices being an object with a values array
18
+ if (indices) {
19
+ indices = indices.values || indices.value || indices;
20
+ }
21
+ // Autodeduce length from indices
22
+ if (end === undefined) {
23
+ end = indices ? indices.length : start;
24
+ }
25
+ // iteration info
26
+ const info = {
27
+ attributes,
28
+ type: (0, modes_1.getPrimitiveModeType)(mode),
29
+ i1: 0,
30
+ i2: 0,
31
+ i3: 0
32
+ };
33
+ let i = start;
34
+ // @ts-ignore
35
+ while (i < end) {
36
+ switch (mode) {
37
+ case constants_1.GL.POINTS: // draw single points.
38
+ info.i1 = i;
39
+ i += 1;
40
+ break;
41
+ case constants_1.GL.LINES: // draw lines. Each set of two vertices is treated as a separate line segment.
42
+ info.i1 = i;
43
+ info.i2 = i + 1;
44
+ i += 2;
45
+ break;
46
+ case constants_1.GL.LINE_STRIP: // draw lines. Each vertex connects to the one after it.
47
+ info.i1 = i;
48
+ info.i2 = i + 1;
49
+ i += 1;
50
+ break;
51
+ case constants_1.GL.LINE_LOOP: // draw a connected group of line segments from the first vertex to the last
52
+ info.i1 = i;
53
+ info.i2 = i + 1;
54
+ i += 1;
55
+ break;
56
+ case constants_1.GL.TRIANGLES: // draw triangles. Each set of three vertices creates a separate triangle.
57
+ info.i1 = i;
58
+ info.i2 = i + 1;
59
+ info.i3 = i + 2;
60
+ i += 3;
61
+ break;
62
+ case constants_1.GL.TRIANGLE_STRIP: // draw a connected group of triangles.
63
+ info.i1 = i;
64
+ info.i2 = i + 1;
65
+ i += 1;
66
+ break;
67
+ case constants_1.GL.TRIANGLE_FAN: // draw a connected group of triangles.
68
+ info.i1 = 1;
69
+ info.i2 = i;
70
+ info.i3 = i + 1;
71
+ i += 1;
72
+ break;
73
+ default:
74
+ (0, loader_utils_1.assert)(false);
75
+ }
76
+ // if indices are present, lookup actual vertices in indices
77
+ if (indices) {
78
+ if ('i1' in info) {
79
+ info.i1 = indices[info.i1];
80
+ info.i2 = indices[info.i2];
81
+ info.i3 = indices[info.i3];
82
+ }
83
+ }
84
+ // @ts-ignore
85
+ yield info;
86
+ }
87
+ }
88
+ exports.makePrimitiveIterator = makePrimitiveIterator;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Different methods of working with geometries depending on glType
3
+ /**
4
+
5
+ /**
6
+ * @param mode
7
+ * @returns draw points | lines | triangles
8
+ */
9
+ export declare function getPrimitiveModeType(mode?: number): number;
10
+ /**
11
+ * @param mode
12
+ * @returns true | false
13
+ */
14
+ export declare function isPrimitiveModeExpandable(mode: number): boolean;
15
+ /**
16
+ * Returns new length depends on glType
17
+ * @param mode
18
+ * @param length
19
+ * @returns new length
20
+ */
21
+ export declare function getPrimitiveModeExpandedLength(mode: number, length: number): number;
22
+ //# sourceMappingURL=modes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modes.d.ts","sourceRoot":"","sources":["../../../src/geometry/primitives/modes.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAe1D;AACD;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAU/D;AACD;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAkBnF"}
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPrimitiveModeExpandedLength = exports.isPrimitiveModeExpandable = exports.getPrimitiveModeType = void 0;
4
+ const constants_1 = require("../constants");
5
+ /**
6
+ * Different methods of working with geometries depending on glType
7
+ /**
8
+
9
+ /**
10
+ * @param mode
11
+ * @returns draw points | lines | triangles
12
+ */
13
+ function getPrimitiveModeType(mode) {
14
+ switch (mode) {
15
+ case constants_1.GL.POINTS: // draw single points.
16
+ return constants_1.GL.POINTS;
17
+ case constants_1.GL.LINES: // draw lines. Each set of two vertices is treated as a separate line segment.
18
+ case constants_1.GL.LINE_STRIP: // draw lines. Each vertex connects to the one after it.
19
+ case constants_1.GL.LINE_LOOP: // draw a connected group of line segments from the first vertex to the last
20
+ return constants_1.GL.LINES;
21
+ case constants_1.GL.TRIANGLES:
22
+ case constants_1.GL.TRIANGLE_STRIP:
23
+ case constants_1.GL.TRIANGLE_FAN: // draw a connected group of triangles.
24
+ return constants_1.GL.TRIANGLES;
25
+ default:
26
+ throw new Error('Unknown primitive mode');
27
+ }
28
+ }
29
+ exports.getPrimitiveModeType = getPrimitiveModeType;
30
+ /**
31
+ * @param mode
32
+ * @returns true | false
33
+ */
34
+ function isPrimitiveModeExpandable(mode) {
35
+ switch (mode) {
36
+ case constants_1.GL.LINE_STRIP: // draw lines. Each vertex connects to the one after it.
37
+ case constants_1.GL.LINE_LOOP: // draw a connected group of line segments from the first vertex to the last
38
+ case constants_1.GL.TRIANGLE_STRIP: // draw a connected group of triangles.
39
+ case constants_1.GL.TRIANGLE_FAN: // draw a connected group of triangles.
40
+ return true;
41
+ default:
42
+ return false;
43
+ }
44
+ }
45
+ exports.isPrimitiveModeExpandable = isPrimitiveModeExpandable;
46
+ /**
47
+ * Returns new length depends on glType
48
+ * @param mode
49
+ * @param length
50
+ * @returns new length
51
+ */
52
+ function getPrimitiveModeExpandedLength(mode, length) {
53
+ switch (mode) {
54
+ case constants_1.GL.POINTS: // draw single points.
55
+ return length;
56
+ case constants_1.GL.LINES: // draw lines. Each set of two vertices is treated as a separate line segment.
57
+ return length;
58
+ case constants_1.GL.LINE_STRIP: // draw lines. Each vertex connects to the one after it.
59
+ return length;
60
+ case constants_1.GL.LINE_LOOP: // draw a connected group of line segments from the first vertex to the last
61
+ return length + 1;
62
+ case constants_1.GL.TRIANGLES: // draw triangles. Each set of three vertices creates a separate triangle.
63
+ return length;
64
+ case constants_1.GL.TRIANGLE_STRIP: // draw a connected group of triangles.
65
+ case constants_1.GL.TRIANGLE_FAN: // draw a connected group of triangles.
66
+ return (length - 2) * 3;
67
+ default:
68
+ throw new Error('Unknown length');
69
+ }
70
+ }
71
+ exports.getPrimitiveModeExpandedLength = getPrimitiveModeExpandedLength;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Concats typed arrays
3
+ * @param arrays
4
+ * @returns new Uint8Array
5
+ */
6
+ export declare function concatTypedArrays(arrays?: any): Uint8Array;
7
+ //# sourceMappingURL=typed-array-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typed-array-utils.d.ts","sourceRoot":"","sources":["../../../src/geometry/typed-arrays/typed-array-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,GAAQ,GAAG,UAAU,CAgB9D"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.concatTypedArrays = void 0;
4
+ /**
5
+ * Concats typed arrays
6
+ * @param arrays
7
+ * @returns new Uint8Array
8
+ */
9
+ function concatTypedArrays(arrays = []) {
10
+ let byteLength = 0;
11
+ for (let i = 0; i < arrays.length; ++i) {
12
+ byteLength += arrays[i].byteLength;
13
+ }
14
+ const buffer = new Uint8Array(byteLength);
15
+ let byteOffset = 0;
16
+ for (let i = 0; i < arrays.length; ++i) {
17
+ const data = new Uint8Array(arrays[i].buffer);
18
+ byteLength = data.length;
19
+ for (let j = 0; j < byteLength; ++j) {
20
+ buffer[byteOffset++] = data[j];
21
+ }
22
+ }
23
+ return buffer;
24
+ }
25
+ exports.concatTypedArrays = concatTypedArrays;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Type for encoding to Vector4
3
+ */
4
+ export declare type Vector4 = {
5
+ x: number;
6
+ y: number;
7
+ z: number;
8
+ w: number;
9
+ };
10
+ export declare type TypedIntArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Int32Array | Uint32Array;
11
+ export declare type TypedFloatArray = Uint16Array | Float32Array | Float64Array;
12
+ export declare type TypedArray = TypedIntArray | TypedFloatArray;
13
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/geometry/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,OAAO,GAAG;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX,CAAC;AAGF,oBAAY,aAAa,GACrB,SAAS,GACT,UAAU,GACV,iBAAiB,GACjB,UAAU,GACV,WAAW,GACX,UAAU,GACV,WAAW,GACX,UAAU,GACV,WAAW,CAAC;AAEhB,oBAAY,eAAe,GAAG,WAAW,GAAG,YAAY,GAAG,YAAY,CAAC;AAExE,oBAAY,UAAU,GAAG,aAAa,GAAG,eAAe,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Throws error message
3
+ * @param condition checks if an attribute equal to condition
4
+ * @param message error message
5
+ */
6
+ export declare function assert(condition: any, message?: any): void;
7
+ //# sourceMappingURL=assert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../../src/geometry/utils/assert.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,SAAS,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,IAAI,CAI1D"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assert = void 0;
4
+ /**
5
+ * Throws error message
6
+ * @param condition checks if an attribute equal to condition
7
+ * @param message error message
8
+ */
9
+ function assert(condition, message) {
10
+ if (!condition) {
11
+ throw new Error(`math.gl assertion failed. ${message}`);
12
+ }
13
+ }
14
+ exports.assert = assert;
@@ -0,0 +1,11 @@
1
+ export { GL } from './geometry/constants';
2
+ export { GL_TYPE } from './geometry/constants';
3
+ export { default as GLType } from './geometry/gl/gl-type';
4
+ export { default as isGeometry } from './geometry/is-geometry';
5
+ export { makeAttributeIterator } from './geometry/iterators/attribute-iterator';
6
+ export { makePrimitiveIterator } from './geometry/iterators/primitive-iterator';
7
+ export { computeVertexNormals } from './geometry/attributes/compute-vertex-normals';
8
+ export { encodeRGB565, decodeRGB565 } from './geometry/colors/rgb565';
9
+ export { concatTypedArrays } from './geometry/typed-arrays/typed-array-utils';
10
+ export { octEncodeInRange, octEncode, octEncodeToVector4, octDecodeInRange, octDecode, octDecodeFromVector4, octPackFloat, octEncodeFloat, octDecodeFloat, octPack, octUnpack, compressTextureCoordinates, decompressTextureCoordinates, zigZagDeltaDecode } from './geometry/compression/attribute-compression';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,EAAE,EAAC,MAAM,sBAAsB,CAAC;AAGxC,OAAO,EAAC,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAGxD,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAG7D,OAAO,EAAC,qBAAqB,EAAC,MAAM,yCAAyC,CAAC;AAC9E,OAAO,EAAC,qBAAqB,EAAC,MAAM,yCAAyC,CAAC;AAG9E,OAAO,EAAC,oBAAoB,EAAC,MAAM,8CAA8C,CAAC;AAElF,OAAO,EAAC,YAAY,EAAE,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAGpE,OAAO,EAAC,iBAAiB,EAAC,MAAM,2CAA2C,CAAC;AAG5E,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,kBAAkB,EAClB,gBAAgB,EAChB,SAAS,EACT,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,OAAO,EACP,SAAS,EACT,0BAA0B,EAC1B,4BAA4B,EAC5B,iBAAiB,EAClB,MAAM,8CAA8C,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.zigZagDeltaDecode = exports.decompressTextureCoordinates = exports.compressTextureCoordinates = exports.octUnpack = exports.octPack = exports.octDecodeFloat = exports.octEncodeFloat = exports.octPackFloat = exports.octDecodeFromVector4 = exports.octDecode = exports.octDecodeInRange = exports.octEncodeToVector4 = exports.octEncode = exports.octEncodeInRange = exports.concatTypedArrays = exports.decodeRGB565 = exports.encodeRGB565 = exports.computeVertexNormals = exports.makePrimitiveIterator = exports.makeAttributeIterator = exports.isGeometry = exports.GLType = exports.GL_TYPE = exports.GL = void 0;
7
+ var constants_1 = require("./geometry/constants");
8
+ Object.defineProperty(exports, "GL", { enumerable: true, get: function () { return constants_1.GL; } });
9
+ // GL support
10
+ var constants_2 = require("./geometry/constants");
11
+ Object.defineProperty(exports, "GL_TYPE", { enumerable: true, get: function () { return constants_2.GL_TYPE; } });
12
+ var gl_type_1 = require("./geometry/gl/gl-type");
13
+ Object.defineProperty(exports, "GLType", { enumerable: true, get: function () { return __importDefault(gl_type_1).default; } });
14
+ // Geometry
15
+ var is_geometry_1 = require("./geometry/is-geometry");
16
+ Object.defineProperty(exports, "isGeometry", { enumerable: true, get: function () { return __importDefault(is_geometry_1).default; } });
17
+ // Iterators
18
+ var attribute_iterator_1 = require("./geometry/iterators/attribute-iterator");
19
+ Object.defineProperty(exports, "makeAttributeIterator", { enumerable: true, get: function () { return attribute_iterator_1.makeAttributeIterator; } });
20
+ var primitive_iterator_1 = require("./geometry/iterators/primitive-iterator");
21
+ Object.defineProperty(exports, "makePrimitiveIterator", { enumerable: true, get: function () { return primitive_iterator_1.makePrimitiveIterator; } });
22
+ // Helper methods
23
+ var compute_vertex_normals_1 = require("./geometry/attributes/compute-vertex-normals");
24
+ Object.defineProperty(exports, "computeVertexNormals", { enumerable: true, get: function () { return compute_vertex_normals_1.computeVertexNormals; } });
25
+ var rgb565_1 = require("./geometry/colors/rgb565");
26
+ Object.defineProperty(exports, "encodeRGB565", { enumerable: true, get: function () { return rgb565_1.encodeRGB565; } });
27
+ Object.defineProperty(exports, "decodeRGB565", { enumerable: true, get: function () { return rgb565_1.decodeRGB565; } });
28
+ // Typed array utils
29
+ var typed_array_utils_1 = require("./geometry/typed-arrays/typed-array-utils");
30
+ Object.defineProperty(exports, "concatTypedArrays", { enumerable: true, get: function () { return typed_array_utils_1.concatTypedArrays; } });
31
+ // Compression
32
+ var attribute_compression_1 = require("./geometry/compression/attribute-compression");
33
+ Object.defineProperty(exports, "octEncodeInRange", { enumerable: true, get: function () { return attribute_compression_1.octEncodeInRange; } });
34
+ Object.defineProperty(exports, "octEncode", { enumerable: true, get: function () { return attribute_compression_1.octEncode; } });
35
+ Object.defineProperty(exports, "octEncodeToVector4", { enumerable: true, get: function () { return attribute_compression_1.octEncodeToVector4; } });
36
+ Object.defineProperty(exports, "octDecodeInRange", { enumerable: true, get: function () { return attribute_compression_1.octDecodeInRange; } });
37
+ Object.defineProperty(exports, "octDecode", { enumerable: true, get: function () { return attribute_compression_1.octDecode; } });
38
+ Object.defineProperty(exports, "octDecodeFromVector4", { enumerable: true, get: function () { return attribute_compression_1.octDecodeFromVector4; } });
39
+ Object.defineProperty(exports, "octPackFloat", { enumerable: true, get: function () { return attribute_compression_1.octPackFloat; } });
40
+ Object.defineProperty(exports, "octEncodeFloat", { enumerable: true, get: function () { return attribute_compression_1.octEncodeFloat; } });
41
+ Object.defineProperty(exports, "octDecodeFloat", { enumerable: true, get: function () { return attribute_compression_1.octDecodeFloat; } });
42
+ Object.defineProperty(exports, "octPack", { enumerable: true, get: function () { return attribute_compression_1.octPack; } });
43
+ Object.defineProperty(exports, "octUnpack", { enumerable: true, get: function () { return attribute_compression_1.octUnpack; } });
44
+ Object.defineProperty(exports, "compressTextureCoordinates", { enumerable: true, get: function () { return attribute_compression_1.compressTextureCoordinates; } });
45
+ Object.defineProperty(exports, "decompressTextureCoordinates", { enumerable: true, get: function () { return attribute_compression_1.decompressTextureCoordinates; } });
46
+ Object.defineProperty(exports, "zigZagDeltaDecode", { enumerable: true, get: function () { return attribute_compression_1.zigZagDeltaDecode; } });
@@ -0,0 +1,2 @@
1
+ export declare function assert(condition: Boolean, message?: string): void;
2
+ //# sourceMappingURL=assert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../src/utils/assert.ts"],"names":[],"mappings":"AAGA,wBAAgB,MAAM,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAIjE"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assert = void 0;
4
+ // Replacement for the external assert method to reduce bundle size
5
+ // Note: We don't use the second "message" argument in calling code,
6
+ // so no need to support it here
7
+ function assert(condition, message) {
8
+ if (!condition) {
9
+ throw new Error(message || '3d-tile loader: assertion failed.');
10
+ }
11
+ }
12
+ exports.assert = assert;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/math",
3
- "version": "3.1.0-alpha.4",
3
+ "version": "3.1.0-beta.3",
4
4
  "description": "Experimental math classes for loaders.gl",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -17,7 +17,7 @@
17
17
  "GLB",
18
18
  "glTF"
19
19
  ],
20
- "types": "src/index.ts",
20
+ "types": "dist/index.d.ts",
21
21
  "main": "dist/es5/index.js",
22
22
  "module": "dist/esm/index.js",
23
23
  "sideEffects": false,
@@ -31,9 +31,9 @@
31
31
  "pre-build": "echo \"Nothing to build in @loaders.gl/math\""
32
32
  },
33
33
  "dependencies": {
34
- "@loaders.gl/images": "3.1.0-alpha.4",
35
- "@loaders.gl/loader-utils": "3.1.0-alpha.4",
34
+ "@loaders.gl/images": "3.1.0-beta.3",
35
+ "@loaders.gl/loader-utils": "3.1.0-beta.3",
36
36
  "@math.gl/core": "^3.5.1"
37
37
  },
38
- "gitHead": "e309784af37ef9f3640c7733c7851124c72e1fa3"
38
+ "gitHead": "3537c382b3ea4e092b24b6f94c3edee72076039c"
39
39
  }