@woosh/meep-engine 2.47.3 → 2.47.8
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/bundle-worker-image-decoder.js +1 -0
- package/build/bundle-worker-terrain.js +1 -0
- package/build/meep.cjs +659 -553
- package/build/meep.min.js +1 -1
- package/build/meep.module.js +659 -553
- package/package.json +2 -2
- package/src/core/binary/BitSet.spec.js +3 -3
- package/src/core/bvh2/BinaryNode.js +12 -10
- package/src/core/bvh2/aabb3/AABB3.js +30 -31
- package/src/core/bvh2/binary/2/BinaryUint32BVH.js +1 -1
- package/src/core/bvh2/binary/BinaryBVH.js +1 -1
- package/src/core/bvh2/binary/RayLeafIntersectionVisitor.js +1 -1
- package/src/core/bvh2/bvh3/ExplicitBinaryBoundingVolumeHierarchy.js +1 -1
- package/src/core/bvh2/bvh3/ebvh_build_for_geometry_morton.js +2 -2
- package/src/core/bvh2/bvh3/query/BVHQueryIntersectsFrustum.js +1 -1
- package/src/core/bvh2/bvh3/query/BVHQueryIntersectsRay.js +1 -1
- package/src/core/bvh2/bvh3/query/bvh_collect_user_data.js +10 -8
- package/src/core/bvh2/bvh3/query/bvh_query_leaves_generic.js +14 -22
- package/src/core/bvh2/bvh3/query/bvh_query_leaves_ray.js +13 -15
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_generic.js +14 -21
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_nearest_to_point.js +16 -24
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_overlaps_frustum.js +23 -26
- package/src/core/bvh2/bvh3/query/compute_tight_near_far_clipping_planes.js +10 -11
- package/src/core/bvh2/transform/BottomUpOptimizingRebuilder.js +2 -2
- package/src/core/bvh2/transform/tryRotateSingleNode.js +2 -2
- package/src/core/bvh2/traversal/aabb3_detailed_volume_intersection_callback_based.js +1 -1
- package/src/core/bvh2/traversal/queryBinaryNode_FrustumIntersections.js +1 -1
- package/src/core/collection/SCRATCH_UINT32_TRAVERSAL_STACK.js +13 -0
- package/src/core/color/Color.d.ts +2 -1
- package/src/core/color/Color.js +30 -5
- package/src/core/color/ColorUtils.js +7 -5
- package/src/core/color/parseHex.js +11 -3
- package/src/core/color/rgb2hex.js +1 -1
- package/src/core/geom/3d/SurfacePoint3.d.ts +7 -0
- package/src/core/geom/3d/SurfacePoint3.js +56 -1
- package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_array_combine.js +2 -2
- package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_array_contains_point.js +1 -1
- package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_array_intersects_frustum_degree.js +2 -2
- package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_combined_surface_area.js +2 -2
- package/src/core/geom/3d/aabb/aabb3_compute_distance_above_plane_max.js +1 -1
- package/src/core/geom/3d/aabb/aabb3_compute_distance_above_plane_max.spec.js +8 -0
- package/src/core/geom/3d/aabb/{computeAABB3PlaneSide.js → aabb3_compute_plane_side.js} +1 -1
- package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_detailed_volume_intersection.js +7 -7
- package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_from_v3_array.js +4 -4
- package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_from_v3_array_transformed.js +2 -2
- package/src/core/{bvh2/aabb3/aabb3_intersect_aabb3.js → geom/3d/aabb/aabb3_intersects_aabb3.js} +2 -2
- package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_intersects_frustum_array.js +2 -2
- package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_intersects_frustum_degree.js +4 -4
- package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_intersects_line_segment.js +1 -1
- package/src/core/geom/3d/aabb/aabb3_intersects_ray.js +87 -0
- package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_intersects_ray.spec.js +1 -1
- package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_intersects_ray_branchless.js +2 -2
- package/src/core/{bvh2/aabb3/aabb3_intersect_ray_slab.js → geom/3d/aabb/aabb3_intersects_ray_slab.js} +35 -17
- package/src/core/geom/3d/aabb/aabb3_matrix4_project_by_corners.js +5 -1
- package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_nearest_point_on_surface.js +2 -2
- package/src/core/geom/3d/aabb/aabb3_raycast.js +103 -0
- package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_signed_distance_sqr_to_point.js +1 -1
- package/src/core/geom/3d/aabb/computeBoundingBoxFromVertexData.js +4 -12
- package/src/core/geom/3d/aabb/compute_aabb_from_points.js +8 -1
- package/src/core/geom/3d/shape/UnitCubeShape3D.js +1 -1
- package/src/core/geom/3d/triangle/computeTriangleRayIntersection.js +4 -7
- package/src/core/model/node-graph/DataType.d.ts +4 -0
- package/src/core/model/node-graph/node/NodeDescription.d.ts +11 -1
- package/src/core/model/node-graph/node/NodeRegistry.spec.js +47 -1
- package/src/core/model/node-graph/node/Port.d.ts +3 -0
- package/src/core/model/node-graph/node/Port.js +7 -3
- package/src/core/model/node-graph/node/Port.spec.js +44 -0
- package/src/core/model/node-graph/node/PortDirection.d.ts +5 -0
- package/src/engine/asset/loaders/GLTFAssetLoader.js +1 -1
- package/src/engine/ecs/foliage/InstancedFoliage.js +1 -1
- package/src/engine/ecs/storage/BinaryBufferSerializer.js +13 -1
- package/src/engine/ecs/storage/binary/collection/BinaryCollectionSerializer.js +11 -4
- package/src/engine/ecs/storage/binary/object/BinaryObjectSerializationAdapter2.js +54 -0
- package/src/engine/ecs/systems/RenderSystem.js +1 -33
- package/src/engine/ecs/terrain/ecs/makeTerrainWorkerProxy.js +2 -4
- package/src/engine/ecs/terrain/tiles/TileBuildWorker.js +6 -1
- package/src/engine/graphics/GraphicsEngine.js +5 -1
- package/src/engine/graphics/ecs/decal/v2/Decal.js +44 -2
- package/src/engine/graphics/ecs/decal/v2/DecalSerializationAdapter.js +31 -0
- package/src/engine/graphics/ecs/decal/v2/FPDecalSystem.js +16 -5
- package/src/engine/graphics/ecs/decal/v2/prototypeDecalSystem.js +88 -56
- package/src/engine/graphics/geometry/buffered/query/ClippingPlaneContainmentComputingVisitor.js +2 -2
- package/src/engine/graphics/geometry/buffered/query/RaycastNearestHitComputingVisitor.js +1 -1
- package/src/engine/graphics/geometry/instancing/InstancedMeshGroup.js +3 -2
- package/src/engine/graphics/geometry/skining/computeSkinnedMeshBoundingVolumes.js +3 -2
- package/src/engine/graphics/micron/format/MicronGeometry.js +1 -1
- package/src/engine/graphics/micron/format/validate_patch_bounds.js +1 -1
- package/src/engine/graphics/micron/render/refinement/ActivePatchList.js +1 -1
- package/src/engine/graphics/micron/render/refinement/get_geometry_patch_cut.js +16 -16
- package/src/engine/graphics/render/forward_plus/LightManager.js +3 -0
- package/src/engine/graphics/render/forward_plus/LightManager.spec.js +5 -5
- package/src/engine/graphics/render/forward_plus/materials/FP_SHADER_CHUNK_APPLY_DECALS.js +4 -0
- package/src/engine/graphics/render/forward_plus/model/Decal.js +10 -2
- package/src/engine/graphics/render/forward_plus/query/query_bvh_frustum_from_objects.js +2 -2
- package/src/engine/graphics/render/forward_plus/query/query_bvh_frustum_from_texture.js +18 -16
- package/src/engine/graphics/render/gizmo/GizmoShapeRenderingInterface.js +2 -0
- package/src/engine/graphics/render/visibility/IncrementalDeltaSet.js +26 -13
- package/src/engine/graphics/sh3/path_tracer/GeometryBVHBatched.js +8 -2
- package/src/engine/graphics/sh3/path_tracer/PathTracer.js +3 -3
- package/src/engine/graphics/sh3/path_tracer/prototypePathTracer.js +18 -15
- package/src/engine/graphics/texture/sampler/sampler2d_channel_compute_max.js +1 -1
- package/src/engine/graphics/texture/sampler/sampler2d_channel_compute_min.js +1 -1
- package/src/engine/graphics/three/three_computeObjectBoundingBox.js +56 -0
- package/src/engine/input/devices/{InputDeviceButton.d.ts → InputDeviceSwitch.d.ts} +1 -1
- package/src/engine/input/devices/{InputDeviceButton.js → InputDeviceSwitch.js} +1 -1
- package/src/engine/input/devices/KeyboardDevice.d.ts +2 -2
- package/src/engine/input/devices/KeyboardDevice.js +58 -40
- package/src/engine/input/devices/PointerDevice.js +224 -179
- package/src/core/bvh2/aabb3/aabb3_intersects_ray.js +0 -97
- package/src/core/geom/3d/aabb/aabb3_computeDistanceAbovePlane_max.spec.js +0 -8
- /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_array_intersects_frustum_array.js +0 -0
- /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_array_intersects_ray.js +0 -0
- /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_array_intersects_ray_array.js +0 -0
- /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_box_surface_area_2.js +0 -0
- /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_compute_half_surface_area.js +0 -0
- /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_compute_surface_area.js +0 -0
- /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_corner_edge_mapping.js +0 -0
- /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_corner_edge_mapping.spec.js +0 -0
- /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_edge_corner_mapping.js +0 -0
- /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_edge_corner_mapping.spec.js +0 -0
- /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_edge_plane_mapping.js +0 -0
- /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_expand_array.js +0 -0
- /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_intersects_ray_fast.js +0 -0
- /package/src/core/{bvh2/aabb3 → geom/3d/aabb}/aabb3_score_boxes_SAH.js +0 -0
- /package/src/core/{bvh2/aabb3/aabb_score_boxes_SAH_delta.js → geom/3d/aabb/aabb3_score_boxes_SAH_delta.js} +0 -0
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { fabsf } from "../../math/fabsf.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* NOTES:
|
|
6
|
-
* https://web.archive.org/web/20090803054252/http://tog.acm.org/resources/GraphicsGems/gems/RayBox.c
|
|
7
|
-
* https://tavianator.com/fast-branchless-raybounding-box-intersections/
|
|
8
|
-
* https://gamedev.stackexchange.com/questions/18436/most-efficient-aabb-vs-ray-collision-algorithms
|
|
9
|
-
*
|
|
10
|
-
* @param {number} x0
|
|
11
|
-
* @param {number} y0
|
|
12
|
-
* @param {number} z0
|
|
13
|
-
* @param {number} x1
|
|
14
|
-
* @param {number} y1
|
|
15
|
-
* @param {number} z1
|
|
16
|
-
* @param {number} oX
|
|
17
|
-
* @param {number} oY
|
|
18
|
-
* @param {number} oZ
|
|
19
|
-
* @param {number} dirX
|
|
20
|
-
* @param {number} dirY
|
|
21
|
-
* @param {number} dirZ
|
|
22
|
-
* @returns {boolean}
|
|
23
|
-
*/
|
|
24
|
-
export function aabb3_intersects_ray(
|
|
25
|
-
x0, y0, z0,
|
|
26
|
-
x1, y1, z1,
|
|
27
|
-
oX, oY, oZ,
|
|
28
|
-
dirX, dirY, dirZ
|
|
29
|
-
) {
|
|
30
|
-
|
|
31
|
-
// Z Projection
|
|
32
|
-
const boxExtentsX = (x1 - x0) * 0.5;
|
|
33
|
-
|
|
34
|
-
const centerX = x0 + boxExtentsX;
|
|
35
|
-
|
|
36
|
-
const diffX = oX - centerX;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (diffX * dirX >= 0.0 && fabsf(diffX) > boxExtentsX) {
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Y projection
|
|
44
|
-
const boxExtentsY = (y1 - y0) * 0.5;
|
|
45
|
-
|
|
46
|
-
const centerY = y0 + boxExtentsY;
|
|
47
|
-
|
|
48
|
-
const diffY = oY - centerY;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if (diffY * dirY >= 0.0 && fabsf(diffY) > boxExtentsY) {
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// Z projection
|
|
56
|
-
const boxExtentsZ = (z1 - z0) * 0.5;
|
|
57
|
-
|
|
58
|
-
const centerZ = z0 + boxExtentsZ;
|
|
59
|
-
|
|
60
|
-
const diffZ = oZ - centerZ;
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
if (diffZ * dirZ >= 0.0 && fabsf(diffZ) > boxExtentsZ) {
|
|
64
|
-
return false;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
//Dir.y = 0.5f * (segment.mP1.y - segment.mP0.y);
|
|
68
|
-
//BoxExtents.y = aabb.GetExtents(1);
|
|
69
|
-
//Diff.y = (0.5f * (segment.mP1.y + segment.mP0.y)) - aabb.GetCenter(1);
|
|
70
|
-
//b = fabsf(Dir.y);
|
|
71
|
-
//if(fabsf(Diff.y)>BoxExtents.y + b) return false;
|
|
72
|
-
|
|
73
|
-
const b = fabsf(dirY);
|
|
74
|
-
const c = fabsf(dirZ);
|
|
75
|
-
const a = fabsf(dirX);
|
|
76
|
-
|
|
77
|
-
const f0 = dirY * diffZ - dirZ * diffY;
|
|
78
|
-
|
|
79
|
-
if (fabsf(f0) > boxExtentsY * c + boxExtentsZ * b) {
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const f1 = dirZ * diffX - dirX * diffZ;
|
|
84
|
-
|
|
85
|
-
if (fabsf(f1) > boxExtentsX * c + boxExtentsZ * a) {
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const f2 = dirX * diffY - dirY * diffX;
|
|
90
|
-
|
|
91
|
-
if (fabsf(f2) > boxExtentsX * b + boxExtentsY * a) {
|
|
92
|
-
return false;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return true;
|
|
96
|
-
}
|
|
97
|
-
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|