@woosh/meep-engine 2.84.8 → 2.84.10
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 +27 -13
- package/build/meep.cjs +213 -140
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +213 -140
- package/editor/process/symbolic/makePositionedIconDisplaySymbol.js +2 -4
- package/editor/view/EditorView.js +48 -204
- package/editor/view/ecs/HierarchicalEntityListView.js +191 -0
- package/editor/view/ecs/HierarchicalEntityListView.module.scss +13 -0
- package/editor/view/prepareMeshLibrary.js +178 -0
- package/editor/view/v2/SplitView.js +104 -0
- package/editor/view/v2/ViewManagementSystem.js +0 -0
- package/editor/view/v2/prototypeEditor.js +127 -0
- package/package.json +10 -5
- package/src/core/cache/Cache.d.ts +2 -0
- package/src/core/cache/Cache.js +58 -8
- package/src/core/cache/Cache.spec.js +38 -0
- package/src/core/cache/CacheElement.js +6 -0
- package/src/core/cache/LoadingCache.js +27 -3
- package/src/core/cache/LoadingCache.spec.js +22 -7
- package/src/core/collection/array/arraySetSortingDiff.js +6 -6
- package/src/core/collection/table/RowFirstTable.js +364 -368
- package/src/core/geom/3d/SurfacePoint3.js +3 -40
- package/src/core/geom/3d/plane/plane3_compute_ray_intersection.js +3 -1
- package/src/core/geom/3d/topology/simplify/prototypeMeshSimplification.js +7 -7
- package/src/core/geom/Vector3.js +25 -14
- package/src/core/model/stat/LinearModifier.spec.js +5 -6
- package/src/core/process/PromiseWatcher.spec.js +27 -23
- package/src/engine/animation/behavior/animateProperty.js +4 -4
- package/src/engine/animation/curve/ecd_bind_animation_curve.js +9 -0
- package/src/engine/ecs/EntityReference.js +12 -0
- package/src/engine/ecs/dynamic_actions/actions/definition/SpeakLineActionDescription.js +1 -1
- package/src/engine/ecs/transform/Transform.js +1 -1
- package/src/engine/ecs/transform/Transform.spec.js +44 -0
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometryFlags.js +8 -1
- package/src/engine/graphics/ecs/mesh-v2/aggregate/prototypeSGMesh.js +23 -19
- package/src/engine/graphics/ecs/mesh-v2/sg_hierarchy_compute_bounding_box_via_parent_entity.js +2 -2
- package/src/engine/graphics/ecs/mesh-v2/three_object_to_entity_composition.js +3 -1
- package/src/engine/graphics/particles/particular/engine/parameter/ParameterLookupTable.js +6 -6
- package/src/engine/intelligence/behavior/ecs/SendEventBehavior.js +43 -0
- package/src/view/View.js +64 -95
- package/src/view/setElementTransform.js +20 -0
- package/src/view/setElementVisibility.js +15 -0
package/src/view/View.js
CHANGED
|
@@ -14,43 +14,10 @@ import Vector1 from "../core/geom/Vector1.js";
|
|
|
14
14
|
import Vector2 from "../core/geom/Vector2.js";
|
|
15
15
|
import { epsilonEquals } from "../core/math/epsilonEquals.js";
|
|
16
16
|
import { FLT_EPSILON_32 } from "../core/math/FLT_EPSILON_32.js";
|
|
17
|
+
import { setElementVisibility } from "./setElementVisibility.js";
|
|
17
18
|
import { writeCssTransformMatrix } from "./writeCssTransformMatrix.js";
|
|
18
19
|
|
|
19
20
|
|
|
20
|
-
const scratch_m3_0 = new Float32Array(9);
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @see https://dev.opera.com/articles/understanding-the-css-transforms-matrix/
|
|
24
|
-
* @param domElement
|
|
25
|
-
* @param {Vector2} position
|
|
26
|
-
* @param {Vector2} scale
|
|
27
|
-
* @param {number} rotation angle in radians
|
|
28
|
-
*/
|
|
29
|
-
function setElementTransform(domElement, position, scale, rotation) {
|
|
30
|
-
|
|
31
|
-
const m3 = scratch_m3_0;
|
|
32
|
-
|
|
33
|
-
m3_cm_compose_transform(m3, position.x, position.y, scale.x, scale.y, 0, 0, rotation);
|
|
34
|
-
|
|
35
|
-
writeCssTransformMatrix(m3, domElement);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
*
|
|
40
|
-
* @param {HTMLElement} domElement
|
|
41
|
-
* @param {boolean} visibility
|
|
42
|
-
*/
|
|
43
|
-
function setElementVisibility(domElement, visibility) {
|
|
44
|
-
const style = domElement.style;
|
|
45
|
-
|
|
46
|
-
if (!visibility) {
|
|
47
|
-
style.display = 'none';
|
|
48
|
-
} else {
|
|
49
|
-
// remove display property, this allows style re-flow whereby previous display type is assumed
|
|
50
|
-
style.removeProperty('display');
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
21
|
/**
|
|
55
22
|
*
|
|
56
23
|
* @enum {number}
|
|
@@ -72,84 +39,86 @@ const INITIAL_FLAGS = ViewFlags.Visible;
|
|
|
72
39
|
* @class
|
|
73
40
|
*/
|
|
74
41
|
class View {
|
|
75
|
-
#transform_written = new Float32Array(9);
|
|
76
|
-
#transform_current = new Float32Array(9);
|
|
77
42
|
|
|
78
43
|
/**
|
|
79
|
-
*
|
|
44
|
+
* Signal bindings, these will be linked and unlinked along with the view
|
|
45
|
+
* @private
|
|
46
|
+
* @type {SignalBinding[]}
|
|
80
47
|
*/
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
*
|
|
84
|
-
* @type {Element|NodeDescription|null}
|
|
85
|
-
*/
|
|
86
|
-
this.el = null;
|
|
48
|
+
bindings = [];
|
|
87
49
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
this.bindings = [];
|
|
50
|
+
/**
|
|
51
|
+
*
|
|
52
|
+
* @type {ViewFlags|number}
|
|
53
|
+
*/
|
|
54
|
+
flags = INITIAL_FLAGS;
|
|
94
55
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
56
|
+
/**
|
|
57
|
+
* @readonly
|
|
58
|
+
* @type {Vector2}
|
|
59
|
+
*/
|
|
60
|
+
position = new Vector2(0, 0);
|
|
100
61
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
62
|
+
/**
|
|
63
|
+
* @readonly
|
|
64
|
+
* @type {Vector1}
|
|
65
|
+
*/
|
|
66
|
+
rotation = new Vector1(0);
|
|
106
67
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
68
|
+
/**
|
|
69
|
+
* @readonly
|
|
70
|
+
* @type {Vector2}
|
|
71
|
+
*/
|
|
72
|
+
scale = new Vector2(1, 1);
|
|
112
73
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
74
|
+
/**
|
|
75
|
+
* @readonly
|
|
76
|
+
* @type {Vector2}
|
|
77
|
+
*/
|
|
78
|
+
size = new Vector2(0, 0);
|
|
118
79
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
80
|
+
/**
|
|
81
|
+
* Origin from which rotation and scaling is applied
|
|
82
|
+
* @readonly
|
|
83
|
+
* @type {Vector2}
|
|
84
|
+
*/
|
|
85
|
+
transformOrigin = new Vector2(0.5, 0.5);
|
|
124
86
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
*/
|
|
130
|
-
this.transformOrigin = new Vector2(0.5, 0.5);
|
|
87
|
+
on = {
|
|
88
|
+
linked: new Signal(),
|
|
89
|
+
unlinked: new Signal()
|
|
90
|
+
};
|
|
131
91
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
92
|
+
/**
|
|
93
|
+
*
|
|
94
|
+
* @type {View[]}
|
|
95
|
+
*/
|
|
96
|
+
children = [];
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
*
|
|
100
|
+
* @type {View|null}
|
|
101
|
+
*/
|
|
102
|
+
parent = null;
|
|
136
103
|
|
|
137
|
-
/**
|
|
138
|
-
*
|
|
139
|
-
* @type {View[]}
|
|
140
|
-
*/
|
|
141
|
-
this.children = [];
|
|
142
104
|
|
|
105
|
+
#transform_written = new Float32Array(9);
|
|
106
|
+
#transform_current = new Float32Array(9);
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* @constructor
|
|
110
|
+
*/
|
|
111
|
+
constructor() {
|
|
143
112
|
/**
|
|
144
113
|
*
|
|
145
|
-
* @type {
|
|
114
|
+
* @type {Element|NodeDescription|null}
|
|
146
115
|
*/
|
|
147
|
-
this.
|
|
116
|
+
this.el = null;
|
|
148
117
|
|
|
149
|
-
position.onChanged.add(this.__updateTransform, this);
|
|
150
|
-
scale.onChanged.add(this.__updateTransform, this);
|
|
151
|
-
rotation.onChanged.add(this.__updateTransform, this);
|
|
152
|
-
size.onChanged.add(this.__setDimensions, this);
|
|
118
|
+
this.position.onChanged.add(this.__updateTransform, this);
|
|
119
|
+
this.scale.onChanged.add(this.__updateTransform, this);
|
|
120
|
+
this.rotation.onChanged.add(this.__updateTransform, this);
|
|
121
|
+
this.size.onChanged.add(this.__setDimensions, this);
|
|
153
122
|
|
|
154
123
|
this.transformOrigin.onChanged.add(this.__setTransformOrigin, this);
|
|
155
124
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { m3_cm_compose_transform } from "../core/geom/mat3/m3_cm_compose_transform.js";
|
|
2
|
+
import { writeCssTransformMatrix } from "./writeCssTransformMatrix.js";
|
|
3
|
+
|
|
4
|
+
const scratch_m3_0 = new Float32Array(9);
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @see https://dev.opera.com/articles/understanding-the-css-transforms-matrix/
|
|
8
|
+
* @param domElement
|
|
9
|
+
* @param {Vector2} position
|
|
10
|
+
* @param {Vector2} scale
|
|
11
|
+
* @param {number} rotation angle in radians
|
|
12
|
+
*/
|
|
13
|
+
function setElementTransform(domElement, position, scale, rotation) {
|
|
14
|
+
|
|
15
|
+
const m3 = scratch_m3_0;
|
|
16
|
+
|
|
17
|
+
m3_cm_compose_transform(m3, position.x, position.y, scale.x, scale.y, 0, 0, rotation);
|
|
18
|
+
|
|
19
|
+
writeCssTransformMatrix(m3, domElement);
|
|
20
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* @param {HTMLElement} domElement
|
|
4
|
+
* @param {boolean} visibility
|
|
5
|
+
*/
|
|
6
|
+
export function setElementVisibility(domElement, visibility) {
|
|
7
|
+
const style = domElement.style;
|
|
8
|
+
|
|
9
|
+
if (!visibility) {
|
|
10
|
+
style.display = 'none';
|
|
11
|
+
} else {
|
|
12
|
+
// remove display property, this allows style re-flow whereby previous display type is assumed
|
|
13
|
+
style.removeProperty('display');
|
|
14
|
+
}
|
|
15
|
+
}
|