@woosh/meep-engine 2.46.23 → 2.46.25
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 -9
- package/build/meep.min.js +1 -0
- package/build/meep.module.js +20 -9
- package/package.json +3 -2
- package/src/core/model/node-graph/visual/NodeGraphVisualData.js +3 -3
- package/src/engine/graphics/ecs/light/shadow/LightShadow.js +4 -0
- package/src/engine/graphics/render/forward_plus/LightManager.js +1 -1
- package/src/engine/intelligence/behavior/SelectorBehavior.js +4 -1
- package/src/engine/intelligence/behavior/primitive/ActionBehavior.js +16 -7
package/build/meep.module.js
CHANGED
|
@@ -99861,25 +99861,34 @@ class RepeatBehavior extends AbstractDecoratorBehavior {
|
|
|
99861
99861
|
|
|
99862
99862
|
RepeatBehavior.typeName = "RepeatBehavior";
|
|
99863
99863
|
|
|
99864
|
+
/**
|
|
99865
|
+
* @template CTX
|
|
99866
|
+
* @extends {Behavior<CTX>}
|
|
99867
|
+
*/
|
|
99864
99868
|
class ActionBehavior extends Behavior {
|
|
99865
99869
|
/**
|
|
99866
99870
|
*
|
|
99867
|
-
* @param {function(timeDelta:number)}
|
|
99868
|
-
* @param {*} [
|
|
99871
|
+
* @param {function(timeDelta:number, context:CTX)} func
|
|
99872
|
+
* @param {*} [thisArg] defaults to behavior itself if not specified
|
|
99869
99873
|
*/
|
|
99870
|
-
constructor(
|
|
99874
|
+
constructor(func, thisArg) {
|
|
99871
99875
|
super();
|
|
99872
99876
|
|
|
99873
|
-
assert.typeOf(
|
|
99877
|
+
assert.typeOf(func, 'function', "action");
|
|
99878
|
+
|
|
99879
|
+
this.__action = func;
|
|
99874
99880
|
|
|
99875
|
-
|
|
99876
|
-
|
|
99881
|
+
if (thisArg === undefined) {
|
|
99882
|
+
this.__context = this;
|
|
99883
|
+
} else {
|
|
99884
|
+
this.__context = thisArg;
|
|
99885
|
+
}
|
|
99877
99886
|
}
|
|
99878
99887
|
|
|
99879
99888
|
tick(timeDelta) {
|
|
99880
99889
|
|
|
99881
99890
|
try {
|
|
99882
|
-
this.__action.call(this.__context, timeDelta);
|
|
99891
|
+
this.__action.call(this.__context, timeDelta, this.context);
|
|
99883
99892
|
|
|
99884
99893
|
return BehaviorStatus.Succeeded;
|
|
99885
99894
|
|
|
@@ -120309,7 +120318,7 @@ class LightManager {
|
|
|
120309
120318
|
*/
|
|
120310
120319
|
this.__visible_bvh_needs_update = true;
|
|
120311
120320
|
|
|
120312
|
-
window.light_manager = this; // DEBUG
|
|
120321
|
+
// window.light_manager = this; // DEBUG
|
|
120313
120322
|
}
|
|
120314
120323
|
|
|
120315
120324
|
/**
|
|
@@ -125834,9 +125843,11 @@ class SelectorBehavior extends CompositeBehavior {
|
|
|
125834
125843
|
* @returns {SelectorBehavior}
|
|
125835
125844
|
*/
|
|
125836
125845
|
static from(children) {
|
|
125846
|
+
assert.isArray(children, 'children');
|
|
125847
|
+
|
|
125837
125848
|
const r = new SelectorBehavior();
|
|
125838
125849
|
|
|
125839
|
-
children.forEach(
|
|
125850
|
+
children.forEach(r.addChild, r);
|
|
125840
125851
|
|
|
125841
125852
|
return r;
|
|
125842
125853
|
}
|
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.46.
|
|
8
|
+
"version": "2.46.25",
|
|
9
9
|
"main": "build/meep.module.js",
|
|
10
10
|
"module": "build/meep.module.js",
|
|
11
11
|
"exports": {
|
|
@@ -44,7 +44,8 @@
|
|
|
44
44
|
"@babel/preset-env": "7.20.2",
|
|
45
45
|
"@rollup/plugin-commonjs": "24.0.1",
|
|
46
46
|
"@rollup/plugin-node-resolve": "15.0.1",
|
|
47
|
-
"@rollup/plugin-
|
|
47
|
+
"@rollup/plugin-terser": "0.4.0",
|
|
48
|
+
"@rollup/plugin-strip": "3.0.2",
|
|
48
49
|
"@types/three": "^0.135.0",
|
|
49
50
|
"babel-jest": "26.6.3",
|
|
50
51
|
"rollup": "3.16.0"
|
|
@@ -112,7 +112,7 @@ export class NodeGraphVisualData {
|
|
|
112
112
|
*
|
|
113
113
|
* @param {NodeInstancePortReference} ref
|
|
114
114
|
*/
|
|
115
|
-
const
|
|
115
|
+
const getEndpointLayoutSpec = (ref) => {
|
|
116
116
|
const endpoint = endpoints.get(ref);
|
|
117
117
|
|
|
118
118
|
if (endpoint !== undefined) {
|
|
@@ -141,8 +141,8 @@ export class NodeGraphVisualData {
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
graph.traverseConnections(connection => {
|
|
144
|
-
const source =
|
|
145
|
-
const target =
|
|
144
|
+
const source = getEndpointLayoutSpec(connection.source);
|
|
145
|
+
const target = getEndpointLayoutSpec(connection.target);
|
|
146
146
|
|
|
147
147
|
const spec = ConnectionLayoutSpec.from(
|
|
148
148
|
source,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CompositeBehavior } from "./composite/CompositeBehavior.js";
|
|
2
2
|
import { BehaviorStatus } from "./BehaviorStatus.js";
|
|
3
|
+
import { assert } from "../../../core/assert.js";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Will try every child behaviour in order until one succeeds or if all fail - the selector behavior will fail too
|
|
@@ -29,9 +30,11 @@ export class SelectorBehavior extends CompositeBehavior {
|
|
|
29
30
|
* @returns {SelectorBehavior}
|
|
30
31
|
*/
|
|
31
32
|
static from(children) {
|
|
33
|
+
assert.isArray(children, 'children');
|
|
34
|
+
|
|
32
35
|
const r = new SelectorBehavior();
|
|
33
36
|
|
|
34
|
-
children.forEach(
|
|
37
|
+
children.forEach(r.addChild, r);
|
|
35
38
|
|
|
36
39
|
return r;
|
|
37
40
|
}
|
|
@@ -2,25 +2,34 @@ import { Behavior } from "../Behavior.js";
|
|
|
2
2
|
import { BehaviorStatus } from "../BehaviorStatus.js";
|
|
3
3
|
import { assert } from "../../../../core/assert.js";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @template CTX
|
|
7
|
+
* @extends {Behavior<CTX>}
|
|
8
|
+
*/
|
|
5
9
|
export class ActionBehavior extends Behavior {
|
|
6
10
|
/**
|
|
7
11
|
*
|
|
8
|
-
* @param {function(timeDelta:number)}
|
|
9
|
-
* @param {*} [
|
|
12
|
+
* @param {function(timeDelta:number, context:CTX)} func
|
|
13
|
+
* @param {*} [thisArg] defaults to behavior itself if not specified
|
|
10
14
|
*/
|
|
11
|
-
constructor(
|
|
15
|
+
constructor(func, thisArg) {
|
|
12
16
|
super();
|
|
13
17
|
|
|
14
|
-
assert.typeOf(
|
|
18
|
+
assert.typeOf(func, 'function', "action");
|
|
15
19
|
|
|
16
|
-
this.__action =
|
|
17
|
-
|
|
20
|
+
this.__action = func;
|
|
21
|
+
|
|
22
|
+
if (thisArg === undefined) {
|
|
23
|
+
this.__context = this;
|
|
24
|
+
} else {
|
|
25
|
+
this.__context = thisArg;
|
|
26
|
+
}
|
|
18
27
|
}
|
|
19
28
|
|
|
20
29
|
tick(timeDelta) {
|
|
21
30
|
|
|
22
31
|
try {
|
|
23
|
-
this.__action.call(this.__context, timeDelta);
|
|
32
|
+
this.__action.call(this.__context, timeDelta, this.context);
|
|
24
33
|
|
|
25
34
|
return BehaviorStatus.Succeeded;
|
|
26
35
|
|