@woosh/meep-engine 2.119.30 → 2.119.32

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/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "description": "Fully featured ECS game engine written in JavaScript",
6
6
  "type": "module",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.119.30",
8
+ "version": "2.119.32",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -37,27 +37,46 @@ export class EngineHarness {
37
37
  fieldOfView?: number;
38
38
  }): Entity;
39
39
  /**
40
- *
41
- * @param {Engine} engine
42
- * @param {Vector3} [focus]
43
- * @param [heightMap]
44
- * @param [heightRange]
45
- * @param [pitch]
46
- * @param [yaw]
47
- * @param {number} [distance]
48
- * @param {Vector2} [terrainSize]
49
- * @param {number} [terrainResolution]
50
- * @param {boolean} [enableWater]
51
- * @param {boolean} [enableTerrain]
52
- * @param {boolean} [enableLights=true]
53
- * @param {number} [cameraFieldOfView]
54
- * @param {number} [cameraFarDistance]
55
- * @param {boolean} [cameraController=true]
56
- * @param {boolean} [cameraAutoClip]
57
- * @param shadowmapResolution
58
- * @param showFps
40
+ * @param {Object} params
41
+ * @param {Engine} params.engine
42
+ * @param {Vector3} [params.focus]
43
+ * @param [params.heightMap]
44
+ * @param [params.heightRange]
45
+ * @param {number} [params.pitch]
46
+ * @param {number} [params.yaw]
47
+ * @param {number} [params.distance]
48
+ * @param {Vector2} [params.terrainSize]
49
+ * @param {number} [params.terrainResolution]
50
+ * @param {boolean} [params.enableWater]
51
+ * @param {boolean} [params.enableTerrain]
52
+ * @param {boolean} [params.enableLights=true]
53
+ * @param {number} [params.cameraFieldOfView]
54
+ * @param {number} [params.cameraFarDistance]
55
+ * @param {boolean} [params.cameraController=true]
56
+ * @param {boolean} [params.cameraAutoClip]
57
+ * @param {number} [params.shadowmapResolution]
58
+ * @param {boolean} [params.showFps]
59
59
  */
60
- static buildBasics({ engine, focus, heightMap, heightRange, pitch, yaw, distance, terrainSize, terrainResolution, enableWater, enableTerrain, enableLights, cameraFieldOfView, cameraFarDistance, cameraController, cameraAutoClip, shadowmapResolution, showFps }: Engine): Promise<void>;
60
+ static buildBasics({ engine, focus, heightMap, heightRange, pitch, yaw, distance, terrainSize, terrainResolution, enableWater, enableTerrain, enableLights, cameraFieldOfView, cameraFarDistance, cameraController, cameraAutoClip, shadowmapResolution, showFps }: {
61
+ engine: Engine;
62
+ focus?: Vector3;
63
+ heightMap?: any;
64
+ heightRange?: any;
65
+ pitch?: number;
66
+ yaw?: number;
67
+ distance?: number;
68
+ terrainSize?: Vector2;
69
+ terrainResolution?: number;
70
+ enableWater?: boolean;
71
+ enableTerrain?: boolean;
72
+ enableLights?: boolean;
73
+ cameraFieldOfView?: number;
74
+ cameraFarDistance?: number;
75
+ cameraController?: boolean;
76
+ cameraAutoClip?: boolean;
77
+ shadowmapResolution?: number;
78
+ showFps?: boolean;
79
+ }): Promise<void>;
61
80
  /**
62
81
  * @param {Object} param
63
82
  * @param {Engine} param.engine
@@ -66,6 +85,7 @@ export class EngineHarness {
66
85
  * @param {boolean} [param.castShadow]
67
86
  * @param {Color} [param.sun]
68
87
  * @param {number} [param.sunIntensity]
88
+ * @param {Vector3} [param.sunDirection]
69
89
  * @param {Color} [param.ambient]
70
90
  * @param {number} [param.ambientIntensity]
71
91
  */
@@ -76,6 +96,7 @@ export class EngineHarness {
76
96
  castShadow?: boolean;
77
97
  sun?: Color;
78
98
  sunIntensity?: number;
99
+ sunDirection?: Vector3;
79
100
  ambient?: Color;
80
101
  ambientIntensity?: number;
81
102
  }): Promise<void>;
@@ -117,11 +138,15 @@ export class EngineHarness {
117
138
  */
118
139
  readonly p: Promise<any> | null;
119
140
  /**
120
- * @param {(config:EngineConfiguration,engine:Engine)=>*} [configuration]
121
- * @param {boolean} [enable_localization] Whether or not to load localization data
141
+ * @param {Object} [params]
142
+ * @param {(config:EngineConfiguration,engine:Engine)=>*} [params.configuration]
143
+ * @param {boolean} [params.enable_localization] Whether or not to load localization data
122
144
  * @returns {Promise<Engine>}
123
145
  */
124
- initialize({ configuration, enable_localization, }?: (config: EngineConfiguration, engine: Engine) => any): Promise<Engine>;
146
+ initialize({ configuration, enable_localization, }?: {
147
+ configuration?: (config: EngineConfiguration, engine: Engine) => any;
148
+ enable_localization?: boolean;
149
+ }): Promise<Engine>;
125
150
  }
