@carbonenginejs/runtime-utils 0.1.0

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 (101) hide show
  1. package/LICENSE +21 -0
  2. package/NOTICE +23 -0
  3. package/README.md +56 -0
  4. package/THIRD-PARTY-NOTICES.md +38 -0
  5. package/docs/README.md +81 -0
  6. package/docs/architecture.md +101 -0
  7. package/docs/concepts/foundation-consolidation.md +86 -0
  8. package/docs/const-kb.md +92 -0
  9. package/docs/core-types/DECORATOR-TODOS.md +25 -0
  10. package/docs/core-types/README.md +203 -0
  11. package/docs/reference/api.md +70 -0
  12. package/docs/reference/classes/README.md +115 -0
  13. package/package.json +132 -0
  14. package/src/arrays.js +5 -0
  15. package/src/audio/audioFormats.js +34 -0
  16. package/src/audio/index.js +1 -0
  17. package/src/box3.js +1385 -0
  18. package/src/bytes.js +56 -0
  19. package/src/compression.js +56 -0
  20. package/src/constants/index.js +6 -0
  21. package/src/constants.js +15 -0
  22. package/src/curve.js +419 -0
  23. package/src/d3d/dxgiFormats.js +46 -0
  24. package/src/d3d/index.js +2 -0
  25. package/src/d3d/primitiveTopology.js +11 -0
  26. package/src/document/CjsCarbonDocument.js +212 -0
  27. package/src/document/CjsClassRegistry.js +373 -0
  28. package/src/document/CjsDocumentDehydrator.js +142 -0
  29. package/src/document/CjsDocumentHydrator.js +156 -0
  30. package/src/document/CjsStructRegistry.js +348 -0
  31. package/src/document/hydrationAdapter.js +129 -0
  32. package/src/document/index.js +6 -0
  33. package/src/geometry/box.js +137 -0
  34. package/src/geometry/cylinder.js +244 -0
  35. package/src/geometry/helpers/LICENSE +15 -0
  36. package/src/geometry/helpers/earcut.js +766 -0
  37. package/src/geometry/helpers/misc.js +103 -0
  38. package/src/geometry/index.js +8 -0
  39. package/src/geometry/json.js +165 -0
  40. package/src/geometry/lathe.js +172 -0
  41. package/src/geometry/octahedron.js +0 -0
  42. package/src/geometry/plane.js +81 -0
  43. package/src/geometry/shape.js +95 -0
  44. package/src/geometry/sphere.js +123 -0
  45. package/src/geometry/torus.js +96 -0
  46. package/src/graphics/colorSpaces.js +22 -0
  47. package/src/graphics/index.js +4 -0
  48. package/src/graphics/pixelFormats.js +158 -0
  49. package/src/graphics/textureDimensions.js +22 -0
  50. package/src/graphics/trinityEnums.js +87 -0
  51. package/src/index.js +58 -0
  52. package/src/is.js +524 -0
  53. package/src/json.js +23 -0
  54. package/src/lifecycle/CjsLifecycleState.js +77 -0
  55. package/src/lifecycle/index.js +1 -0
  56. package/src/lne3.js +497 -0
  57. package/src/lookup.js +48 -0
  58. package/src/mat3.js +131 -0
  59. package/src/mat4.js +699 -0
  60. package/src/math/index.js +25 -0
  61. package/src/math/scalar.js +63 -0
  62. package/src/media/index.js +1 -0
  63. package/src/media/mediaTypes.js +50 -0
  64. package/src/mesh.js +394 -0
  65. package/src/model/CjsEventEmitter.js +333 -0
  66. package/src/model/CjsModel.js +1544 -0
  67. package/src/model/CjsModelState.js +72 -0
  68. package/src/model/index.js +4 -0
  69. package/src/model/sourceRecordUtils.js +54 -0
  70. package/src/noise.js +310 -0
  71. package/src/num.js +827 -0
  72. package/src/path.js +21 -0
  73. package/src/pln.js +762 -0
  74. package/src/pool.js +160 -0
  75. package/src/quat.js +144 -0
  76. package/src/ray3.js +1085 -0
  77. package/src/renderContext/formats.js +145 -0
  78. package/src/renderContext/index.js +5 -0
  79. package/src/renderContext/presentation.js +125 -0
  80. package/src/renderContext/resources.js +27 -0
  81. package/src/renderContext/upscaling.js +22 -0
  82. package/src/renderContext/window.js +20 -0
  83. package/src/runtime/CjsRuntimeState.js +50 -0
  84. package/src/schema/CjsSchema.js +1009 -0
  85. package/src/schema/index.js +17 -0
  86. package/src/shader/index.js +1 -0
  87. package/src/shader/shaderStages.js +37 -0
  88. package/src/sph3.js +754 -0
  89. package/src/tangent.js +288 -0
  90. package/src/text.js +40 -0
  91. package/src/tri3.js +650 -0
  92. package/src/types/carbonTypes.js +635 -0
  93. package/src/types/index.js +2 -0
  94. package/src/utils.js +58 -0
  95. package/src/validation.js +46 -0
  96. package/src/vec2.js +229 -0
  97. package/src/vec3.js +1172 -0
  98. package/src/vec4.js +347 -0
  99. package/src/vertex.js +108 -0
  100. package/src/webgpu/index.js +1 -0
  101. package/src/webgpu/textureFormats.js +121 -0
