@woosh/meep-engine 2.75.2 → 2.75.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 +56 -60
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +56 -60
- package/package.json +1 -1
- package/src/core/geom/3d/ray/ray_computeNearestPointToPoint.js +7 -1
- package/src/core/geom/3d/topology/simplify/compute_face_normal_change_dot_product.js +19 -39
- package/src/core/geom/3d/v3_compute_triangle_normal.js +1 -1
- package/src/core/geom/Quaternion.js +0 -59
- package/src/engine/asset/loaders/image/ImageRGBADataLoader.js +2 -1
- package/src/engine/graphics/ecs/mesh-v2/aggregate/SGMeshHighlightSystem.js +7 -1
- package/src/engine/graphics/geometry/VertexDataSpec.d.ts +10 -0
- package/src/engine/graphics/geometry/VertexDataSpec.js +20 -21
- package/src/engine/graphics/render/visibility/hiz/buildCanvasViewFromTexture.js +41 -10
- package/src/engine/graphics/texture/formatToChannelCount.js +2 -1
- package/src/engine/graphics/texture/sampler/filter/sampler2d_scale_down_generic.js +2 -2
- package/src/engine/graphics/texture/sampler/prototypeSamplerFiltering.js +20 -19
- package/src/engine/graphics/texture/virtual/v2/NOTES.md +93 -1
- package/src/engine/graphics/texture/virtual/v2/VirtualTextureMaterial.js +193 -0
- package/src/engine/graphics/texture/virtual/v2/VirtualTextureMemoryMapping.js +203 -0
- package/src/engine/graphics/texture/virtual/v2/{PageTexture.js → VirtualTexturePage.js} +151 -22
- package/src/engine/graphics/texture/virtual/v2/VirtualTextureTileLoader.js +10 -1
- package/src/engine/graphics/texture/virtual/v2/VirtualTextureUsage.js +43 -10
- package/src/engine/graphics/texture/virtual/v2/VirtualTextureUsageShader.js +3 -3
- package/src/engine/graphics/texture/virtual/v2/VirtualTextureUsageUpdater.js +39 -11
- package/src/engine/graphics/texture/virtual/v2/debug/ResidencyDebugView.js +20 -5
- package/src/engine/graphics/texture/virtual/v2/prototype.js +148 -62
- package/src/engine/graphics/texture/virtual/v2/tile/VirtualTextureTile.js +4 -0
- package/src/core/bvh2/sah/surfaceAreaHeuristic.js +0 -15
- package/src/core/bvh2/sah/surfaceAreaHeuristicFull.js +0 -14
- package/src/core/geom/3d/aabb/computeBoundingBoxFromVertexData.js +0 -12
- package/src/core/geom/3d/frustum/array_normalize_plane.js +0 -25
- package/src/core/geom/3d/plane/lerp_planes_to_array.js +0 -53
- package/src/core/geom/3d/plane/planeRayIntersection.js +0 -14
- package/src/core/geom/3d/voxel/DenseBitVolume3D.js +0 -87
- package/src/core/geom/3d/voxel/buildVolumeFromProjectedGeometry.js +0 -23
- package/src/engine/graphics/texture/virtual/v2/ResidentTileTexture.js +0 -46
- /package/src/core/math/{bessel_i0.spec.js → bessel_j0.spec.js} +0 -0
package/build/meep.cjs
CHANGED
|
@@ -3906,65 +3906,6 @@ let Quaternion$1 = class Quaternion {
|
|
|
3906
3906
|
result.set(psi, theta, phi);
|
|
3907
3907
|
}
|
|
3908
3908
|
|
|
3909
|
-
/**
|
|
3910
|
-
*
|
|
3911
|
-
* @param {Matrix4} m
|
|
3912
|
-
*/
|
|
3913
|
-
threeSetRotationMatrix(m) {
|
|
3914
|
-
throw new Error('Deprecated');
|
|
3915
|
-
}
|
|
3916
|
-
|
|
3917
|
-
/**
|
|
3918
|
-
* Read out rotation into a matrix
|
|
3919
|
-
* @param {Array<Number>} elements
|
|
3920
|
-
*/
|
|
3921
|
-
setRotationMatrix(elements) {
|
|
3922
|
-
const x = this.x;
|
|
3923
|
-
const y = this.y;
|
|
3924
|
-
const z = this.z;
|
|
3925
|
-
const w = this.w;
|
|
3926
|
-
|
|
3927
|
-
const x2 = x + x;
|
|
3928
|
-
const y2 = y + y;
|
|
3929
|
-
const z2 = z + z;
|
|
3930
|
-
|
|
3931
|
-
const xx = x * x2;
|
|
3932
|
-
const xy = x * y2;
|
|
3933
|
-
const xz = x * z2;
|
|
3934
|
-
|
|
3935
|
-
const yy = y * y2;
|
|
3936
|
-
const yz = y * z2;
|
|
3937
|
-
const zz = z * z2;
|
|
3938
|
-
|
|
3939
|
-
const wx = w * x2;
|
|
3940
|
-
const wy = w * y2;
|
|
3941
|
-
const wz = w * z2;
|
|
3942
|
-
|
|
3943
|
-
// set 3x3 rotation matrix
|
|
3944
|
-
elements[0] = 1 - (yy + zz);
|
|
3945
|
-
elements[4] = xy - wz;
|
|
3946
|
-
elements[8] = xz + wy;
|
|
3947
|
-
|
|
3948
|
-
elements[1] = xy + wz;
|
|
3949
|
-
elements[5] = 1 - (xx + zz);
|
|
3950
|
-
elements[9] = yz - wx;
|
|
3951
|
-
|
|
3952
|
-
elements[2] = xz - wy;
|
|
3953
|
-
elements[6] = yz + wx;
|
|
3954
|
-
elements[10] = 1 - (xx + yy);
|
|
3955
|
-
|
|
3956
|
-
// last column
|
|
3957
|
-
elements[3] = 0;
|
|
3958
|
-
elements[7] = 0;
|
|
3959
|
-
elements[11] = 0;
|
|
3960
|
-
|
|
3961
|
-
// bottom row
|
|
3962
|
-
elements[12] = 0;
|
|
3963
|
-
elements[13] = 0;
|
|
3964
|
-
elements[14] = 0;
|
|
3965
|
-
elements[15] = 1;
|
|
3966
|
-
}
|
|
3967
|
-
|
|
3968
3909
|
/**
|
|
3969
3910
|
* XYZ order
|
|
3970
3911
|
* @source: https://stackoverflow.com/questions/12088610/conversion-between-euler-quaternion-like-in-unity3d-engine
|
|
@@ -69484,6 +69425,61 @@ class CodecWithFallback extends Codec {
|
|
|
69484
69425
|
}
|
|
69485
69426
|
}
|
|
69486
69427
|
|
|
69428
|
+
/**
|
|
69429
|
+
*
|
|
69430
|
+
* @param {Image|ImageBitmap|HTMLImageElement} img
|
|
69431
|
+
* @returns {Uint8Array}
|
|
69432
|
+
*/
|
|
69433
|
+
function decode(img) {
|
|
69434
|
+
const imgWidth = img.width;
|
|
69435
|
+
const imgHeight = img.height;
|
|
69436
|
+
|
|
69437
|
+
//
|
|
69438
|
+
const canvas = document.createElement('canvas');
|
|
69439
|
+
|
|
69440
|
+
canvas.width = imgWidth;
|
|
69441
|
+
canvas.height = imgHeight;
|
|
69442
|
+
|
|
69443
|
+
const context = canvas.getContext('2d');
|
|
69444
|
+
|
|
69445
|
+
context.drawImage(img, 0, 0, imgWidth, imgHeight);
|
|
69446
|
+
|
|
69447
|
+
const imgd = context.getImageData(0, 0, imgWidth, imgHeight);
|
|
69448
|
+
|
|
69449
|
+
return imgd.data;
|
|
69450
|
+
}
|
|
69451
|
+
|
|
69452
|
+
class NativeImageDecoder extends Codec {
|
|
69453
|
+
async decode(data) {
|
|
69454
|
+
const image = new Image();
|
|
69455
|
+
|
|
69456
|
+
// convert binary data to image URL that we can load
|
|
69457
|
+
const blob = new Blob([data]);
|
|
69458
|
+
const url = URL.createObjectURL(blob);
|
|
69459
|
+
|
|
69460
|
+
image.src = url;
|
|
69461
|
+
|
|
69462
|
+
// give browser a chance to decode image in async
|
|
69463
|
+
await image.decode();
|
|
69464
|
+
|
|
69465
|
+
const rgba_data = decode(image);
|
|
69466
|
+
|
|
69467
|
+
const width = image.width;
|
|
69468
|
+
const height = image.height;
|
|
69469
|
+
|
|
69470
|
+
// release resources
|
|
69471
|
+
URL.revokeObjectURL(url);
|
|
69472
|
+
|
|
69473
|
+
return {
|
|
69474
|
+
data: rgba_data,
|
|
69475
|
+
width: width,
|
|
69476
|
+
height: height,
|
|
69477
|
+
itemSize: 4,
|
|
69478
|
+
bitDepth: 8
|
|
69479
|
+
};
|
|
69480
|
+
}
|
|
69481
|
+
}
|
|
69482
|
+
|
|
69487
69483
|
class OnDemandWorkerManager {
|
|
69488
69484
|
|
|
69489
69485
|
/**
|
|
@@ -69699,7 +69695,7 @@ class ImageRGBADataLoader extends AssetLoader {
|
|
|
69699
69695
|
|
|
69700
69696
|
this.decoder = new CodecWithFallback(
|
|
69701
69697
|
new ThreadedImageDecoder(),
|
|
69702
|
-
|
|
69698
|
+
new NativeImageDecoder()
|
|
69703
69699
|
);
|
|
69704
69700
|
}
|
|
69705
69701
|
|