@woosh/meep-engine 2.33.25 → 2.33.29
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/binary/BitSet.js +151 -167
- package/core/binary/BitSet.spec.js +99 -1
- package/core/binary/ValidatingBitSetWrapper.js +81 -0
- package/core/bvh2/aabb3/AABB3.js +3 -10
- package/core/cache/Cache.d.ts +4 -2
- package/core/cache/Cache.js +5 -2
- package/core/collection/HashMap.d.ts +9 -2
- package/core/collection/HashSet.d.ts +7 -2
- package/core/collection/HashSet.js +7 -2
- package/core/collection/array/typed/typed_array_copy.js +1 -1
- package/core/geom/3d/frustum/array_setFromProjectionMatrix.js +3 -3
- package/core/geom/3d/shape/AbstractShape3D.js +28 -1
- package/core/geom/3d/shape/TransformedShape3D.js +65 -10
- package/core/geom/3d/shape/TransformedShape3D.spec.js +33 -0
- package/core/geom/3d/shape/{CompositeShape.js → UnionShape3D.js} +27 -12
- package/core/geom/3d/shape/UnitCubeShape3D.js +77 -0
- package/core/geom/3d/shape/UnitCubeShape3D.spec.js +42 -0
- package/core/geom/3d/shape/UnitSphereShape3D.js +32 -1
- package/core/geom/3d/shape/util/compute_signed_distance_gradient_by_sampling.js +48 -0
- package/core/geom/3d/shape/util/shape_to_visual_entity.js +3 -3
- package/core/model/ObservedBoolean.d.ts +2 -0
- package/core/parser/simple/Token.d.ts +13 -0
- package/core/parser/simple/Token.js +61 -27
- package/editor/tools/FoliagePaintTool.js +4 -4
- package/engine/asset/loaders/GLTFAssetLoader.js +52 -1
- package/engine/asset/loaders/image/ImageDecoderWorker.js +4 -3
- package/engine/asset/loaders/image/ImageRGBADataAsset.js +3 -2
- package/engine/asset/loaders/image/ImageRGBADataLoader.js +3 -3
- package/engine/asset/loaders/image/codec/NativeImageDecoder.js +2 -1
- package/engine/asset/loaders/image/png/PNG.js +113 -6
- package/engine/asset/loaders/image/png/PNGReader.js +5 -0
- package/engine/asset/loaders/material/bitmap2sampler_gl.js +1 -1
- package/engine/asset/loaders/material/computeImageBitmapEquality.js +6 -1
- package/engine/asset/loaders/material/computeTextureEquality.js +40 -49
- package/engine/ecs/EntityComponentDataset.js +1 -1
- package/engine/ecs/foliage/InstancedFoliage.js +277 -266
- package/engine/ecs/foliage/ecs/Foliage2System.js +7 -7
- package/engine/ecs/foliage/ecs/InstancedMeshComponent.js +37 -0
- package/engine/ecs/foliage/ecs/{Foliage2.js → InstancedMeshLayer.js} +3 -45
- package/engine/ecs/foliage/ecs/InstancedMeshSerializationAdapter.js +6 -5
- package/engine/ecs/foliage/ecs/InstancedMeshUtils.js +7 -6
- package/engine/ecs/storage/binary/BinarySerializationRegistry.js +1 -1
- package/engine/ecs/terrain/ecs/layers/TerrainLayer.js +12 -16
- package/engine/graphics/ecs/highlight/plugin/OutlineRenderPlugin.js +2 -2
- package/engine/graphics/geometry/instancing/InstancedMeshGroup.js +14 -72
- package/engine/graphics/geometry/instancing/rewriteMaterial.js +70 -0
- package/engine/graphics/material/manager/MaterialManager.js +2 -1
- package/engine/graphics/micron/render/instanced/AttributeDataTexture.js +6 -4
- package/engine/graphics/micron/render/instanced/ThreeInstancedAdapter.js +0 -2
- package/engine/graphics/particles/particular/engine/shader/ShaderManager.js +1 -2
- package/engine/graphics/particles/particular/engine/shader/debugAtlas.js +1 -1
- package/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +12 -9
- package/engine/graphics/render/buffer/simple-fx/ao/AmbientOcclusionPostProcessEffect.js +3 -4
- package/engine/graphics/render/forward_plus/materials/FPlusDebugMaterial.js +3 -3
- package/engine/graphics/render/forward_plus/materials/ForwardPlusThreeMaterial.js +1 -1
- package/engine/graphics/render/forward_plus/prototypeLightManager.js +4 -4
- package/engine/graphics/render/forward_plus/query/point_light_inside_volume.js +10 -9
- package/engine/graphics/shadows/ShadowMapRenderer.js +8 -2
- package/engine/graphics/texture/atlas/ManagedTextureAtlas.js +12 -1
- package/engine/graphics/texture/sampler/Sampler2D.js +3 -1
- package/engine/graphics/texture/sampler/convertTexture2Sampler2D.js +1 -1
- package/engine/graphics/texture/sampler/copy_Sampler2D_channel_data.js +66 -0
- package/engine/input/devices/KeyCodes.d.ts +1 -0
- package/package.json +1 -1
- package/view/minimap/gl/MinimapWorldGL.js +12 -5
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { computeImageBitmapEquality } from "./computeImageBitmapEquality.js";
|
|
2
|
+
import { isArrayEqualStrict } from "../../../../core/collection/array/isArrayEqualStrict.js";
|
|
2
3
|
|
|
3
4
|
//
|
|
4
5
|
|
|
@@ -50,20 +51,10 @@ export function computeTextureEquality(a, b) {
|
|
|
50
51
|
const aMipmaps = a.mipmaps;
|
|
51
52
|
const bMipmaps = b.mipmaps;
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if (n !== bMipmaps.length) {
|
|
54
|
+
if (!textureMipChainEqual(aMipmaps, bMipmaps)) {
|
|
56
55
|
return false;
|
|
57
56
|
}
|
|
58
57
|
|
|
59
|
-
for (let i = 0; i < n; i++) {
|
|
60
|
-
const aMipmap = aMipmaps[i];
|
|
61
|
-
const bMipmap = bMipmaps[i];
|
|
62
|
-
|
|
63
|
-
if (!textureMipmapEqual(aMipmap, bMipmap)) {
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
58
|
}
|
|
68
59
|
|
|
69
60
|
//TODO implement support for other texture types
|
|
@@ -119,47 +110,52 @@ export function textureImagesEqual(a, b) {
|
|
|
119
110
|
const bMipmaps = bi.mipmaps;
|
|
120
111
|
|
|
121
112
|
//TODO should we ignore mipmaps if they are absent?
|
|
122
|
-
if (aMipmaps
|
|
123
|
-
if (bMipmaps === undefined) {
|
|
124
|
-
continue;
|
|
125
|
-
} else {
|
|
126
|
-
return false;
|
|
127
|
-
}
|
|
128
|
-
} else if (bMipmaps === undefined) {
|
|
113
|
+
if (!textureMipChainEqual(aMipmaps, bMipmaps)) {
|
|
129
114
|
return false;
|
|
130
115
|
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
}
|
|
131
119
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
120
|
+
// assume equivalent
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
*
|
|
126
|
+
* @param {[]} a
|
|
127
|
+
* @param {[]} b
|
|
128
|
+
* @returns {boolean}
|
|
129
|
+
*/
|
|
130
|
+
function textureMipChainEqual(a, b) {
|
|
131
|
+
if (a === undefined) {
|
|
132
|
+
if (b === undefined) {
|
|
133
|
+
return true;
|
|
134
|
+
} else {
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
} else if (b === undefined) {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
135
140
|
|
|
136
|
-
|
|
137
|
-
* @type {Uint8Array}
|
|
138
|
-
*/
|
|
139
|
-
const aData = aMipmap.data;
|
|
141
|
+
const a_length = a.length;
|
|
140
142
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
143
|
+
if (a_length !== b.length) {
|
|
144
|
+
// different mip chain length
|
|
145
|
+
return false;
|
|
146
|
+
}
|
|
145
147
|
|
|
146
|
-
|
|
147
|
-
if (dataLength !== bData.length) {
|
|
148
|
-
return false;
|
|
149
|
-
}
|
|
148
|
+
for (let j = a_length - 1; j >= 0; j--) { //traverse chain top to bottom, starting from smallest mip for faster rejection
|
|
150
149
|
|
|
150
|
+
const aMipmap = a[j];
|
|
151
|
+
const bMipmap = b[j];
|
|
151
152
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
return false;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
153
|
+
if (!textureMipmapEqual(aMipmap, bMipmap)) {
|
|
154
|
+
return false;
|
|
158
155
|
}
|
|
159
156
|
|
|
160
157
|
}
|
|
161
158
|
|
|
162
|
-
// assume equivalent
|
|
163
159
|
return true;
|
|
164
160
|
}
|
|
165
161
|
|
|
@@ -182,16 +178,11 @@ function textureMipmapEqual(a, b) {
|
|
|
182
178
|
const aData = a.data;
|
|
183
179
|
const bData = b.data;
|
|
184
180
|
|
|
185
|
-
const n = aData.length;
|
|
186
|
-
if (bData.length !== n) {
|
|
187
|
-
return false;
|
|
188
|
-
}
|
|
189
181
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
182
|
+
if (aData === bData) {
|
|
183
|
+
// special case
|
|
184
|
+
return true;
|
|
194
185
|
}
|
|
195
186
|
|
|
196
|
-
return
|
|
187
|
+
return isArrayEqualStrict(aData, bData);
|
|
197
188
|
}
|
|
@@ -1212,7 +1212,7 @@ export class EntityComponentDataset {
|
|
|
1212
1212
|
|
|
1213
1213
|
if (!ENV_PRODUCTION) {
|
|
1214
1214
|
assert.isNumber(componentTypeIndex, "componentTypeIndex");
|
|
1215
|
-
assert.
|
|
1215
|
+
assert.isFunction(visitor, "visitor");
|
|
1216
1216
|
}
|
|
1217
1217
|
|
|
1218
1218
|
|