@carbonenginejs/runtime-utils 0.1.1 → 0.1.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 (104) hide show
  1. package/LICENSE +21 -21
  2. package/NOTICE +23 -23
  3. package/README.md +69 -69
  4. package/THIRD-PARTY-NOTICES.md +64 -64
  5. package/docs/README.md +74 -73
  6. package/docs/architecture.md +101 -101
  7. package/docs/concepts/foundation-consolidation.md +85 -85
  8. package/docs/concepts/model-lifecycle.md +111 -0
  9. package/docs/const-kb.md +85 -87
  10. package/docs/core-types/DECORATOR-TODOS.md +25 -25
  11. package/docs/core-types/README.md +229 -168
  12. package/docs/reference/api.md +105 -102
  13. package/docs/reference/classes/README.md +135 -135
  14. package/package.json +139 -139
  15. package/src/arrays.js +5 -5
  16. package/src/audio/audioFormats.js +34 -34
  17. package/src/audio/index.js +1 -1
  18. package/src/box3.js +331 -331
  19. package/src/bytes.js +56 -56
  20. package/src/compression.js +56 -56
  21. package/src/constants/index.js +7 -7
  22. package/src/constants/trinity.js +13 -13
  23. package/src/constants.js +15 -15
  24. package/src/curve.js +79 -79
  25. package/src/d3d/dxgiFormats.js +46 -46
  26. package/src/d3d/index.js +2 -2
  27. package/src/d3d/primitiveTopology.js +11 -11
  28. package/src/document/CjsCarbonDocument.js +212 -212
  29. package/src/document/CjsClassRegistry.js +373 -373
  30. package/src/document/CjsDocumentDehydrator.js +142 -142
  31. package/src/document/CjsDocumentHydrator.js +156 -156
  32. package/src/document/CjsStructRegistry.js +348 -348
  33. package/src/document/hydrationAdapter.js +129 -129
  34. package/src/document/index.js +6 -6
  35. package/src/errors/CjsError.js +286 -286
  36. package/src/errors/index.js +5 -5
  37. package/src/geometry/box.js +22 -22
  38. package/src/geometry/cylinder.js +22 -22
  39. package/src/geometry/helpers/earcut.js +1 -1
  40. package/src/geometry/helpers/misc.js +3 -3
  41. package/src/geometry/index.js +8 -8
  42. package/src/geometry/json.js +67 -67
  43. package/src/geometry/lathe.js +44 -44
  44. package/src/geometry/plane.js +14 -14
  45. package/src/geometry/shape.js +4 -4
  46. package/src/geometry/sphere.js +24 -24
  47. package/src/geometry/torus.js +14 -14
  48. package/src/graphics/colorSpaces.js +22 -22
  49. package/src/graphics/index.js +4 -4
  50. package/src/graphics/pixelFormats.js +158 -158
  51. package/src/graphics/textureDimensions.js +22 -22
  52. package/src/graphics/trinityEnums.js +87 -87
  53. package/src/index.js +62 -62
  54. package/src/is.js +108 -46
  55. package/src/json.js +23 -23
  56. package/src/lifecycle/CjsLifecycleState.js +77 -77
  57. package/src/lifecycle/index.js +1 -1
  58. package/src/lne3.js +70 -70
  59. package/src/lookup.js +48 -48
  60. package/src/mat3.js +51 -51
  61. package/src/mat4.js +699 -699
  62. package/src/math/index.js +25 -25
  63. package/src/math/scalar.js +63 -63
  64. package/src/media/index.js +1 -1
  65. package/src/media/mediaTypes.js +50 -50
  66. package/src/mesh.js +424 -424
  67. package/src/model/CjsEventEmitter.js +333 -333
  68. package/src/model/CjsModel.js +1589 -1544
  69. package/src/model/CjsModelState.js +72 -72
  70. package/src/model/index.js +4 -4
  71. package/src/model/sourceRecordUtils.js +54 -54
  72. package/src/noise.js +310 -310
  73. package/src/num.js +827 -827
  74. package/src/object.js +39 -39
  75. package/src/path.js +53 -53
  76. package/src/pln.js +125 -125
  77. package/src/pool.js +9 -9
  78. package/src/quat.js +144 -144
  79. package/src/ray3.js +188 -188
  80. package/src/renderContext/formats.js +145 -145
  81. package/src/renderContext/index.js +5 -5
  82. package/src/renderContext/presentation.js +125 -125
  83. package/src/renderContext/resources.js +27 -27
  84. package/src/renderContext/upscaling.js +22 -22
  85. package/src/renderContext/window.js +20 -20
  86. package/src/runtime/CjsRuntimeState.js +50 -50
  87. package/src/schema/CjsSchema.js +555 -318
  88. package/src/schema/index.js +4 -4
  89. package/src/shader/index.js +1 -1
  90. package/src/shader/shaderStages.js +37 -37
  91. package/src/sph3.js +181 -181
  92. package/src/tangent.js +288 -288
  93. package/src/text.js +40 -40
  94. package/src/tri3.js +98 -98
  95. package/src/types/carbonTypes.js +635 -635
  96. package/src/types/index.js +2 -2
  97. package/src/utils.js +58 -58
  98. package/src/validation.js +46 -46
  99. package/src/vec2.js +229 -229
  100. package/src/vec3.js +1188 -1172
  101. package/src/vec4.js +347 -347
  102. package/src/vertex.js +108 -108
  103. package/src/webgpu/index.js +1 -1
  104. package/src/webgpu/textureFormats.js +121 -121