@@ -0,0 +1,123 @@
1
+ import { vec3 } from "../vec3.js";
2
+ import { toJSON } from "./json.js";
3
+
4
+ /**
5
+ * Creates a sphere
6
+ * @author Three.js converted
7
+ *
8
+ *
9
+ **/
10
+ export function createSphere(options = {})
11
+ {
12
+
13
+ let {
14
+ radius = 1,
15
+ widthSegments = 32,
16
+ heightSegments = 16,
17
+ phiStart = 0,
18
+ phiLength = Math.PI * 2,
19
+ thetaStart = 0,
20
+ thetaLength = Math.PI
21
+ } = options;
22
+
23
+ if (![ radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ].every(Number.isFinite) ||
24
+ radius <= 0 ||
25
+ phiLength <= 0 ||
26
+ thetaLength <= 0)
27
+ {
28
+ throw new Error("Invalid sphere dimensions");
29
+ }
30
+
31
+ widthSegments = Math.max(3, Math.floor(widthSegments));
32
+ heightSegments = Math.max(2, Math.floor(heightSegments));
33
+
34
+ const
35
+ thetaEnd = Math.min(thetaStart + thetaLength, Math.PI),
36
+ grid = [],
37
+ vertex = vec3.alloc(),
38
+ normal = vec3.alloc();
39
+
40
+ let index = 0;
41
+
42
+ // buffers
43
+ const
44
+ indices = [],
45
+ vertices = [],
46
+ normals = [],
47
+ uvs = [];
48
+
49
+ // generate vertices, normals and uvs
50
+ for (let iy = 0; iy <= heightSegments; iy++)
51
+ {
52
+ const
53
+ verticesRow = [],
54
+ v = iy / heightSegments;
55
+
56
+ // special case for the poles
57
+ let uOffset = 0;
58
+ if (iy === 0 && thetaStart === 0)
59
+ {
60
+ uOffset = 0.5 / widthSegments;
61
+ }
62
+ else if (iy === heightSegments && thetaEnd === Math.PI)
63
+ {
64
+ uOffset = -0.5 / widthSegments;
65
+ }
66
+
67
+ for (let ix = 0; ix <= widthSegments; ix++)
68
+ {
69
+ const u = ix / widthSegments;
70
+
71
+ // vertex
72
+ vertex[0] = -radius * Math.cos(phiStart + u * phiLength) * Math.sin(thetaStart + v * thetaLength);
73
+ vertex[1] = radius * Math.cos(thetaStart + v * thetaLength);
74
+ vertex[2] = radius * Math.sin(phiStart + u * phiLength) * Math.sin(thetaStart + v * thetaLength);
75
+ vertices.push(vertex[0], vertex[1], vertex[2]);
76
+
77
+ // normal
78
+ vec3.copy(normal, vertex);
79
+ vec3.normalize(normal, normal);
80
+ normals.push(normal[0], normal[1], normal[2]);
81
+
82
+ // uv
83
+ uvs.push(u + uOffset, 1 - v);
84
+ verticesRow.push(index++);
85
+ }
86
+
87
+ grid.push(verticesRow);
88
+ }
89
+
90
+ // indices
91
+ for (let iy = 0; iy < heightSegments; iy++)
92
+ {
93
+ for (let ix = 0; ix < widthSegments; ix++)
94
+ {
95
+ const
96
+ a = grid[iy][ix + 1],
97
+ b = grid[iy][ix],
98
+ c = grid[iy + 1][ix],
99
+ d = grid[iy + 1][ix + 1];
100
+
101
+ if (iy !== 0 || thetaStart > 0) indices.push(a, b, d);
102
+ if (iy !== heightSegments - 1 || thetaEnd < Math.PI) indices.push(b, c, d);
103
+ }
104
+ }
105
+
106
+ vec3.unalloc(vertex);
107
+ vec3.unalloc(normal);
108
+
109
+ const result = toJSON(indices, vertices, uvs, normals);
110
+ result.factory = createSphere;
111
+ result.options = {
112
+ radius,
113
+ widthSegments,
114
+ heightSegments,
115
+ phiStart,
116
+ phiLength,
117
+ thetaStart,
118
+ thetaLength
119
+ };
120
+ result.shape = { factory: result.factory, options: result.options };
121
+
122
+ return result;
123
+ }
@@ -0,0 +1,96 @@
1
+ import { toJSON } from "./json.js";
2
+ import { vec3 } from "../vec3.js";
3
+
4
+
5
+ export function createTorus(options = {})
6
+ {
7
+ let {
8
+ radius = 1,
9
+ tube = 0.4,
10
+ radialSegments = 12,
11
+ tubularSegments = 49,
12
+ arc = Math.PI * 2
13
+ } = options;
14
+
15
+ if (![ radius, tube, radialSegments, tubularSegments, arc ].every(Number.isFinite) ||
16
+ radius <= 0 ||
17
+ tube <= 0 ||
18
+ arc === 0)
19
+ {
20
+ throw new Error("Invalid torus dimensions");
21
+ }
22
+
23
+ radialSegments = Math.max(3, Math.floor(Number.isFinite(radialSegments) ? radialSegments : 12));
24
+ tubularSegments = Math.max(3, Math.floor(Number.isFinite(tubularSegments) ? tubularSegments : 49));
25
+
26
+ const
27
+ indices = [],
28
+ positions = [],
29
+ uvs = [],
30
+ normals = [];
31
+
32
+ const
33
+ center = vec3.alloc(),
34
+ vertex = vec3.alloc(),
35
+ normal = vec3.alloc();
36
+
37
+ // generate vertices, normals and uvs
38
+ for (let j = 0; j <= radialSegments; j++)
39
+ {
40
+ for (let i = 0; i <= tubularSegments; i++)
41
+ {
42
+ const
43
+ u = i / tubularSegments * arc,
44
+ v = j / radialSegments * Math.PI * 2;
45
+
46
+ // vertex
47
+ vertex[0] = (radius + tube * Math.cos(v)) * Math.cos(u);
48
+ vertex[1] = (radius + tube * Math.cos(v)) * Math.sin(u);
49
+ vertex[2] = tube * Math.sin(v);
50
+ positions.push(vertex[0], vertex[1], vertex[2]);
51
+
52
+ // normal
53
+ center[0] = radius * Math.cos(u);
54
+ center[1] = radius * Math.sin(u);
55
+ vec3.subtract(normal, vertex, center);
56
+ vec3.normalize(normal, normal);
57
+ normals.push(normal[0], normal[1], normal[2]);
58
+
59
+ // uv
60
+ uvs.push(i / tubularSegments);
61
+ uvs.push(j / radialSegments);
62
+ }
63
+ }
64
+
65
+ vec3.unalloc(center);
66
+ vec3.unalloc(vertex);
67
+ vec3.unalloc(normal);
68
+
69
+ // generate indices
70
+ for (let j = 1; j <= radialSegments; j++)
71
+ {
72
+ for (let i = 1; i <= tubularSegments; i++)
73
+ {
74
+ // indices
75
+ const
76
+ a = (tubularSegments + 1) * j + i - 1,
77
+ b = (tubularSegments + 1) * (j - 1) + i - 1,
78
+ c = (tubularSegments + 1) * (j - 1) + i,
79
+ d = (tubularSegments + 1) * j + i;
80
+ // faces
81
+ indices.push(a, b, d);
82
+ indices.push(b, c, d);
83
+ }
84
+ }
85
+
86
+ const result = toJSON(indices, positions, uvs, normals);
87
+ result.factory = createTorus;
88
+ result.options = {
89
+ radius,
90
+ tube,
91
+ radialSegments,
92
+ tubularSegments,
93
+ arc
94
+ };
95
+ return result;
96
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Canonical color space tokens for decoded image/texture payloads.
3
+ */
4
+ export const ColorSpace = Object.freeze({
5
+ UNKNOWN: "unknown",
6
+ LINEAR: "linear",
7
+ SRGB: "srgb",
8
+ DISPLAY_P3: "display-p3",
9
+ REC709: "rec709",
10
+ REC2020: "rec2020"
11
+ });
12
+
13
+ /**
14
+ * Normalize a color space token.
15
+ *
16
+ * @param {string} colorSpace Color space token.
17
+ * @returns {string} Canonical lowercase token or unknown.
18
+ */
19
+ export function normalizeColorSpace(colorSpace)
20
+ {
21
+ return colorSpace ? String(colorSpace).trim().toLowerCase() : ColorSpace.UNKNOWN;
22
+ }
@@ -0,0 +1,4 @@
1
+ export * from "./pixelFormats.js";
2
+ export * from "./colorSpaces.js";
3
+ export * from "./textureDimensions.js";
4
+ export * from "./trinityEnums.js";
@@ -0,0 +1,158 @@
1
+ /**
2
+ * Canonical GPU-free pixel format names used by decoded images and textures.
3
+ */
4
+ export const PixelFormat = Object.freeze({
5
+ UNKNOWN: "unknown",
6
+
7
+ R8_UNORM: "r8unorm",
8
+ RG8_UNORM: "rg8unorm",
9
+ RGB8_UNORM: "rgb8unorm",
10
+ RGBA8_UNORM: "rgba8unorm",
11
+ BGRA8_UNORM: "bgra8unorm",
12
+ BGRX8_UNORM: "bgrx8unorm",
13
+ RGBA8_UNORM_SRGB: "rgba8unorm-srgb",
14
+ BGRA8_UNORM_SRGB: "bgra8unorm-srgb",
15
+ BGRX8_UNORM_SRGB: "bgrx8unorm-srgb",
16
+
17
+ R16_UINT: "r16uint",
18
+ R16_FLOAT: "r16float",
19
+ RG16_FLOAT: "rg16float",
20
+ RGBA16_FLOAT: "rgba16float",
21
+
22
+ R32_UINT: "r32uint",
23
+ R32_FLOAT: "r32float",
24
+ RG32_FLOAT: "rg32float",
25
+ RGBA32_FLOAT: "rgba32float",
26
+
27
+ BC1_RGBA_UNORM: "bc1-rgba-unorm",
28
+ BC1_RGBA_UNORM_SRGB: "bc1-rgba-unorm-srgb",
29
+ BC2_RGBA_UNORM: "bc2-rgba-unorm",
30
+ BC2_RGBA_UNORM_SRGB: "bc2-rgba-unorm-srgb",
31
+ BC3_RGBA_UNORM: "bc3-rgba-unorm",
32
+ BC3_RGBA_UNORM_SRGB: "bc3-rgba-unorm-srgb",
33
+ BC4_R_UNORM: "bc4-r-unorm",
34
+ BC4_R_SNORM: "bc4-r-snorm",
35
+ BC5_RG_UNORM: "bc5-rg-unorm",
36
+ BC5_RG_SNORM: "bc5-rg-snorm",
37
+ BC6H_RGB_UFLOAT: "bc6h-rgb-ufloat",
38
+ BC6H_RGB_FLOAT: "bc6h-rgb-float",
39
+ BC7_RGBA_UNORM: "bc7-rgba-unorm",
40
+ BC7_RGBA_UNORM_SRGB: "bc7-rgba-unorm-srgb"
41
+ });
42
+
43
+ const COMPRESSED_FORMATS = new Set([
44
+ PixelFormat.BC1_RGBA_UNORM,
45
+ PixelFormat.BC1_RGBA_UNORM_SRGB,
46
+ PixelFormat.BC2_RGBA_UNORM,
47
+ PixelFormat.BC2_RGBA_UNORM_SRGB,
48
+ PixelFormat.BC3_RGBA_UNORM,
49
+ PixelFormat.BC3_RGBA_UNORM_SRGB,
50
+ PixelFormat.BC4_R_UNORM,
51
+ PixelFormat.BC4_R_SNORM,
52
+ PixelFormat.BC5_RG_UNORM,
53
+ PixelFormat.BC5_RG_SNORM,
54
+ PixelFormat.BC6H_RGB_UFLOAT,
55
+ PixelFormat.BC6H_RGB_FLOAT,
56
+ PixelFormat.BC7_RGBA_UNORM,
57
+ PixelFormat.BC7_RGBA_UNORM_SRGB
58
+ ]);
59
+
60
+ const BYTES_PER_BLOCK = Object.freeze({
61
+ [PixelFormat.R8_UNORM]: 1,
62
+ [PixelFormat.RG8_UNORM]: 2,
63
+ [PixelFormat.RGB8_UNORM]: 3,
64
+ [PixelFormat.RGBA8_UNORM]: 4,
65
+ [PixelFormat.BGRA8_UNORM]: 4,
66
+ [PixelFormat.BGRX8_UNORM]: 4,
67
+ [PixelFormat.RGBA8_UNORM_SRGB]: 4,
68
+ [PixelFormat.BGRA8_UNORM_SRGB]: 4,
69
+ [PixelFormat.BGRX8_UNORM_SRGB]: 4,
70
+ [PixelFormat.R16_UINT]: 2,
71
+ [PixelFormat.R16_FLOAT]: 2,
72
+ [PixelFormat.RG16_FLOAT]: 4,
73
+ [PixelFormat.RGBA16_FLOAT]: 8,
74
+ [PixelFormat.R32_UINT]: 4,
75
+ [PixelFormat.R32_FLOAT]: 4,
76
+ [PixelFormat.RG32_FLOAT]: 8,
77
+ [PixelFormat.RGBA32_FLOAT]: 16,
78
+ [PixelFormat.BC1_RGBA_UNORM]: 8,
79
+ [PixelFormat.BC1_RGBA_UNORM_SRGB]: 8,
80
+ [PixelFormat.BC2_RGBA_UNORM]: 16,
81
+ [PixelFormat.BC2_RGBA_UNORM_SRGB]: 16,
82
+ [PixelFormat.BC3_RGBA_UNORM]: 16,
83
+ [PixelFormat.BC3_RGBA_UNORM_SRGB]: 16,
84
+ [PixelFormat.BC4_R_UNORM]: 8,
85
+ [PixelFormat.BC4_R_SNORM]: 8,
86
+ [PixelFormat.BC5_RG_UNORM]: 16,
87
+ [PixelFormat.BC5_RG_SNORM]: 16,
88
+ [PixelFormat.BC6H_RGB_UFLOAT]: 16,
89
+ [PixelFormat.BC6H_RGB_FLOAT]: 16,
90
+ [PixelFormat.BC7_RGBA_UNORM]: 16,
91
+ [PixelFormat.BC7_RGBA_UNORM_SRGB]: 16
92
+ });
93
+
94
+ /**
95
+ * Normalize a pixel format token.
96
+ *
97
+ * @param {string} format Pixel format token.
98
+ * @returns {string} Canonical lowercase token or empty string.
99
+ */
100
+ export function normalizePixelFormat(format)
101
+ {
102
+ return format ? String(format).trim().toLowerCase() : "";
103
+ }
104
+
105
+ /**
106
+ * Test whether a pixel format is block compressed.
107
+ *
108
+ * @param {string} format Pixel format token.
109
+ * @returns {boolean} True when the format is compressed.
110
+ */
111
+ export function isCompressedPixelFormat(format)
112
+ {
113
+ return COMPRESSED_FORMATS.has(normalizePixelFormat(format));
114
+ }
115
+
116
+ /**
117
+ * Test whether a pixel format is marked as sRGB.
118
+ *
119
+ * @param {string} format Pixel format token.
120
+ * @returns {boolean} True when the token ends with -srgb.
121
+ */
122
+ export function isSrgbPixelFormat(format)
123
+ {
124
+ return normalizePixelFormat(format).endsWith("-srgb");
125
+ }
126
+
127
+ /**
128
+ * Get bytes per texel or compressed block for a pixel format.
129
+ *
130
+ * @param {string} format Pixel format token.
131
+ * @returns {number} Bytes per texel/block, or 0 when unknown.
132
+ */
133
+ export function getPixelFormatBytesPerBlock(format)
134
+ {
135
+ return BYTES_PER_BLOCK[normalizePixelFormat(format)] || 0;
136
+ }
137
+
138
+ /**
139
+ * Get the block width for a pixel format.
140
+ *
141
+ * @param {string} format Pixel format token.
142
+ * @returns {number} Block width in texels.
143
+ */
144
+ export function getPixelFormatBlockWidth(format)
145
+ {
146
+ return isCompressedPixelFormat(format) ? 4 : 1;
147
+ }
148
+
149
+ /**
150
+ * Get the block height for a pixel format.
151
+ *
152
+ * @param {string} format Pixel format token.
153
+ * @returns {number} Block height in texels.
154
+ */
155
+ export function getPixelFormatBlockHeight(format)
156
+ {
157
+ return isCompressedPixelFormat(format) ? 4 : 1;
158
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Canonical texture dimension tokens.
3
+ */
4
+ export const TextureDimension = Object.freeze({
5
+ D1: "1d",
6
+ D2: "2d",
7
+ D3: "3d",
8
+ CUBE: "cube",
9
+ D2_ARRAY: "2d-array",
10
+ CUBE_ARRAY: "cube-array"
11
+ });
12
+
13
+ /**
14
+ * Normalize a texture dimension token.
15
+ *
16
+ * @param {string} dimension Texture dimension token.
17
+ * @returns {string} Canonical lowercase token.
18
+ */
19
+ export function normalizeTextureDimension(dimension)
20
+ {
21
+ return dimension ? String(dimension).trim().toLowerCase() : "";
22
+ }
@@ -0,0 +1,87 @@
1
+ /** Global Trinity render-batch vocabulary from ITr2Renderable.h. */
2
+ export const TriBatchType = Object.freeze({
3
+ TRIBATCHTYPE_OPAQUE: 0,
4
+ TRIBATCHTYPE_DECAL: 1,
5
+ TRIBATCHTYPE_TRANSPARENT: 2,
6
+ TRIBATCHTYPE_DEPTH: 3,
7
+ TRIBATCHTYPE_ADDITIVE: 4,
8
+ TRIBATCHTYPE_PICKING: 5,
9
+ TRIBATCHTYPE_MIRROR: 6,
10
+ TRIBATCHTYPE_DECALNORMAL: 7,
11
+ TRIBATCHTYPE_DEPTHNORMAL: 8,
12
+ TRIBATCHTYPE_OPAQUE_PREPASS: 9,
13
+ TRIBATCHTYPE_DECAL_PREPASS: 10,
14
+ TRIBATCHTYPE_GEOMETRY_ERASER: 11,
15
+ TRIBATCHTYPE_FLARE: 12,
16
+ TRIBATCHTYPE_DISTORTION: 13,
17
+ TRIBATCHTYPE_COUNT_OF_BATCH_TYPES: 14
18
+ });
19
+
20
+ /** Trinity standard render-state selector from Shader/Tr2EffectStateManager.h.
21
+ * Cross-package: runtime-trinity batches/accumulators and engine dispatch both
22
+ * key on it. Distinct from TriBatchType (batch bucket) — a render-state mode.
23
+ * Unscoped Carbon enum: values are sequential from RM_ANY = 0. */
24
+ export const RenderingMode = Object.freeze({
25
+ RM_ANY: 0,
26
+ RM_OPAQUE: 1,
27
+ RM_DECAL: 2,
28
+ RM_DECAL_NO_DEPTH: 3,
29
+ RM_ALPHA: 4,
30
+ RM_ALPHA_ADDITIVE: 5,
31
+ RM_DEPTH_ONLY: 6,
32
+ RM_PICKING: 7,
33
+ RM_FULLSCREEN: 8,
34
+ RM_SPRITE2D: 9,
35
+ RM_CULL: 10,
36
+ RM_LIGHT: 11,
37
+ RM_ERASE: 12,
38
+ RM_PREPASS_COLOR: 13,
39
+ RM_COUNT: 14
40
+ });
41
+
42
+ /** Shared EVE entity reflection vocabulary from EntityComponents. */
43
+ export const ReflectionMode = Object.freeze({
44
+ REFLECT_HIGH: 0,
45
+ REFLECT_MEDIUM_AND_HIGH: 1,
46
+ REFLECT_LOW_MEDIUM_HIGH: 2,
47
+ REFLECT_NEVER: 3
48
+ });
49
+
50
+ /** Trinity graph value-combination operator from blue/include/ITriConstants.h. */
51
+ export const TriOperator = Object.freeze({
52
+ TRIOP_MULTIPLY: 0,
53
+ TRIOP_ADD: 1,
54
+ TRIOP_AVERAGE: 2
55
+ });
56
+
57
+ /** Trinity transform-parameter base frame from blue/include/ITriConstants.h. */
58
+ export const TriTransformBase = Object.freeze({
59
+ TRITB_OBJECT: 0,
60
+ TRITB_CAMERA_ROTATION: 1,
61
+ TRITB_CAMERA_TRANSLATION: 2,
62
+ TRITB_CAMERA: 3,
63
+ TRITB_CAMERA_ROTATION_ALIGNED: 4,
64
+ TRITB_FIXED: 5,
65
+ TRITB_CAMERA_ROTATION_FALLOFF: 6,
66
+ TRITB_CAMERA_ROTATION_ALIGNED_SYMMETRY: 7,
67
+ TRITB_CAMERA_ROTATION_FALLOFF_SYMMETRY: 8,
68
+ TRITB_BOOSTER: 9,
69
+ TRITB_SIMPLE_HALO: 10,
70
+ TRITB_SIMPLE_HALO_SYMMETRY: 11,
71
+ TRITB_BOOSTER_FALLOFF: 12,
72
+ TRITB_WORLD: 13,
73
+ TRITB_SIMPLE_HALO_FALLOFF: 14,
74
+ TRITB_SIMPLE_SPRITE: 15,
75
+ TRITB_SIMPLE_SPRITE_FALLOFF: 16,
76
+ TRITB_SIMPLE_SPRITE_CONSTANT: 17
77
+ });
78
+
79
+ // Carbon TRIEXTRAPOLATION (blue/include/ITriConstants.h:33) - curve
80
+ // extrapolation modes, shared by trinity curves (TriEventCurve) and audio
81
+ // (AudEventCurve). Class statics alias this export (TriOperator pattern).
82
+ export const TriExtrapolation = Object.freeze({
83
+ TRIEXT_NONE: 0,
84
+ TRIEXT_CONSTANT: 1,
85
+ TRIEXT_GRADIENT: 2,
86
+ TRIEXT_CYCLE: 3
87
+ });
package/src/index.js ADDED
@@ -0,0 +1,58 @@
1
+ export * as is from "./is.js";
2
+ export * from "./is.js";
3
+
4
+ export * as arrays from "./arrays.js";
5
+ export * from "./arrays.js";
6
+ export * as bytes from "./bytes.js";
7
+ export * from "./bytes.js";
8
+ export * as compression from "./compression.js";
9
+ export * from "./compression.js";
10
+ export * as json from "./json.js";
11
+ export * from "./json.js";
12
+ export * as lookup from "./lookup.js";
13
+ export * from "./lookup.js";
14
+ export * as path from "./path.js";
15
+ export * from "./path.js";
16
+ export * as text from "./text.js";
17
+ export * from "./text.js";
18
+ export * as validation from "./validation.js";
19
+ export {
20
+ assertPlainObject,
21
+ assertNonEmptyString,
22
+ assertSupportedVersion
23
+ } from "./validation.js";
24
+
25
+ export * as constants from "./constants/index.js";
26
+ export * from "./constants/index.js";
27
+
28
+ export * as num from "./num.js";
29
+ export * as math from "./math/index.js";
30
+ export * from "./math/scalar.js";
31
+ export * as vec2 from "./vec2.js";
32
+ export * as vec3 from "./vec3.js";
33
+ export * as vec4 from "./vec4.js";
34
+ export * as quat from "./quat.js";
35
+ export * as mat3 from "./mat3.js";
36
+ export * as mat4 from "./mat4.js";
37
+
38
+ export * as box3 from "./box3.js";
39
+ export * as tri3 from "./tri3.js";
40
+ export * as lne3 from "./lne3.js";
41
+ export * as pln from "./pln.js";
42
+ export * as ray3 from "./ray3.js";
43
+ export * as sph3 from "./sph3.js";
44
+
45
+ export * as pool from "./pool.js";
46
+ export * as noise from "./noise.js";
47
+ export * as curve from "./curve.js";
48
+
49
+ export * as geometry from "./geometry/index.js";
50
+ export * as vertex from "./vertex.js";
51
+ export * as mesh from "./mesh.js";
52
+ export * as tangent from "./tangent.js";
53
+
54
+
55
+ /**
56
+ * TypedArray
57
+ * @typedef {Float64Array|Float32Array|Uint32Array|Uint16Array|Uint8Array|Uint8ClampedArray|Int32Array|Int16Array|Int8Array} TypedArray
58
+ */