@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
package/src/object.js CHANGED
@@ -1,39 +1,39 @@
1
- /**
2
- * Invokes handlers for keys explicitly owned by a source object.
3
- *
4
- * @param {object|Function} source Source values.
5
- * @param {object} handlers Property-keyed handler functions.
6
- * @param {*} [context=null] Optional `this` value for handlers.
7
- * @returns {number} Number of invoked handlers.
8
- */
9
- export function hasOwnThen(source, handlers, context = null)
10
- {
11
- if (!source || (typeof source !== "object" && typeof source !== "function"))
12
- {
13
- throw new TypeError("hasOwnThen source must be an object or function.");
14
- }
15
-
16
- if (!handlers || typeof handlers !== "object" || Array.isArray(handlers))
17
- {
18
- throw new TypeError("hasOwnThen handlers must be an object.");
19
- }
20
-
21
- let invoked = 0;
22
-
23
- for (const property of Reflect.ownKeys(handlers))
24
- {
25
- if (!Object.hasOwn(source, property)) continue;
26
-
27
- const handler = handlers[property];
28
-
29
- if (typeof handler !== "function")
30
- {
31
- throw new TypeError(`hasOwnThen handler must be a function: ${String(property)}.`);
32
- }
33
-
34
- handler.call(context, source[property], source, property);
35
- invoked++;
36
- }
37
-
38
- return invoked;
39
- }
1
+ /**
2
+ * Invokes handlers for keys explicitly owned by a source object.
3
+ *
4
+ * @param {object|Function} source Source values.
5
+ * @param {object} handlers Property-keyed handler functions.
6
+ * @param {*} [context=null] Optional `this` value for handlers.
7
+ * @returns {number} Number of invoked handlers.
8
+ */
9
+ export function hasOwnThen(source, handlers, context = null)
10
+ {
11
+ if (!source || (typeof source !== "object" && typeof source !== "function"))
12
+ {
13
+ throw new TypeError("hasOwnThen source must be an object or function.");
14
+ }
15
+
16
+ if (!handlers || typeof handlers !== "object" || Array.isArray(handlers))
17
+ {
18
+ throw new TypeError("hasOwnThen handlers must be an object.");
19
+ }
20
+
21
+ let invoked = 0;
22
+
23
+ for (const property of Reflect.ownKeys(handlers))
24
+ {
25
+ if (!Object.hasOwn(source, property)) continue;
26
+
27
+ const handler = handlers[property];
28
+
29
+ if (typeof handler !== "function")
30
+ {
31
+ throw new TypeError(`hasOwnThen handler must be a function: ${String(property)}.`);
32
+ }
33
+
34
+ handler.call(context, source[property], source, property);
35
+ invoked++;
36
+ }
37
+
38
+ return invoked;
39
+ }
package/src/path.js CHANGED
@@ -1,53 +1,53 @@
1
- /**
2
- * Normalizes slash direction and repeated separators without resolving dot
3
- * segments. URI-style scheme separators retain their authored slash count.
4
- */
5
- export function normalizePath(value, options = {})
6
- {
7
- let result = String(value ?? "").trim().replace(/\\/gu, "/");
8
- const scheme = /^([A-Za-z][A-Za-z0-9+.-]*:)(\/+)/u.exec(result);
9
-
10
- if (scheme)
11
- {
12
- const prefix = scheme[0];
13
- result = `${prefix}${result.slice(prefix.length).replace(/\/+/gu, "/")}`;
14
- }
15
- else
16
- {
17
- result = result.replace(/\/+/gu, "/");
18
- }
19
-
20
- return options.lowerCase ? result.toLowerCase() : result;
21
- }
22
-
23
- /** Normalizes a case-insensitive URI-style resource path. */
24
- export function normalizeResourcePath(value)
25
- {
26
- return normalizePath(value, { lowerCase: true });
27
- }
28
-
29
- /** Returns the normalized extension of a URI-style resource path. */
30
- export function getResourceExtension(value)
31
- {
32
- const path = normalizeResourcePath(value);
33
- const queryIndex = path.search(/[?#]/u);
34
- const cleanPath = queryIndex === -1 ? path : path.slice(0, queryIndex);
35
- const slashIndex = cleanPath.lastIndexOf("/");
36
- const dotIndex = cleanPath.lastIndexOf(".");
37
-
38
- if (dotIndex === -1 || dotIndex < slashIndex)
39
- {
40
- return "";
41
- }
42
-
43
- return cleanPath.slice(dotIndex + 1);
44
- }
45
-
46
- /** Normalizes a resource extension without its optional leading dot. */
47
- export function normalizeResourceExtension(value)
48
- {
49
- return String(value ?? "")
50
- .trim()
51
- .replace(/^\./u, "")
52
- .toLowerCase();
53
- }
1
+ /**
2
+ * Normalizes slash direction and repeated separators without resolving dot
3
+ * segments. URI-style scheme separators retain their authored slash count.
4
+ */
5
+ export function normalizePath(value, options = {})
6
+ {
7
+ let result = String(value ?? "").trim().replace(/\\/gu, "/");
8
+ const scheme = /^([A-Za-z][A-Za-z0-9+.-]*:)(\/+)/u.exec(result);
9
+
10
+ if (scheme)
11
+ {
12
+ const prefix = scheme[0];
13
+ result = `${prefix}${result.slice(prefix.length).replace(/\/+/gu, "/")}`;
14
+ }
15
+ else
16
+ {
17
+ result = result.replace(/\/+/gu, "/");
18
+ }
19
+
20
+ return options.lowerCase ? result.toLowerCase() : result;
21
+ }
22
+
23
+ /** Normalizes a case-insensitive URI-style resource path. */
24
+ export function normalizeResourcePath(value)
25
+ {
26
+ return normalizePath(value, { lowerCase: true });
27
+ }
28
+
29
+ /** Returns the normalized extension of a URI-style resource path. */
30
+ export function getResourceExtension(value)
31
+ {
32
+ const path = normalizeResourcePath(value);
33
+ const queryIndex = path.search(/[?#]/u);
34
+ const cleanPath = queryIndex === -1 ? path : path.slice(0, queryIndex);
35
+ const slashIndex = cleanPath.lastIndexOf("/");
36
+ const dotIndex = cleanPath.lastIndexOf(".");
37
+
38
+ if (dotIndex === -1 || dotIndex < slashIndex)
39
+ {
40
+ return "";
41
+ }
42
+
43
+ return cleanPath.slice(dotIndex + 1);
44
+ }
45
+
46
+ /** Normalizes a resource extension without its optional leading dot. */
47
+ export function normalizeResourceExtension(value)
48
+ {
49
+ return String(value ?? "")
50
+ .trim()
51
+ .replace(/^\./u, "")
52
+ .toLowerCase();
53
+ }
package/src/pln.js CHANGED
@@ -85,11 +85,11 @@ pln.create = vec4.create;
85
85
  * @param {vec3} p - Point to compare
86
86
  * @returns {number} - The distance between them
87
87
  */
88
- pln.distanceToPoint = function(a, p)
89
- {
90
- const length = Math.hypot(a[0], a[1], a[2]);
91
- const distance = (a[0] * p[0] + a[1] * p[1] + a[2] * p[2]) + a[3];
92
- return length === 0 ? distance : distance / length;
88
+ pln.distanceToPoint = function(a, p)
89
+ {
90
+ const length = Math.hypot(a[0], a[1], a[2]);
91
+ const distance = (a[0] * p[0] + a[1] * p[1] + a[2] * p[2]) + a[3];
92
+ return length === 0 ? distance : distance / length;
93
93
  };
94
94
 
95
95
  /**
@@ -100,10 +100,10 @@ pln.distanceToPoint = function(a, p)
100
100
  * @param {number} radius - sphere radius to compare
101
101
  * @returns {number} - The distance between them
102
102
  */
103
- pln.distanceToPositionRadius = function(a, position, radius)
104
- {
105
- return pln.distanceToPoint(a, position) - radius;
106
- };
103
+ pln.distanceToPositionRadius = function(a, position, radius)
104
+ {
105
+ return pln.distanceToPoint(a, position) - radius;
106
+ };
107
107
 
108
108
  /**
109
109
  * Gets the distance from a plane to a Float32Array(4) sphere
@@ -112,10 +112,10 @@ pln.distanceToPositionRadius = function(a, position, radius)
112
112
  * @param {sph3} sphere - sphere to compare
113
113
  * @returns {number} - The distance between them
114
114
  */
115
- pln.distanceToSph3 = function(a, sphere)
116
- {
117
- return pln.distanceToPoint(a, sphere) - sphere[3];
118
- };
115
+ pln.distanceToSph3 = function(a, sphere)
116
+ {
117
+ return pln.distanceToPoint(a, sphere) - sphere[3];
118
+ };
119
119
 
120
120
  /**
121
121
  * Gets the distance from a plane to a point's values
@@ -126,11 +126,11 @@ pln.distanceToSph3 = function(a, sphere)
126
126
  * @param {Number} pz - Point z to compare
127
127
  * @returns {number} - The distance between them
128
128
  */
129
- pln.distanceToValues = function(a, px, py, pz)
130
- {
131
- const length = Math.hypot(a[0], a[1], a[2]);
132
- const distance = (a[0] * px + a[1] * py + a[2] * pz) + a[3];
133
- return length === 0 ? distance : distance / length;
129
+ pln.distanceToValues = function(a, px, py, pz)
130
+ {
131
+ const length = Math.hypot(a[0], a[1], a[2]);
132
+ const distance = (a[0] * px + a[1] * py + a[2] * pz) + a[3];
133
+ return length === 0 ? distance : distance / length;
134
134
  };
135
135
 
136
136
  /**
@@ -293,18 +293,18 @@ pln.fromNormalAndCoplanarPoint = function(out, normal, point)
293
293
  * @param {pln} a - the source plane
294
294
  * @returns {vec3} out - receiving vec3
295
295
  */
296
- pln.getCoplanarPoint = function(out, a)
297
- {
298
- const lengthSquared = a[0] * a[0] + a[1] * a[1] + a[2] * a[2];
299
- if (lengthSquared === 0)
300
- {
301
- out[0] = out[1] = out[2] = 0;
302
- return out;
303
- }
304
- const inverseLengthSquared = 1 / lengthSquared;
305
- out[0] = a[0] * -a[3] * inverseLengthSquared;
306
- out[1] = a[1] * -a[3] * inverseLengthSquared;
307
- out[2] = a[2] * -a[3] * inverseLengthSquared;
296
+ pln.getCoplanarPoint = function(out, a)
297
+ {
298
+ const lengthSquared = a[0] * a[0] + a[1] * a[1] + a[2] * a[2];
299
+ if (lengthSquared === 0)
300
+ {
301
+ out[0] = out[1] = out[2] = 0;
302
+ return out;
303
+ }
304
+ const inverseLengthSquared = 1 / lengthSquared;
305
+ out[0] = a[0] * -a[3] * inverseLengthSquared;
306
+ out[1] = a[1] * -a[3] * inverseLengthSquared;
307
+ out[2] = a[2] * -a[3] * inverseLengthSquared;
308
308
  return out;
309
309
  };
310
310
 
@@ -346,14 +346,14 @@ pln.getIntersectLne3 = function(out, a, l)
346
346
  return out;
347
347
  }
348
348
 
349
- return null;
349
+ return null;
350
350
  }
351
351
 
352
- let t = -((lsx * a[0] + lsy * a[1] + lsz * a[2]) + a[3]) / den;
352
+ let t = -((lsx * a[0] + lsy * a[1] + lsz * a[2]) + a[3]) / den;
353
353
 
354
354
  if (t < 0 || t > 1)
355
355
  {
356
- return null;
356
+ return null;
357
357
  }
358
358
 
359
359
  out[0] = (dirX * t) + lsx;
@@ -373,13 +373,13 @@ pln.getIntersectLne3 = function(out, a, l)
373
373
  * @param {vec3} lineEnd
374
374
  * @returns {vec3}
375
375
  */
376
- pln.getIntersectStartEnd = function(out, a, lineStart, lineEnd)
377
- {
378
- const vec6_0 = box3.alloc();
379
- box3.from(vec6_0, lineStart, lineEnd);
380
- const result = pln.getIntersectLne3(out, a, vec6_0);
381
- box3.unalloc(vec6_0);
382
- return result;
376
+ pln.getIntersectStartEnd = function(out, a, lineStart, lineEnd)
377
+ {
378
+ const vec6_0 = box3.alloc();
379
+ box3.from(vec6_0, lineStart, lineEnd);
380
+ const result = pln.getIntersectLne3(out, a, vec6_0);
381
+ box3.unalloc(vec6_0);
382
+ return result;
383
383
  };
384
384
 
385
385
  /**
@@ -405,16 +405,16 @@ pln.getNormal = function(out, a)
405
405
  * @param {vec3} p - the point to project
406
406
  * @returns {vec3} out - receiving vec3
407
407
  */
408
- pln.getOrthoPoint = function(out, a, p)
409
- {
410
- const
411
- lengthSquared = a[0] * a[0] + a[1] * a[1] + a[2] * a[2],
412
- scale = lengthSquared === 0 ? 0 :
413
- ((a[0] * p[0] + a[1] * p[1] + a[2] * p[2]) + a[3]) / lengthSquared;
414
-
415
- out[0] = a[0] * scale;
416
- out[1] = a[1] * scale;
417
- out[2] = a[2] * scale;
408
+ pln.getOrthoPoint = function(out, a, p)
409
+ {
410
+ const
411
+ lengthSquared = a[0] * a[0] + a[1] * a[1] + a[2] * a[2],
412
+ scale = lengthSquared === 0 ? 0 :
413
+ ((a[0] * p[0] + a[1] * p[1] + a[2] * p[2]) + a[3]) / lengthSquared;
414
+
415
+ out[0] = a[0] * scale;
416
+ out[1] = a[1] * scale;
417
+ out[2] = a[2] * scale;
418
418
  return out;
419
419
  };
420
420
 
@@ -475,8 +475,8 @@ pln.intersectsLne3 = function(a, l)
475
475
  {
476
476
  let startSign = (a[0] * l[0] + a[1] * l[1] + a[2] * l[2]) + a[3];
477
477
  let endSign = (a[0] * l[3] + a[1] * l[4] + a[2] * l[5]) + a[3];
478
- return startSign === 0 || endSign === 0 ||
479
- (startSign < 0 && endSign > 0) || (endSign < 0 && startSign > 0);
478
+ return startSign === 0 || endSign === 0 ||
479
+ (startSign < 0 && endSign > 0) || (endSign < 0 && startSign > 0);
480
480
  };
481
481
 
482
482
  /**
@@ -487,13 +487,13 @@ pln.intersectsLne3 = function(a, l)
487
487
  * @param {number} radius - sphere radius compare
488
488
  * @returns {boolean} - true if intersection occurs
489
489
  */
490
- pln.intersectsPositionRadius = function(a, position, radius)
491
- {
492
- const
493
- distance = position[0] * a[0] + position[1] * a[1] + position[2] * a[2] + a[3],
494
- normalLength = Math.hypot(a[0], a[1], a[2]);
495
- return radius >= 0 && Math.abs(distance) <= radius * (normalLength || 1);
496
- };
490
+ pln.intersectsPositionRadius = function(a, position, radius)
491
+ {
492
+ const
493
+ distance = position[0] * a[0] + position[1] * a[1] + position[2] * a[2] + a[3],
494
+ normalLength = Math.hypot(a[0], a[1], a[2]);
495
+ return radius >= 0 && Math.abs(distance) <= radius * (normalLength || 1);
496
+ };
497
497
 
498
498
  /**
499
499
  * Checks if a plane intersects a sph3
@@ -502,13 +502,13 @@ pln.intersectsPositionRadius = function(a, position, radius)
502
502
  * @param {sph3} s - sphere to compare
503
503
  * @returns {boolean} - true if intersection occurs
504
504
  */
505
- pln.intersectsSph3 = function(a, s)
506
- {
507
- const
508
- distance = s[0] * a[0] + s[1] * a[1] + s[2] * a[2] + a[3],
509
- normalLength = Math.hypot(a[0], a[1], a[2]);
510
- return s[3] >= 0 && Math.abs(distance) <= s[3] * (normalLength || 1);
511
- };
505
+ pln.intersectsSph3 = function(a, s)
506
+ {
507
+ const
508
+ distance = s[0] * a[0] + s[1] * a[1] + s[2] * a[2] + a[3],
509
+ normalLength = Math.hypot(a[0], a[1], a[2]);
510
+ return s[3] >= 0 && Math.abs(distance) <= s[3] * (normalLength || 1);
511
+ };
512
512
 
513
513
  /**
514
514
  * Checks if a plane intersects a lne3's components
@@ -522,8 +522,8 @@ pln.intersectsStartEnd = function(a, start, end)
522
522
  {
523
523
  let startSign = (a[0] * start[0] + a[1] * start[1] + a[2] * start[2]) + a[3];
524
524
  let endSign = (a[0] * end[0] + a[1] * end[1] + a[2] * end[2]) + a[3];
525
- return startSign === 0 || endSign === 0 ||
526
- (startSign < 0 && endSign > 0) || (endSign < 0 && startSign > 0);
525
+ return startSign === 0 || endSign === 0 ||
526
+ (startSign < 0 && endSign > 0) || (endSign < 0 && startSign > 0);
527
527
  };
528
528
 
529
529
  /**
@@ -646,12 +646,12 @@ pln.toArray = function(a, arr, offset = 0)
646
646
  * @param {mat3} [nMatrix] - optional normal matrix
647
647
  * @returns {pln} out - the receiving plane
648
648
  */
649
- pln.transformMat4 = function(out, a, m, nMatrix)
650
- {
651
- const sourceLengthSquared = a[0] * a[0] + a[1] * a[1] + a[2] * a[2];
652
- if (sourceLengthSquared === 0) return pln.copy(out, a);
653
-
654
- let mat3_0;
649
+ pln.transformMat4 = function(out, a, m, nMatrix)
650
+ {
651
+ const sourceLengthSquared = a[0] * a[0] + a[1] * a[1] + a[2] * a[2];
652
+ if (sourceLengthSquared === 0) return pln.copy(out, a);
653
+
654
+ let mat3_0;
655
655
  if (!nMatrix)
656
656
  {
657
657
  mat3_0 = mat3.alloc();
@@ -659,10 +659,10 @@ pln.transformMat4 = function(out, a, m, nMatrix)
659
659
  }
660
660
 
661
661
  // Coplanar Point
662
- const inverseLengthSquared = 1 / sourceLengthSquared;
663
- let cpX = a[0] * -a[3] * inverseLengthSquared,
664
- cpY = a[1] * -a[3] * inverseLengthSquared,
665
- cpZ = a[2] * -a[3] * inverseLengthSquared;
662
+ const inverseLengthSquared = 1 / sourceLengthSquared;
663
+ let cpX = a[0] * -a[3] * inverseLengthSquared,
664
+ cpY = a[1] * -a[3] * inverseLengthSquared,
665
+ cpZ = a[2] * -a[3] * inverseLengthSquared;
666
666
 
667
667
  // Create reference point from Coplanar Point transformed by the affine mat4
668
668
  let rX = m[0] * cpX + m[4] * cpY + m[8] * cpZ + m[12],
@@ -710,53 +710,53 @@ pln.transformMat4 = function(out, a, m, nMatrix)
710
710
  * @param {vec3} v - the vector to translate with
711
711
  * @returns {pln} out - the receiving plane
712
712
  */
713
- pln.translate = function(out, a, v)
714
- {
713
+ pln.translate = function(out, a, v)
714
+ {
715
715
  out[0] = a[0];
716
716
  out[1] = a[1];
717
717
  out[2] = a[2];
718
- out[3] = a[3] - (v[0] * a[0] + v[1] * a[1] + v[2] * a[2]);
719
- return out;
720
- };
721
-
722
- export const {
723
- alloc,
724
- unalloc,
725
- $normal,
726
- clone,
727
- constant,
728
- copy,
729
- create,
730
- distanceToPoint,
731
- distanceToPositionRadius,
732
- distanceToSph3,
733
- distanceToValues,
734
- equals,
735
- equalsNormalConstant,
736
- exactEquals,
737
- exactEqualsNormalConstant,
738
- extract,
739
- fromNormalConstant,
740
- fromCoplanarPoints,
741
- fromNormalAndCoplanarPoint,
742
- getCoplanarPoint,
743
- getIntersectLne3,
744
- getIntersectStartEnd,
745
- getNormal,
746
- getOrthoPoint,
747
- getProjectedPoint,
748
- intersectsBounds,
749
- intersectsBox3,
750
- intersectsLne3,
751
- intersectsPositionRadius,
752
- intersectsSph3,
753
- intersectsStartEnd,
754
- negate,
755
- normalize,
756
- set,
757
- setAndNormalize,
758
- setArray,
759
- toArray,
760
- transformMat4,
761
- translate
762
- } = pln;
718
+ out[3] = a[3] - (v[0] * a[0] + v[1] * a[1] + v[2] * a[2]);
719
+ return out;
720
+ };
721
+
722
+ export const {
723
+ alloc,
724
+ unalloc,
725
+ $normal,
726
+ clone,
727
+ constant,
728
+ copy,
729
+ create,
730
+ distanceToPoint,
731
+ distanceToPositionRadius,
732
+ distanceToSph3,
733
+ distanceToValues,
734
+ equals,
735
+ equalsNormalConstant,
736
+ exactEquals,
737
+ exactEqualsNormalConstant,
738
+ extract,
739
+ fromNormalConstant,
740
+ fromCoplanarPoints,
741
+ fromNormalAndCoplanarPoint,
742
+ getCoplanarPoint,
743
+ getIntersectLne3,
744
+ getIntersectStartEnd,
745
+ getNormal,
746
+ getOrthoPoint,
747
+ getProjectedPoint,
748
+ intersectsBounds,
749
+ intersectsBox3,
750
+ intersectsLne3,
751
+ intersectsPositionRadius,
752
+ intersectsSph3,
753
+ intersectsStartEnd,
754
+ negate,
755
+ normalize,
756
+ set,
757
+ setAndNormalize,
758
+ setArray,
759
+ toArray,
760
+ transformMat4,
761
+ translate
762
+ } = pln;
package/src/pool.js CHANGED
@@ -149,12 +149,12 @@ export function createPool()
149
149
 
150
150
  }
151
151
 
152
- export const pool = createPool();
153
-
154
- export const {
155
- allocF32,
156
- allocType,
157
- unalloc,
158
- freeType,
159
- free
160
- } = pool;
152
+ export const pool = createPool();
153
+
154
+ export const {
155
+ allocF32,
156
+ allocType,
157
+ unalloc,
158
+ freeType,
159
+ free
160
+ } = pool;