@woosh/meep-engine 2.33.1 → 2.33.5
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/core/bvh2/aabb3/AABB3.js +18 -0
- package/core/bvh2/aabb3/aabb3_intersects_frustum.js +38 -0
- package/core/collection/array/copyArray.js +2 -2
- package/core/collection/table/RowFirstTableSpec.js +8 -0
- package/core/geom/3d/aabb/aabb3_compute_projected_area.js +11 -10
- package/core/geom/3d/aabb/aabb3_estimate_projected_area2.js +59 -0
- package/core/geom/3d/aabb/aabb3_matrix4_project.js +33 -0
- package/core/geom/3d/aabb/aabb3_matrix4_project.spec.js +41 -0
- package/core/geom/3d/plane/plane3_lerp.js +2 -2
- package/core/geom/3d/topology/TopoTriangle.js +2 -2
- package/core/geom/AABB2.d.ts +2 -0
- package/core/geom/Matrix4.js +4 -4
- package/core/geom/Vector3.js +5 -5
- package/core/model/reactive/model/terminal/ReactiveReference.js +7 -1
- package/engine/asset/loaders/GLTFAssetLoader.js +3 -3
- package/engine/asset/loaders/material/TextureAttachmensByMaterialType.js +11 -1
- package/engine/asset/loaders/material/TextureAttachment.js +12 -1
- package/engine/asset/loaders/material/computeTextureEquality.js +1 -1
- package/engine/asset/loaders/material/computeTextureHash.js +16 -14
- package/engine/asset/loaders/material/traverseMaterialTextures.js +2 -2
- package/engine/ecs/animation/OneBoneSurfaceAlignmentSolver.js +2 -2
- package/engine/ecs/animation/TwoBoneInverseKinematicsSolver.js +4 -4
- package/engine/graphics/GraphicsEngine.d.ts +2 -2
- package/engine/graphics/GraphicsEngine.js +20 -62
- package/engine/graphics/filter/FlipArrayInPlace.js +25 -0
- package/engine/graphics/filter/FlipArrayViaCanvas.js +13 -0
- package/engine/graphics/filter/ImageFilter.js +20 -51
- package/engine/graphics/geometry/bvh/buffered/BVHGeometryRaycaster.js +2 -2
- package/engine/graphics/material/optimization/MaterialOptimizationContext.js +598 -0
- package/engine/graphics/micron/build/PatchRepresentation.js +4 -43
- package/engine/graphics/micron/build/buildMicronGeometryFromBufferGeometry.js +3 -70
- package/engine/graphics/micron/build/compute_buffer_geometry_byte_size.js +16 -0
- package/engine/graphics/micron/format/MicronGeometryBufferAttributeSpec.js +1 -1
- package/engine/graphics/micron/format/MicronGeometryPatch.js +9 -5
- package/engine/graphics/micron/prototypeVirtualGeometry.js +19 -12
- package/engine/graphics/micron/render/RefinementSpec.js +104 -33
- package/engine/graphics/micron/render/VirtualGeometryBuilder.js +12 -21
- package/engine/graphics/micron/render/instanced/AttributeDataTexture.js +2 -4
- package/engine/graphics/micron/render/instanced/PatchDataTextures.js +1 -0
- package/engine/graphics/micron/render/instanced/ThreeInstancedAdapter.js +1 -29
- package/engine/graphics/micron/render/refinement/ActivePatchList.js +41 -138
- package/engine/graphics/micron/render/refinement/ActivePatchRecord.js +4 -2
- package/engine/graphics/micron/render/refinement/is_patch_facing_back.js +43 -0
- package/engine/graphics/micron/render/refinement/is_patch_visible.js +37 -0
- package/engine/graphics/micron/util/unit_hemioct.spec.js +2 -2
- package/engine/graphics/render/buffer/buffers/NormalFrameBuffer.js +12 -2
- package/engine/graphics/render/buffer/buffers/prototypeNormalFrameBuffer.js +8 -10
- package/engine/graphics/render/forward_plus/LightManager.js +5 -7
- package/engine/graphics/render/forward_plus/data/NumericType.js +9 -0
- package/engine/graphics/render/forward_plus/{TextureBackedMemoryRegion.js → data/TextureBackedMemoryRegion.js} +11 -190
- package/engine/graphics/render/forward_plus/data/channelCountToThreIntegerTextureType.js +16 -0
- package/engine/graphics/render/forward_plus/data/computeDataType.js +36 -0
- package/engine/graphics/render/forward_plus/data/computeThreeTextureFormat.js +18 -0
- package/engine/graphics/render/forward_plus/data/computeThreeTextureInternalFormatFromDataType.js +63 -0
- package/engine/graphics/render/forward_plus/data/computeThreeTextureTypeFromDataType.js +41 -0
- package/engine/graphics/render/forward_plus/plugin/ptototypeFPPlugin.js +1 -1
- package/engine/graphics/render/utils/ThreeBypassRenderer.js +1 -3
- package/engine/graphics/render/visibility/VisibilityComputer.js +11 -0
- package/engine/graphics/render/visibility/hiz/buffer/HierarchicalZBuffer.js +198 -0
- package/engine/graphics/render/visibility/hiz/buffer/ReductionShader.js +51 -0
- package/engine/graphics/render/visibility/hiz/buildCanvasViewFromTexture.js +179 -0
- package/engine/graphics/render/visibility/hiz/prototypeHiZ.js +435 -0
- package/engine/graphics/render/visibility/hiz/query/BatchOcclusionQuery.js +174 -0
- package/engine/graphics/render/visibility/hiz/query/QueryShader.js +173 -0
- package/engine/graphics/texture/atlas/TextureAtlas.js +1 -1
- package/engine/graphics/texture/cubemap/buildCubeURLs.js +13 -0
- package/engine/graphics/texture/cubemap/load_environment_map.d.ts +8 -0
- package/engine/graphics/texture/cubemap/load_environment_map.js +137 -0
- package/engine/graphics/texture/sampler/convertTexture2Sampler2D.js +8 -4
- package/engine/graphics/texture/virtual/v2/ShaderUsage.js +6 -5
- package/engine/graphics/texture/virtual/v2/prototype.js +16 -6
- package/package.json +1 -1
- package/view/elements/progress/segmented/SegmentedResourceBarView.js +50 -15
|
@@ -11,12 +11,12 @@ import ListView from "../../../common/ListView.js";
|
|
|
11
11
|
export class SegmentedResourceBarView extends View {
|
|
12
12
|
/**
|
|
13
13
|
*
|
|
14
|
-
* @param {Vector1|ObservedInteger} value
|
|
15
|
-
* @param {Vector1|ObservedInteger} [max=1]
|
|
14
|
+
* @param {(Vector1|ObservedInteger)[]} value
|
|
15
|
+
* @param {Vector1|ObservedInteger|ReactiveExpression} [max=1]
|
|
16
16
|
* @param {string[]} [classList]
|
|
17
17
|
*/
|
|
18
18
|
constructor({
|
|
19
|
-
|
|
19
|
+
values,
|
|
20
20
|
max = Vector1.one,
|
|
21
21
|
classList = []
|
|
22
22
|
}) {
|
|
@@ -24,10 +24,10 @@ export class SegmentedResourceBarView extends View {
|
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
*
|
|
27
|
-
* @type {Vector1|ObservedInteger}
|
|
27
|
+
* @type {(Vector1|ObservedInteger)[]}
|
|
28
28
|
* @private
|
|
29
29
|
*/
|
|
30
|
-
this.
|
|
30
|
+
this.__values_current = values;
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
*
|
|
@@ -52,9 +52,18 @@ export class SegmentedResourceBarView extends View {
|
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
// build structure
|
|
55
|
-
this.__v__fill = new EmptyView({ classList: ['fill'] });
|
|
55
|
+
this.__v__fill = new EmptyView({ classList: ['fill-container'] });
|
|
56
56
|
this.addChild(this.__v__fill);
|
|
57
57
|
|
|
58
|
+
this.__value_fills = [];
|
|
59
|
+
|
|
60
|
+
for (let i = 0; i < this.__values_current.length; i++) {
|
|
61
|
+
const v_value = new EmptyView({ classList: ['fill', `value-${i}`] });
|
|
62
|
+
|
|
63
|
+
this.__v__fill.addChild(v_value);
|
|
64
|
+
this.__value_fills[i] = v_value;
|
|
65
|
+
}
|
|
66
|
+
|
|
58
67
|
this.__v__ghost = new EmptyView({ classList: ['ghost'] });
|
|
59
68
|
this.addChild(this.__v__ghost);
|
|
60
69
|
|
|
@@ -62,7 +71,7 @@ export class SegmentedResourceBarView extends View {
|
|
|
62
71
|
this.__v_segments = new CanvasView();
|
|
63
72
|
this.__v_segments.addClass('notch-overlay');
|
|
64
73
|
|
|
65
|
-
this.
|
|
74
|
+
this.addChild(this.__v_segments);
|
|
66
75
|
|
|
67
76
|
|
|
68
77
|
/**
|
|
@@ -74,12 +83,13 @@ export class SegmentedResourceBarView extends View {
|
|
|
74
83
|
elementFactory: (interval) => {
|
|
75
84
|
const v = new EmptyView({ classList: ['highlight'] });
|
|
76
85
|
|
|
77
|
-
const valueCurrent = this.__value_current;
|
|
78
86
|
const valueMax = this.__value_max;
|
|
79
87
|
|
|
80
88
|
const update = () => {
|
|
81
|
-
const
|
|
82
|
-
|
|
89
|
+
const m = valueMax.getValue();
|
|
90
|
+
|
|
91
|
+
const v0 = interval.min / m;
|
|
92
|
+
const span = (interval.max - interval.min) / m;
|
|
83
93
|
|
|
84
94
|
const style = v.el.style;
|
|
85
95
|
|
|
@@ -89,7 +99,15 @@ export class SegmentedResourceBarView extends View {
|
|
|
89
99
|
};
|
|
90
100
|
|
|
91
101
|
v.bindSignal(interval.onChanged, update);
|
|
92
|
-
|
|
102
|
+
|
|
103
|
+
const valuesCurrent = this.__values_current;
|
|
104
|
+
|
|
105
|
+
for (let i = 0; i < valuesCurrent.length; i++) {
|
|
106
|
+
const valueCurrent = valuesCurrent[i];
|
|
107
|
+
|
|
108
|
+
v.bindSignal(valueCurrent.onChanged, update);
|
|
109
|
+
}
|
|
110
|
+
|
|
93
111
|
v.bindSignal(valueMax.onChanged, update);
|
|
94
112
|
|
|
95
113
|
v.on.linked.add(update);
|
|
@@ -101,8 +119,10 @@ export class SegmentedResourceBarView extends View {
|
|
|
101
119
|
this.addChild(this.highlightViews);
|
|
102
120
|
|
|
103
121
|
// subscribe to changes
|
|
122
|
+
for (let i = 0; i < this.__values_current.length; i++) {
|
|
123
|
+
this.bindSignal(this.__values_current[i].onChanged, this.updateFill, this);
|
|
124
|
+
}
|
|
104
125
|
|
|
105
|
-
this.bindSignal(this.__value_current.onChanged, this.updateFill, this);
|
|
106
126
|
this.bindSignal(this.__value_max.onChanged, this.handleMaxChange, this);
|
|
107
127
|
|
|
108
128
|
/**
|
|
@@ -252,14 +272,29 @@ export class SegmentedResourceBarView extends View {
|
|
|
252
272
|
}
|
|
253
273
|
|
|
254
274
|
updateFill() {
|
|
255
|
-
const c = this.__value_current.getValue();
|
|
256
275
|
const m = this.__value_max.getValue();
|
|
257
276
|
|
|
258
|
-
|
|
277
|
+
let total_current = 0;
|
|
278
|
+
|
|
279
|
+
for (let i = 0; i < this.__values_current.length; i++) {
|
|
280
|
+
const v = this.__values_current[i];
|
|
281
|
+
|
|
282
|
+
const value = v.getValue();
|
|
283
|
+
|
|
284
|
+
total_current += value;
|
|
285
|
+
|
|
286
|
+
const v_fraction = clamp(v / m, 0, 1);
|
|
287
|
+
|
|
288
|
+
const fill_view = this.__value_fills[i];
|
|
289
|
+
|
|
290
|
+
fill_view.el.style.width = `${v_fraction * 100}%`;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
const f = clamp(total_current / m, 0, 1);
|
|
259
295
|
|
|
260
296
|
const width = `${f * 100}%`;
|
|
261
297
|
|
|
262
|
-
this.__v__fill.el.style.width = width
|
|
263
298
|
this.__v__ghost.el.style.width = width;
|
|
264
299
|
}
|
|
265
300
|
}
|