@woosh/meep-engine 2.85.2 → 2.85.4
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 +20 -12
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +20 -12
- package/package.json +5 -3
- package/src/engine/Engine.d.ts +1 -1
- package/src/engine/Engine.js +8 -5
- package/src/engine/graphics/GraphicsEngine.js +12 -7
- package/src/engine/simulation/Ticker.d.ts +10 -0
package/build/meep.module.js
CHANGED
|
@@ -89211,22 +89211,24 @@ function configureThreeRenderer(webGLRenderer) {
|
|
|
89211
89211
|
//turn off automatic info reset, we use multi-pass rendering, so we manually reset the render info
|
|
89212
89212
|
webGLRenderer.info.autoReset = false;
|
|
89213
89213
|
|
|
89214
|
-
if (ENV_PRODUCTION) {
|
|
89215
|
-
//disable shader error checking in production build
|
|
89216
|
-
webGLRenderer.debug.checkShaderErrors = false;
|
|
89217
|
-
} else {
|
|
89218
|
-
webGLRenderer.debug.checkShaderErrors = true;
|
|
89219
|
-
}
|
|
89220
89214
|
}
|
|
89221
89215
|
|
|
89222
89216
|
|
|
89223
89217
|
class GraphicsEngine {
|
|
89218
|
+
#debug = false;
|
|
89219
|
+
|
|
89224
89220
|
/**
|
|
89225
89221
|
*
|
|
89226
89222
|
* @param {Camera} camera
|
|
89223
|
+
* @param {boolean} [debug]
|
|
89227
89224
|
* @constructor
|
|
89228
89225
|
*/
|
|
89229
|
-
constructor(
|
|
89226
|
+
constructor({
|
|
89227
|
+
camera,
|
|
89228
|
+
debug = false
|
|
89229
|
+
}) {
|
|
89230
|
+
this.#debug = debug;
|
|
89231
|
+
|
|
89230
89232
|
const self = this;
|
|
89231
89233
|
|
|
89232
89234
|
/**
|
|
@@ -89511,6 +89513,9 @@ class GraphicsEngine {
|
|
|
89511
89513
|
|
|
89512
89514
|
configureThreeRenderer(webGLRenderer);
|
|
89513
89515
|
|
|
89516
|
+
//disable shader error checking in production build
|
|
89517
|
+
webGLRenderer.debug.checkShaderErrors = this.#debug;
|
|
89518
|
+
|
|
89514
89519
|
this.enableExtensions();
|
|
89515
89520
|
|
|
89516
89521
|
this.initializeFrameBuffers();
|
|
@@ -103185,14 +103190,14 @@ class Engine {
|
|
|
103185
103190
|
* @param {EntityManager} [entityManager]
|
|
103186
103191
|
* @param {boolean} [enableGraphics]
|
|
103187
103192
|
* @param {boolean} [enableAudio]
|
|
103188
|
-
* @param {boolean} [
|
|
103193
|
+
* @param {boolean} [debug]
|
|
103189
103194
|
* @constructor
|
|
103190
103195
|
*/
|
|
103191
103196
|
constructor(platform, {
|
|
103192
103197
|
entityManager,
|
|
103193
103198
|
enableGraphics = true,
|
|
103194
103199
|
enableAudio = true,
|
|
103195
|
-
|
|
103200
|
+
debug = true
|
|
103196
103201
|
} = {}) {
|
|
103197
103202
|
|
|
103198
103203
|
/**
|
|
@@ -103206,7 +103211,7 @@ class Engine {
|
|
|
103206
103211
|
* @type {StaticKnowledgeDatabase}
|
|
103207
103212
|
*/
|
|
103208
103213
|
this.staticKnowledge = new StaticKnowledgeDatabase();
|
|
103209
|
-
this.staticKnowledge.validation_enabled =
|
|
103214
|
+
this.staticKnowledge.validation_enabled = debug;
|
|
103210
103215
|
|
|
103211
103216
|
/**
|
|
103212
103217
|
*
|
|
@@ -103289,7 +103294,7 @@ class Engine {
|
|
|
103289
103294
|
|
|
103290
103295
|
if (!this.__using_external_entity_manager) {
|
|
103291
103296
|
// subscribe simulator to common ticker
|
|
103292
|
-
this.ticker.
|
|
103297
|
+
this.ticker.onTick.add(timeDelta => {
|
|
103293
103298
|
const t0 = performance.now();
|
|
103294
103299
|
this.entityManager.simulate(timeDelta);
|
|
103295
103300
|
|
|
@@ -103357,7 +103362,10 @@ class Engine {
|
|
|
103357
103362
|
|
|
103358
103363
|
if (enableGraphics !== false) {
|
|
103359
103364
|
|
|
103360
|
-
const graphicsEngine = new GraphicsEngine(
|
|
103365
|
+
const graphicsEngine = new GraphicsEngine({
|
|
103366
|
+
camera: this.camera,
|
|
103367
|
+
debug
|
|
103368
|
+
});
|
|
103361
103369
|
|
|
103362
103370
|
/**
|
|
103363
103371
|
*
|
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.85.
|
|
8
|
+
"version": "2.85.4",
|
|
9
9
|
"main": "build/meep.module.js",
|
|
10
10
|
"module": "build/meep.module.js",
|
|
11
11
|
"exports": {
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
"scripts": {
|
|
21
21
|
"test:ci": "jest --config ./jest.conf.json --collectCoverage --coverageDirectory=\"./coverage\" --ci --reporters=default --reporters=jest-junit --watchAll=false",
|
|
22
22
|
"build-module": "rollup -c rollup.config.js",
|
|
23
|
-
"publish-npm": "npm publish"
|
|
23
|
+
"publish-npm": "npm publish",
|
|
24
|
+
"generate-types": "npx -p typescript tsc src/**/*.js --declaration --allowJs --emitDeclarationOnly --outDir dist"
|
|
24
25
|
},
|
|
25
26
|
"browserslist": [
|
|
26
27
|
"last 2 chrome version",
|
|
@@ -61,7 +62,8 @@
|
|
|
61
62
|
"jest": "29.6.4",
|
|
62
63
|
"jest-environment-jsdom": "29.6.4",
|
|
63
64
|
"jest-junit": "16.0.0",
|
|
64
|
-
"rollup": "3.26.2"
|
|
65
|
+
"rollup": "3.26.2",
|
|
66
|
+
"typescript": "5.2.2"
|
|
65
67
|
},
|
|
66
68
|
"keywords": [
|
|
67
69
|
"dream",
|
package/src/engine/Engine.d.ts
CHANGED
package/src/engine/Engine.js
CHANGED
|
@@ -54,14 +54,14 @@ class Engine {
|
|
|
54
54
|
* @param {EntityManager} [entityManager]
|
|
55
55
|
* @param {boolean} [enableGraphics]
|
|
56
56
|
* @param {boolean} [enableAudio]
|
|
57
|
-
* @param {boolean} [
|
|
57
|
+
* @param {boolean} [debug]
|
|
58
58
|
* @constructor
|
|
59
59
|
*/
|
|
60
60
|
constructor(platform, {
|
|
61
61
|
entityManager,
|
|
62
62
|
enableGraphics = true,
|
|
63
63
|
enableAudio = true,
|
|
64
|
-
|
|
64
|
+
debug = true
|
|
65
65
|
} = {}) {
|
|
66
66
|
assert.defined(platform, 'platform');
|
|
67
67
|
|
|
@@ -76,7 +76,7 @@ class Engine {
|
|
|
76
76
|
* @type {StaticKnowledgeDatabase}
|
|
77
77
|
*/
|
|
78
78
|
this.staticKnowledge = new StaticKnowledgeDatabase();
|
|
79
|
-
this.staticKnowledge.validation_enabled =
|
|
79
|
+
this.staticKnowledge.validation_enabled = debug;
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
82
|
*
|
|
@@ -159,7 +159,7 @@ class Engine {
|
|
|
159
159
|
|
|
160
160
|
if (!this.__using_external_entity_manager) {
|
|
161
161
|
// subscribe simulator to common ticker
|
|
162
|
-
this.ticker.
|
|
162
|
+
this.ticker.onTick.add(timeDelta => {
|
|
163
163
|
const t0 = performance.now();
|
|
164
164
|
this.entityManager.simulate(timeDelta);
|
|
165
165
|
|
|
@@ -227,7 +227,10 @@ class Engine {
|
|
|
227
227
|
|
|
228
228
|
if (enableGraphics !== false) {
|
|
229
229
|
|
|
230
|
-
const graphicsEngine = new GraphicsEngine(
|
|
230
|
+
const graphicsEngine = new GraphicsEngine({
|
|
231
|
+
camera: this.camera,
|
|
232
|
+
debug
|
|
233
|
+
});
|
|
231
234
|
|
|
232
235
|
/**
|
|
233
236
|
*
|
|
@@ -58,22 +58,24 @@ function configureThreeRenderer(webGLRenderer) {
|
|
|
58
58
|
//turn off automatic info reset, we use multi-pass rendering, so we manually reset the render info
|
|
59
59
|
webGLRenderer.info.autoReset = false;
|
|
60
60
|
|
|
61
|
-
if (ENV_PRODUCTION) {
|
|
62
|
-
//disable shader error checking in production build
|
|
63
|
-
webGLRenderer.debug.checkShaderErrors = false;
|
|
64
|
-
} else {
|
|
65
|
-
webGLRenderer.debug.checkShaderErrors = true;
|
|
66
|
-
}
|
|
67
61
|
}
|
|
68
62
|
|
|
69
63
|
|
|
70
64
|
export class GraphicsEngine {
|
|
65
|
+
#debug = false;
|
|
66
|
+
|
|
71
67
|
/**
|
|
72
68
|
*
|
|
73
69
|
* @param {Camera} camera
|
|
70
|
+
* @param {boolean} [debug]
|
|
74
71
|
* @constructor
|
|
75
72
|
*/
|
|
76
|
-
constructor(
|
|
73
|
+
constructor({
|
|
74
|
+
camera,
|
|
75
|
+
debug = false
|
|
76
|
+
}) {
|
|
77
|
+
this.#debug = debug;
|
|
78
|
+
|
|
77
79
|
const self = this;
|
|
78
80
|
|
|
79
81
|
/**
|
|
@@ -363,6 +365,9 @@ export class GraphicsEngine {
|
|
|
363
365
|
|
|
364
366
|
configureThreeRenderer(webGLRenderer);
|
|
365
367
|
|
|
368
|
+
//disable shader error checking in production build
|
|
369
|
+
webGLRenderer.debug.checkShaderErrors = this.#debug;
|
|
370
|
+
|
|
366
371
|
this.enableExtensions();
|
|
367
372
|
|
|
368
373
|
this.initializeFrameBuffers();
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
import Signal from "../../core/events/signal/Signal";
|
|
2
|
+
|
|
1
3
|
export default class Ticker {
|
|
4
|
+
readonly onTick: Signal<number>
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated
|
|
8
|
+
*/
|
|
2
9
|
subscribe(f: (timeDelta: number) => any, thisArg?: any): void
|
|
3
10
|
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated
|
|
13
|
+
*/
|
|
4
14
|
unsubscribe(f: (timeDelta: number) => any, thisArg?: any): void
|
|
5
15
|
}
|