@carbonenginejs/runtime-utils 0.1.0 → 0.1.2
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.
- package/README.md +21 -7
- package/THIRD-PARTY-NOTICES.md +30 -4
- package/docs/README.md +10 -7
- package/docs/architecture.md +7 -6
- package/docs/concepts/foundation-consolidation.md +20 -21
- package/docs/const-kb.md +18 -11
- package/docs/core-types/DECORATOR-TODOS.md +1 -1
- package/docs/reference/api.md +43 -1
- package/docs/reference/classes/README.md +20 -0
- package/package.json +8 -1
- package/src/constants/index.js +1 -0
- package/src/constants/trinity.js +13 -0
- package/src/errors/CjsError.js +286 -0
- package/src/errors/index.js +5 -0
- package/src/index.js +4 -0
- package/src/is.js +71 -9
- package/src/mesh.js +37 -7
- package/src/model/CjsModel.js +61 -16
- package/src/object.js +39 -0
- package/src/path.js +32 -0
- package/src/schema/CjsSchema.js +416 -297
- package/src/vec3.js +16 -0
package/src/vec3.js
CHANGED
|
@@ -559,6 +559,21 @@ vec3.isEmpty = function (a)
|
|
|
559
559
|
return a[0] === 0 && a[1] === 0 && a[2] === 0;
|
|
560
560
|
};
|
|
561
561
|
|
|
562
|
+
/**
|
|
563
|
+
* The largest of the three components.
|
|
564
|
+
*
|
|
565
|
+
* A reduction to one number, unlike `max`, which is the component-wise maximum
|
|
566
|
+
* of two vectors. Carbon spells it `MaxVectorComponent`, and uses it to reduce a
|
|
567
|
+
* colour to the single value that decides how bright it counts as.
|
|
568
|
+
*
|
|
569
|
+
* @param {vec3} a
|
|
570
|
+
* @returns {Number}
|
|
571
|
+
*/
|
|
572
|
+
vec3.maxComponent = function (a)
|
|
573
|
+
{
|
|
574
|
+
return Math.max(a[0], a[1], a[2]);
|
|
575
|
+
};
|
|
576
|
+
|
|
562
577
|
/**
|
|
563
578
|
* Multiplies a vec3 by a scalar
|
|
564
579
|
*
|
|
@@ -1097,6 +1112,7 @@ export const {
|
|
|
1097
1112
|
length,
|
|
1098
1113
|
lerp,
|
|
1099
1114
|
max,
|
|
1115
|
+
maxComponent,
|
|
1100
1116
|
min,
|
|
1101
1117
|
mul,
|
|
1102
1118
|
multiply,
|