126
151
  export namespace EngineHarness {
127
152
  /**
@@ -134,6 +159,7 @@ import Engine from "./Engine.js";
134
159
  import { EngineConfiguration } from "./EngineConfiguration.js";
135
160
  import Vector3 from "../core/geom/Vector3.js";
136
161
  import Entity from "./ecs/Entity.js";
162
+ import Vector2 from "../core/geom/Vector2.js";
137
163
  import { Color } from "../core/color/Color.js";
138
164
  import Terrain from "./ecs/terrain/ecs/Terrain.js";
139
165
  //# sourceMappingURL=EngineHarness.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EngineHarness.d.ts","sourceRoot":"","sources":["../../../src/engine/EngineHarness.js"],"names":[],"mappings":"AA6DA;IAmBI;;;;OAIG;IACH,8CAHmB,mBAAmB,UAAQ,MAAM,WACxC,QAAQ,MAAM,CAAC,CAM1B;IAED;;;OAGG;IACH,6BAFW,MAAM,QAYhB;IAkED;;;;;;;;;;;;;OAaG;IACH;QAZyB,MAAM,EAApB,MAAM;QACyB,GAAG;QAClB,MAAM,GAAtB,OAAO;QACQ,QAAQ,GAAvB,MAAM;QACS,KAAK,GAApB,MAAM;QACS,GAAG,GAAlB,MAAM;QACU,QAAQ,GAAxB,OAAO;QACQ,WAAW,GAA1B,MAAM;QACS,WAAW,GAA1B,MAAM;QACS,WAAW,GAA1B,MAAM;QACJ,MAAM,CA+DlB;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,oQAnBW,MAAM,iBAmFhB;IAGD;;;;;;;;;;OAUG;IACH;QATyB,MAAM,EAApB,MAAM;QACyB,GAAG;QACnB,mBAAmB,GAAlC,MAAM;QACU,UA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W;QACF,KAAK,GAArB,MAAM;QACU,GAAG,GAAnB,MAAM;QACU,QAAQ,GAAxB,MAAM;QACW,WAAW,GAA5B,OAAO;QACS,iBAAiB,GAAjC,MAAM;QACW,WAAW,GAA5B,OAAO;QACU,aAAa,GAA9B,OAAO;QACU,YAAY,GAA7B,OAAO;QACS,iBAAiB,GAAjC,MAAM;QACU,iBAAiB,GAAjC,MAAM;QACW,gBAAgB,GAAjC,OAAO;QACU,cAAc,GAA/B,OAAO;QACS,mBAAmB,GAAnC,MAAM;QACW,OAAO,GAAxB,OAAO;sBAkEjB;IAGD;;;;;;;;;;;OAWG;IACH;QAVyB,MAAM,EAApB,MAAM;QACyB,GAAG;QACnB,mBAAmB,GAAlC,MAAM;QACU,UAAU,GAA1B,OAAO;QACO,GAAG,GAAjB,KAAK;QACU,YAAY,GAA3B,MAAM;QACU,YAAY,GAA5B,OAAO;QACO,OAAO,GAArB,KAAK;QACU,gBAAgB,GAA/B,MAAM;sBAqDhB;IAED;;;;;;;OAOG;IACH;QAN0B,YAAY,GAA3B,MAAM;QACQ,MAAM,EAApB,MAAM;QACS,WAAW,GAA1B,MAAM;QACyB,GAAG;QAChC,MAAM,CA2ClB;IAGD;;;;;;;;;;;OAWG;IACH,mGAVW,MAAM,GAQJ,OAAO,CAuDnB;IAxcG;;;OAGG;IACH,QAFU,MAAM,CAEiC;IAMjD;;;OAGG;IACH,YAFU,eAAQ,IAAI,CAET;IA8BjB;;;;;OAKG;IACH;iCAJmB,mBAAmB,UAAQ,MAAM;8BACzC,OAAO;QACL,QAAQ,MAAM,CAAC,CA2D3B;CA8VJ;;IAID;;;OAGG;IACH,uCAMC;;mBAvgBkB,aAAa;oCACI,0BAA0B;oBAX1C,yBAAyB;mBAK1B,iBAAiB;oBANhB,yBAAyB;sBAHvB,wBAAwB;oBAW1B,8BAA8B"}
@@ -106,8 +106,9 @@ export class EngineHarness {
106
106
  }
107
107
 
108
108
  /**
109
- * @param {(config:EngineConfiguration,engine:Engine)=>*} [configuration]
110
- * @param {boolean} [enable_localization] Whether or not to load localization data
109
+ * @param {Object} [params]
110
+ * @param {(config:EngineConfiguration,engine:Engine)=>*} [params.configuration]
111
+ * @param {boolean} [params.enable_localization] Whether or not to load localization data
111
112
  * @returns {Promise<Engine>}
112
113
  */
113
114
  initialize({
@@ -247,25 +248,25 @@ export class EngineHarness {
247
248
  }
248
249
 
249
250
  /**
250
- *
251
- * @param {Engine} engine
252
- * @param {Vector3} [focus]
253
- * @param [heightMap]
254
- * @param [heightRange]
255
- * @param [pitch]
256
- * @param [yaw]
257
- * @param {number} [distance]
258
- * @param {Vector2} [terrainSize]
259
- * @param {number} [terrainResolution]
260
- * @param {boolean} [enableWater]
261
- * @param {boolean} [enableTerrain]
262
- * @param {boolean} [enableLights=true]
263
- * @param {number} [cameraFieldOfView]
264
- * @param {number} [cameraFarDistance]
265
- * @param {boolean} [cameraController=true]
266
- * @param {boolean} [cameraAutoClip]
267
- * @param shadowmapResolution
268
- * @param showFps
251
+ * @param {Object} params
252
+ * @param {Engine} params.engine
253
+ * @param {Vector3} [params.focus]
254
+ * @param [params.heightMap]
255
+ * @param [params.heightRange]
256
+ * @param {number} [params.pitch]
257
+ * @param {number} [params.yaw]
258
+ * @param {number} [params.distance]
259
+ * @param {Vector2} [params.terrainSize]
260
+ * @param {number} [params.terrainResolution]
261
+ * @param {boolean} [params.enableWater]
262
+ * @param {boolean} [params.enableTerrain]
263
+ * @param {boolean} [params.enableLights=true]
264
+ * @param {number} [params.cameraFieldOfView]
265
+ * @param {number} [params.cameraFarDistance]
266
+ * @param {boolean} [params.cameraController=true]
267
+ * @param {boolean} [params.cameraAutoClip]
268
+ * @param {number} [params.shadowmapResolution]
269
+ * @param {boolean} [params.showFps]
269
270
  */
270
271
  static async buildBasics({
271
272
  engine,
@@ -342,6 +343,7 @@ export class EngineHarness {
342
343
  * @param {boolean} [param.castShadow]
343
344
  * @param {Color} [param.sun]
344
345
  * @param {number} [param.sunIntensity]
346
+ * @param {Vector3} [param.sunDirection]
345
347
  * @param {Color} [param.ambient]
346
348
  * @param {number} [param.ambientIntensity]
347
349
  */
@@ -3,7 +3,7 @@ import Signal from "../../core/events/signal/Signal";
3
3
  import Vector2 from "../../core/geom/Vector2";
4
4
  import Vector3 from "../../core/geom/Vector3";
5
5
  import View from "../../view/View";
6
- import {MaterialManager} from "./material/manager/MaterialManager";
6
+ import {MaterialManager} from "./material/manager/MaterialManager.js";
7
7
  import {RenderLayerManager} from "./render/layers/RenderLayerManager";
8
8
 
9
9
  interface IGraphicsEngineSignals {
@@ -1,6 +1,64 @@
1
- import {Material} from "three";
2
- import {Reference} from "../../../reference/v2/Reference";
3
-
4
- export class MaterialManager{
5
- obtain(source:Material):Reference<Material>
6
- }
1
+ export class MaterialManager {
2
+ /**
3
+ * Stores links from uncompiled (source) materials to managed containers
4
+ * @type {HashMap<Material, ManagedMaterial>}
5
+ * @private
6
+ */
7
+ private __library;
8
+ /**
9
+ * Cache for unused materials, gives them a second chance to be used before being disposed completely
10
+ * @type {Cache<Material, ManagedMaterial>}
11
+ * @private
12
+ */
13
+ private __cache;
14
+ /**
15
+ * Stores links from compiled materials back to the container
16
+ * @type {HashMap<Material, ManagedMaterial>}
17
+ * @private
18
+ */
19
+ private __reverse_library;
20
+ /**
21
+ *
22
+ * @type {AbstractMaterialTransformer[]}
23
+ * @private
24
+ */
25
+ private __transform_chain;
26
+ /**
27
+ * handle material disposal
28
+ * @param {Material} m
29
+ * @param {ManagedMaterial} managed_material
30
+ * @private
31
+ */
32
+ private __dispose_material;
33
+ /**
34
+ *
35
+ * @param {ManagedMaterial} material
36
+ * @private
37
+ */
38
+ private __handle_last_reference_removed;
39
+ /**
40
+ *
41
+ * @param {AbstractMaterialTransformer} def
42
+ */
43
+ addCompileStep(def: AbstractMaterialTransformer): void;
44
+ /**
45
+ *
46
+ * @param {AbstractMaterialTransformer} def
47
+ * @returns {boolean}
48
+ */
49
+ removeCompileStep(def: AbstractMaterialTransformer): boolean;
50
+ /**
51
+ *
52
+ * @param {Material} m
53
+ * @returns {Material}
54
+ * @private
55
+ */
56
+ private __compile;
57
+ /**
58
+ *
59
+ * @param {Material} source
60
+ * @returns {Reference<Material>}
61
+ */
62
+ obtain(source: Material): Reference<Material>;
63
+ }
64
+ //# sourceMappingURL=MaterialManager.d.ts.map