@woosh/meep-engine 2.118.6 → 2.118.7
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/build/meep.cjs +13 -6
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +13 -6
- package/package.json +1 -1
- package/src/core/color/Color.d.ts.map +1 -1
- package/src/core/color/Color.js +12 -5
- package/src/core/color/operations/color_desaturate.d.ts +7 -0
- package/src/core/color/operations/color_desaturate.d.ts.map +1 -0
- package/src/core/color/operations/color_desaturate.js +16 -0
- package/src/engine/graphics/ecs/light/LightSystem.js +1 -1
package/build/meep.module.js
CHANGED
|
@@ -54427,22 +54427,29 @@ class Color {
|
|
|
54427
54427
|
/**
|
|
54428
54428
|
*
|
|
54429
54429
|
* @param {Color} input
|
|
54430
|
-
* @param {Color} output
|
|
54430
|
+
* @param {Color} [output]
|
|
54431
|
+
* @returns {Color}
|
|
54431
54432
|
*/
|
|
54432
|
-
static from_linear_to_sRGB(input, output) {
|
|
54433
|
+
static from_linear_to_sRGB(input, output=new Color()) {
|
|
54434
|
+
|
|
54433
54435
|
linear_to_sRGB(output, 0, input, 0);
|
|
54436
|
+
|
|
54437
|
+
return output;
|
|
54434
54438
|
}
|
|
54435
54439
|
|
|
54436
54440
|
/**
|
|
54437
54441
|
*
|
|
54438
54442
|
* @param {Color} input
|
|
54439
|
-
* @param {Color} output
|
|
54443
|
+
* @param {Color} [output]
|
|
54444
|
+
* @returns {Color}
|
|
54440
54445
|
*/
|
|
54441
|
-
static from_sRGB_to_linear(input, output) {
|
|
54446
|
+
static from_sRGB_to_linear(input, output = new Color()) {
|
|
54442
54447
|
sRGB_to_linear(output, 0, input, 0);
|
|
54448
|
+
|
|
54449
|
+
return output;
|
|
54443
54450
|
}
|
|
54444
54451
|
}
|
|
54445
|
-
|
|
54452
|
+
ex;
|
|
54446
54453
|
/**
|
|
54447
54454
|
* @deprecated use {@link Color#toArray} instead
|
|
54448
54455
|
* @readonly
|
|
@@ -114198,7 +114205,7 @@ class LightSystem extends AbstractContextSystem {
|
|
|
114198
114205
|
}
|
|
114199
114206
|
|
|
114200
114207
|
if (settings.preAllocateLightsAmbient !== undefined) {
|
|
114201
|
-
this.__three_light_cache.reserve(LightType.
|
|
114208
|
+
this.__three_light_cache.reserve(LightType.AMBIENT, settings.preAllocateLightsAmbient);
|
|
114202
114209
|
}
|
|
114203
114210
|
}
|
|
114204
114211
|
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Color.d.ts","sourceRoot":"","sources":["../../../../src/core/color/Color.js"],"names":[],"mappings":"AAkBA;;;GAGG;AACH;IAumBI;;;;;;OAMG;IACH,kBALW,MAAM,KACN,MAAM,KACN,MAAM,GACJ,KAAK,CAIjB;IAED;;;;;;OAMG;IACH,kBALW,MAAM,KACN,MAAM,KACN,MAAM,GACL,KAAK,CAQhB;IAGD;;;;OAIG;IACH,kBAHW,MAAM,GACL,KAAK,CAQhB;IAED
|
|
1
|
+
{"version":3,"file":"Color.d.ts","sourceRoot":"","sources":["../../../../src/core/color/Color.js"],"names":[],"mappings":"AAkBA;;;GAGG;AACH;IAumBI;;;;;;OAMG;IACH,kBALW,MAAM,KACN,MAAM,KACN,MAAM,GACJ,KAAK,CAIjB;IAED;;;;;;OAMG;IACH,kBALW,MAAM,KACN,MAAM,KACN,MAAM,GACL,KAAK,CAQhB;IAGD;;;;OAIG;IACH,kBAHW,MAAM,GACL,KAAK,CAQhB;IAED;;;;;OAKG;IACH,kCAJW,KAAK,WACL,KAAK,GACH,KAAK,CAOjB;IAED;;;;;OAKG;IACH,kCAJW,KAAK,WACL,KAAK,GACH,KAAK,CAMjB;IArqBD;;;;;;OAMG;IACH,gBALW,MAAM,MACN,MAAM,MACN,MAAM,MACN,MAAM,EAuChB;IA/BG;;;;OAIG;IACH,GAFU,MAAM,CAEN;IACV;;;;OAIG;IACH,GAFU,MAAM,CAEN;IACV;;;;OAIG;IACH,GAFU,MAAM,CAE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IACH,SAFa,KAAK,CAQjB;IAED;;;OAGG;IACH,QAFa,MAAM,CAIlB;IAED;;;;;aAEC;IAED;;;;;MAOC;IAWD;;;;;OAKG;IACH,sBAJW,MAAM,EAAE,uBACR,MAAM,GACJ,MAAM,EAAE,CASpB;IAED;;;;OAIG;IACH,kBAHW,MAAM,EAAE,GAAC,YAAY,WACrB,MAAM,QAShB;IAGD;;;OAGG;IACH,2CAKC;IAED;;;OAGG;IACH,6CAOC;IAED;;;;OAIG;IACH,WAHW,MAAM,GACJ,IAAI,CAYhB;IAED;;;;;OAKG;IACH,cAJW,KAAK,KACL,KAAK,KACL,MAAM,QAOhB;IAoEL;;;OAGG;IACH,sCAxJe,MAAM,EAAE,uBACR,MAAM,KACJ,MAAM,EAAE,CAsJG;IAnKxB,sDAOC;CAsJJ;;aAUS,SAAS,KAAK,CAAC;eAMf,SAAS,KAAK,CAAC;cAMf,SAAS,KAAK,CAAC;gBAMf,SAAS,KAAK,CAAC;cAMf,SAAS,KAAK,CAAC;iBAMf,SAAS,KAAK,CAAC;eAMf,SAAS,KAAK,CAAC;eAMf,SAAS,KAAK,CAAC;qBAMf,SAAS,KAAK,CAAC;;mBApvBN,4BAA4B"}
|
package/src/core/color/Color.js
CHANGED
|
@@ -678,22 +678,29 @@ export class Color {
|
|
|
678
678
|
/**
|
|
679
679
|
*
|
|
680
680
|
* @param {Color} input
|
|
681
|
-
* @param {Color} output
|
|
681
|
+
* @param {Color} [output]
|
|
682
|
+
* @returns {Color}
|
|
682
683
|
*/
|
|
683
|
-
static from_linear_to_sRGB(input, output) {
|
|
684
|
+
static from_linear_to_sRGB(input, output=new Color()) {
|
|
685
|
+
|
|
684
686
|
linear_to_sRGB(output, 0, input, 0);
|
|
687
|
+
|
|
688
|
+
return output;
|
|
685
689
|
}
|
|
686
690
|
|
|
687
691
|
/**
|
|
688
692
|
*
|
|
689
693
|
* @param {Color} input
|
|
690
|
-
* @param {Color} output
|
|
694
|
+
* @param {Color} [output]
|
|
695
|
+
* @returns {Color}
|
|
691
696
|
*/
|
|
692
|
-
static from_sRGB_to_linear(input, output) {
|
|
697
|
+
static from_sRGB_to_linear(input, output = new Color()) {
|
|
693
698
|
sRGB_to_linear(output, 0, input, 0);
|
|
699
|
+
|
|
700
|
+
return output;
|
|
694
701
|
}
|
|
695
702
|
}
|
|
696
|
-
|
|
703
|
+
ex
|
|
697
704
|
/**
|
|
698
705
|
* @deprecated use {@link Color#toArray} instead
|
|
699
706
|
* @readonly
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color_desaturate.d.ts","sourceRoot":"","sources":["../../../../../src/core/color/operations/color_desaturate.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,uDAFW,MAAM,OAUhB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { clamp01 } from "../../math/clamp01.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param {Color} input
|
|
6
|
+
* @param {number} amount
|
|
7
|
+
*/
|
|
8
|
+
export function color_desaturate(input, amount) {
|
|
9
|
+
const r = input.clone();
|
|
10
|
+
|
|
11
|
+
const hsv = r.getHSV();
|
|
12
|
+
|
|
13
|
+
r.setHSV(hsv.h, hsv.s * clamp01(1 - amount), hsv.v);
|
|
14
|
+
|
|
15
|
+
return r;
|
|
16
|
+
}
|
|
@@ -106,7 +106,7 @@ class LightSystem extends AbstractContextSystem {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
if (settings.preAllocateLightsAmbient !== undefined) {
|
|
109
|
-
this.__three_light_cache.reserve(LightType.
|
|
109
|
+
this.__three_light_cache.reserve(LightType.AMBIENT, settings.preAllocateLightsAmbient);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
|