@@ -1,158 +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
- }
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
+ }
@@ -1,22 +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
- }
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
+ }
@@ -1,87 +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
- });
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 CHANGED
@@ -1,62 +1,62 @@
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 object from "./object.js";
15
- export * from "./object.js";
16
- export * as path from "./path.js";
17
- export * from "./path.js";
18
- export * as text from "./text.js";
19
- export * from "./text.js";
20
- export * as validation from "./validation.js";
21
- export {
22
- assertPlainObject,
23
- assertNonEmptyString,
24
- assertSupportedVersion
25
- } from "./validation.js";
26
- export * as errors from "./errors/index.js";
27
- export * from "./errors/index.js";
28
-
29
- export * as constants from "./constants/index.js";
30
- export * from "./constants/index.js";
31
-
32
- export * as num from "./num.js";
33
- export * as math from "./math/index.js";
34
- export * from "./math/scalar.js";
35
- export * as vec2 from "./vec2.js";
36
- export * as vec3 from "./vec3.js";
37
- export * as vec4 from "./vec4.js";
38
- export * as quat from "./quat.js";
39
- export * as mat3 from "./mat3.js";
40
- export * as mat4 from "./mat4.js";
41
-
42
- export * as box3 from "./box3.js";
43
- export * as tri3 from "./tri3.js";
44
- export * as lne3 from "./lne3.js";
45
- export * as pln from "./pln.js";
46
- export * as ray3 from "./ray3.js";
47
- export * as sph3 from "./sph3.js";
48
-
49
- export * as pool from "./pool.js";
50
- export * as noise from "./noise.js";
51
- export * as curve from "./curve.js";
52
-
53
- export * as geometry from "./geometry/index.js";
54
- export * as vertex from "./vertex.js";
55
- export * as mesh from "./mesh.js";
56
- export * as tangent from "./tangent.js";
57
-
58
-
59
- /**
60
- * TypedArray
61
- * @typedef {Float64Array|Float32Array|Uint32Array|Uint16Array|Uint8Array|Uint8ClampedArray|Int32Array|Int16Array|Int8Array} TypedArray
62
- */
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 object from "./object.js";
15
+ export * from "./object.js";
16
+ export * as path from "./path.js";
17
+ export * from "./path.js";
18
+ export * as text from "./text.js";
19
+ export * from "./text.js";
20
+ export * as validation from "./validation.js";
21
+ export {
22
+ assertPlainObject,
23
+ assertNonEmptyString,
24
+ assertSupportedVersion
25
+ } from "./validation.js";
26
+ export * as errors from "./errors/index.js";
27
+ export * from "./errors/index.js";
28
+
29
+ export * as constants from "./constants/index.js";
30
+ export * from "./constants/index.js";
31
+
32
+ export * as num from "./num.js";
33
+ export * as math from "./math/index.js";
34
+ export * from "./math/scalar.js";
35
+ export * as vec2 from "./vec2.js";
36
+ export * as vec3 from "./vec3.js";
37
+ export * as vec4 from "./vec4.js";
38
+ export * as quat from "./quat.js";
39
+ export * as mat3 from "./mat3.js";
40
+ export * as mat4 from "./mat4.js";
41
+
42
+ export * as box3 from "./box3.js";
43
+ export * as tri3 from "./tri3.js";
44
+ export * as lne3 from "./lne3.js";
45
+ export * as pln from "./pln.js";
46
+ export * as ray3 from "./ray3.js";
47
+ export * as sph3 from "./sph3.js";
48
+
49
+ export * as pool from "./pool.js";
50
+ export * as noise from "./noise.js";
51
+ export * as curve from "./curve.js";
52
+
53
+ export * as geometry from "./geometry/index.js";
54
+ export * as vertex from "./vertex.js";
55
+ export * as mesh from "./mesh.js";
56
+ export * as tangent from "./tangent.js";
57
+
58
+
59
+ /**
60
+ * TypedArray
61
+ * @typedef {Float64Array|Float32Array|Uint32Array|Uint16Array|Uint8Array|Uint8ClampedArray|Int32Array|Int16Array|Int8Array} TypedArray
62
+ */