@woosh/meep-engine 2.163.11 → 2.165.0
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-terrain.js +1 -1
- package/editor/ecs/component/editors/ecs/Trail3DEditor.js +45 -0
- package/editor/ecs/component/prototypeObjectEditor.js +3 -0
- package/editor/tools/v2/BlenderCameraOrientationGizmo.js +2 -2
- package/editor/view/node-graph/connection_wire_geometry.js +2 -2
- package/package.json +1 -1
- package/src/core/binary/BitImage2.d.ts +91 -0
- package/src/core/binary/BitImage2.d.ts.map +1 -0
- package/src/core/binary/BitImage2.js +242 -0
- package/src/core/bvh2/binary/2/BinaryUint32BVH.js +2 -2
- package/src/core/bvh2/binary/2/bvh32_query_user_data_ray.d.ts.map +1 -1
- package/src/core/bvh2/binary/2/bvh32_query_user_data_ray.js +2 -4
- package/src/core/bvh2/bvh3/BVH.d.ts +388 -55
- package/src/core/bvh2/bvh3/BVH.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/BVH.js +11 -5
- package/src/core/bvh2/bvh3/BvhClient.d.ts +31 -11
- package/src/core/bvh2/bvh3/bvh_build_from_unindexed_triangles.d.ts.map +1 -0
- package/src/core/bvh2/bvh3/ebvh_build_for_geometry_incremental.js +2 -2
- package/src/core/bvh2/bvh3/ebvh_build_hierarchy.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/ebvh_build_hierarchy.js +8 -0
- package/src/core/bvh2/bvh3/ebvh_geometry_query_any_triangle_ray.d.ts +22 -0
- package/src/core/bvh2/bvh3/ebvh_geometry_query_any_triangle_ray.d.ts.map +1 -0
- package/src/core/bvh2/bvh3/ebvh_geometry_query_any_triangle_ray.js +149 -0
- package/src/core/bvh2/bvh3/ebvh_geometry_query_nearest_triangle_ray.d.ts +5 -2
- package/src/core/bvh2/bvh3/ebvh_geometry_query_nearest_triangle_ray.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/ebvh_geometry_query_nearest_triangle_ray.js +16 -10
- package/src/core/bvh2/bvh3/ebvh_optimize_treelet.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/ebvh_optimize_treelet.js +19 -6
- package/src/core/bvh2/bvh3/ebvh_sort_for_traversal_depth_first.d.ts +14 -3
- package/src/core/bvh2/bvh3/ebvh_sort_for_traversal_depth_first.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/ebvh_sort_for_traversal_depth_first.js +96 -116
- package/src/core/bvh2/bvh3/query/backtracking/bvh_backtracking_query_leaves_ray.d.ts +3 -3
- package/src/core/bvh2/bvh3/query/backtracking/bvh_backtracking_query_leaves_ray.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/query/backtracking/bvh_backtracking_query_leaves_ray.js +3 -3
- package/src/core/bvh2/bvh3/query/bvh_query_depth_range_in_frustum.js +2 -2
- package/src/core/bvh2/bvh3/query/bvh_query_leaves_generic.d.ts +12 -5
- package/src/core/bvh2/bvh3/query/bvh_query_leaves_generic.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/query/bvh_query_leaves_generic.js +11 -4
- package/src/core/bvh2/bvh3/query/bvh_query_leaves_ray.d.ts +3 -3
- package/src/core/bvh2/bvh3/query/bvh_query_leaves_ray.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/query/bvh_query_leaves_ray.js +3 -3
- package/src/core/bvh2/bvh3/query/bvh_query_leaves_ray_segment.d.ts +3 -3
- package/src/core/bvh2/bvh3/query/bvh_query_leaves_ray_segment.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/query/bvh_query_leaves_ray_segment.js +3 -3
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_generic.d.ts +12 -5
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_generic.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_generic.js +11 -4
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_intersects_aabb.d.ts +9 -0
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_intersects_aabb.d.ts.map +1 -0
- package/src/core/bvh2/bvh3/query/{bvh_query_user_data_overlaps_aabb.js → bvh_query_user_data_intersects_aabb.js} +1 -1
- package/src/core/bvh2/bvh3/query/{bvh_query_user_data_overlaps_capsule.d.ts → bvh_query_user_data_intersects_capsule.d.ts} +4 -4
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_intersects_capsule.d.ts.map +1 -0
- package/src/core/bvh2/bvh3/query/{bvh_query_user_data_overlaps_capsule.js → bvh_query_user_data_intersects_capsule.js} +3 -3
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_intersects_frustum.d.ts +9 -0
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_intersects_frustum.d.ts.map +1 -0
- package/src/core/bvh2/bvh3/query/{bvh_query_user_data_overlaps_frustum.js → bvh_query_user_data_intersects_frustum.js} +3 -3
- package/src/core/bvh2/bvh3/query/{bvh_query_user_data_overlaps_sphere.d.ts → bvh_query_user_data_intersects_sphere.d.ts} +2 -2
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_intersects_sphere.d.ts.map +1 -0
- package/src/core/bvh2/bvh3/query/{bvh_query_user_data_overlaps_sphere.js → bvh_query_user_data_intersects_sphere.js} +1 -1
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_nearest_to_point_filtered.d.ts +23 -0
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_nearest_to_point_filtered.d.ts.map +1 -0
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_nearest_to_point_filtered.js +86 -0
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_ray.d.ts +3 -3
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_ray.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_ray.js +3 -3
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_ray_segment.d.ts +3 -3
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_ray_segment.d.ts.map +1 -1
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_ray_segment.js +3 -3
- package/src/core/bvh2/traversal/aabb3_detailed_volume_intersection_callback_based.js +2 -2
- package/src/core/bvh8/bvh8_node_child_surface_area.js +2 -2
- package/src/core/bvh8/bvh8_quality.js +2 -2
- package/src/core/collection/SCRATCH_UINT32_TRAVERSAL_STACK.d.ts +12 -0
- package/src/core/collection/SCRATCH_UINT32_TRAVERSAL_STACK.d.ts.map +1 -1
- package/src/core/collection/SCRATCH_UINT32_TRAVERSAL_STACK.js +12 -0
- package/src/core/collection/heap/IndexedFloatMinHeap.d.ts +62 -0
- package/src/core/collection/heap/IndexedFloatMinHeap.d.ts.map +1 -0
- package/src/core/collection/heap/IndexedFloatMinHeap.js +268 -0
- package/src/core/color/tonemap/tonemap_aces.d.ts +21 -0
- package/src/core/color/tonemap/tonemap_aces.d.ts.map +1 -0
- package/src/core/color/tonemap/tonemap_aces.js +41 -0
- package/src/core/geom/2d/Rectangle.js +2 -2
- package/src/core/geom/2d/aabb/AABB2.d.ts.map +1 -1
- package/src/core/geom/2d/aabb/AABB2.js +11 -13
- package/src/core/geom/2d/aabb/aabb2_area.d.ts +10 -0
- package/src/core/geom/2d/aabb/aabb2_area.d.ts.map +1 -0
- package/src/core/geom/2d/aabb/aabb2_area.js +14 -0
- package/src/core/geom/2d/aabb/aabb2_array_combine.d.ts +4 -8
- package/src/core/geom/2d/aabb/aabb2_array_combine.d.ts.map +1 -1
- package/src/core/geom/2d/aabb/aabb2_array_combine.js +7 -35
- package/src/core/geom/2d/aabb/aabb2_center_from_aabb2_buffer.d.ts +8 -0
- package/src/core/geom/2d/aabb/aabb2_center_from_aabb2_buffer.d.ts.map +1 -0
- package/src/core/geom/2d/aabb/aabb2_center_from_aabb2_buffer.js +24 -0
- package/src/core/geom/2d/aabb/aabb2_compute_area.d.ts +4 -7
- package/src/core/geom/2d/aabb/aabb2_compute_area.d.ts.map +1 -1
- package/src/core/geom/2d/aabb/aabb2_compute_area.js +7 -14
- package/src/core/geom/2d/aabb/aabb2_compute_center_from_multiple.d.ts +4 -5
- package/src/core/geom/2d/aabb/aabb2_compute_center_from_multiple.d.ts.map +1 -1
- package/src/core/geom/2d/aabb/aabb2_compute_center_from_multiple.js +7 -24
- package/src/core/geom/2d/aabb/aabb2_compute_intersection.d.ts +15 -0
- package/src/core/geom/2d/aabb/aabb2_compute_intersection.d.ts.map +1 -0
- package/src/core/geom/2d/aabb/aabb2_compute_intersection.js +42 -0
- package/src/core/geom/2d/aabb/aabb2_compute_overlap.d.ts +4 -12
- package/src/core/geom/2d/aabb/aabb2_compute_overlap.d.ts.map +1 -1
- package/src/core/geom/2d/aabb/aabb2_compute_overlap.js +7 -42
- package/src/core/geom/2d/aabb/aabb2_contains_point.d.ts +12 -0
- package/src/core/geom/2d/aabb/aabb2_contains_point.d.ts.map +1 -0
- package/src/core/geom/2d/aabb/aabb2_contains_point.js +17 -0
- package/src/core/geom/2d/aabb/aabb2_from_rectangle.d.ts +8 -0
- package/src/core/geom/2d/aabb/aabb2_from_rectangle.d.ts.map +1 -0
- package/src/core/geom/2d/aabb/aabb2_from_rectangle.js +29 -0
- package/src/core/geom/2d/aabb/aabb2_from_v2_array.d.ts +4 -5
- package/src/core/geom/2d/aabb/aabb2_from_v2_array.d.ts.map +1 -1
- package/src/core/geom/2d/aabb/aabb2_from_v2_array.js +7 -33
- package/src/core/geom/2d/aabb/aabb2_from_v2_buffer.d.ts +8 -0
- package/src/core/geom/2d/aabb/aabb2_from_v2_buffer.d.ts.map +1 -0
- package/src/core/geom/2d/aabb/aabb2_from_v2_buffer.js +33 -0
- package/src/core/geom/2d/aabb/aabb2_intersects_aabb2.d.ts +14 -0
- package/src/core/geom/2d/aabb/aabb2_intersects_aabb2.d.ts.map +1 -0
- package/src/core/geom/2d/aabb/aabb2_intersects_aabb2.js +21 -0
- package/src/core/geom/2d/aabb/aabb2_intersects_point.d.ts +4 -9
- package/src/core/geom/2d/aabb/aabb2_intersects_point.d.ts.map +1 -1
- package/src/core/geom/2d/aabb/aabb2_intersects_point.js +7 -17
- package/src/core/geom/2d/aabb/aabb2_overlap_exists.d.ts +4 -11
- package/src/core/geom/2d/aabb/aabb2_overlap_exists.d.ts.map +1 -1
- package/src/core/geom/2d/aabb/aabb2_overlap_exists.js +7 -21
- package/src/core/geom/2d/aabb/aabb2_union_array.d.ts +11 -0
- package/src/core/geom/2d/aabb/aabb2_union_array.d.ts.map +1 -0
- package/src/core/geom/2d/aabb/aabb2_union_array.js +35 -0
- package/src/core/geom/2d/bvh/BVH2D.js +5 -5
- package/src/core/geom/2d/circle/circle_compute_circle_intersection.d.ts +4 -11
- package/src/core/geom/2d/circle/circle_compute_circle_intersection.d.ts.map +1 -1
- package/src/core/geom/2d/circle/circle_compute_circle_intersection.js +7 -64
- package/src/core/geom/2d/circle/circle_compute_circle_penetration.d.ts +4 -9
- package/src/core/geom/2d/circle/circle_compute_circle_penetration.d.ts.map +1 -1
- package/src/core/geom/2d/circle/circle_compute_circle_penetration.js +7 -32
- package/src/core/geom/2d/circle/circle_compute_intersection.d.ts +14 -0
- package/src/core/geom/2d/circle/circle_compute_intersection.d.ts.map +1 -0
- package/src/core/geom/2d/circle/circle_compute_intersection.js +64 -0
- package/src/core/geom/2d/circle/circle_compute_penetration.d.ts +12 -0
- package/src/core/geom/2d/circle/circle_compute_penetration.d.ts.map +1 -0
- package/src/core/geom/2d/circle/circle_compute_penetration.js +32 -0
- package/src/core/geom/2d/circle/circle_contains_point.d.ts +11 -0
- package/src/core/geom/2d/circle/circle_contains_point.d.ts.map +1 -0
- package/src/core/geom/2d/circle/circle_contains_point.js +16 -0
- package/src/core/geom/2d/circle/circle_intersects_point.d.ts +4 -8
- package/src/core/geom/2d/circle/circle_intersects_point.d.ts.map +1 -1
- package/src/core/geom/2d/circle/circle_intersects_point.js +7 -16
- package/src/core/geom/2d/compute_polygon_area_2d.d.ts +4 -5
- package/src/core/geom/2d/compute_polygon_area_2d.d.ts.map +1 -1
- package/src/core/geom/2d/compute_polygon_area_2d.js +7 -34
- package/src/core/geom/2d/convex-hull/convex_hull_fixed_count_2d_bruteforce.d.ts +17 -0
- package/src/core/geom/2d/convex-hull/convex_hull_fixed_count_2d_bruteforce.d.ts.map +1 -0
- package/src/core/geom/2d/convex-hull/convex_hull_fixed_count_2d_bruteforce.js +156 -0
- package/src/core/geom/2d/convex-hull/convex_hull_fixed_count_2d_relaxation.d.ts +17 -0
- package/src/core/geom/2d/convex-hull/convex_hull_fixed_count_2d_relaxation.d.ts.map +1 -0
- package/src/core/geom/2d/convex-hull/convex_hull_fixed_count_2d_relaxation.js +288 -0
- package/src/core/geom/2d/convex-hull/convex_hull_jarvis_2d.js +2 -2
- package/src/core/geom/2d/convex-hull/convex_hull_monotone_2d.js +3 -3
- package/src/core/geom/2d/convex-hull/fixed_convex_hull_humus.d.ts +4 -14
- package/src/core/geom/2d/convex-hull/fixed_convex_hull_humus.d.ts.map +1 -1
- package/src/core/geom/2d/convex-hull/fixed_convex_hull_humus.js +7 -156
- package/src/core/geom/2d/convex-hull/fixed_convex_hull_relaxation.d.ts +4 -14
- package/src/core/geom/2d/convex-hull/fixed_convex_hull_relaxation.d.ts.map +1 -1
- package/src/core/geom/2d/convex-hull/fixed_convex_hull_relaxation.js +7 -288
- package/src/core/geom/2d/convex-hull/orient2d_indexed.d.ts +10 -0
- package/src/core/geom/2d/convex-hull/orient2d_indexed.d.ts.map +1 -0
- package/src/core/geom/2d/convex-hull/orient2d_indexed.js +22 -0
- package/src/core/geom/2d/convex-hull/orientation3_array.d.ts +4 -7
- package/src/core/geom/2d/convex-hull/orientation3_array.d.ts.map +1 -1
- package/src/core/geom/2d/convex-hull/orientation3_array.js +7 -22
- package/src/core/geom/2d/hash-grid/shg_query_elements_line.js +3 -3
- package/src/core/geom/2d/intersect_ray_2d.d.ts +4 -13
- package/src/core/geom/2d/intersect_ray_2d.d.ts.map +1 -1
- package/src/core/geom/2d/intersect_ray_2d.js +7 -49
- package/src/core/geom/2d/line/line2_compute_segment_point_distance_sqr.d.ts +11 -0
- package/src/core/geom/2d/line/line2_compute_segment_point_distance_sqr.d.ts.map +1 -0
- package/src/core/geom/2d/line/line2_compute_segment_point_distance_sqr.js +39 -0
- package/src/core/geom/2d/line/line2_distance_to_point_sqr.d.ts +4 -8
- package/src/core/geom/2d/line/line2_distance_to_point_sqr.d.ts.map +1 -1
- package/src/core/geom/2d/line/line2_distance_to_point_sqr.js +7 -39
- package/src/core/geom/2d/line/line2_segment_intersection_fraction_2d.d.ts +23 -0
- package/src/core/geom/2d/line/line2_segment_intersection_fraction_2d.d.ts.map +1 -0
- package/src/core/geom/2d/line/line2_segment_intersection_fraction_2d.js +44 -0
- package/src/core/geom/2d/line/line_segment_compute_line_segment_intersection_2d.d.ts +4 -11
- package/src/core/geom/2d/line/line_segment_compute_line_segment_intersection_2d.d.ts.map +1 -1
- package/src/core/geom/2d/line/line_segment_compute_line_segment_intersection_2d.js +7 -35
- package/src/core/geom/2d/line/line_segment_compute_line_segment_intersection_array_2d.d.ts +4 -17
- package/src/core/geom/2d/line/line_segment_compute_line_segment_intersection_array_2d.d.ts.map +1 -1
- package/src/core/geom/2d/line/line_segment_compute_line_segment_intersection_array_2d.js +7 -51
- package/src/core/geom/2d/line/line_segment_compute_line_segment_intersection_vectors_2d.d.ts +4 -7
- package/src/core/geom/2d/line/line_segment_compute_line_segment_intersection_vectors_2d.d.ts.map +1 -1
- package/src/core/geom/2d/line/line_segment_compute_line_segment_intersection_vectors_2d.js +7 -15
- package/src/core/geom/2d/line/line_segment_compute_line_segment_intersection_vectors_array_2d.d.ts +4 -6
- package/src/core/geom/2d/line/line_segment_compute_line_segment_intersection_vectors_array_2d.d.ts.map +1 -1
- package/src/core/geom/2d/line/line_segment_compute_line_segment_intersection_vectors_array_2d.js +7 -30
- package/src/core/geom/2d/line/line_segment_intersection_fraction_2d.d.ts +4 -20
- package/src/core/geom/2d/line/line_segment_intersection_fraction_2d.d.ts.map +1 -1
- package/src/core/geom/2d/line/line_segment_intersection_fraction_2d.js +4 -41
- package/src/core/geom/2d/line/line_segment_line_segment_intersection_exists_2d.d.ts +4 -12
- package/src/core/geom/2d/line/line_segment_line_segment_intersection_exists_2d.d.ts.map +1 -1
- package/src/core/geom/2d/line/line_segment_line_segment_intersection_exists_2d.js +7 -29
- package/src/core/geom/2d/line/ray2_ray2_compute_intersection_array_2d.d.ts +16 -0
- package/src/core/geom/2d/line/ray2_ray2_compute_intersection_array_2d.d.ts.map +1 -0
- package/src/core/geom/2d/line/ray2_ray2_compute_intersection_array_2d.js +49 -0
- package/src/core/geom/2d/line/segment2_intersects_segment2_2d.d.ts +15 -0
- package/src/core/geom/2d/line/segment2_intersects_segment2_2d.d.ts.map +1 -0
- package/src/core/geom/2d/line/segment2_intersects_segment2_2d.js +29 -0
- package/src/core/geom/2d/line/segment2_segment_compute_intersection_array_2d.d.ts +20 -0
- package/src/core/geom/2d/line/segment2_segment_compute_intersection_array_2d.d.ts.map +1 -0
- package/src/core/geom/2d/line/segment2_segment_compute_intersection_array_2d.js +51 -0
- package/src/core/geom/2d/line/segment2_segment_compute_intersection_to_new_array_2d.d.ts +9 -0
- package/src/core/geom/2d/line/segment2_segment_compute_intersection_to_new_array_2d.d.ts.map +1 -0
- package/src/core/geom/2d/line/segment2_segment_compute_intersection_to_new_array_2d.js +28 -0
- package/src/core/geom/2d/line/segment2_segment_compute_intersection_v2_2d.d.ts +14 -0
- package/src/core/geom/2d/line/segment2_segment_compute_intersection_v2_2d.d.ts.map +1 -0
- package/src/core/geom/2d/line/segment2_segment_compute_intersection_v2_2d.js +33 -0
- package/src/core/geom/2d/line/segment2_segment_compute_intersection_v2_objects_2d.d.ts +10 -0
- package/src/core/geom/2d/line/segment2_segment_compute_intersection_v2_objects_2d.d.ts.map +1 -0
- package/src/core/geom/2d/line/segment2_segment_compute_intersection_v2_objects_2d.js +13 -0
- package/src/core/geom/2d/oriented-box/min_area_rect_2d.d.ts +22 -0
- package/src/core/geom/2d/oriented-box/min_area_rect_2d.d.ts.map +1 -0
- package/src/core/geom/2d/oriented-box/min_area_rect_2d.js +69 -0
- package/src/core/geom/2d/packing/skyline.d.ts +116 -0
- package/src/core/geom/2d/packing/skyline.d.ts.map +1 -0
- package/src/core/geom/2d/packing/skyline.js +258 -0
- package/src/core/geom/2d/polygon/polygon2_clip_halfplane.d.ts +17 -0
- package/src/core/geom/2d/polygon/polygon2_clip_halfplane.d.ts.map +1 -0
- package/src/core/geom/2d/polygon/polygon2_clip_halfplane.js +50 -0
- package/src/core/geom/2d/polygon/polygon2_signed_area.d.ts +8 -0
- package/src/core/geom/2d/polygon/polygon2_signed_area.d.ts.map +1 -0
- package/src/core/geom/2d/polygon/polygon2_signed_area.js +34 -0
- package/src/core/geom/2d/quad-tree/qt_collect_by_box.js +3 -3
- package/src/core/geom/2d/quad-tree/qt_collect_by_point.js +3 -3
- package/src/core/geom/2d/quad-tree/qt_query_closest_to_point.d.ts +12 -0
- package/src/core/geom/2d/quad-tree/qt_query_closest_to_point.d.ts.map +1 -0
- package/src/core/geom/2d/quad-tree/qt_query_closest_to_point.js +62 -0
- package/src/core/geom/2d/quad-tree/qt_query_data_nearest_to_point.d.ts +4 -9
- package/src/core/geom/2d/quad-tree/qt_query_data_nearest_to_point.d.ts.map +1 -1
- package/src/core/geom/2d/quad-tree/qt_query_data_nearest_to_point.js +7 -62
- package/src/core/geom/2d/r-tree/StaticR2Tree.js +3 -3
- package/src/core/geom/2d/rectangle_to_aabb.d.ts +4 -5
- package/src/core/geom/2d/rectangle_to_aabb.d.ts.map +1 -1
- package/src/core/geom/2d/rectangle_to_aabb.js +7 -29
- package/src/core/geom/2d/spline2_quadratic_bezier.d.ts +13 -0
- package/src/core/geom/2d/spline2_quadratic_bezier.d.ts.map +1 -0
- package/src/core/geom/2d/spline2_quadratic_bezier.js +26 -0
- package/src/core/geom/2d/spline_bezier2_2d.d.ts +4 -10
- package/src/core/geom/2d/spline_bezier2_2d.d.ts.map +1 -1
- package/src/core/geom/2d/spline_bezier2_2d.js +7 -26
- package/src/core/geom/2d/triangle/tri2_compute_barycentric.d.ts +15 -0
- package/src/core/geom/2d/triangle/tri2_compute_barycentric.d.ts.map +1 -0
- package/src/core/geom/2d/triangle/tri2_compute_barycentric.js +48 -0
- package/src/core/geom/2d/triangle/tri2_contains_point.d.ts +14 -0
- package/src/core/geom/2d/triangle/tri2_contains_point.d.ts.map +1 -0
- package/src/core/geom/2d/triangle/tri2_contains_point.js +39 -0
- package/src/core/geom/2d/triangle/tri2_rasterize_conservative.d.ts +18 -0
- package/src/core/geom/2d/triangle/tri2_rasterize_conservative.d.ts.map +1 -0
- package/src/core/geom/2d/triangle/tri2_rasterize_conservative.js +86 -0
- package/src/core/geom/2d/triangle/tri2_signed_area.d.ts +12 -0
- package/src/core/geom/2d/triangle/tri2_signed_area.d.ts.map +1 -0
- package/src/core/geom/2d/triangle/tri2_signed_area.js +23 -0
- package/src/core/geom/2d/triangle2d_compute_area.d.ts +4 -9
- package/src/core/geom/2d/triangle2d_compute_area.d.ts.map +1 -1
- package/src/core/geom/2d/triangle2d_compute_area.js +7 -23
- package/src/core/geom/2d/triangle2d_contains_point.d.ts +4 -11
- package/src/core/geom/2d/triangle2d_contains_point.d.ts.map +1 -1
- package/src/core/geom/2d/triangle2d_contains_point.js +7 -39
- package/src/core/geom/2d/triangle2d_get_barycentric.d.ts +4 -12
- package/src/core/geom/2d/triangle2d_get_barycentric.d.ts.map +1 -1
- package/src/core/geom/2d/triangle2d_get_barycentric.js +7 -48
- package/src/core/geom/3d/aabb/AABB3.js +6 -6
- package/src/core/geom/3d/aabb/aabb3_array_intersects_frustum_degree.d.ts +4 -6
- package/src/core/geom/3d/aabb/aabb3_array_intersects_frustum_degree.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_array_intersects_frustum_degree.js +7 -29
- package/src/core/geom/3d/aabb/aabb3_array_near_distance_to_intersection_ray_segment.js +2 -2
- package/src/core/geom/3d/aabb/aabb3_box_surface_area_2.d.ts +4 -4
- package/src/core/geom/3d/aabb/aabb3_box_surface_area_2.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_box_surface_area_2.js +7 -10
- package/src/core/geom/3d/aabb/aabb3_build_frustum.d.ts +11 -0
- package/src/core/geom/3d/aabb/aabb3_build_frustum.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_build_frustum.js +6 -1
- package/src/core/geom/3d/aabb/aabb3_classify_against_frustum.d.ts +13 -0
- package/src/core/geom/3d/aabb/aabb3_classify_against_frustum.d.ts.map +1 -0
- package/src/core/geom/3d/aabb/aabb3_classify_against_frustum.js +46 -0
- package/src/core/geom/3d/aabb/aabb3_classify_against_frustum_array.d.ts +9 -0
- package/src/core/geom/3d/aabb/aabb3_classify_against_frustum_array.d.ts.map +1 -0
- package/src/core/geom/3d/aabb/aabb3_classify_against_frustum_array.js +29 -0
- package/src/core/geom/3d/aabb/aabb3_closest_point_on_surface.d.ts +15 -0
- package/src/core/geom/3d/aabb/aabb3_closest_point_on_surface.d.ts.map +1 -0
- package/src/core/geom/3d/aabb/aabb3_closest_point_on_surface.js +57 -0
- package/src/core/geom/3d/aabb/aabb3_combined_surface_area.d.ts +4 -5
- package/src/core/geom/3d/aabb/aabb3_combined_surface_area.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_combined_surface_area.js +7 -21
- package/src/core/geom/3d/aabb/aabb3_compute_clipping_volume_intersection.d.ts +22 -0
- package/src/core/geom/3d/aabb/aabb3_compute_clipping_volume_intersection.d.ts.map +1 -0
- package/src/core/geom/3d/aabb/aabb3_compute_clipping_volume_intersection.js +298 -0
- package/src/core/geom/3d/aabb/aabb3_compute_half_surface_area.d.ts +4 -9
- package/src/core/geom/3d/aabb/aabb3_compute_half_surface_area.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_compute_half_surface_area.js +7 -19
- package/src/core/geom/3d/aabb/aabb3_compute_projected_area.d.ts +4 -6
- package/src/core/geom/3d/aabb/aabb3_compute_projected_area.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_compute_projected_area.js +7 -86
- package/src/core/geom/3d/aabb/aabb3_compute_surface_area.d.ts +4 -9
- package/src/core/geom/3d/aabb/aabb3_compute_surface_area.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_compute_surface_area.js +7 -16
- package/src/core/geom/3d/aabb/aabb3_detailed_volume_intersection.d.ts +4 -19
- package/src/core/geom/3d/aabb/aabb3_detailed_volume_intersection.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_detailed_volume_intersection.js +7 -298
- package/src/core/geom/3d/aabb/aabb3_estimate_projected_area.d.ts +8 -0
- package/src/core/geom/3d/aabb/aabb3_estimate_projected_area.d.ts.map +1 -0
- package/src/core/geom/3d/aabb/aabb3_estimate_projected_area.js +59 -0
- package/src/core/geom/3d/aabb/aabb3_estimate_projected_area2.d.ts +4 -5
- package/src/core/geom/3d/aabb/aabb3_estimate_projected_area2.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_estimate_projected_area2.js +7 -59
- package/src/core/geom/3d/aabb/aabb3_from_three_geometry.d.ts +7 -0
- package/src/core/geom/3d/aabb/aabb3_from_three_geometry.d.ts.map +1 -0
- package/src/core/geom/3d/aabb/aabb3_from_three_geometry.js +18 -0
- package/src/core/geom/3d/aabb/aabb3_from_threejs_geometry.d.ts +4 -4
- package/src/core/geom/3d/aabb/aabb3_from_threejs_geometry.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_from_threejs_geometry.js +7 -18
- package/src/core/geom/3d/aabb/aabb3_from_triangle_group.d.ts +12 -0
- package/src/core/geom/3d/aabb/aabb3_from_triangle_group.d.ts.map +1 -0
- package/src/core/geom/3d/aabb/aabb3_from_triangle_group.js +46 -0
- package/src/core/geom/3d/aabb/aabb3_half_surface_area.d.ts +7 -0
- package/src/core/geom/3d/aabb/aabb3_half_surface_area.d.ts.map +1 -0
- package/src/core/geom/3d/aabb/aabb3_half_surface_area.js +10 -0
- package/src/core/geom/3d/aabb/aabb3_half_surface_area_extents.d.ts +12 -0
- package/src/core/geom/3d/aabb/aabb3_half_surface_area_extents.d.ts.map +1 -0
- package/src/core/geom/3d/aabb/aabb3_half_surface_area_extents.js +19 -0
- package/src/core/geom/3d/aabb/aabb3_intersects_frustum_degree.d.ts +4 -10
- package/src/core/geom/3d/aabb/aabb3_intersects_frustum_degree.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_intersects_frustum_degree.js +7 -46
- package/src/core/geom/3d/aabb/aabb3_intersects_line_segment.d.ts +4 -15
- package/src/core/geom/3d/aabb/aabb3_intersects_line_segment.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_intersects_line_segment.js +7 -77
- package/src/core/geom/3d/aabb/aabb3_intersects_ray_segment.d.ts +13 -0
- package/src/core/geom/3d/aabb/aabb3_intersects_ray_segment.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_intersects_ray_segment.js +27 -6
- package/src/core/geom/3d/aabb/aabb3_intersects_segment3.d.ts +18 -0
- package/src/core/geom/3d/aabb/aabb3_intersects_segment3.d.ts.map +1 -0
- package/src/core/geom/3d/aabb/aabb3_intersects_segment3.js +77 -0
- package/src/core/geom/3d/aabb/aabb3_near_distance_to_intersection_ray_segment.d.ts +4 -17
- package/src/core/geom/3d/aabb/aabb3_near_distance_to_intersection_ray_segment.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_near_distance_to_intersection_ray_segment.js +7 -70
- package/src/core/geom/3d/aabb/aabb3_nearest_point_on_surface.d.ts +4 -12
- package/src/core/geom/3d/aabb/aabb3_nearest_point_on_surface.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_nearest_point_on_surface.js +4 -54
- package/src/core/geom/3d/aabb/aabb3_projected_area.d.ts +9 -0
- package/src/core/geom/3d/aabb/aabb3_projected_area.d.ts.map +1 -0
- package/src/core/geom/3d/aabb/aabb3_projected_area.js +86 -0
- package/src/core/geom/3d/aabb/aabb3_ray_segment_entry_distance.d.ts +38 -0
- package/src/core/geom/3d/aabb/aabb3_ray_segment_entry_distance.d.ts.map +1 -0
- package/src/core/geom/3d/aabb/aabb3_ray_segment_entry_distance.js +95 -0
- package/src/core/geom/3d/aabb/aabb3_raycast.d.ts +4 -22
- package/src/core/geom/3d/aabb/aabb3_raycast.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_raycast.js +7 -109
- package/src/core/geom/3d/aabb/aabb3_raycast_hit_point.d.ts +25 -0
- package/src/core/geom/3d/aabb/aabb3_raycast_hit_point.d.ts.map +1 -0
- package/src/core/geom/3d/aabb/aabb3_raycast_hit_point.js +109 -0
- package/src/core/geom/3d/aabb/aabb3_score_boxes_SAH.js +2 -2
- package/src/core/geom/3d/aabb/aabb3_score_boxes_SAH_delta.d.ts +7 -1
- package/src/core/geom/3d/aabb/aabb3_score_boxes_SAH_delta.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_score_boxes_SAH_delta.js +8 -5
- package/src/core/geom/3d/aabb/aabb3_surface_area.d.ts +12 -0
- package/src/core/geom/3d/aabb/aabb3_surface_area.d.ts.map +1 -0
- package/src/core/geom/3d/aabb/aabb3_surface_area.js +16 -0
- package/src/core/geom/3d/aabb/aabb3_transform_oriented_inverse.js +2 -2
- package/src/core/geom/3d/aabb/aabb3_transformed_compute_plane_side.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/aabb3_transformed_compute_plane_side.js +4 -1
- package/src/core/geom/3d/aabb/aabb3_union_half_surface_area.d.ts +8 -0
- package/src/core/geom/3d/aabb/aabb3_union_half_surface_area.d.ts.map +1 -0
- package/src/core/geom/3d/aabb/aabb3_union_half_surface_area.js +21 -0
- package/src/core/geom/3d/aabb/aabb_nd_from_points.d.ts +10 -0
- package/src/core/geom/3d/aabb/aabb_nd_from_points.d.ts.map +1 -0
- package/src/core/geom/3d/aabb/aabb_nd_from_points.js +39 -0
- package/src/core/geom/3d/aabb/compute_aabb_from_points.d.ts +4 -7
- package/src/core/geom/3d/aabb/compute_aabb_from_points.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/compute_aabb_from_points.js +7 -39
- package/src/core/geom/3d/aabb/compute_triangle_group_aabb3.d.ts +4 -9
- package/src/core/geom/3d/aabb/compute_triangle_group_aabb3.d.ts.map +1 -1
- package/src/core/geom/3d/aabb/compute_triangle_group_aabb3.js +4 -43
- package/src/core/geom/3d/atlas/ATLAS_PORT_PLAN.md +486 -0
- package/src/core/geom/3d/atlas/BFF_PLAN.md +174 -0
- package/src/core/geom/3d/atlas/Chart.d.ts +58 -0
- package/src/core/geom/3d/atlas/Chart.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/Chart.js +77 -0
- package/src/core/geom/3d/atlas/REVIEW_02.md +392 -0
- package/src/core/geom/3d/atlas/atlas_bench_lib.d.ts +73 -0
- package/src/core/geom/3d/atlas/atlas_bench_lib.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/atlas_bench_lib.js +315 -0
- package/src/core/geom/3d/atlas/atlas_chart_type.d.ts +17 -0
- package/src/core/geom/3d/atlas/atlas_chart_type.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/atlas_chart_type.js +16 -0
- package/src/core/geom/3d/atlas/atlas_compute_charts.d.ts +25 -0
- package/src/core/geom/3d/atlas/atlas_compute_charts.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/atlas_compute_charts.js +188 -0
- package/src/core/geom/3d/atlas/atlas_extract_chart.d.ts +17 -0
- package/src/core/geom/3d/atlas/atlas_extract_chart.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/atlas_extract_chart.js +107 -0
- package/src/core/geom/3d/atlas/atlas_generate.d.ts +39 -0
- package/src/core/geom/3d/atlas/atlas_generate.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/atlas_generate.js +43 -0
- package/src/core/geom/3d/atlas/atlas_test_fixtures.d.ts +84 -0
- package/src/core/geom/3d/atlas/atlas_test_fixtures.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/atlas_test_fixtures.js +266 -0
- package/src/core/geom/3d/atlas/atlas_write_chart_uvs.d.ts +25 -0
- package/src/core/geom/3d/atlas/atlas_write_chart_uvs.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/atlas_write_chart_uvs.js +36 -0
- package/src/core/geom/3d/atlas/data/atlas_build_edge_dihedrals.d.ts +22 -0
- package/src/core/geom/3d/atlas/data/atlas_build_edge_dihedrals.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/data/atlas_build_edge_dihedrals.js +62 -0
- package/src/core/geom/3d/atlas/data/atlas_build_edge_lengths.d.ts +9 -0
- package/src/core/geom/3d/atlas/data/atlas_build_edge_lengths.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/data/atlas_build_edge_lengths.js +33 -0
- package/src/core/geom/3d/atlas/data/atlas_build_face_areas.d.ts +9 -0
- package/src/core/geom/3d/atlas/data/atlas_build_face_areas.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/data/atlas_build_face_areas.js +50 -0
- package/src/core/geom/3d/atlas/io/atlas_mesh_weld_colocals.d.ts +27 -0
- package/src/core/geom/3d/atlas/io/atlas_mesh_weld_colocals.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/io/atlas_mesh_weld_colocals.js +39 -0
- package/src/core/geom/3d/atlas/io/bt_loop_uv.d.ts +22 -0
- package/src/core/geom/3d/atlas/io/bt_loop_uv.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/io/bt_loop_uv.js +57 -0
- package/src/core/geom/3d/atlas/pack/ChartPlacement.d.ts +36 -0
- package/src/core/geom/3d/atlas/pack/ChartPlacement.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/pack/ChartPlacement.js +46 -0
- package/src/core/geom/3d/atlas/pack/atlas_pack_charts.d.ts +62 -0
- package/src/core/geom/3d/atlas/pack/atlas_pack_charts.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/pack/atlas_pack_charts.js +551 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_param_validity.d.ts +22 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_param_validity.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_param_validity.js +73 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_bff.d.ts +37 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_bff.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_bff.js +270 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_lscm.d.ts +23 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_lscm.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_lscm.js +224 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_ortho.d.ts +14 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_ortho.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_parameterize_ortho.js +38 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_stretch_metric.d.ts +22 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_stretch_metric.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/param/atlas_chart_stretch_metric.js +86 -0
- package/src/core/geom/3d/atlas/param/atlas_piecewise_resegment.d.ts +20 -0
- package/src/core/geom/3d/atlas/param/atlas_piecewise_resegment.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/param/atlas_piecewise_resegment.js +183 -0
- package/src/core/geom/3d/atlas/param/fit_plane_basis.d.ts +27 -0
- package/src/core/geom/3d/atlas/param/fit_plane_basis.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/param/fit_plane_basis.js +66 -0
- package/src/core/geom/3d/atlas/segment/RegionGraph.d.ts +31 -0
- package/src/core/geom/3d/atlas/segment/RegionGraph.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/segment/RegionGraph.js +40 -0
- package/src/core/geom/3d/atlas/segment/atlas_build_region_graph.d.ts +23 -0
- package/src/core/geom/3d/atlas/segment/atlas_build_region_graph.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/segment/atlas_build_region_graph.js +136 -0
- package/src/core/geom/3d/atlas/segment/atlas_compute_planar_regions.d.ts +24 -0
- package/src/core/geom/3d/atlas/segment/atlas_compute_planar_regions.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/segment/atlas_compute_planar_regions.js +77 -0
- package/src/core/geom/3d/atlas/segment/atlas_merge_charts.d.ts +27 -0
- package/src/core/geom/3d/atlas/segment/atlas_merge_charts.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/segment/atlas_merge_charts.js +113 -0
- package/src/core/geom/3d/atlas/segment/atlas_segment_charts.d.ts +44 -0
- package/src/core/geom/3d/atlas/segment/atlas_segment_charts.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/segment/atlas_segment_charts.js +275 -0
- package/src/core/geom/3d/atlas/segment/atlas_segment_charts_atomic.d.ts +22 -0
- package/src/core/geom/3d/atlas/segment/atlas_segment_charts_atomic.d.ts.map +1 -0
- package/src/core/geom/3d/atlas/segment/atlas_segment_charts_atomic.js +199 -0
- package/src/core/geom/3d/capsule/capsule_intersects_aabb3_closed.d.ts +1 -1
- package/src/core/geom/3d/capsule/capsule_intersects_aabb3_closed.js +3 -3
- package/src/core/geom/3d/circle3_compute_bounding_box.d.ts +14 -0
- package/src/core/geom/3d/circle3_compute_bounding_box.d.ts.map +1 -0
- package/src/core/geom/3d/circle3_compute_bounding_box.js +35 -0
- package/src/core/geom/3d/compute_circle_bounding_box.d.ts +4 -11
- package/src/core/geom/3d/compute_circle_bounding_box.d.ts.map +1 -1
- package/src/core/geom/3d/compute_circle_bounding_box.js +7 -35
- package/src/core/geom/3d/cone/computeConeBoundingBox.d.ts +4 -11
- package/src/core/geom/3d/cone/computeConeBoundingBox.d.ts.map +1 -1
- package/src/core/geom/3d/cone/computeConeBoundingBox.js +7 -58
- package/src/core/geom/3d/cone/computeConePlaneSide.d.ts +4 -16
- package/src/core/geom/3d/cone/computeConePlaneSide.d.ts.map +1 -1
- package/src/core/geom/3d/cone/computeConePlaneSide.js +7 -86
- package/src/core/geom/3d/cone/compute_bounding_cone_of_2_cones.d.ts +4 -5
- package/src/core/geom/3d/cone/compute_bounding_cone_of_2_cones.d.ts.map +1 -1
- package/src/core/geom/3d/cone/compute_bounding_cone_of_2_cones.js +7 -97
- package/src/core/geom/3d/cone/cone_compute_bounding_box.d.ts +14 -0
- package/src/core/geom/3d/cone/cone_compute_bounding_box.d.ts.map +1 -0
- package/src/core/geom/3d/cone/cone_compute_bounding_box.js +58 -0
- package/src/core/geom/3d/cone/cone_compute_bounding_of_2_cones.d.ts +8 -0
- package/src/core/geom/3d/cone/cone_compute_bounding_of_2_cones.d.ts.map +1 -0
- package/src/core/geom/3d/cone/cone_compute_bounding_of_2_cones.js +97 -0
- package/src/core/geom/3d/cone/cone_compute_plane_side.d.ts +19 -0
- package/src/core/geom/3d/cone/cone_compute_plane_side.d.ts.map +1 -0
- package/src/core/geom/3d/cone/cone_compute_plane_side.js +86 -0
- package/src/core/geom/3d/frustum/clipping_volume_matrix4_project.d.ts +4 -8
- package/src/core/geom/3d/frustum/clipping_volume_matrix4_project.d.ts.map +1 -1
- package/src/core/geom/3d/frustum/clipping_volume_matrix4_project.js +7 -45
- package/src/core/geom/3d/frustum/frustum3_computeNearestPointToPoint.d.ts +4 -9
- package/src/core/geom/3d/frustum/frustum3_computeNearestPointToPoint.d.ts.map +1 -1
- package/src/core/geom/3d/frustum/frustum3_computeNearestPointToPoint.js +7 -112
- package/src/core/geom/3d/frustum/frustum3_compute_closest_point.d.ts +12 -0
- package/src/core/geom/3d/frustum/frustum3_compute_closest_point.d.ts.map +1 -0
- package/src/core/geom/3d/frustum/frustum3_compute_closest_point.js +110 -0
- package/src/core/geom/3d/frustum/frustum3_from_aabb.d.ts +19 -0
- package/src/core/geom/3d/frustum/frustum3_from_aabb.d.ts.map +1 -0
- package/src/core/geom/3d/frustum/frustum3_from_aabb.js +60 -0
- package/src/core/geom/3d/frustum/frustum3_matrix4_project.d.ts +10 -0
- package/src/core/geom/3d/frustum/frustum3_matrix4_project.d.ts.map +1 -0
- package/src/core/geom/3d/frustum/frustum3_matrix4_project.js +18 -0
- package/src/core/geom/3d/frustum/frustum3_matrix4_project_n.d.ts +11 -0
- package/src/core/geom/3d/frustum/frustum3_matrix4_project_n.d.ts.map +1 -0
- package/src/core/geom/3d/frustum/frustum3_matrix4_project_n.js +45 -0
- package/src/core/geom/3d/frustum/frustum3_planes_to_flat_from_three.d.ts +7 -0
- package/src/core/geom/3d/frustum/frustum3_planes_to_flat_from_three.d.ts.map +1 -0
- package/src/core/geom/3d/frustum/frustum3_planes_to_flat_from_three.js +26 -0
- package/src/core/geom/3d/frustum/frustum3_slice_linear_to_points.d.ts +10 -0
- package/src/core/geom/3d/frustum/frustum3_slice_linear_to_points.d.ts.map +1 -0
- package/src/core/geom/3d/frustum/frustum3_slice_linear_to_points.js +96 -0
- package/src/core/geom/3d/frustum/frustum_compute_corners.js +9 -9
- package/src/core/geom/3d/frustum/frustum_matrix4_project.d.ts +4 -7
- package/src/core/geom/3d/frustum/frustum_matrix4_project.d.ts.map +1 -1
- package/src/core/geom/3d/frustum/frustum_matrix4_project.js +7 -18
- package/src/core/geom/3d/frustum/hexahedron_from_aabb.d.ts +4 -16
- package/src/core/geom/3d/frustum/hexahedron_from_aabb.d.ts.map +1 -1
- package/src/core/geom/3d/frustum/hexahedron_from_aabb.js +7 -60
- package/src/core/geom/3d/frustum/read_three_planes_to_array.d.ts.map +1 -1
- package/src/core/geom/3d/frustum/read_three_planes_to_array.js +7 -26
- package/src/core/geom/3d/frustum/slice_frustum_linear_to_points.d.ts +4 -7
- package/src/core/geom/3d/frustum/slice_frustum_linear_to_points.d.ts.map +1 -1
- package/src/core/geom/3d/frustum/slice_frustum_linear_to_points.js +7 -96
- package/src/core/geom/3d/funnel_string_pull.d.ts.map +1 -0
- package/src/{engine/navigation/mesh → core/geom/3d}/funnel_string_pull.js +1 -1
- package/src/core/geom/3d/gjk/gjk.js +4 -4
- package/src/core/geom/3d/gjk/gjk_epa_penetration.js +13 -13
- package/src/core/geom/3d/line/line3_closest_points_segment_segment.d.ts +4 -24
- package/src/core/geom/3d/line/line3_closest_points_segment_segment.d.ts.map +1 -1
- package/src/core/geom/3d/line/line3_closest_points_segment_segment.js +4 -85
- package/src/core/geom/3d/line/line3_compute_nearest_point_to_point.d.ts.map +1 -1
- package/src/core/geom/3d/line/line3_compute_nearest_point_to_point.js +7 -34
- package/src/core/geom/3d/line/line3_compute_point_segment_point_distance_unfolded.d.ts +32 -0
- package/src/core/geom/3d/line/line3_compute_point_segment_point_distance_unfolded.d.ts.map +1 -0
- package/src/core/geom/3d/line/line3_compute_point_segment_point_distance_unfolded.js +64 -0
- package/src/core/geom/3d/line/line3_compute_segment_closest_point.d.ts +16 -0
- package/src/core/geom/3d/line/line3_compute_segment_closest_point.d.ts.map +1 -0
- package/src/core/geom/3d/line/line3_compute_segment_closest_point.js +34 -0
- package/src/core/geom/3d/line/line3_compute_segment_closest_point_t.d.ts +19 -0
- package/src/core/geom/3d/line/line3_compute_segment_closest_point_t.d.ts.map +1 -0
- package/src/core/geom/3d/line/line3_compute_segment_closest_point_t.js +48 -0
- package/src/core/geom/3d/line/line3_compute_segment_closest_point_to_aabb3_t.d.ts +44 -0
- package/src/core/geom/3d/line/line3_compute_segment_closest_point_to_aabb3_t.d.ts.map +1 -0
- package/src/core/geom/3d/line/line3_compute_segment_closest_point_to_aabb3_t.js +153 -0
- package/src/core/geom/3d/line/line3_compute_segment_nearest_point_to_aabb3_t.d.ts +4 -41
- package/src/core/geom/3d/line/line3_compute_segment_nearest_point_to_aabb3_t.d.ts.map +1 -1
- package/src/core/geom/3d/line/line3_compute_segment_nearest_point_to_aabb3_t.js +4 -150
- package/src/core/geom/3d/line/line3_compute_segment_nearest_point_to_point_t.d.ts +4 -16
- package/src/core/geom/3d/line/line3_compute_segment_nearest_point_to_point_t.d.ts.map +1 -1
- package/src/core/geom/3d/line/line3_compute_segment_nearest_point_to_point_t.js +7 -48
- package/src/core/geom/3d/line/line3_compute_segment_point_distance_sqr.d.ts +1 -1
- package/src/core/geom/3d/line/line3_compute_segment_point_distance_sqr.js +2 -2
- package/src/core/geom/3d/line/line3_compute_segment_segment_closest_points.d.ts +27 -0
- package/src/core/geom/3d/line/line3_compute_segment_segment_closest_points.d.ts.map +1 -0
- package/src/core/geom/3d/line/line3_compute_segment_segment_closest_points.js +88 -0
- package/src/core/geom/3d/line/segment3_point_distance_to_segments.d.ts +11 -0
- package/src/core/geom/3d/line/segment3_point_distance_to_segments.d.ts.map +1 -0
- package/src/core/geom/3d/line/segment3_point_distance_to_segments.js +25 -0
- package/src/core/geom/3d/mat4/allocate_m4.d.ts +4 -3
- package/src/core/geom/3d/mat4/allocate_m4.d.ts.map +1 -1
- package/src/core/geom/3d/mat4/allocate_m4.js +7 -16
- package/src/core/geom/3d/mat4/apply_mat4_transform_to_direction_v3_array.d.ts +4 -9
- package/src/core/geom/3d/mat4/apply_mat4_transform_to_direction_v3_array.d.ts.map +1 -1
- package/src/core/geom/3d/mat4/apply_mat4_transform_to_direction_v3_array.js +7 -55
- package/src/core/geom/3d/mat4/apply_mat4_transform_to_v3_array.d.ts +4 -9
- package/src/core/geom/3d/mat4/apply_mat4_transform_to_v3_array.d.ts.map +1 -1
- package/src/core/geom/3d/mat4/apply_mat4_transform_to_v3_array.js +7 -30
- package/src/core/geom/3d/mat4/compose_matrix4_array.d.ts +4 -19
- package/src/core/geom/3d/mat4/compose_matrix4_array.d.ts.map +1 -1
- package/src/core/geom/3d/mat4/compose_matrix4_array.js +7 -53
- package/src/core/geom/3d/mat4/decompose_matrix_4_array.d.ts +4 -6
- package/src/core/geom/3d/mat4/decompose_matrix_4_array.d.ts.map +1 -1
- package/src/core/geom/3d/mat4/decompose_matrix_4_array.js +7 -76
- package/src/core/geom/3d/mat4/eulerAnglesFromMatrix.d.ts +4 -30
- package/src/core/geom/3d/mat4/eulerAnglesFromMatrix.d.ts.map +1 -1
- package/src/core/geom/3d/mat4/eulerAnglesFromMatrix.js +7 -124
- package/src/core/geom/3d/mat4/m4_allocate.d.ts +6 -0
- package/src/core/geom/3d/mat4/m4_allocate.d.ts.map +1 -0
- package/src/core/geom/3d/mat4/m4_allocate.js +16 -0
- package/src/core/geom/3d/mat4/m4_compose.d.ts +22 -0
- package/src/core/geom/3d/mat4/m4_compose.d.ts.map +1 -0
- package/src/core/geom/3d/mat4/m4_compose.js +53 -0
- package/src/core/geom/3d/mat4/m4_compute_normal_matrix3.d.ts +7 -0
- package/src/core/geom/3d/mat4/m4_compute_normal_matrix3.d.ts.map +1 -0
- package/src/core/geom/3d/mat4/m4_compute_normal_matrix3.js +7 -0
- package/src/core/geom/3d/mat4/m4_decompose.d.ts +9 -0
- package/src/core/geom/3d/mat4/m4_decompose.d.ts.map +1 -0
- package/src/core/geom/3d/mat4/m4_decompose.js +76 -0
- package/src/core/geom/3d/mat4/m4_euler_angles.d.ts +33 -0
- package/src/core/geom/3d/mat4/m4_euler_angles.d.ts.map +1 -0
- package/src/core/geom/3d/mat4/m4_euler_angles.js +124 -0
- package/src/core/geom/3d/mat4/m4_from_rotation_translation_scale.d.ts +20 -0
- package/src/core/geom/3d/mat4/m4_from_rotation_translation_scale.d.ts.map +1 -0
- package/src/core/geom/3d/mat4/m4_from_rotation_translation_scale.js +66 -0
- package/src/core/geom/3d/mat4/m4_normal_matrix3.d.ts +20 -0
- package/src/core/geom/3d/mat4/m4_normal_matrix3.d.ts.map +1 -0
- package/src/core/geom/3d/mat4/m4_normal_matrix3.js +39 -0
- package/src/core/geom/3d/mat4/m4_transform_direction_v3_buffer.d.ts +12 -0
- package/src/core/geom/3d/mat4/m4_transform_direction_v3_buffer.d.ts.map +1 -0
- package/src/core/geom/3d/mat4/m4_transform_direction_v3_buffer.js +55 -0
- package/src/core/geom/3d/mat4/m4_transform_v3_buffer.d.ts +12 -0
- package/src/core/geom/3d/mat4/m4_transform_v3_buffer.d.ts.map +1 -0
- package/src/core/geom/3d/mat4/m4_transform_v3_buffer.js +30 -0
- package/src/core/geom/3d/morton/mortonEncode_LUT.d.ts +4 -9
- package/src/core/geom/3d/morton/mortonEncode_LUT.d.ts.map +1 -1
- package/src/core/geom/3d/morton/mortonEncode_LUT.js +7 -143
- package/src/core/geom/3d/morton/mortonEncode_magicbits.d.ts +4 -9
- package/src/core/geom/3d/morton/mortonEncode_magicbits.d.ts.map +1 -1
- package/src/core/geom/3d/morton/mortonEncode_magicbits.js +7 -20
- package/src/core/geom/3d/morton/v3_morton_encode.d.ts +2 -2
- package/src/core/geom/3d/morton/v3_morton_encode.d.ts.map +1 -1
- package/src/core/geom/3d/morton/v3_morton_encode.js +2 -2
- package/src/core/geom/3d/morton/v3_morton_encode_bounded.d.ts +2 -2
- package/src/core/geom/3d/morton/v3_morton_encode_bounded.d.ts.map +1 -1
- package/src/core/geom/3d/morton/v3_morton_encode_bounded.js +1 -1
- package/src/core/geom/3d/morton/v3_morton_encode_lut.d.ts +12 -0
- package/src/core/geom/3d/morton/v3_morton_encode_lut.d.ts.map +1 -0
- package/src/core/geom/3d/morton/v3_morton_encode_lut.js +143 -0
- package/src/core/geom/3d/morton/v3_morton_encode_magicbits.d.ts +12 -0
- package/src/core/geom/3d/morton/v3_morton_encode_magicbits.d.ts.map +1 -0
- package/src/core/geom/3d/morton/v3_morton_encode_magicbits.js +20 -0
- package/src/core/geom/3d/normal/hemioct/encode_unit3_hemioct.d.ts +1 -14
- package/src/core/geom/3d/normal/hemioct/encode_unit3_hemioct.d.ts.map +1 -1
- package/src/core/geom/3d/normal/hemioct/encode_unit3_hemioct.js +5 -29
- package/src/core/geom/3d/normal/hemioct/encode_unit_to_hemioct.d.ts +15 -0
- package/src/core/geom/3d/normal/hemioct/encode_unit_to_hemioct.d.ts.map +1 -0
- package/src/core/geom/3d/normal/hemioct/encode_unit_to_hemioct.js +28 -0
- package/src/core/geom/3d/normal/lambert_azimuth/decode_azimuth_to_unit.d.ts +9 -0
- package/src/core/geom/3d/normal/lambert_azimuth/decode_azimuth_to_unit.d.ts.map +1 -0
- package/src/core/geom/3d/normal/{lamber_azimuth/transform.js → lambert_azimuth/decode_azimuth_to_unit.js} +30 -61
- package/src/core/geom/3d/normal/lambert_azimuth/encode_unit_to_azimuth.d.ts +10 -0
- package/src/core/geom/3d/normal/lambert_azimuth/encode_unit_to_azimuth.d.ts.map +1 -0
- package/src/core/geom/3d/normal/lambert_azimuth/encode_unit_to_azimuth.js +19 -0
- package/src/core/geom/3d/normal/spherical/decode_spheremap_to_unit.d.ts +9 -0
- package/src/core/geom/3d/normal/spherical/decode_spheremap_to_unit.d.ts.map +1 -0
- package/src/core/geom/3d/normal/spherical/decode_spheremap_to_unit.js +38 -0
- package/src/core/geom/3d/normal/spherical/{sphere_map_transform.d.ts → encode_unit_to_spheremap.d.ts} +2 -2
- package/src/core/geom/3d/normal/spherical/encode_unit_to_spheremap.d.ts.map +1 -0
- package/src/core/geom/3d/normal/spherical/encode_unit_to_spheremap.js +30 -0
- package/src/core/geom/3d/octahedra/octahedral_uv_to_direction.js +2 -2
- package/src/core/geom/3d/plane/is_point_within_planes.d.ts +4 -10
- package/src/core/geom/3d/plane/is_point_within_planes.d.ts.map +1 -1
- package/src/core/geom/3d/plane/is_point_within_planes.js +7 -46
- package/src/core/geom/3d/plane/plane3_compute_3_plane_intersection.d.ts +25 -0
- package/src/core/geom/3d/plane/plane3_compute_3_plane_intersection.d.ts.map +1 -0
- package/src/core/geom/3d/plane/plane3_compute_3_plane_intersection.js +72 -0
- package/src/core/geom/3d/plane/plane3_compute_3_plane_intersection_from_three.d.ts +11 -0
- package/src/core/geom/3d/plane/plane3_compute_3_plane_intersection_from_three.d.ts.map +1 -0
- package/src/core/geom/3d/plane/plane3_compute_3_plane_intersection_from_three.js +27 -0
- package/src/core/geom/3d/plane/plane3_compute_convex_3_plane_intersection.d.ts +4 -22
- package/src/core/geom/3d/plane/plane3_compute_convex_3_plane_intersection.d.ts.map +1 -1
- package/src/core/geom/3d/plane/plane3_compute_convex_3_plane_intersection.js +7 -72
- package/src/core/geom/3d/plane/plane3_compute_intersection.d.ts +17 -0
- package/src/core/geom/3d/plane/plane3_compute_intersection.d.ts.map +1 -0
- package/src/core/geom/3d/plane/plane3_compute_intersection.js +76 -0
- package/src/core/geom/3d/plane/plane3_compute_intersection_objects.d.ts +14 -0
- package/src/core/geom/3d/plane/plane3_compute_intersection_objects.d.ts.map +1 -0
- package/src/core/geom/3d/plane/plane3_compute_intersection_objects.js +82 -0
- package/src/core/geom/3d/plane/plane3_compute_plane_intersection.d.ts +4 -11
- package/src/core/geom/3d/plane/plane3_compute_plane_intersection.d.ts.map +1 -1
- package/src/core/geom/3d/plane/plane3_compute_plane_intersection.js +7 -82
- package/src/core/geom/3d/plane/plane3_contains_point_within_set.d.ts +13 -0
- package/src/core/geom/3d/plane/plane3_contains_point_within_set.d.ts.map +1 -0
- package/src/core/geom/3d/plane/plane3_contains_point_within_set.js +46 -0
- package/src/core/geom/3d/plane/plane3_intersect_plane.d.ts +4 -14
- package/src/core/geom/3d/plane/plane3_intersect_plane.d.ts.map +1 -1
- package/src/core/geom/3d/plane/plane3_intersect_plane.js +7 -76
- package/src/core/geom/3d/plane/plane3_matrix4_project.js +4 -4
- package/src/core/geom/3d/plane/plane3_three_compute_convex_3_plane_intersection.d.ts +4 -8
- package/src/core/geom/3d/plane/plane3_three_compute_convex_3_plane_intersection.d.ts.map +1 -1
- package/src/core/geom/3d/plane/plane3_three_compute_convex_3_plane_intersection.js +7 -27
- package/src/core/geom/3d/quaternion/quat3_createFromAxisAngle.d.ts +4 -5
- package/src/core/geom/3d/quaternion/quat3_createFromAxisAngle.d.ts.map +1 -1
- package/src/core/geom/3d/quaternion/quat3_createFromAxisAngle.js +7 -11
- package/src/core/geom/3d/quaternion/quat3_decode_from_uint32.d.ts +12 -0
- package/src/core/geom/3d/quaternion/quat3_decode_from_uint32.d.ts.map +1 -0
- package/src/core/geom/3d/quaternion/quat3_decode_from_uint32.js +66 -0
- package/src/core/geom/3d/quaternion/quat3_encode_to_uint32.d.ts +14 -0
- package/src/core/geom/3d/quaternion/quat3_encode_to_uint32.d.ts.map +1 -0
- package/src/core/geom/3d/quaternion/quat3_encode_to_uint32.js +110 -0
- package/src/core/geom/3d/quaternion/quat3_from_axis_angle.d.ts +8 -0
- package/src/core/geom/3d/quaternion/quat3_from_axis_angle.d.ts.map +1 -0
- package/src/core/geom/3d/quaternion/quat3_from_axis_angle.js +11 -0
- package/src/core/geom/3d/quaternion/quat_decode_from_uint32.d.ts +4 -9
- package/src/core/geom/3d/quaternion/quat_decode_from_uint32.d.ts.map +1 -1
- package/src/core/geom/3d/quaternion/quat_decode_from_uint32.js +7 -57
- package/src/core/geom/3d/quaternion/quat_encode_to_uint32.d.ts +4 -11
- package/src/core/geom/3d/quaternion/quat_encode_to_uint32.d.ts.map +1 -1
- package/src/core/geom/3d/quaternion/quat_encode_to_uint32.js +7 -110
- package/src/core/geom/3d/ray/Ray3.js +4 -4
- package/src/core/geom/3d/ray/ray3_array_apply_matrix4.js +2 -2
- package/src/core/geom/3d/ray/ray3_array_compose.d.ts +4 -9
- package/src/core/geom/3d/ray/ray3_array_compose.d.ts.map +1 -1
- package/src/core/geom/3d/ray/ray3_array_compose.js +7 -19
- package/src/core/geom/3d/ray/ray3_compose_array.d.ts +12 -0
- package/src/core/geom/3d/ray/ray3_compose_array.d.ts.map +1 -0
- package/src/core/geom/3d/ray/ray3_compose_array.js +19 -0
- package/src/core/geom/3d/ray/ray3_compute_closest_point.d.ts +16 -0
- package/src/core/geom/3d/ray/ray3_compute_closest_point.d.ts.map +1 -0
- package/src/core/geom/3d/ray/ray3_compute_closest_point.js +43 -0
- package/src/core/geom/3d/ray/ray3_compute_nearest_point_to_point.d.ts +4 -13
- package/src/core/geom/3d/ray/ray3_compute_nearest_point_to_point.d.ts.map +1 -1
- package/src/core/geom/3d/ray/ray3_compute_nearest_point_to_point.js +7 -43
- package/src/core/geom/3d/ray/ray3_compute_point_projection_t.d.ts +15 -0
- package/src/core/geom/3d/ray/ray3_compute_point_projection_t.d.ts.map +1 -0
- package/src/core/geom/3d/ray/ray3_compute_point_projection_t.js +31 -0
- package/src/core/geom/3d/ray/ray3_distance_to_point.d.ts +4 -12
- package/src/core/geom/3d/ray/ray3_distance_to_point.d.ts.map +1 -1
- package/src/core/geom/3d/ray/ray3_distance_to_point.js +7 -31
- package/src/core/geom/3d/ray/ray3_shift_origin_along_direction.d.ts +4 -7
- package/src/core/geom/3d/ray/ray3_shift_origin_along_direction.d.ts.map +1 -1
- package/src/core/geom/3d/ray/ray3_shift_origin_along_direction.js +7 -35
- package/src/core/geom/3d/ray/ray3_shift_origin_along_direction_array.d.ts +10 -0
- package/src/core/geom/3d/ray/ray3_shift_origin_along_direction_array.d.ts.map +1 -0
- package/src/core/geom/3d/ray/ray3_shift_origin_along_direction_array.js +35 -0
- package/src/core/geom/3d/shape/AbstractShape3D.d.ts +13 -0
- package/src/core/geom/3d/shape/AbstractShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/AbstractShape3D.js +16 -0
- package/src/core/geom/3d/shape/BoxShape3D.d.ts +1 -0
- package/src/core/geom/3d/shape/BoxShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/BoxShape3D.js +21 -5
- package/src/core/geom/3d/shape/CapsuleShape3D.d.ts +1 -0
- package/src/core/geom/3d/shape/CapsuleShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/CapsuleShape3D.js +23 -4
- package/src/core/geom/3d/shape/ConvexHullShape3D.js +3 -3
- package/src/core/geom/3d/shape/CylinderShape3D.js +2 -2
- package/src/core/geom/3d/shape/MeshShape3D.d.ts +39 -4
- package/src/core/geom/3d/shape/MeshShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/MeshShape3D.js +120 -11
- package/src/core/geom/3d/shape/SphereShape3D.d.ts +1 -0
- package/src/core/geom/3d/shape/SphereShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/SphereShape3D.js +17 -2
- package/src/core/geom/3d/shape/TransformedShape3D.d.ts +7 -3
- package/src/core/geom/3d/shape/TransformedShape3D.d.ts.map +1 -1
- package/src/core/geom/3d/shape/TransformedShape3D.js +3 -1
- package/src/core/geom/3d/shape/Triangle3D.d.ts +1 -1
- package/src/core/geom/3d/shape/Triangle3D.js +5 -5
- package/src/core/geom/3d/shape/shape3_mesh_from_geometry.d.ts +30 -0
- package/src/core/geom/3d/shape/shape3_mesh_from_geometry.d.ts.map +1 -0
- package/src/core/geom/3d/shape/shape3_mesh_from_geometry.js +64 -0
- package/src/core/geom/3d/shape/shape_mesh_from_geometry.d.ts +4 -27
- package/src/core/geom/3d/shape/shape_mesh_from_geometry.d.ts.map +1 -1
- package/src/core/geom/3d/shape/shape_mesh_from_geometry.js +4 -61
- package/src/core/geom/3d/shape/util/shape3_voxelize_to_grid.d.ts +61 -0
- package/src/core/geom/3d/shape/util/shape3_voxelize_to_grid.d.ts.map +1 -0
- package/src/core/geom/3d/shape/util/shape3_voxelize_to_grid.js +153 -0
- package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.d.ts +4 -58
- package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.d.ts.map +1 -1
- package/src/core/geom/3d/shape/util/shape3d_voxelize_to_grid.js +7 -153
- package/src/core/geom/3d/sphere/compute_bounding_sphere_of_2_spheres.d.ts +4 -5
- package/src/core/geom/3d/sphere/compute_bounding_sphere_of_2_spheres.d.ts.map +1 -1
- package/src/core/geom/3d/sphere/compute_bounding_sphere_of_2_spheres.js +7 -74
- package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.d.ts.map +1 -1
- package/src/core/geom/3d/sphere/harmonics/sh3_dering_optimize_positive.js +15 -13
- package/src/core/geom/3d/sphere/harmonics/sh3_rotate.d.ts +8 -0
- package/src/core/geom/3d/sphere/harmonics/sh3_rotate.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/harmonics/sh3_rotate.js +94 -0
- package/src/core/geom/3d/sphere/harmonics/sh3_rotate_bl.d.ts +4 -5
- package/src/core/geom/3d/sphere/harmonics/sh3_rotate_bl.d.ts.map +1 -1
- package/src/core/geom/3d/sphere/harmonics/sh3_rotate_bl.js +7 -94
- package/src/core/geom/3d/sphere/harmonics/sh_compute_K.d.ts +4 -6
- package/src/core/geom/3d/sphere/harmonics/sh_compute_K.d.ts.map +1 -1
- package/src/core/geom/3d/sphere/harmonics/sh_compute_K.js +7 -17
- package/src/core/geom/3d/sphere/harmonics/sh_normalization_factor.d.ts +9 -0
- package/src/core/geom/3d/sphere/harmonics/sh_normalization_factor.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/harmonics/sh_normalization_factor.js +17 -0
- package/src/core/geom/3d/sphere/sphere_array_intersects_point.d.ts +4 -7
- package/src/core/geom/3d/sphere/sphere_array_intersects_point.d.ts.map +1 -1
- package/src/core/geom/3d/sphere/sphere_array_intersects_point.js +7 -15
- package/src/core/geom/3d/sphere/sphere_array_intersects_ray.d.ts +4 -10
- package/src/core/geom/3d/sphere/sphere_array_intersects_ray.d.ts.map +1 -1
- package/src/core/geom/3d/sphere/sphere_array_intersects_ray.js +7 -25
- package/src/core/geom/3d/sphere/sphere_compute_bounding_of_2_spheres.d.ts +8 -0
- package/src/core/geom/3d/sphere/sphere_compute_bounding_of_2_spheres.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/sphere_compute_bounding_of_2_spheres.js +75 -0
- package/src/core/geom/3d/sphere/sphere_contains_point.d.ts +13 -0
- package/src/core/geom/3d/sphere/sphere_contains_point.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/sphere_contains_point.js +29 -0
- package/src/core/geom/3d/sphere/sphere_fibonacci_point.d.ts +2 -2
- package/src/core/geom/3d/sphere/sphere_fibonacci_point.d.ts.map +1 -1
- package/src/core/geom/3d/sphere/sphere_fibonacci_point.js +1 -1
- package/src/core/geom/3d/sphere/sphere_intersects_point.d.ts +4 -10
- package/src/core/geom/3d/sphere/sphere_intersects_point.d.ts.map +1 -1
- package/src/core/geom/3d/sphere/sphere_intersects_point.js +7 -29
- package/src/core/geom/3d/sphere/sphere_matrix4_transform.d.ts +7 -0
- package/src/core/geom/3d/sphere/sphere_matrix4_transform.d.ts.map +1 -1
- package/src/core/geom/3d/sphere/sphere_matrix4_transform.js +6 -2
- package/src/core/geom/3d/sphere/sphere_packed_contains_point.d.ts +10 -0
- package/src/core/geom/3d/sphere/sphere_packed_contains_point.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/sphere_packed_contains_point.js +15 -0
- package/src/core/geom/3d/sphere/sphere_packed_intersects_ray.d.ts +13 -0
- package/src/core/geom/3d/sphere/sphere_packed_intersects_ray.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/sphere_packed_intersects_ray.js +25 -0
- package/src/core/geom/3d/sphere/sphere_project.js +2 -2
- package/src/core/geom/3d/sphere/sphere_projected_radius_sqr.d.ts +9 -0
- package/src/core/geom/3d/sphere/sphere_projected_radius_sqr.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/sphere_projected_radius_sqr.js +45 -0
- package/src/core/geom/3d/sphere/sphere_projected_sphere_radius_sqr.d.ts +4 -6
- package/src/core/geom/3d/sphere/sphere_projected_sphere_radius_sqr.d.ts.map +1 -1
- package/src/core/geom/3d/sphere/sphere_projected_sphere_radius_sqr.js +7 -45
- package/src/core/geom/3d/sphere/sphere_radius_sqr_from_v3_array_transformed.d.ts +4 -6
- package/src/core/geom/3d/sphere/sphere_radius_sqr_from_v3_array_transformed.d.ts.map +1 -1
- package/src/core/geom/3d/sphere/sphere_radius_sqr_from_v3_array_transformed.js +7 -32
- package/src/core/geom/3d/sphere/sphere_radius_sqr_from_v3_buffer_transformed.d.ts +9 -0
- package/src/core/geom/3d/sphere/sphere_radius_sqr_from_v3_buffer_transformed.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/sphere_radius_sqr_from_v3_buffer_transformed.js +32 -0
- package/src/core/geom/3d/sphere/sphere_spherical_from_cartesian.d.ts +10 -0
- package/src/core/geom/3d/sphere/sphere_spherical_from_cartesian.d.ts.map +1 -0
- package/src/core/geom/3d/sphere/sphere_spherical_from_cartesian.js +29 -0
- package/src/core/geom/3d/sphere/spherical_from_cartesian.d.ts +4 -7
- package/src/core/geom/3d/sphere/spherical_from_cartesian.d.ts.map +1 -1
- package/src/core/geom/3d/sphere/spherical_from_cartesian.js +7 -29
- package/src/core/geom/3d/tetrahedra/compute_bounding_simplex_3d.js +5 -5
- package/src/core/geom/3d/tetrahedra/compute_tetrahedral_mesh_from_surface.d.ts.map +1 -1
- package/src/core/geom/3d/tetrahedra/compute_tetrahedral_mesh_from_surface.js +3 -5
- package/src/core/geom/3d/tetrahedra/compute_tetrahedron_quality.d.ts +4 -12
- package/src/core/geom/3d/tetrahedra/compute_tetrahedron_quality.d.ts.map +1 -1
- package/src/core/geom/3d/tetrahedra/compute_tetrahedron_quality.js +4 -19
- package/src/core/geom/3d/tetrahedra/compute_tetrahedron_volume.d.ts +4 -6
- package/src/core/geom/3d/tetrahedra/compute_tetrahedron_volume.d.ts.map +1 -1
- package/src/core/geom/3d/tetrahedra/compute_tetrahedron_volume.js +7 -18
- package/src/core/geom/3d/tetrahedra/delaunay/compute_delaunay_tetrahedral_mesh.js +2 -2
- package/src/core/geom/3d/tetrahedra/delaunay/fill_in_a_cavity.d.ts +4 -7
- package/src/core/geom/3d/tetrahedra/delaunay/fill_in_a_cavity.d.ts.map +1 -1
- package/src/core/geom/3d/tetrahedra/delaunay/fill_in_a_cavity.js +7 -166
- package/src/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_fill_cavity.d.ts +10 -0
- package/src/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_fill_cavity.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/delaunay/tetrahedral_mesh_fill_cavity.js +166 -0
- package/src/core/geom/3d/tetrahedra/prototypeTetrahedraBuilder.js +2 -2
- package/src/core/geom/3d/tetrahedra/prototype_tetrahedrize_mesh.js +6 -8
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_carve_outside_surface.js +3 -3
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_compute_tet_quality.d.ts +15 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_compute_tet_quality.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_compute_tet_quality.js +22 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_compute_tet_volume.d.ts +9 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_compute_tet_volume.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_compute_tet_volume.js +18 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_get_neighbours.d.ts +24 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_get_neighbours.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_get_neighbours.js +39 -0
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_improve_quality.js +12 -12
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_tet_get_neighbours.d.ts +4 -21
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_tet_get_neighbours.d.ts.map +1 -1
- package/src/core/geom/3d/tetrahedra/tetrahedral_mesh_tet_get_neighbours.js +7 -39
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_quality.js +5 -5
- package/src/core/geom/3d/tetrahedra/tetrahedron_compute_signed_volume.js +2 -2
- package/src/core/geom/3d/tetrahedra/triangle/prototype.js +5 -4
- package/src/core/geom/3d/tetrahedra/triangle/trace_triangular_depth_map.js +2 -2
- package/src/core/geom/3d/tetrahedra/triangle/triangle_decode_depth.d.ts +2 -0
- package/src/core/geom/3d/tetrahedra/triangle/triangle_decode_depth.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/triangle/{triangle_encode_rasterized_depth.js → triangle_decode_depth.js} +59 -112
- package/src/core/geom/3d/tetrahedra/triangle/triangle_rasterized_depth_sample_index.d.ts +12 -0
- package/src/core/geom/3d/tetrahedra/triangle/triangle_rasterized_depth_sample_index.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/triangle/triangle_rasterized_depth_sample_index.js +54 -0
- package/src/core/geom/3d/tetrahedra/validate_neighbour.d.ts +10 -0
- package/src/core/geom/3d/tetrahedra/validate_neighbour.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/validate_neighbour.js +70 -0
- package/src/core/geom/3d/tetrahedra/validate_tetrahedral_mesh.d.ts +0 -16
- package/src/core/geom/3d/tetrahedra/validate_tetrahedral_mesh.d.ts.map +1 -1
- package/src/core/geom/3d/tetrahedra/validate_tetrahedral_mesh.js +69 -186
- package/src/core/geom/3d/tetrahedra/validate_tetrahedron_neighbourhood.d.ts +9 -0
- package/src/core/geom/3d/tetrahedra/validate_tetrahedron_neighbourhood.d.ts.map +1 -0
- package/src/core/geom/3d/tetrahedra/validate_tetrahedron_neighbourhood.js +50 -0
- package/src/core/geom/3d/topology/bounds/computeTopoMeshBoundingSphere.d.ts +4 -4
- package/src/core/geom/3d/topology/bounds/computeTopoMeshBoundingSphere.d.ts.map +1 -1
- package/src/core/geom/3d/topology/bounds/computeTopoMeshBoundingSphere.js +7 -37
- package/src/core/geom/3d/topology/bounds/computeTopoMeshBoundiningBox.d.ts +4 -4
- package/src/core/geom/3d/topology/bounds/computeTopoMeshBoundiningBox.d.ts.map +1 -1
- package/src/core/geom/3d/topology/bounds/computeTopoMeshBoundiningBox.js +7 -16
- package/src/core/geom/3d/topology/bounds/computeTriangleClusterNormalBoundingCone.d.ts +4 -6
- package/src/core/geom/3d/topology/bounds/computeTriangleClusterNormalBoundingCone.d.ts.map +1 -1
- package/src/core/geom/3d/topology/bounds/computeTriangleClusterNormalBoundingCone.js +7 -87
- package/src/core/geom/3d/topology/bounds/compute_topo_mesh_bounding_box.d.ts +7 -0
- package/src/core/geom/3d/topology/bounds/compute_topo_mesh_bounding_box.d.ts.map +1 -0
- package/src/core/geom/3d/topology/bounds/compute_topo_mesh_bounding_box.js +16 -0
- package/src/core/geom/3d/topology/bounds/compute_topo_mesh_bounding_sphere.d.ts +7 -0
- package/src/core/geom/3d/topology/bounds/compute_topo_mesh_bounding_sphere.d.ts.map +1 -0
- package/src/core/geom/3d/topology/bounds/compute_topo_mesh_bounding_sphere.js +37 -0
- package/src/core/geom/3d/topology/bounds/compute_triangle_cluster_normal_bounding_cone.d.ts +9 -0
- package/src/core/geom/3d/topology/bounds/compute_triangle_cluster_normal_bounding_cone.d.ts.map +1 -0
- package/src/core/geom/3d/topology/bounds/compute_triangle_cluster_normal_bounding_cone.js +87 -0
- package/src/core/geom/3d/topology/build_face_graph_from_mesh.d.ts +0 -7
- package/src/core/geom/3d/topology/build_face_graph_from_mesh.d.ts.map +1 -1
- package/src/core/geom/3d/topology/build_face_graph_from_mesh.js +78 -113
- package/src/core/geom/3d/topology/compareEdges.d.ts +6 -1
- package/src/core/geom/3d/topology/compareEdges.d.ts.map +1 -1
- package/src/core/geom/3d/topology/compareEdges.js +7 -16
- package/src/core/geom/3d/topology/compare_edges.d.ts +8 -0
- package/src/core/geom/3d/topology/compare_edges.d.ts.map +1 -0
- package/src/core/geom/3d/topology/compare_edges.js +16 -0
- package/src/core/geom/3d/topology/computeTopoMeshVertexDuplicates.d.ts +4 -6
- package/src/core/geom/3d/topology/computeTopoMeshVertexDuplicates.d.ts.map +1 -1
- package/src/core/geom/3d/topology/computeTopoMeshVertexDuplicates.js +7 -108
- package/src/core/geom/3d/topology/compute_topo_mesh_vertex_duplicates.d.ts +9 -0
- package/src/core/geom/3d/topology/compute_topo_mesh_vertex_duplicates.d.ts.map +1 -0
- package/src/core/geom/3d/topology/compute_topo_mesh_vertex_duplicates.js +108 -0
- package/src/core/geom/3d/topology/expandConnectivityByLocality.js +2 -2
- package/src/core/geom/3d/topology/graph_create_off_mesh_links.d.ts +8 -0
- package/src/core/geom/3d/topology/graph_create_off_mesh_links.d.ts.map +1 -0
- package/src/core/geom/3d/topology/graph_create_off_mesh_links.js +35 -0
- package/src/core/geom/3d/topology/samples/prototypeFloodFill.js +4 -4
- package/src/core/geom/3d/topology/simplify/EdgeCollapseCandidate.d.ts.map +1 -1
- package/src/core/geom/3d/topology/simplify/EdgeCollapseCandidate.js +9 -8
- package/src/core/geom/3d/topology/simplify/collapse_degenerate_edge.js +2 -2
- package/src/core/geom/3d/topology/simplify/collapse_edge.d.ts +11 -0
- package/src/core/geom/3d/topology/simplify/collapse_edge.d.ts.map +1 -0
- package/src/core/geom/3d/topology/simplify/collapse_edge.js +21 -0
- package/src/core/geom/3d/topology/simplify/computeEdgeCollapseCost.d.ts +4 -8
- package/src/core/geom/3d/topology/simplify/computeEdgeCollapseCost.d.ts.map +1 -1
- package/src/core/geom/3d/topology/simplify/computeEdgeCollapseCost.js +7 -82
- package/src/core/geom/3d/topology/simplify/compute_edge_collapse_cost.d.ts +11 -0
- package/src/core/geom/3d/topology/simplify/compute_edge_collapse_cost.d.ts.map +1 -0
- package/src/core/geom/3d/topology/simplify/compute_edge_collapse_cost.js +82 -0
- package/src/core/geom/3d/topology/simplify/compute_face_normal_change_dot_product.js +3 -3
- package/src/core/geom/3d/topology/simplify/decimate_edge_collapse_snap.d.ts.map +1 -1
- package/src/core/geom/3d/topology/simplify/decimate_edge_collapse_snap.js +6 -5
- package/src/core/geom/3d/topology/simplify/edge_collapse_quadratic.js +2 -2
- package/src/core/geom/3d/topology/simplify/partial_edge_collapse.d.ts +11 -0
- package/src/core/geom/3d/topology/simplify/partial_edge_collapse.d.ts.map +1 -0
- package/src/core/geom/3d/topology/simplify/{collapseEdge.js → partial_edge_collapse.js} +118 -167
- package/src/core/geom/3d/topology/simplify/prototypeMeshSimplification.js +2 -2
- package/src/core/geom/3d/topology/simplify/quadratic/Quadric3.d.ts.map +1 -1
- package/src/core/geom/3d/topology/simplify/quadratic/Quadric3.js +4 -3
- package/src/core/geom/3d/topology/simplify/quadratic/apply_border_penalties_to_vertex_quadrics.d.ts +9 -0
- package/src/core/geom/3d/topology/simplify/quadratic/apply_border_penalties_to_vertex_quadrics.d.ts.map +1 -0
- package/src/core/geom/3d/topology/simplify/quadratic/apply_border_penalties_to_vertex_quadrics.js +16 -0
- package/src/core/geom/3d/topology/simplify/quadratic/apply_border_penalty_to_vertex_quadrics.d.ts +10 -0
- package/src/core/geom/3d/topology/simplify/quadratic/apply_border_penalty_to_vertex_quadrics.d.ts.map +1 -0
- package/src/core/geom/3d/topology/simplify/quadratic/apply_border_penalty_to_vertex_quadrics.js +51 -0
- package/src/core/geom/3d/topology/simplify/quadratic/build_vertex_quadrics.d.ts +9 -0
- package/src/core/geom/3d/topology/simplify/quadratic/build_vertex_quadrics.d.ts.map +1 -0
- package/src/core/geom/3d/topology/simplify/quadratic/build_vertex_quadrics.js +95 -0
- package/src/core/geom/3d/topology/simplify/quadratic/compute_edge_collapse_cost_quadratic.d.ts +4 -7
- package/src/core/geom/3d/topology/simplify/quadratic/compute_edge_collapse_cost_quadratic.d.ts.map +1 -1
- package/src/core/geom/3d/topology/simplify/quadratic/compute_edge_collapse_cost_quadratic.js +7 -28
- package/src/core/geom/3d/topology/simplify/quadratic/compute_edge_collapse_cost_quadric.d.ts +10 -0
- package/src/core/geom/3d/topology/simplify/quadratic/compute_edge_collapse_cost_quadric.d.ts.map +1 -0
- package/src/core/geom/3d/topology/simplify/quadratic/compute_edge_collapse_cost_quadric.js +28 -0
- package/src/core/geom/3d/topology/simplify/quadratic/deep_copy_vertex_quadrics.d.ts +8 -0
- package/src/core/geom/3d/topology/simplify/quadratic/deep_copy_vertex_quadrics.d.ts.map +1 -0
- package/src/core/geom/3d/topology/simplify/quadratic/deep_copy_vertex_quadrics.js +20 -0
- package/src/core/geom/3d/topology/simplify/simplifyTopoMesh.js +2 -2
- package/src/core/geom/3d/topology/simplify/simplifyTopoMesh2.js +2 -2
- package/src/core/geom/3d/topology/struct/TopoMesh.d.ts +3 -3
- package/src/core/geom/3d/topology/struct/TopoMesh.js +12 -12
- package/src/core/geom/3d/topology/struct/TopoTriangle.d.ts +0 -2
- package/src/core/geom/3d/topology/struct/TopoTriangle.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/TopoTriangle.js +4 -4
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_bridge_islands.js +4 -4
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_cleanup_faceless_references.js +2 -2
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_close_boundary_holes.js +2 -2
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compute_face_normals.js +2 -2
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compute_vertex_quadratics.d.ts +4 -11
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compute_vertex_quadratics.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compute_vertex_quadratics.js +4 -92
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compute_vertex_quadrics.d.ts +14 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compute_vertex_quadrics.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_compute_vertex_quadrics.js +95 -0
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_face_decouple_islands.js +2 -2
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_face_island_erode.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_face_island_erode.js +6 -8
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_fill_small_holes.js +2 -2
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_resolve_t_junctions.js +3 -3
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_simplify.js +6 -6
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_simplify_by_error.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/bt_mesh_simplify_by_error.js +45 -10
- package/src/core/geom/3d/topology/struct/binary/io/edge/bt_edge_collapse.js +2 -2
- package/src/core/geom/3d/topology/struct/binary/io/face/bt_face_poke.d.ts +14 -0
- package/src/core/geom/3d/topology/struct/binary/io/face/bt_face_poke.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/face/bt_face_poke.js +6 -2
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_kill_only_vert.d.ts +4 -4
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_kill_only_vert.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_kill_only_vert.js +7 -8
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_merge_vertices_by_distance.d.ts +10 -0
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_merge_vertices_by_distance.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_merge_vertices_by_distance.js +165 -0
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_merge_verts_by_distance.d.ts +4 -7
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_merge_verts_by_distance.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_merge_verts_by_distance.js +7 -165
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vert_fuse_duplicate_edges.d.ts +4 -19
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vert_fuse_duplicate_edges.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vert_fuse_duplicate_edges.js +4 -145
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vert_kill.d.ts +4 -4
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vert_kill.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vert_kill.js +7 -21
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_fuse_duplicate_edges.d.ts +22 -0
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_fuse_duplicate_edges.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_fuse_duplicate_edges.js +148 -0
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_kill.d.ts +7 -0
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_kill.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_kill.js +21 -0
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_kill_only.d.ts +7 -0
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_kill_only.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/io/vertex/bt_vertex_kill_only.js +8 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_collect_boundary_segments.d.ts +14 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_collect_boundary_segments.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_collect_boundary_segments.js +29 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_edge_is_boundary.d.ts +11 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_edge_is_boundary.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_edge_is_boundary.js +20 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_attached_faces.d.ts +4 -9
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_attached_faces.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_attached_faces.js +7 -96
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_edge_adjacent_faces.d.ts +12 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_edge_adjacent_faces.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_edge_adjacent_faces.js +74 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_incenter.js +2 -2
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_neighbour_faces.d.ts +4 -9
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_neighbour_faces.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_neighbour_faces.js +7 -74
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_shared_loop.d.ts +15 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_shared_loop.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_shared_loop.js +48 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_vertex_adjacent_faces.d.ts +12 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_vertex_adjacent_faces.d.ts.map +1 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_get_vertex_adjacent_faces.js +96 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_face_island_flood_fill.js +2 -2
- package/src/core/geom/3d/topology/struct/binary/query/bt_faces_shared_loop.d.ts +4 -12
- package/src/core/geom/3d/topology/struct/binary/query/bt_faces_shared_loop.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/query/bt_faces_shared_loop.js +4 -45
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_build_boundary_euclidean_distance_field.d.ts +0 -23
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_build_boundary_euclidean_distance_field.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_build_boundary_euclidean_distance_field.js +2 -54
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_build_face_bvh.d.ts +9 -0
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_build_face_bvh.d.ts.map +1 -0
- package/src/{engine/navigation/mesh/bvh_build_from_bt_mesh.js → core/geom/3d/topology/struct/binary/query/bt_mesh_build_face_bvh.js} +5 -3
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_face_find_path.d.ts.map +1 -0
- package/src/{engine/navigation/mesh → core/geom/3d/topology/struct/binary/query}/bt_mesh_face_find_path.js +7 -9
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_face_find_path_polyanya.d.ts.map +1 -0
- package/src/{engine/navigation/mesh → core/geom/3d/topology/struct/binary/query}/bt_mesh_face_find_path_polyanya.js +22 -41
- package/src/{engine/navigation/mesh/bvh_query_nearest_face.d.ts → core/geom/3d/topology/struct/binary/query/bt_mesh_find_nearest_face.d.ts} +3 -3
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_find_nearest_face.d.ts.map +1 -0
- package/src/{engine/navigation/mesh/bvh_query_nearest_face.js → core/geom/3d/topology/struct/binary/query/bt_mesh_find_nearest_face.js} +9 -11
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_sample_interior_grid_points.js +3 -3
- package/src/{engine/navigation/mesh/bvh_segment_penetrates_mesh.d.ts → core/geom/3d/topology/struct/binary/query/bt_mesh_segment_penetrates_surface.d.ts} +3 -3
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_segment_penetrates_surface.d.ts.map +1 -0
- package/src/{engine/navigation/mesh/bvh_segment_penetrates_mesh.js → core/geom/3d/topology/struct/binary/query/bt_mesh_segment_penetrates_surface.js} +4 -4
- package/src/core/geom/3d/topology/struct/binary/query/bt_mesh_walk_boundary_loops.js +3 -3
- package/src/core/geom/3d/topology/struct/binary/query/bt_query_edge_is_boundary.d.ts +4 -8
- package/src/core/geom/3d/topology/struct/binary/query/bt_query_edge_is_boundary.d.ts.map +1 -1
- package/src/core/geom/3d/topology/struct/binary/query/bt_query_edge_is_boundary.js +4 -17
- package/src/core/geom/3d/topology/tm_edge_kill.js +2 -2
- package/src/core/geom/3d/topology/tm_edge_kill_only.d.ts +7 -0
- package/src/core/geom/3d/topology/tm_edge_kill_only.d.ts.map +1 -0
- package/src/core/geom/3d/topology/tm_edge_kill_only.js +35 -0
- package/src/core/geom/3d/topology/tm_face_area.js +2 -2
- package/src/core/geom/3d/topology/tm_face_kill.js +2 -2
- package/src/core/geom/3d/topology/tm_face_kill_only.d.ts +7 -0
- package/src/core/geom/3d/topology/tm_face_kill_only.d.ts.map +1 -0
- package/src/core/geom/3d/topology/tm_face_kill_only.js +12 -0
- package/src/core/geom/3d/topology/tm_face_normal.js +2 -2
- package/src/core/geom/3d/topology/tm_kill_only_edge.d.ts +4 -4
- package/src/core/geom/3d/topology/tm_kill_only_edge.d.ts.map +1 -1
- package/src/core/geom/3d/topology/tm_kill_only_edge.js +7 -35
- package/src/core/geom/3d/topology/tm_kill_only_face.d.ts +4 -4
- package/src/core/geom/3d/topology/tm_kill_only_face.d.ts.map +1 -1
- package/src/core/geom/3d/topology/tm_kill_only_face.js +7 -12
- package/src/core/geom/3d/topology/tm_kill_only_vert.d.ts +4 -4
- package/src/core/geom/3d/topology/tm_kill_only_vert.d.ts.map +1 -1
- package/src/core/geom/3d/topology/tm_kill_only_vert.js +7 -14
- package/src/core/geom/3d/topology/tm_vert_kill.d.ts +4 -4
- package/src/core/geom/3d/topology/tm_vert_kill.d.ts.map +1 -1
- package/src/core/geom/3d/topology/tm_vert_kill.js +7 -19
- package/src/core/geom/3d/topology/tm_vert_splice.d.ts +4 -9
- package/src/core/geom/3d/topology/tm_vert_splice.d.ts.map +1 -1
- package/src/core/geom/3d/topology/tm_vert_splice.js +7 -64
- package/src/core/geom/3d/topology/tm_vertex_compute_normal.js +2 -2
- package/src/core/geom/3d/topology/tm_vertex_kill.d.ts +7 -0
- package/src/core/geom/3d/topology/tm_vertex_kill.d.ts.map +1 -0
- package/src/core/geom/3d/topology/tm_vertex_kill.js +19 -0
- package/src/core/geom/3d/topology/tm_vertex_kill_only.d.ts +7 -0
- package/src/core/geom/3d/topology/tm_vertex_kill_only.d.ts.map +1 -0
- package/src/core/geom/3d/topology/tm_vertex_kill_only.js +14 -0
- package/src/core/geom/3d/topology/tm_vertex_splice.d.ts +12 -0
- package/src/core/geom/3d/topology/tm_vertex_splice.d.ts.map +1 -0
- package/src/core/geom/3d/topology/tm_vertex_splice.js +64 -0
- package/src/core/geom/3d/topology/tm_weld_duplicate_vertices.js +4 -4
- package/src/core/geom/3d/triangle/computeTriangleClosestPointToPointBarycentric.d.ts +4 -17
- package/src/core/geom/3d/triangle/computeTriangleClosestPointToPointBarycentric.d.ts.map +1 -1
- package/src/core/geom/3d/triangle/computeTriangleClosestPointToPointBarycentric.js +7 -167
- package/src/core/geom/3d/triangle/computeTriangleRayIntersection.d.ts +4 -20
- package/src/core/geom/3d/triangle/computeTriangleRayIntersection.d.ts.map +1 -1
- package/src/core/geom/3d/triangle/computeTriangleRayIntersection.js +4 -157
- package/src/core/geom/3d/triangle/computeTriangleRayIntersectionBarycentric.d.ts +4 -22
- package/src/core/geom/3d/triangle/computeTriangleRayIntersectionBarycentric.d.ts.map +1 -1
- package/src/core/geom/3d/triangle/computeTriangleRayIntersectionBarycentric.js +4 -93
- package/src/core/geom/3d/triangle/computeTriangleRayIntersectionBarycentricEdge.d.ts +4 -23
- package/src/core/geom/3d/triangle/computeTriangleRayIntersectionBarycentricEdge.d.ts.map +1 -1
- package/src/core/geom/3d/triangle/computeTriangleRayIntersectionBarycentricEdge.js +7 -95
- package/src/core/geom/3d/triangle/computeTriangleRayIntersectionBarycentricGeometry.d.ts +4 -13
- package/src/core/geom/3d/triangle/computeTriangleRayIntersectionBarycentricGeometry.d.ts.map +1 -1
- package/src/core/geom/3d/triangle/computeTriangleRayIntersectionBarycentricGeometry.js +7 -55
- package/src/core/geom/3d/triangle/compute_triangle_area_3d.d.ts +4 -12
- package/src/core/geom/3d/triangle/compute_triangle_area_3d.d.ts.map +1 -1
- package/src/core/geom/3d/triangle/compute_triangle_area_3d.js +7 -50
- package/src/core/geom/3d/triangle/compute_triangle_normal.d.ts +4 -18
- package/src/core/geom/3d/triangle/compute_triangle_normal.d.ts.map +1 -1
- package/src/core/geom/3d/triangle/compute_triangle_normal.js +7 -25
- package/src/core/geom/3d/triangle/rayTriangleIntersection.d.ts +4 -10
- package/src/core/geom/3d/triangle/rayTriangleIntersection.d.ts.map +1 -1
- package/src/core/geom/3d/triangle/rayTriangleIntersection.js +7 -37
- package/src/core/geom/3d/triangle/tri3_area.d.ts +15 -0
- package/src/core/geom/3d/triangle/tri3_area.d.ts.map +1 -0
- package/src/core/geom/3d/triangle/tri3_area.js +50 -0
- package/src/core/geom/3d/triangle/tri3_closest_point_barycentric.d.ts +20 -0
- package/src/core/geom/3d/triangle/tri3_closest_point_barycentric.d.ts.map +1 -0
- package/src/core/geom/3d/triangle/tri3_closest_point_barycentric.js +167 -0
- package/src/core/geom/3d/triangle/tri3_compute_normal.d.ts +16 -0
- package/src/core/geom/3d/triangle/tri3_compute_normal.d.ts.map +1 -0
- package/src/core/geom/3d/triangle/tri3_compute_normal.js +57 -0
- package/src/core/geom/3d/triangle/tri3_compute_normal_v3_objects.d.ts +21 -0
- package/src/core/geom/3d/triangle/tri3_compute_normal_v3_objects.d.ts.map +1 -0
- package/src/core/geom/3d/triangle/tri3_compute_normal_v3_objects.js +25 -0
- package/src/core/geom/3d/triangle/tri3_compute_plane_side.d.ts +24 -0
- package/src/core/geom/3d/triangle/tri3_compute_plane_side.d.ts.map +1 -0
- package/src/core/geom/3d/triangle/tri3_compute_plane_side.js +39 -0
- package/src/core/geom/3d/triangle/tri3_compute_signed_volume.d.ts +17 -0
- package/src/core/geom/3d/triangle/tri3_compute_signed_volume.d.ts.map +1 -0
- package/src/core/geom/3d/triangle/tri3_compute_signed_volume.js +33 -0
- package/src/core/geom/3d/triangle/tri3_incenter.d.ts +19 -0
- package/src/core/geom/3d/triangle/tri3_incenter.d.ts.map +1 -0
- package/src/core/geom/3d/triangle/tri3_incenter.js +60 -0
- package/src/core/geom/3d/triangle/tri3_intersects_clipping_volume.d.ts +17 -0
- package/src/core/geom/3d/triangle/tri3_intersects_clipping_volume.d.ts.map +1 -0
- package/src/core/geom/3d/triangle/tri3_intersects_clipping_volume.js +51 -0
- package/src/core/geom/3d/triangle/tri3_mesh_compute_signed_volume.d.ts +20 -0
- package/src/core/geom/3d/triangle/tri3_mesh_compute_signed_volume.d.ts.map +1 -0
- package/src/core/geom/3d/triangle/tri3_mesh_compute_signed_volume.js +38 -0
- package/src/core/geom/3d/triangle/tri3_ray_intersection.d.ts +23 -0
- package/src/core/geom/3d/triangle/tri3_ray_intersection.d.ts.map +1 -0
- package/src/core/geom/3d/triangle/tri3_ray_intersection.js +160 -0
- package/src/core/geom/3d/triangle/tri3_ray_intersection_barycentric.d.ts +25 -0
- package/src/core/geom/3d/triangle/tri3_ray_intersection_barycentric.d.ts.map +1 -0
- package/src/core/geom/3d/triangle/tri3_ray_intersection_barycentric.js +96 -0
- package/src/core/geom/3d/triangle/tri3_ray_intersection_barycentric_edge.d.ts +26 -0
- package/src/core/geom/3d/triangle/tri3_ray_intersection_barycentric_edge.d.ts.map +1 -0
- package/src/core/geom/3d/triangle/tri3_ray_intersection_barycentric_edge.js +95 -0
- package/src/core/geom/3d/triangle/tri3_ray_intersection_indexed.d.ts +16 -0
- package/src/core/geom/3d/triangle/tri3_ray_intersection_indexed.d.ts.map +1 -0
- package/src/core/geom/3d/triangle/tri3_ray_intersection_indexed.js +55 -0
- package/src/core/geom/3d/triangle/tri3_ray_intersection_v3_objects.d.ts +13 -0
- package/src/core/geom/3d/triangle/tri3_ray_intersection_v3_objects.d.ts.map +1 -0
- package/src/core/geom/3d/triangle/tri3_ray_intersection_v3_objects.js +37 -0
- package/src/core/geom/3d/triangle/triangle3_incenter.d.ts +4 -16
- package/src/core/geom/3d/triangle/triangle3_incenter.d.ts.map +1 -1
- package/src/core/geom/3d/triangle/triangle3_incenter.js +7 -60
- package/src/core/geom/3d/triangle/triangle_compute_plane_side.d.ts +4 -21
- package/src/core/geom/3d/triangle/triangle_compute_plane_side.d.ts.map +1 -1
- package/src/core/geom/3d/triangle/triangle_compute_plane_side.js +7 -39
- package/src/core/geom/3d/triangle/triangle_compute_signed_volume.d.ts +4 -14
- package/src/core/geom/3d/triangle/triangle_compute_signed_volume.d.ts.map +1 -1
- package/src/core/geom/3d/triangle/triangle_compute_signed_volume.js +7 -33
- package/src/core/geom/3d/triangle/triangle_intersects_clipping_volume.d.ts +4 -14
- package/src/core/geom/3d/triangle/triangle_intersects_clipping_volume.d.ts.map +1 -1
- package/src/core/geom/3d/triangle/triangle_intersects_clipping_volume.js +7 -51
- package/src/core/geom/3d/triangle/triangle_mesh_compute_signed_volume.d.ts +4 -17
- package/src/core/geom/3d/triangle/triangle_mesh_compute_signed_volume.d.ts.map +1 -1
- package/src/core/geom/3d/triangle/triangle_mesh_compute_signed_volume.js +4 -35
- package/src/core/geom/3d/triangle/v3_compute_triangle_normal.d.ts +4 -13
- package/src/core/geom/3d/triangle/v3_compute_triangle_normal.d.ts.map +1 -1
- package/src/core/geom/3d/triangle/v3_compute_triangle_normal.js +7 -57
- package/src/core/geom/3d/util/aabb3_emit_point_grid.d.ts +10 -0
- package/src/core/geom/3d/util/aabb3_emit_point_grid.d.ts.map +1 -0
- package/src/core/geom/3d/util/aabb3_emit_point_grid.js +42 -0
- package/src/core/geom/3d/util/make_justified_point_grid.d.ts +4 -7
- package/src/core/geom/3d/util/make_justified_point_grid.d.ts.map +1 -1
- package/src/core/geom/3d/util/make_justified_point_grid.js +7 -42
- package/src/core/geom/GEOMETRY_REVIEW_002_API_ISSUES.md +381 -0
- package/src/core/geom/GEOMETRY_REVIEW_002_NAMING.md +684 -0
- package/src/core/geom/Vector3.js +2 -2
- package/src/core/geom/Vector4.d.ts +1 -1
- package/src/core/geom/Vector4.d.ts.map +1 -1
- package/src/core/geom/Vector4.js +0 -10
- package/src/core/geom/mat3/m3_cm_from_translation.d.ts +4 -5
- package/src/core/geom/mat3/m3_cm_from_translation.d.ts.map +1 -1
- package/src/core/geom/mat3/m3_cm_from_translation.js +7 -19
- package/src/core/geom/mat3/m3_cm_invert.d.ts +4 -4
- package/src/core/geom/mat3/m3_cm_invert.d.ts.map +1 -1
- package/src/core/geom/mat3/m3_cm_invert.js +7 -45
- package/src/core/geom/mat3/m3_cm_make_translation.d.ts +8 -0
- package/src/core/geom/mat3/m3_cm_make_translation.d.ts.map +1 -0
- package/src/core/geom/mat3/m3_cm_make_translation.js +19 -0
- package/src/core/geom/mat3/m3_invert.d.ts +7 -0
- package/src/core/geom/mat3/m3_invert.d.ts.map +1 -0
- package/src/core/geom/mat3/m3_invert.js +45 -0
- package/src/core/geom/mat3/m3_make_rotation.d.ts +1 -8
- package/src/core/geom/mat3/m3_make_rotation.d.ts.map +1 -1
- package/src/core/geom/mat3/m3_make_rotation.js +5 -31
- package/src/core/geom/mat3/m3_make_rotation_TBN.d.ts +9 -0
- package/src/core/geom/mat3/m3_make_rotation_TBN.d.ts.map +1 -0
- package/src/core/geom/mat3/m3_make_rotation_TBN.js +31 -0
- package/src/core/geom/mat3/m3_multiply_vec3.d.ts +4 -5
- package/src/core/geom/mat3/m3_multiply_vec3.d.ts.map +1 -1
- package/src/core/geom/mat3/m3_multiply_vec3.js +7 -21
- package/src/core/geom/mat3/m3_scale_columns_by_vec3.d.ts +8 -0
- package/src/core/geom/mat3/m3_scale_columns_by_vec3.d.ts.map +1 -0
- package/src/core/geom/mat3/m3_scale_columns_by_vec3.js +21 -0
- package/src/core/geom/packing/computeBoundingSphereOfSpheres.d.ts +4 -9
- package/src/core/geom/packing/computeBoundingSphereOfSpheres.d.ts.map +1 -1
- package/src/core/geom/packing/computeBoundingSphereOfSpheres.js +7 -102
- package/src/core/geom/packing/max-rect/MaxRectanglesPacker.js +9 -9
- package/src/core/geom/packing/max-rect/aabb2_validate_packing.d.ts +7 -1
- package/src/core/geom/packing/max-rect/aabb2_validate_packing.d.ts.map +1 -1
- package/src/core/geom/packing/max-rect/aabb2_validate_packing.js +2 -2
- package/src/core/geom/packing/max-rect/cost/costByBestShortSide.d.ts +4 -7
- package/src/core/geom/packing/max-rect/cost/costByBestShortSide.d.ts.map +1 -1
- package/src/core/geom/packing/max-rect/cost/costByBestShortSide.js +7 -11
- package/src/core/geom/packing/max-rect/cost/costByRemainingArea.d.ts +4 -7
- package/src/core/geom/packing/max-rect/cost/costByRemainingArea.d.ts.map +1 -1
- package/src/core/geom/packing/max-rect/cost/costByRemainingArea.js +7 -14
- package/src/core/geom/packing/max-rect/cost/cost_by_best_short_side.d.ts +10 -0
- package/src/core/geom/packing/max-rect/cost/cost_by_best_short_side.d.ts.map +1 -0
- package/src/core/geom/packing/max-rect/cost/cost_by_best_short_side.js +11 -0
- package/src/core/geom/packing/max-rect/cost/cost_by_remaining_area.d.ts +10 -0
- package/src/core/geom/packing/max-rect/cost/cost_by_remaining_area.d.ts.map +1 -0
- package/src/core/geom/packing/max-rect/cost/cost_by_remaining_area.js +14 -0
- package/src/core/geom/packing/max-rect/cutArea.d.ts +4 -4
- package/src/core/geom/packing/max-rect/cutArea.d.ts.map +1 -1
- package/src/core/geom/packing/max-rect/cutArea.js +7 -85
- package/src/core/geom/packing/max-rect/cut_area.d.ts +7 -0
- package/src/core/geom/packing/max-rect/cut_area.d.ts.map +1 -0
- package/src/core/geom/packing/max-rect/cut_area.js +85 -0
- package/src/core/geom/packing/max-rect/findBestContainer.d.ts +4 -7
- package/src/core/geom/packing/max-rect/findBestContainer.d.ts.map +1 -1
- package/src/core/geom/packing/max-rect/findBestContainer.js +7 -80
- package/src/core/geom/packing/max-rect/find_best_container.d.ts +10 -0
- package/src/core/geom/packing/max-rect/find_best_container.d.ts.map +1 -0
- package/src/core/geom/packing/max-rect/find_best_container.js +80 -0
- package/src/core/geom/packing/max-rect/packMaxRectangles.d.ts +4 -7
- package/src/core/geom/packing/max-rect/packMaxRectangles.d.ts.map +1 -1
- package/src/core/geom/packing/max-rect/packMaxRectangles.js +7 -16
- package/src/core/geom/packing/max-rect/packOneBox.d.ts +4 -5
- package/src/core/geom/packing/max-rect/packOneBox.d.ts.map +1 -1
- package/src/core/geom/packing/max-rect/packOneBox.js +7 -54
- package/src/core/geom/packing/max-rect/pack_max_rectangles.d.ts +10 -0
- package/src/core/geom/packing/max-rect/pack_max_rectangles.d.ts.map +1 -0
- package/src/core/geom/packing/max-rect/pack_max_rectangles.js +16 -0
- package/src/core/geom/packing/max-rect/pack_one_box.d.ts +8 -0
- package/src/core/geom/packing/max-rect/pack_one_box.d.ts.map +1 -0
- package/src/core/geom/packing/max-rect/pack_one_box.js +54 -0
- package/src/core/geom/packing/max-rect/removeRedundantBoxes.d.ts +4 -3
- package/src/core/geom/packing/max-rect/removeRedundantBoxes.d.ts.map +1 -1
- package/src/core/geom/packing/max-rect/removeRedundantBoxes.js +7 -84
- package/src/core/geom/packing/max-rect/removeRedundantBoxesArray.d.ts +4 -3
- package/src/core/geom/packing/max-rect/removeRedundantBoxesArray.d.ts.map +1 -1
- package/src/core/geom/packing/max-rect/removeRedundantBoxesArray.js +7 -46
- package/src/core/geom/packing/max-rect/remove_redundant_boxes.d.ts +6 -0
- package/src/core/geom/packing/max-rect/remove_redundant_boxes.d.ts.map +1 -0
- package/src/core/geom/packing/max-rect/remove_redundant_boxes.js +84 -0
- package/src/core/geom/packing/max-rect/remove_redundant_boxes_from_array.d.ts +6 -0
- package/src/core/geom/packing/max-rect/remove_redundant_boxes_from_array.d.ts.map +1 -0
- package/src/core/geom/packing/max-rect/remove_redundant_boxes_from_array.js +46 -0
- package/src/core/geom/packing/sphere_compute_bounding_of_spheres.d.ts +12 -0
- package/src/core/geom/packing/sphere_compute_bounding_of_spheres.d.ts.map +1 -0
- package/src/core/geom/packing/sphere_compute_bounding_of_spheres.js +102 -0
- package/src/core/geom/random/randomPointInBox.d.ts +4 -5
- package/src/core/geom/random/randomPointInBox.d.ts.map +1 -1
- package/src/core/geom/random/randomPointInBox.js +7 -16
- package/src/core/geom/random/randomPointInCircle.d.ts +4 -6
- package/src/core/geom/random/randomPointInCircle.d.ts.map +1 -1
- package/src/core/geom/random/randomPointInCircle.js +7 -21
- package/src/core/geom/random/randomPointInPoint.d.ts +4 -5
- package/src/core/geom/random/randomPointInPoint.d.ts.map +1 -1
- package/src/core/geom/random/randomPointInPoint.js +7 -11
- package/src/core/geom/random/randomPointInSphere.d.ts +4 -6
- package/src/core/geom/random/randomPointInSphere.d.ts.map +1 -1
- package/src/core/geom/random/randomPointInSphere.js +7 -35
- package/src/core/geom/random/randomPointOnBox.d.ts +4 -5
- package/src/core/geom/random/randomPointOnBox.d.ts.map +1 -1
- package/src/core/geom/random/randomPointOnBox.js +7 -37
- package/src/core/geom/random/randomPointOnSphere.d.ts +4 -6
- package/src/core/geom/random/randomPointOnSphere.d.ts.map +1 -1
- package/src/core/geom/random/randomPointOnSphere.js +7 -26
- package/src/core/geom/random/random_point_in_box.d.ts +8 -0
- package/src/core/geom/random/random_point_in_box.d.ts.map +1 -0
- package/src/core/geom/random/random_point_in_box.js +16 -0
- package/src/core/geom/random/random_point_in_circle.d.ts +9 -0
- package/src/core/geom/random/random_point_in_circle.d.ts.map +1 -0
- package/src/core/geom/random/random_point_in_circle.js +21 -0
- package/src/core/geom/random/random_point_in_point.d.ts +8 -0
- package/src/core/geom/random/random_point_in_point.d.ts.map +1 -0
- package/src/core/geom/random/random_point_in_point.js +11 -0
- package/src/core/geom/random/random_point_in_sphere.d.ts +9 -0
- package/src/core/geom/random/random_point_in_sphere.d.ts.map +1 -0
- package/src/core/geom/random/random_point_in_sphere.js +35 -0
- package/src/core/geom/random/random_point_on_box.d.ts +8 -0
- package/src/core/geom/random/random_point_on_box.d.ts.map +1 -0
- package/src/core/geom/random/random_point_on_box.js +37 -0
- package/src/core/geom/random/random_point_on_sphere.d.ts +9 -0
- package/src/core/geom/random/random_point_on_sphere.d.ts.map +1 -0
- package/src/core/geom/random/random_point_on_sphere.js +26 -0
- package/src/core/geom/vec/vector_copy.d.ts +4 -7
- package/src/core/geom/vec/vector_copy.d.ts.map +1 -1
- package/src/core/geom/vec/vector_copy.js +7 -13
- package/src/core/geom/vec/vector_copy_offset.d.ts +10 -0
- package/src/core/geom/vec/vector_copy_offset.d.ts.map +1 -0
- package/src/core/geom/vec/vector_copy_offset.js +13 -0
- package/src/core/geom/vec/vector_scale_array.d.ts +4 -8
- package/src/core/geom/vec/vector_scale_array.d.ts.map +1 -1
- package/src/core/geom/vec/vector_scale_array.js +7 -31
- package/src/core/geom/vec/vector_scale_offset.d.ts +11 -0
- package/src/core/geom/vec/vector_scale_offset.d.ts.map +1 -0
- package/src/core/geom/vec/vector_scale_offset.js +31 -0
- package/src/core/geom/vec3/v3_add.d.ts +10 -0
- package/src/core/geom/vec3/v3_add.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_add.js +13 -0
- package/src/core/geom/vec3/v3_add_array.d.ts +10 -0
- package/src/core/geom/vec3/v3_add_array.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_add_array.js +19 -0
- package/src/core/geom/vec3/v3_angle.d.ts +12 -0
- package/src/core/geom/vec3/v3_angle.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_angle.js +23 -0
- package/src/core/geom/vec3/v3_angle_atan2_between.d.ts +4 -9
- package/src/core/geom/vec3/v3_angle_atan2_between.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_angle_atan2_between.js +7 -27
- package/src/core/geom/vec3/v3_angle_between.d.ts +4 -9
- package/src/core/geom/vec3/v3_angle_between.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_angle_between.js +7 -23
- package/src/core/geom/vec3/v3_angle_cos_between.d.ts +4 -9
- package/src/core/geom/vec3/v3_angle_cos_between.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_angle_cos_between.js +7 -35
- package/src/core/geom/vec3/v3_angle_stable.d.ts +12 -0
- package/src/core/geom/vec3/v3_angle_stable.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_angle_stable.js +27 -0
- package/src/core/geom/vec3/v3_array_add_in_place.d.ts +4 -7
- package/src/core/geom/vec3/v3_array_add_in_place.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_array_add_in_place.js +7 -13
- package/src/core/geom/vec3/v3_array_centroid.d.ts +4 -8
- package/src/core/geom/vec3/v3_array_centroid.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_array_centroid.js +7 -40
- package/src/core/geom/vec3/v3_array_copy.d.ts +4 -6
- package/src/core/geom/vec3/v3_array_copy.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_array_copy.js +7 -17
- package/src/core/geom/vec3/v3_array_displace_in_direction.d.ts +4 -11
- package/src/core/geom/vec3/v3_array_displace_in_direction.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_array_displace_in_direction.js +7 -23
- package/src/core/geom/vec3/v3_array_equals.d.ts +4 -6
- package/src/core/geom/vec3/v3_array_equals.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_array_equals.js +7 -13
- package/src/core/geom/vec3/v3_array_immediate_add.d.ts +4 -7
- package/src/core/geom/vec3/v3_array_immediate_add.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_array_immediate_add.js +7 -19
- package/src/core/geom/vec3/v3_array_matrix4_rotate.d.ts +4 -8
- package/src/core/geom/vec3/v3_array_matrix4_rotate.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_array_matrix4_rotate.js +7 -22
- package/src/core/geom/vec3/v3_array_normalize.d.ts +4 -6
- package/src/core/geom/vec3/v3_array_normalize.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_array_normalize.js +7 -32
- package/src/core/geom/vec3/v3_array_scale.d.ts +4 -8
- package/src/core/geom/vec3/v3_array_scale.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_array_scale.js +5 -16
- package/src/core/geom/vec3/v3_centroid_v3_buffer.d.ts +11 -0
- package/src/core/geom/vec3/v3_centroid_v3_buffer.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_centroid_v3_buffer.js +40 -0
- package/src/core/geom/vec3/v3_compute_interior_angle.d.ts +4 -19
- package/src/core/geom/vec3/v3_compute_interior_angle.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_compute_interior_angle.js +7 -26
- package/src/core/geom/vec3/v3_copy_array.d.ts +9 -0
- package/src/core/geom/vec3/v3_copy_array.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_copy_array.js +17 -0
- package/src/core/geom/vec3/v3_cos_angle.d.ts +12 -0
- package/src/core/geom/vec3/v3_cos_angle.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_cos_angle.js +35 -0
- package/src/core/geom/vec3/v3_cotangent.d.ts +20 -0
- package/src/core/geom/vec3/v3_cotangent.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_cotangent.js +29 -0
- package/src/core/geom/vec3/v3_displace_in_direction_to_array.d.ts +14 -0
- package/src/core/geom/vec3/v3_displace_in_direction_to_array.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_displace_in_direction_to_array.js +23 -0
- package/src/core/geom/vec3/v3_dot_array.d.ts +10 -0
- package/src/core/geom/vec3/v3_dot_array.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_dot_array.js +25 -0
- package/src/core/geom/vec3/v3_dot_array_array.d.ts +4 -7
- package/src/core/geom/vec3/v3_dot_array_array.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_dot_array_array.js +7 -25
- package/src/core/geom/vec3/v3_equals_array.d.ts +9 -0
- package/src/core/geom/vec3/v3_equals_array.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_equals_array.js +13 -0
- package/src/core/geom/vec3/v3_interior_angle.d.ts +22 -0
- package/src/core/geom/vec3/v3_interior_angle.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_interior_angle.js +26 -0
- package/src/core/geom/vec3/v3_matrix3_multiply.d.ts +19 -0
- package/src/core/geom/vec3/v3_matrix3_multiply.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_matrix3_multiply.js +30 -0
- package/src/core/geom/vec3/v3_matrix3_rotate.d.ts +3 -3
- package/src/core/geom/vec3/v3_matrix3_rotate.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_matrix3_rotate.js +2 -2
- package/src/core/geom/vec3/v3_matrix4_rotate.d.ts +4 -13
- package/src/core/geom/vec3/v3_matrix4_rotate.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_matrix4_rotate.js +7 -51
- package/src/core/geom/vec3/v3_matrix4_rotate_array.d.ts +11 -0
- package/src/core/geom/vec3/v3_matrix4_rotate_array.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_matrix4_rotate_array.js +22 -0
- package/src/core/geom/vec3/v3_matrix4_rotate_unit.d.ts +16 -0
- package/src/core/geom/vec3/v3_matrix4_rotate_unit.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_matrix4_rotate_unit.js +51 -0
- package/src/core/geom/vec3/v3_multiply.d.ts +16 -0
- package/src/core/geom/vec3/v3_multiply.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_multiply.js +19 -0
- package/src/core/geom/vec3/v3_multiply_scalar.d.ts +4 -8
- package/src/core/geom/vec3/v3_multiply_scalar.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_multiply_scalar.js +7 -19
- package/src/core/geom/vec3/v3_normalize_array.d.ts +9 -0
- package/src/core/geom/vec3/v3_normalize_array.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_normalize_array.js +32 -0
- package/src/core/geom/vec3/v3_orthonormal_matrix_from_normal.d.ts +4 -1
- package/src/core/geom/vec3/v3_orthonormal_matrix_from_normal.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_orthonormal_matrix_from_normal.js +4 -1
- package/src/core/geom/vec3/v3_quat3_apply.d.ts +4 -26
- package/src/core/geom/vec3/v3_quat3_apply.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_quat3_apply.js +5 -37
- package/src/core/geom/vec3/v3_quat3_apply_inverse.d.ts +4 -27
- package/src/core/geom/vec3/v3_quat3_apply_inverse.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_quat3_apply_inverse.js +5 -39
- package/src/core/geom/vec3/v3_quaternion_apply.d.ts +29 -0
- package/src/core/geom/vec3/v3_quaternion_apply.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_quaternion_apply.js +39 -0
- package/src/core/geom/vec3/v3_quaternion_apply_inverse.d.ts +30 -0
- package/src/core/geom/vec3/v3_quaternion_apply_inverse.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_quaternion_apply_inverse.js +41 -0
- package/src/core/geom/vec3/v3_reflect.d.ts +19 -0
- package/src/core/geom/vec3/v3_reflect.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_reflect.js +24 -0
- package/src/core/geom/vec3/v3_scale.d.ts +11 -0
- package/src/core/geom/vec3/v3_scale.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_scale.js +19 -0
- package/src/core/geom/vec3/v3_scale_array.d.ts +11 -0
- package/src/core/geom/vec3/v3_scale_array.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_scale_array.js +18 -0
- package/src/core/geom/vec3/v3_triple_cross.d.ts +32 -0
- package/src/core/geom/vec3/v3_triple_cross.d.ts.map +1 -0
- package/src/core/geom/vec3/v3_triple_cross.js +45 -0
- package/src/core/geom/vec3/v3_triple_cross_product.d.ts +4 -29
- package/src/core/geom/vec3/v3_triple_cross_product.d.ts.map +1 -1
- package/src/core/geom/vec3/v3_triple_cross_product.js +5 -43
- package/src/core/geom/vec4/v4_matrix4_multiply.d.ts +8 -0
- package/src/core/geom/vec4/v4_matrix4_multiply.d.ts.map +1 -0
- package/src/core/geom/vec4/v4_matrix4_multiply.js +42 -0
- package/src/core/geom/vec4/v4_multiply_mat4.d.ts +4 -5
- package/src/core/geom/vec4/v4_multiply_mat4.d.ts.map +1 -1
- package/src/core/geom/vec4/v4_multiply_mat4.js +7 -42
- package/src/core/graph/csr/CSRGraph.d.ts +12 -8
- package/src/core/graph/csr/CSRGraph.d.ts.map +1 -1
- package/src/core/graph/csr/CSRGraph.js +18 -10
- package/src/core/graph/csr/csr_graph_build_distance_field.d.ts +36 -0
- package/src/core/graph/csr/csr_graph_build_distance_field.d.ts.map +1 -0
- package/src/core/graph/csr/csr_graph_build_distance_field.js +112 -0
- package/src/core/graph/csr/csr_graph_find_edge.d.ts +15 -0
- package/src/core/graph/csr/csr_graph_find_edge.d.ts.map +1 -0
- package/src/core/graph/csr/csr_graph_find_edge.js +25 -0
- package/src/core/graph/csr/csr_graph_find_shortest_path.d.ts +20 -0
- package/src/core/graph/csr/csr_graph_find_shortest_path.d.ts.map +1 -0
- package/src/core/graph/csr/csr_graph_find_shortest_path.js +105 -0
- package/src/core/graph/layout/CircleLayout.d.ts.map +1 -1
- package/src/core/graph/layout/CircleLayout.js +2 -4
- package/src/core/graph/layout/box/applyCentralGravityAABB2.js +2 -2
- package/src/core/graph/metis/cluster_mesh_metis.d.ts.map +1 -1
- package/src/core/graph/metis/cluster_mesh_metis.js +8 -1
- package/src/core/graph/metis/mesh_to_metis_graph.d.ts +2 -2
- package/src/core/graph/metis/mesh_to_metis_graph.d.ts.map +1 -1
- package/src/core/graph/metis/mesh_to_metis_graph.js +3 -3
- package/src/core/graph/metis/native/MetisGraph.d.ts +26 -10
- package/src/core/graph/metis/native/MetisGraph.d.ts.map +1 -1
- package/src/core/graph/metis/native/MetisGraph.js +34 -15
- package/src/core/graph/metis/native/bisection/BisectionScratch.d.ts +2 -2
- package/src/core/graph/metis/native/bisection/BisectionScratch.d.ts.map +1 -1
- package/src/core/graph/metis/native/bisection/BisectionScratch.js +4 -2
- package/src/core/graph/metis/native/bisection/compute_2way_params.d.ts.map +1 -1
- package/src/core/graph/metis/native/bisection/compute_2way_params.js +3 -1
- package/src/core/graph/metis/native/metis_partition_kway.d.ts +2 -2
- package/src/core/graph/metis/native/metis_partition_kway.d.ts.map +1 -1
- package/src/core/graph/metis/native/metis_partition_kway.js +1 -1
- package/src/core/graph/metis/native/refine/compute_kway_params.d.ts.map +1 -1
- package/src/core/graph/metis/native/refine/compute_kway_params.js +20 -8
- package/src/core/graph/metis/native/refine/fm_kway.d.ts.map +1 -1
- package/src/core/graph/metis/native/refine/fm_kway.js +58 -33
- package/src/core/math/linalg/cg/cg_solve.d.ts +24 -0
- package/src/core/math/linalg/cg/cg_solve.d.ts.map +1 -0
- package/src/core/math/linalg/cg/cg_solve.js +106 -0
- package/src/core/math/linalg/cg/cg_solve_normal_equations.d.ts +21 -0
- package/src/core/math/linalg/cg/cg_solve_normal_equations.d.ts.map +1 -0
- package/src/core/math/linalg/cg/cg_solve_normal_equations.js +59 -0
- package/src/core/math/linalg/eigen/matrix_symmetric_3x3_eigen.d.ts +19 -0
- package/src/core/math/linalg/eigen/matrix_symmetric_3x3_eigen.d.ts.map +1 -0
- package/src/core/math/linalg/eigen/matrix_symmetric_3x3_eigen.js +117 -0
- package/src/core/math/linalg/sparse/SparseMatrixCSR.d.ts +50 -0
- package/src/core/math/linalg/sparse/SparseMatrixCSR.d.ts.map +1 -0
- package/src/core/math/linalg/sparse/SparseMatrixCSR.js +88 -0
- package/src/core/math/linalg/sparse/spm_matvec.d.ts +9 -0
- package/src/core/math/linalg/sparse/spm_matvec.d.ts.map +1 -0
- package/src/core/math/linalg/sparse/spm_matvec.js +22 -0
- package/src/core/math/linalg/sparse/spm_matvec_transpose.d.ts +12 -0
- package/src/core/math/linalg/sparse/spm_matvec_transpose.d.ts.map +1 -0
- package/src/core/math/linalg/sparse/spm_matvec_transpose.js +29 -0
- package/src/core/math/physics/mie/MIE_PARTICLES_STANDARD_PRECOMPUTED.d.ts +39 -0
- package/src/core/math/physics/mie/MIE_PARTICLES_STANDARD_PRECOMPUTED.js +22 -1
- package/src/core/math/physics/mie/compute_mie_particle_properties_rgb.d.ts.map +1 -1
- package/src/core/math/physics/mie/compute_mie_particle_properties_rgb.js +32 -9
- package/src/core/math/physics/mie/compute_mie_phase.d.ts +2 -3
- package/src/core/math/physics/mie/compute_mie_phase.d.ts.map +1 -1
- package/src/core/math/physics/mie/compute_mie_phase.js +1 -3
- package/src/core/math/physics/mie/lorenz_mie_coefs.d.ts +0 -1
- package/src/core/math/physics/mie/lorenz_mie_coefs.d.ts.map +1 -1
- package/src/core/math/physics/mie/lorenz_mie_coefs.js +0 -7
- package/src/engine/EngineHarness.js +2 -2
- package/src/engine/animation/curve/view/AnimationCurveView.js +2 -2
- package/src/engine/asset/loaders/material/planeHash.js +2 -2
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.d.ts.map +1 -1
- package/src/engine/control/first-person/FirstPersonPlayerControllerSystem.js +7 -7
- package/src/engine/control/first-person/prototype_first_person_controller.js +3 -3
- package/src/engine/ecs/attachment/TransformAttachmentBinding.js +3 -3
- package/src/engine/ecs/gui/hud/HeadsUpDisplaySystem.js +2 -2
- package/src/engine/ecs/terrain/ecs/Terrain.d.ts.map +1 -1
- package/src/engine/ecs/terrain/ecs/Terrain.js +4 -3
- package/src/engine/ecs/terrain/ecs/TerrainSystem.js +6 -6
- package/src/engine/ecs/terrain/tiles/TerrainTile.js +4 -4
- package/src/engine/ecs/terrain/tiles/TerrainTileManager.d.ts.map +1 -1
- package/src/engine/ecs/terrain/tiles/TerrainTileManager.js +12 -11
- package/src/engine/ecs/transform/Transform.js +7 -7
- package/src/engine/ecs/transform/TransformSerializationAdapter.js +4 -4
- package/src/engine/graphics/GraphicsEngine.d.ts.map +1 -1
- package/src/engine/graphics/GraphicsEngine.js +2 -1
- package/src/engine/graphics/ecs/camera/auto_set_camera_clipping_planes.js +2 -2
- package/src/engine/graphics/ecs/camera/topdown/TopDownCameraController.js +2 -2
- package/src/engine/graphics/ecs/decal/v2/FPDecalSystem.js +10 -10
- package/src/engine/graphics/ecs/decal/v2/prototypeDecalSystem.js +2 -2
- package/src/engine/graphics/ecs/light/shadow/extend_shadow_camera_near_for_casters.d.ts.map +1 -1
- package/src/engine/graphics/ecs/light/shadow/extend_shadow_camera_near_for_casters.js +4 -6
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometry.js +4 -4
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/mesh-v2/ShadedGeometrySystem.js +6 -7
- package/src/engine/graphics/ecs/mesh-v2/render/ShadedGeometryRendererContext.js +3 -3
- package/src/engine/graphics/ecs/path/tube/build/computeFrenetFrames.d.ts.map +1 -1
- package/src/engine/graphics/ecs/path/tube/build/computeFrenetFrames.js +8 -7
- package/src/engine/graphics/ecs/trail2d/Trail2D.d.ts +26 -5
- package/src/engine/graphics/ecs/trail2d/Trail2D.d.ts.map +1 -1
- package/src/engine/graphics/ecs/trail2d/Trail2D.js +51 -11
- package/src/engine/graphics/ecs/trail2d/Trail2DSystem.d.ts.map +1 -1
- package/src/engine/graphics/ecs/trail2d/Trail2DSystem.js +1 -0
- package/src/engine/graphics/ecs/trail2d/prototypeTrail2D.js +2 -2
- package/src/engine/graphics/ecs/trail3d/Trail3D.d.ts +186 -0
- package/src/engine/graphics/ecs/trail3d/Trail3D.d.ts.map +1 -0
- package/src/engine/graphics/ecs/trail3d/Trail3D.js +430 -0
- package/src/engine/graphics/ecs/trail3d/Trail3DFlags.d.ts +9 -0
- package/src/engine/graphics/ecs/trail3d/Trail3DFlags.d.ts.map +1 -0
- package/src/engine/graphics/ecs/trail3d/Trail3DFlags.js +18 -0
- package/src/engine/graphics/ecs/trail3d/Trail3DSystem.d.ts +55 -0
- package/src/engine/graphics/ecs/trail3d/Trail3DSystem.d.ts.map +1 -0
- package/src/engine/graphics/ecs/trail3d/Trail3DSystem.js +248 -0
- package/src/engine/graphics/ecs/trail3d/prototypeTrail3D.d.ts +2 -0
- package/src/engine/graphics/ecs/trail3d/prototypeTrail3D.d.ts.map +1 -0
- package/src/engine/graphics/ecs/trail3d/prototypeTrail3D.js +76 -0
- package/src/engine/graphics/geometry/MikkT/AvgTSpace.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/AvgTSpace.js +11 -6
- package/src/engine/graphics/geometry/MikkT/BuildNeighborsFast.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/BuildNeighborsFast.js +2 -3
- package/src/engine/graphics/geometry/MikkT/CalcTexArea.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/CalcTexArea.js +3 -4
- package/src/engine/graphics/geometry/MikkT/DegenEpilogue.js +4 -4
- package/src/engine/graphics/geometry/MikkT/EvalTspace.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/EvalTspace.js +11 -8
- package/src/engine/graphics/geometry/MikkT/GenerateSharedVerticesIndexList.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/GenerateSharedVerticesIndexList.js +7 -8
- package/src/engine/graphics/geometry/MikkT/GenerateTSpaces.js +8 -8
- package/src/engine/graphics/geometry/MikkT/InitTriInfo.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/InitTriInfo.js +30 -25
- package/src/engine/graphics/geometry/MikkT/MikkTSpace.js +7 -7
- package/src/engine/graphics/geometry/MikkT/NormalizeSafe.d.ts +0 -1
- package/src/engine/graphics/geometry/MikkT/NormalizeSafe.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/NormalizeSafe.js +6 -4
- package/src/engine/graphics/geometry/MikkT/STSpace.d.ts +0 -2
- package/src/engine/graphics/geometry/MikkT/STSpace.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/STSpace.js +3 -3
- package/src/engine/graphics/geometry/MikkT/v3_scale_dot_sub_normalize.d.ts +0 -2
- package/src/engine/graphics/geometry/MikkT/v3_scale_dot_sub_normalize.d.ts.map +1 -1
- package/src/engine/graphics/geometry/MikkT/v3_scale_dot_sub_normalize.js +0 -1
- package/src/engine/graphics/geometry/buffered/geometry_compute_vertex_normals_indexed.js +4 -4
- package/src/engine/graphics/geometry/buffered/query/GeometrySpatialQueryAccelerator.js +2 -2
- package/src/engine/graphics/geometry/buffered/query/bvh32_geometry_nearest.d.ts.map +1 -1
- package/src/engine/graphics/geometry/buffered/query/bvh32_geometry_nearest.js +4 -6
- package/src/engine/graphics/geometry/buffered/query/bvh32_geometry_overlap_clipping_volume.d.ts.map +1 -1
- package/src/engine/graphics/geometry/buffered/query/bvh32_geometry_overlap_clipping_volume.js +2 -4
- package/src/engine/graphics/geometry/buffered/query/bvh32_geometry_raycast.js +2 -2
- package/src/engine/graphics/geometry/buffered/query/query_bvh_geometry_nearest.d.ts.map +1 -1
- package/src/engine/graphics/geometry/buffered/query/query_bvh_geometry_nearest.js +4 -6
- package/src/engine/graphics/geometry/buffered/v3_array_normalize_many.js +2 -2
- package/src/engine/graphics/geometry/computeMeshSurfaceArea.js +2 -2
- package/src/engine/graphics/geometry/geometry_construct_triangle_normal.js +2 -2
- package/src/engine/graphics/impostors/octahedral/ImpostorBaker.d.ts +0 -2
- package/src/engine/graphics/impostors/octahedral/ImpostorBaker.d.ts.map +1 -1
- package/src/engine/graphics/impostors/octahedral/ImpostorBaker.js +4 -3
- package/src/engine/graphics/impostors/octahedral/bake/compute_bounding_sphere.js +2 -2
- package/src/engine/graphics/impostors/octahedral/bake/compute_bounding_sphere_radius_only.d.ts.map +1 -1
- package/src/engine/graphics/impostors/octahedral/bake/compute_bounding_sphere_radius_only.js +2 -4
- package/src/engine/graphics/impostors/octahedral/grid/HemiOctahedralUvEncoder.js +2 -2
- package/src/engine/graphics/impostors/octahedral/grid/UvEncoder.d.ts +17 -7
- package/src/engine/graphics/impostors/octahedral/util/sampler2d_build_cutout.js +4 -4
- package/src/engine/graphics/impostors/voxel/VoxelImpostorBaker.js +2 -2
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleEmitter.js +8 -8
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleLayer.d.ts +20 -5
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleLayer.d.ts.map +1 -1
- package/src/engine/graphics/particles/particular/engine/emitter/ParticleLayer.js +2 -2
- package/src/engine/graphics/particles/particular/engine/emitter/computeEmissionFunction.js +10 -10
- package/src/engine/graphics/particles/particular/engine/utils/volume/ParticleVolume.js +3 -3
- package/src/engine/graphics/particles/particular/engine/utils/volume/prototypeParticleVolume.js +4 -3
- package/src/engine/graphics/render/forward_plus/LightManager.d.ts.map +1 -1
- package/src/engine/graphics/render/forward_plus/LightManager.js +10 -15
- package/src/engine/graphics/render/forward_plus/assign_cluster.d.ts.map +1 -1
- package/src/engine/graphics/render/forward_plus/assign_cluster.js +1 -2
- package/src/engine/graphics/render/forward_plus/computeFrustumCorners.d.ts.map +1 -1
- package/src/engine/graphics/render/forward_plus/computeFrustumCorners.js +9 -11
- package/src/engine/graphics/render/forward_plus/model/Decal.d.ts +0 -2
- package/src/engine/graphics/render/forward_plus/model/Decal.d.ts.map +1 -1
- package/src/engine/graphics/render/forward_plus/model/Decal.js +3 -3
- package/src/engine/graphics/render/forward_plus/model/SpotLight.js +2 -2
- package/src/engine/graphics/render/forward_plus/prototype/prototypeLightManager.js +4 -3
- package/src/engine/graphics/render/forward_plus/query/detailed_sphere_frustum_intersection_test.d.ts +8 -0
- package/src/engine/graphics/render/forward_plus/query/detailed_sphere_frustum_intersection_test.d.ts.map +1 -1
- package/src/engine/graphics/render/forward_plus/query/detailed_sphere_frustum_intersection_test.js +8 -0
- package/src/engine/graphics/render/forward_plus/query/point_light_inside_volume.d.ts +12 -2
- package/src/engine/graphics/render/forward_plus/query/point_light_inside_volume.d.ts.map +1 -1
- package/src/engine/graphics/render/forward_plus/query/point_light_inside_volume.js +18 -48
- package/src/engine/graphics/render/forward_plus/query/query_bvh_frustum_from_texture.d.ts +1 -2
- package/src/engine/graphics/render/forward_plus/query/query_bvh_frustum_from_texture.d.ts.map +1 -1
- package/src/engine/graphics/render/forward_plus/query/query_bvh_frustum_from_texture.js +2 -3
- package/src/engine/graphics/render/forward_plus/query/spot_light_inside_volume.js +2 -2
- package/src/engine/graphics/render/forward_plus/testClusterEquality.js +1 -1
- package/src/engine/graphics/render/gizmo/GizmoShapeRenderingInterface.js +5 -5
- package/src/engine/graphics/render/layers/RenderLayerUtils.d.ts.map +1 -1
- package/src/engine/graphics/render/layers/RenderLayerUtils.js +2 -4
- package/src/engine/graphics/render/make_bvh_visibility_builder.js +3 -3
- package/src/engine/graphics/render/view/CameraView.js +2 -2
- package/src/engine/graphics/render/visibility/hiz/prototypeHiZ.js +6 -4
- package/src/engine/graphics/sh3/fromCubeRenderTarget.js +2 -2
- package/src/engine/graphics/sh3/gi/prototypeSHGI.js +2 -2
- package/src/engine/graphics/sh3/lightmap/ARTIFACTS_PLAN.md +146 -0
- package/src/engine/graphics/sh3/lightmap/CODE_REVIEW.md +121 -0
- package/src/engine/graphics/sh3/lightmap/LIGHTMAPPER_REVIEW.md +183 -0
- package/src/engine/graphics/sh3/lightmap/bake_lightmap_for_scene.d.ts +90 -0
- package/src/engine/graphics/sh3/lightmap/bake_lightmap_for_scene.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lightmap/bake_lightmap_for_scene.js +678 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_build_geometry.d.ts +32 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_build_geometry.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_build_geometry.js +155 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_denoise.d.ts +49 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_denoise.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_denoise.js +136 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_dilate.d.ts +19 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_dilate.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_dilate.js +89 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_gather.d.ts +54 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_gather.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_gather.js +168 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_rasterize_triangle.d.ts +30 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_rasterize_triangle.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_rasterize_triangle.js +145 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_seam_fix.d.ts +38 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_seam_fix.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lightmap/lightmap_seam_fix.js +152 -0
- package/src/engine/graphics/sh3/lightmap/prototypeLightmapBaker.d.ts +2 -0
- package/src/engine/graphics/sh3/lightmap/prototypeLightmapBaker.d.ts.map +1 -0
- package/src/engine/graphics/sh3/lightmap/prototypeLightmapBaker.js +186 -0
- package/src/engine/graphics/sh3/lpv/PathTracerProbeRenderer.js +4 -4
- package/src/engine/graphics/sh3/lpv/depth/octahedral/bake_octahedral_depth_map.js +2 -2
- package/src/engine/graphics/sh3/lpv/depth/octahedral/bake_octahedral_depth_map_fibonacci.js +2 -2
- package/src/engine/graphics/sh3/lpv/depth/sh3_bake_depth.js +2 -2
- package/src/engine/graphics/sh3/path_tracer/BufferedGeometryBVH.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/BufferedGeometryBVH.js +7 -8
- package/src/engine/graphics/sh3/path_tracer/PathTracedMesh.d.ts +1 -0
- package/src/engine/graphics/sh3/path_tracer/PathTracedMesh.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/PathTracedMesh.js +22 -8
- package/src/engine/graphics/sh3/path_tracer/PathTracedRenderer.d.ts +57 -0
- package/src/engine/graphics/sh3/path_tracer/PathTracedRenderer.d.ts.map +1 -0
- package/src/engine/graphics/sh3/path_tracer/PathTracedRenderer.js +186 -0
- package/src/engine/graphics/sh3/path_tracer/PathTracedScene.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/PathTracedScene.js +166 -51
- package/src/engine/graphics/sh3/path_tracer/PathTracer.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/PathTracer.js +46 -27
- package/src/engine/graphics/sh3/path_tracer/REVIEW_001_ACTION_PLAN.md +490 -0
- package/src/engine/graphics/sh3/path_tracer/make_sky_hosek.js +4 -4
- package/src/engine/graphics/sh3/path_tracer/material/MaterialConverter.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/material/MaterialConverter.js +10 -2
- package/src/engine/graphics/sh3/path_tracer/material/StandardTexture.d.ts +6 -0
- package/src/engine/graphics/sh3/path_tracer/material/StandardTexture.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/material/StandardTexture.js +14 -0
- package/src/engine/graphics/sh3/path_tracer/prepare_scene_gltf.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/prepare_scene_gltf.js +6 -4
- package/src/engine/graphics/sh3/path_tracer/prototypePathTracer.js +12 -139
- package/src/engine/graphics/sh3/path_tracer/ray_hit_apply_transform.d.ts +2 -1
- package/src/engine/graphics/sh3/path_tracer/ray_hit_apply_transform.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/ray_hit_apply_transform.js +32 -31
- package/src/engine/graphics/sh3/path_tracer/sampling/getBiasedNormalSample.d.ts +3 -3
- package/src/engine/graphics/sh3/path_tracer/sampling/getBiasedNormalSample.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/sampling/getBiasedNormalSample.js +3 -3
- package/src/engine/graphics/sh3/path_tracer/texture/sample_material.d.ts +1 -1
- package/src/engine/graphics/sh3/path_tracer/texture/sample_material.d.ts.map +1 -1
- package/src/engine/graphics/sh3/path_tracer/texture/sample_material.js +145 -133
- package/src/engine/graphics/sh3/prototypeSH3Probe.js +2 -2
- package/src/engine/graphics/sh3/sky/hosek/prototype_hosek.js +2 -2
- package/src/engine/graphics/sh3/sky/hosek/sky_hosek_compute_irradiance_by_direction.js +7 -7
- package/src/engine/graphics/texture/sprite/prototypeSpriteCutoutGeometry.js +5 -5
- package/src/engine/graphics/three/expand_aabb_by_transformed_three_object.js +2 -2
- package/src/engine/graphics/trail/TrailSpawnMode.d.ts +19 -0
- package/src/engine/graphics/trail/TrailSpawnMode.d.ts.map +1 -0
- package/src/engine/graphics/trail/TrailSpawnMode.js +20 -0
- package/src/engine/graphics/trail/tube/TubeMaterialX.d.ts +5 -0
- package/src/engine/graphics/trail/tube/TubeMaterialX.d.ts.map +1 -0
- package/src/engine/graphics/trail/tube/TubeMaterialX.js +80 -0
- package/src/engine/graphics/trail/tube/TubeX.d.ts +141 -0
- package/src/engine/graphics/trail/tube/TubeX.d.ts.map +1 -0
- package/src/engine/graphics/trail/tube/TubeX.js +555 -0
- package/src/engine/graphics/trail/tube/TubeXMaterialSpec.d.ts +26 -0
- package/src/engine/graphics/trail/tube/TubeXMaterialSpec.d.ts.map +1 -0
- package/src/engine/graphics/trail/tube/TubeXMaterialSpec.js +47 -0
- package/src/engine/graphics/trail/tube/TubeXPlugin.d.ts +21 -0
- package/src/engine/graphics/trail/tube/TubeXPlugin.d.ts.map +1 -0
- package/src/engine/graphics/trail/tube/TubeXPlugin.js +80 -0
- package/src/engine/graphics/trail/tube/simulator/TubeXFixedPhysicsSimulator.d.ts +14 -0
- package/src/engine/graphics/trail/tube/simulator/TubeXFixedPhysicsSimulator.d.ts.map +1 -0
- package/src/engine/graphics/trail/tube/simulator/TubeXFixedPhysicsSimulator.js +32 -0
- package/src/engine/graphics/trail/tube/tube_attributes_spec.d.ts +26 -0
- package/src/engine/graphics/trail/tube/tube_attributes_spec.d.ts.map +1 -0
- package/src/engine/graphics/trail/tube/tube_attributes_spec.js +69 -0
- package/src/engine/graphics/trail/tube/tube_frame.d.ts +32 -0
- package/src/engine/graphics/trail/tube/tube_frame.d.ts.map +1 -0
- package/src/engine/graphics/trail/tube/tube_frame.js +83 -0
- package/src/engine/graphics/util/composeMatrix4.js +2 -2
- package/src/engine/input/devices/KeyboardDevice.d.ts +61 -14
- package/src/engine/input/devices/KeyboardDevice.d.ts.map +1 -1
- package/src/engine/input/devices/KeyboardDevice.js +41 -15
- package/src/engine/input/devices/isHTMLElementFocusable.d.ts.map +1 -1
- package/src/engine/input/devices/isHTMLElementFocusable.js +2 -9
- package/src/engine/navigation/mesh/NavigationMesh.js +6 -6
- package/src/engine/navigation/mesh/PATHFINDING_PLAN.md +1 -1
- package/src/engine/navigation/mesh/build/clip_soup_against_overhangs.d.ts.map +1 -1
- package/src/engine/navigation/mesh/build/clip_soup_against_overhangs.js +5 -51
- package/src/engine/navigation/mesh/build/navmesh_build_topology.d.ts.map +1 -1
- package/src/engine/navigation/mesh/build/navmesh_build_topology.js +19 -23
- package/src/engine/network/CONGESTION_CONTROL.md +87 -0
- package/src/engine/network/NetworkSession.d.ts +7 -1
- package/src/engine/network/NetworkSession.d.ts.map +1 -1
- package/src/engine/network/NetworkSession.js +144 -0
- package/src/engine/network/README.md +7 -0
- package/src/engine/network/adapters/TransformInterpolationAdapter.js +5 -5
- package/src/engine/network/adapters/TransformReplicationAdapter.js +4 -4
- package/src/engine/network/core/MalformedPacketError.d.ts +24 -0
- package/src/engine/network/core/MalformedPacketError.d.ts.map +1 -0
- package/src/engine/network/core/MalformedPacketError.js +26 -0
- package/src/engine/network/ecs/owner_authorization.d.ts +49 -0
- package/src/engine/network/ecs/owner_authorization.d.ts.map +1 -0
- package/src/engine/network/ecs/owner_authorization.js +55 -0
- package/src/engine/network/orchestrator/NetworkPeer.d.ts +31 -0
- package/src/engine/network/orchestrator/NetworkPeer.d.ts.map +1 -1
- package/src/engine/network/orchestrator/NetworkPeer.js +89 -2
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts +38 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.d.ts.map +1 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeServer.js +75 -0
- package/src/engine/network/replication/Replicator.d.ts.map +1 -1
- package/src/engine/network/replication/Replicator.js +28 -0
- package/src/engine/network/sim/SimActionExecutor.d.ts +46 -1
- package/src/engine/network/sim/SimActionExecutor.d.ts.map +1 -1
- package/src/engine/network/sim/SimActionExecutor.js +68 -0
- package/src/engine/network/sim/Snapshotter.d.ts.map +1 -1
- package/src/engine/network/sim/Snapshotter.js +18 -2
- package/src/engine/network/transport/Channel.d.ts +12 -1
- package/src/engine/network/transport/Channel.d.ts.map +1 -1
- package/src/engine/network/transport/Channel.js +34 -1
- package/src/engine/physics/broadphase/generate_pairs.js +3 -3
- package/src/engine/physics/constraint/solve_constraints.js +3 -3
- package/src/engine/physics/ecs/PhysicsSystem.js +2 -2
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/engine/physics/fluid/ecs/FluidSystem.d.ts +3 -3
- package/src/engine/physics/inverse_kinematics/two_joint_ik.js +4 -4
- package/src/engine/physics/narrowphase/box_box_manifold.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/box_box_manifold.js +4 -6
- package/src/engine/physics/narrowphase/box_triangle_contact.d.ts.map +1 -1
- package/src/engine/physics/narrowphase/box_triangle_contact.js +4 -6
- package/src/engine/physics/narrowphase/capsule_contacts.js +15 -15
- package/src/engine/physics/narrowphase/capsule_triangle_contact.js +8 -8
- package/src/engine/physics/narrowphase/compute_penetration.js +8 -8
- package/src/engine/physics/narrowphase/convex_convex_manifold.js +9 -9
- package/src/engine/physics/narrowphase/convex_decomposition.js +8 -8
- package/src/engine/physics/narrowphase/mesh_convex_hull.js +3 -3
- package/src/engine/physics/narrowphase/mesh_mesh_tet_manifold.js +3 -3
- package/src/engine/physics/narrowphase/refine_ray_concave.js +5 -5
- package/src/engine/physics/narrowphase/refine_ray_hit.js +5 -5
- package/src/engine/physics/narrowphase/sphere_box_contact.js +5 -5
- package/src/engine/physics/narrowphase/sphere_triangle_contact.js +2 -2
- package/src/engine/physics/queries/overlap_shape.js +3 -3
- package/src/engine/physics/queries/raycast.d.ts.map +1 -1
- package/src/engine/physics/queries/raycast.js +3 -5
- package/src/engine/physics/queries/shape_cast.js +3 -3
- package/src/engine/physics/solver/solve_contacts.js +6 -6
- package/src/engine/physics/vehicle/RaycastVehicle.js +4 -4
- package/src/engine/sound/SoundEngine.js +2 -2
- package/src/engine/sound/ecs/audio/AudioEmitter.d.ts +32 -1
- package/src/engine/sound/ecs/audio/AudioEmitter.d.ts.map +1 -1
- package/src/engine/sound/ecs/audio/AudioEmitter.js +40 -1
- package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts +33 -8
- package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts.map +1 -1
- package/src/engine/sound/ecs/audio/AudioEmitterSystem.js +90 -12
- package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts +12 -1
- package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts.map +1 -1
- package/src/engine/sound/ecs/audio/LiveEmitterSet.js +25 -4
- package/src/engine/sound/ecs/emitter/SoundEmitterSystem.js +1 -1
- package/src/engine/sound/simulation/AcousticSimulator.d.ts +134 -0
- package/src/engine/sound/simulation/AcousticSimulator.d.ts.map +1 -0
- package/src/engine/sound/simulation/AcousticSimulator.js +637 -0
- package/src/engine/sound/simulation/IMPLEMENTATION_PLAN.md +432 -0
- package/src/engine/sound/simulation/PROBE_PLACEMENT.md +250 -0
- package/src/engine/sound/simulation/PROBE_TRANSFER_RESEARCH.md +322 -0
- package/src/engine/sound/simulation/README.md +277 -0
- package/src/engine/sound/simulation/REFLECTION_IR_PLAN.md +261 -0
- package/src/engine/sound/simulation/VISIBILITY_GRAPH_PLAN.md +121 -0
- package/src/engine/sound/simulation/configureAcousticSimulation.d.ts +31 -0
- package/src/engine/sound/simulation/configureAcousticSimulation.d.ts.map +1 -0
- package/src/engine/sound/simulation/configureAcousticSimulation.js +48 -0
- package/src/engine/sound/simulation/core/AcousticMedium.d.ts +60 -0
- package/src/engine/sound/simulation/core/AcousticMedium.d.ts.map +1 -0
- package/src/engine/sound/simulation/core/AcousticMedium.js +113 -0
- package/src/engine/sound/simulation/core/AcousticMediumSerializationAdapter.d.ts +22 -0
- package/src/engine/sound/simulation/core/AcousticMediumSerializationAdapter.d.ts.map +1 -0
- package/src/engine/sound/simulation/core/AcousticMediumSerializationAdapter.js +27 -0
- package/src/engine/sound/simulation/core/AcousticOccluderIndex.d.ts +85 -0
- package/src/engine/sound/simulation/core/AcousticOccluderIndex.d.ts.map +1 -0
- package/src/engine/sound/simulation/core/AcousticOccluderIndex.js +314 -0
- package/src/engine/sound/simulation/core/AcousticRegionIndex.d.ts +56 -0
- package/src/engine/sound/simulation/core/AcousticRegionIndex.d.ts.map +1 -0
- package/src/engine/sound/simulation/core/AcousticRegionIndex.js +159 -0
- package/src/engine/sound/simulation/core/AcousticSolution.d.ts +66 -0
- package/src/engine/sound/simulation/core/AcousticSolution.d.ts.map +1 -0
- package/src/engine/sound/simulation/core/AcousticSolution.js +90 -0
- package/src/engine/sound/simulation/core/AcousticSourceState.d.ts +55 -0
- package/src/engine/sound/simulation/core/AcousticSourceState.d.ts.map +1 -0
- package/src/engine/sound/simulation/core/AcousticSourceState.js +109 -0
- package/src/engine/sound/simulation/core/AcousticVolumeRegion.d.ts +45 -0
- package/src/engine/sound/simulation/core/AcousticVolumeRegion.d.ts.map +1 -0
- package/src/engine/sound/simulation/core/AcousticVolumeRegion.js +73 -0
- package/src/engine/sound/simulation/core/OccluderBody.d.ts +57 -0
- package/src/engine/sound/simulation/core/OccluderBody.d.ts.map +1 -0
- package/src/engine/sound/simulation/core/OccluderBody.js +74 -0
- package/src/engine/sound/simulation/core/OcclusionSolver.d.ts +29 -0
- package/src/engine/sound/simulation/core/OcclusionSolver.d.ts.map +1 -0
- package/src/engine/sound/simulation/core/OcclusionSolver.js +119 -0
- package/src/engine/sound/simulation/core/RayHit.d.ts +42 -0
- package/src/engine/sound/simulation/core/RayHit.d.ts.map +1 -0
- package/src/engine/sound/simulation/core/RayHit.js +50 -0
- package/src/engine/sound/simulation/core/VolumeField.d.ts +55 -0
- package/src/engine/sound/simulation/core/VolumeField.d.ts.map +1 -0
- package/src/engine/sound/simulation/core/VolumeField.js +145 -0
- package/src/engine/sound/simulation/definition/AcousticDirectivity.d.ts +75 -0
- package/src/engine/sound/simulation/definition/AcousticDirectivity.d.ts.map +1 -0
- package/src/engine/sound/simulation/definition/AcousticDirectivity.js +114 -0
- package/src/engine/sound/simulation/definition/AcousticDirectivitySerializationAdapter.d.ts +23 -0
- package/src/engine/sound/simulation/definition/AcousticDirectivitySerializationAdapter.d.ts.map +1 -0
- package/src/engine/sound/simulation/definition/AcousticDirectivitySerializationAdapter.js +30 -0
- package/src/engine/sound/simulation/definition/AcousticMaterial.d.ts +61 -0
- package/src/engine/sound/simulation/definition/AcousticMaterial.d.ts.map +1 -0
- package/src/engine/sound/simulation/definition/AcousticMaterial.js +122 -0
- package/src/engine/sound/simulation/definition/AcousticMaterialSerializationAdapter.d.ts +23 -0
- package/src/engine/sound/simulation/definition/AcousticMaterialSerializationAdapter.d.ts.map +1 -0
- package/src/engine/sound/simulation/definition/AcousticMaterialSerializationAdapter.js +32 -0
- package/src/engine/sound/simulation/ecs/AcousticBody.d.ts +39 -0
- package/src/engine/sound/simulation/ecs/AcousticBody.d.ts.map +1 -0
- package/src/engine/sound/simulation/ecs/AcousticBody.js +48 -0
- package/src/engine/sound/simulation/ecs/AcousticBodySerializationAdapter.d.ts +24 -0
- package/src/engine/sound/simulation/ecs/AcousticBodySerializationAdapter.d.ts.map +1 -0
- package/src/engine/sound/simulation/ecs/AcousticBodySerializationAdapter.js +34 -0
- package/src/engine/sound/simulation/ecs/AcousticProbeFieldSystem.d.ts +39 -0
- package/src/engine/sound/simulation/ecs/AcousticProbeFieldSystem.d.ts.map +1 -0
- package/src/engine/sound/simulation/ecs/AcousticProbeFieldSystem.js +64 -0
- package/src/engine/sound/simulation/ecs/AcousticSimulationSystem.d.ts +44 -0
- package/src/engine/sound/simulation/ecs/AcousticSimulationSystem.d.ts.map +1 -0
- package/src/engine/sound/simulation/ecs/AcousticSimulationSystem.js +75 -0
- package/src/engine/sound/simulation/ecs/AcousticVolume.d.ts +53 -0
- package/src/engine/sound/simulation/ecs/AcousticVolume.d.ts.map +1 -0
- package/src/engine/sound/simulation/ecs/AcousticVolume.js +74 -0
- package/src/engine/sound/simulation/ecs/AcousticVolumeSerializationAdapter.d.ts +25 -0
- package/src/engine/sound/simulation/ecs/AcousticVolumeSerializationAdapter.d.ts.map +1 -0
- package/src/engine/sound/simulation/ecs/AcousticVolumeSerializationAdapter.js +37 -0
- package/src/engine/sound/simulation/ecs/AcousticVolumeSystem.d.ts +39 -0
- package/src/engine/sound/simulation/ecs/AcousticVolumeSystem.d.ts.map +1 -0
- package/src/engine/sound/simulation/ecs/AcousticVolumeSystem.js +66 -0
- package/src/engine/sound/simulation/probe/AcousticProbeField.d.ts +245 -0
- package/src/engine/sound/simulation/probe/AcousticProbeField.d.ts.map +1 -0
- package/src/engine/sound/simulation/probe/AcousticProbeField.js +574 -0
- package/src/engine/sound/simulation/probe/AcousticProbeFieldSerializationAdapter.d.ts +24 -0
- package/src/engine/sound/simulation/probe/AcousticProbeFieldSerializationAdapter.d.ts.map +1 -0
- package/src/engine/sound/simulation/probe/AcousticProbeFieldSerializationAdapter.js +60 -0
- package/src/engine/sound/simulation/probe/ProbeFieldPathingSolution.d.ts +48 -0
- package/src/engine/sound/simulation/probe/ProbeFieldPathingSolution.d.ts.map +1 -0
- package/src/engine/sound/simulation/probe/ProbeFieldPathingSolution.js +64 -0
- package/src/engine/sound/simulation/probe/ProbeVisibilityRecheck.d.ts +51 -0
- package/src/engine/sound/simulation/probe/ProbeVisibilityRecheck.d.ts.map +1 -0
- package/src/engine/sound/simulation/probe/ProbeVisibilityRecheck.js +137 -0
- package/src/engine/sound/simulation/probe/acoustic_probe_transfer.d.ts +29 -0
- package/src/engine/sound/simulation/probe/acoustic_probe_transfer.d.ts.map +1 -0
- package/src/engine/sound/simulation/probe/acoustic_probe_transfer.js +99 -0
- package/src/engine/sound/simulation/probe/acoustic_trace_energy.d.ts +46 -0
- package/src/engine/sound/simulation/probe/acoustic_trace_energy.d.ts.map +1 -0
- package/src/engine/sound/simulation/probe/acoustic_trace_energy.js +136 -0
- package/src/engine/sound/simulation/probe/bakeProbeField.d.ts +50 -0
- package/src/engine/sound/simulation/probe/bakeProbeField.d.ts.map +1 -0
- package/src/engine/sound/simulation/probe/bakeProbeField.js +169 -0
- package/src/engine/sound/simulation/probe/bakeProbeReflectors.d.ts +15 -0
- package/src/engine/sound/simulation/probe/bakeProbeReflectors.d.ts.map +1 -0
- package/src/engine/sound/simulation/probe/bakeProbeReflectors.js +108 -0
- package/src/engine/sound/simulation/probe/bakeReverbBands.d.ts +32 -0
- package/src/engine/sound/simulation/probe/bakeReverbBands.d.ts.map +1 -0
- package/src/engine/sound/simulation/probe/bakeReverbBands.js +114 -0
- package/src/engine/sound/simulation/probe/bakeVisibility.d.ts +48 -0
- package/src/engine/sound/simulation/probe/bakeVisibility.d.ts.map +1 -0
- package/src/engine/sound/simulation/probe/bakeVisibility.js +178 -0
- package/src/engine/sound/simulation/probe/echogram_band_rt60.d.ts +17 -0
- package/src/engine/sound/simulation/probe/echogram_band_rt60.d.ts.map +1 -0
- package/src/engine/sound/simulation/probe/echogram_band_rt60.js +83 -0
- package/src/engine/sound/simulation/probe/probe_delaunay_edges.d.ts +23 -0
- package/src/engine/sound/simulation/probe/probe_delaunay_edges.d.ts.map +1 -0
- package/src/engine/sound/simulation/probe/probe_delaunay_edges.js +215 -0
- package/src/engine/sound/simulation/probe/probe_densify_portals.d.ts +35 -0
- package/src/engine/sound/simulation/probe/probe_densify_portals.d.ts.map +1 -0
- package/src/engine/sound/simulation/probe/probe_densify_portals.js +143 -0
- package/src/engine/sound/simulation/probe/probe_detect_portals.d.ts +32 -0
- package/src/engine/sound/simulation/probe/probe_detect_portals.d.ts.map +1 -0
- package/src/engine/sound/simulation/probe/probe_detect_portals.js +196 -0
- package/src/engine/sound/simulation/probe/probe_edge_visible.d.ts +16 -0
- package/src/engine/sound/simulation/probe/probe_edge_visible.d.ts.map +1 -0
- package/src/engine/sound/simulation/probe/probe_edge_visible.js +41 -0
- package/src/engine/sound/simulation/probe/probe_place_sdf_cover.d.ts +28 -0
- package/src/engine/sound/simulation/probe/probe_place_sdf_cover.d.ts.map +1 -0
- package/src/engine/sound/simulation/probe/probe_place_sdf_cover.js +82 -0
- package/src/engine/sound/simulation/probe/probe_refine_connectivity.d.ts +26 -0
- package/src/engine/sound/simulation/probe/probe_refine_connectivity.d.ts.map +1 -0
- package/src/engine/sound/simulation/probe/probe_refine_connectivity.js +181 -0
- package/src/engine/sound/simulation/probe/probe_sdf_grid.d.ts +100 -0
- package/src/engine/sound/simulation/probe/probe_sdf_grid.d.ts.map +1 -0
- package/src/engine/sound/simulation/probe/probe_sdf_grid.js +183 -0
- package/src/engine/sound/simulation/probe/probe_visibility_augment.d.ts +30 -0
- package/src/engine/sound/simulation/probe/probe_visibility_augment.d.ts.map +1 -0
- package/src/engine/sound/simulation/probe/probe_visibility_augment.js +182 -0
- package/src/engine/sound/simulation/probe/probe_visibility_bridge_components.d.ts +31 -0
- package/src/engine/sound/simulation/probe/probe_visibility_bridge_components.d.ts.map +1 -0
- package/src/engine/sound/simulation/probe/probe_visibility_bridge_components.js +166 -0
- package/src/engine/sound/simulation/prototypeAcousticSolver.d.ts +2 -0
- package/src/engine/sound/simulation/prototypeAcousticSolver.d.ts.map +1 -0
- package/src/engine/sound/simulation/prototypeAcousticSolver.js +1652 -0
- package/src/engine/sound/simulation/render/FoaProbeReverbRenderer.d.ts +80 -0
- package/src/engine/sound/simulation/render/FoaProbeReverbRenderer.d.ts.map +1 -0
- package/src/engine/sound/simulation/render/FoaProbeReverbRenderer.js +354 -0
- package/src/engine/sound/simulation/render/ProbeReverbRenderer.d.ts +75 -0
- package/src/engine/sound/simulation/render/ProbeReverbRenderer.d.ts.map +1 -0
- package/src/engine/sound/simulation/render/ProbeReverbRenderer.js +231 -0
- package/src/engine/sound/simulation/render/foaReverbImpulseResponse.d.ts +37 -0
- package/src/engine/sound/simulation/render/foaReverbImpulseResponse.d.ts.map +1 -0
- package/src/engine/sound/simulation/render/foaReverbImpulseResponse.js +113 -0
- package/src/engine/sound/simulation/render/reverbImpulseResponse.d.ts +26 -0
- package/src/engine/sound/simulation/render/reverbImpulseResponse.d.ts.map +1 -0
- package/src/engine/sound/simulation/render/reverbImpulseResponse.js +76 -0
- package/src/engine/sound/simulation/serialization/populateAcousticSerializationRegistry.d.ts +10 -0
- package/src/engine/sound/simulation/serialization/populateAcousticSerializationRegistry.d.ts.map +1 -0
- package/src/engine/sound/simulation/serialization/populateAcousticSerializationRegistry.js +25 -0
- package/src/engine/sound/sopra/SopraEngine.d.ts +6 -0
- package/src/engine/sound/sopra/SopraEngine.d.ts.map +1 -1
- package/src/engine/sound/sopra/SopraEngine.js +9 -0
- package/src/engine/sound/sopra/definition/EventDescription.d.ts +3 -0
- package/src/engine/sound/sopra/definition/EventDescription.d.ts.map +1 -1
- package/src/engine/sound/sopra/definition/EventDescription.js +4 -1
- package/src/engine/sound/sopra/runtime/BusGraph.d.ts +7 -0
- package/src/engine/sound/sopra/runtime/BusGraph.d.ts.map +1 -1
- package/src/engine/sound/sopra/runtime/BusGraph.js +16 -0
- package/src/engine/sound/sopra/runtime/EventInstance.d.ts +46 -2
- package/src/engine/sound/sopra/runtime/EventInstance.d.ts.map +1 -1
- package/src/engine/sound/sopra/runtime/EventInstance.js +240 -4
- package/src/engine/sound/sopra/util/MockAudioContext.d.ts +4 -0
- package/src/engine/sound/sopra/util/MockAudioContext.d.ts.map +1 -1
- package/src/engine/sound/sopra/util/MockAudioContext.js +9 -0
- package/src/engine/ui/tiles2d/computeTileGridMove.js +2 -2
- package/src/generation/filtering/numeric/complex/CellFilterAngleToNormal.js +2 -2
- package/src/view/elements/progress/RectangularPieProgressView.d.ts.map +1 -1
- package/src/view/elements/progress/RectangularPieProgressView.js +6 -8
- package/src/view/tooltip/TooltipView.js +2 -2
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_overlaps_aabb.d.ts +0 -9
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_overlaps_aabb.d.ts.map +0 -1
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_overlaps_capsule.d.ts.map +0 -1
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_overlaps_frustum.d.ts +0 -9
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_overlaps_frustum.d.ts.map +0 -1
- package/src/core/bvh2/bvh3/query/bvh_query_user_data_overlaps_sphere.d.ts.map +0 -1
- package/src/core/geom/3d/normal/lamber_azimuth/transform.d.ts +0 -18
- package/src/core/geom/3d/normal/lamber_azimuth/transform.d.ts.map +0 -1
- package/src/core/geom/3d/normal/spherical/sphere_map_transform.d.ts.map +0 -1
- package/src/core/geom/3d/normal/spherical/sphere_map_transform.js +0 -77
- package/src/core/geom/3d/tetrahedra/triangle/triangle_encode_rasterized_depth.d.ts +0 -9
- package/src/core/geom/3d/tetrahedra/triangle/triangle_encode_rasterized_depth.d.ts.map +0 -1
- package/src/core/geom/3d/topology/simplify/collapseEdge.d.ts +0 -21
- package/src/core/geom/3d/topology/simplify/collapseEdge.d.ts.map +0 -1
- package/src/core/geom/3d/topology/simplify/quadratic/build_vertex_quadratics.d.ts +0 -25
- package/src/core/geom/3d/topology/simplify/quadratic/build_vertex_quadratics.d.ts.map +0 -1
- package/src/core/geom/3d/topology/simplify/quadratic/build_vertex_quadratics.js +0 -177
- package/src/engine/navigation/mesh/bt_mesh_face_find_path.d.ts.map +0 -1
- package/src/engine/navigation/mesh/bt_mesh_face_find_path_polyanya.d.ts.map +0 -1
- package/src/engine/navigation/mesh/build/bvh_build_from_unindexed_triangles.d.ts.map +0 -1
- package/src/engine/navigation/mesh/bvh_build_from_bt_mesh.d.ts +0 -7
- package/src/engine/navigation/mesh/bvh_build_from_bt_mesh.d.ts.map +0 -1
- package/src/engine/navigation/mesh/bvh_query_nearest_face.d.ts.map +0 -1
- package/src/engine/navigation/mesh/bvh_segment_penetrates_mesh.d.ts.map +0 -1
- package/src/engine/navigation/mesh/funnel_string_pull.d.ts.map +0 -1
- /package/src/{engine/navigation/mesh/build → core/bvh2/bvh3}/bvh_build_from_unindexed_triangles.d.ts +0 -0
- /package/src/{engine/navigation/mesh/build → core/bvh2/bvh3}/bvh_build_from_unindexed_triangles.js +0 -0
- /package/src/{engine/navigation/mesh → core/geom/3d}/funnel_string_pull.d.ts +0 -0
- /package/src/{engine/navigation/mesh → core/geom/3d/topology/struct/binary/query}/bt_mesh_face_find_path.d.ts +0 -0
- /package/src/{engine/navigation/mesh → core/geom/3d/topology/struct/binary/query}/bt_mesh_face_find_path_polyanya.d.ts +0 -0
|
@@ -0,0 +1,1652 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BoxGeometry,
|
|
3
|
+
BufferGeometry,
|
|
4
|
+
Float32BufferAttribute,
|
|
5
|
+
LineBasicMaterial,
|
|
6
|
+
MeshStandardMaterial,
|
|
7
|
+
SphereGeometry
|
|
8
|
+
} from "three";
|
|
9
|
+
import { Ray3 } from "../../../core/geom/3d/ray/Ray3.js";
|
|
10
|
+
import { BoxShape3D } from "../../../core/geom/3d/shape/BoxShape3D.js";
|
|
11
|
+
import { CapsuleShape3D } from "../../../core/geom/3d/shape/CapsuleShape3D.js";
|
|
12
|
+
import { TransformedShape3D } from "../../../core/geom/3d/shape/TransformedShape3D.js";
|
|
13
|
+
import { Quaternion } from "../../../core/geom/Quaternion.js";
|
|
14
|
+
import Vector3 from "../../../core/geom/Vector3.js";
|
|
15
|
+
import { interpolate_irradiance_smith } from "../../../core/math/physics/irradiance/interpolate_irradiance_smith.js";
|
|
16
|
+
import { seededRandom } from "../../../core/math/random/seededRandom.js";
|
|
17
|
+
import { FirstPersonPlayerController } from "../../control/first-person/FirstPersonPlayerController.js";
|
|
18
|
+
import { FirstPersonPlayerControllerSystem } from "../../control/first-person/FirstPersonPlayerControllerSystem.js";
|
|
19
|
+
import { FirstPersonSensorsSystem } from "../../control/first-person/sensors/FirstPersonSensorsSystem.js";
|
|
20
|
+
import { SerializationMetadata } from "../../ecs/components/SerializationMetadata.js";
|
|
21
|
+
import { Tag } from "../../ecs/components/Tag.js";
|
|
22
|
+
import Entity from "../../ecs/Entity.js";
|
|
23
|
+
import { System } from "../../ecs/System.js";
|
|
24
|
+
import { Transform } from "../../ecs/transform/Transform.js";
|
|
25
|
+
import { EngineHarness } from "../../EngineHarness.js";
|
|
26
|
+
import { CameraSystem } from "../../graphics/ecs/camera/CameraSystem.js";
|
|
27
|
+
import { Light } from "../../graphics/ecs/light/Light.js";
|
|
28
|
+
import { DrawMode } from "../../graphics/ecs/mesh-v2/DrawMode.js";
|
|
29
|
+
import { ShadedGeometry } from "../../graphics/ecs/mesh-v2/ShadedGeometry.js";
|
|
30
|
+
import { ShadedGeometryFlags } from "../../graphics/ecs/mesh-v2/ShadedGeometryFlags.js";
|
|
31
|
+
import { ShadedGeometrySystem } from "../../graphics/ecs/mesh-v2/ShadedGeometrySystem.js";
|
|
32
|
+
import {
|
|
33
|
+
AmbientOcclusionPostProcessEffect
|
|
34
|
+
} from "../../graphics/render/buffer/simple-fx/ao/AmbientOcclusionPostProcessEffect.js";
|
|
35
|
+
import { bake_lightmap_for_scene } from "../../graphics/sh3/lightmap/bake_lightmap_for_scene.js";
|
|
36
|
+
import { setup_environment_sky_from_ecd } from "../../graphics/sh3/sky/hosek/setup_environment_sky_from_ecd.js";
|
|
37
|
+
import {
|
|
38
|
+
sampler2d_sample_equirectangular_direction
|
|
39
|
+
} from "../../graphics/texture/sampler/sampler2d_sample_equirectangular_direction.js";
|
|
40
|
+
import InputController from "../../input/ecs/components/InputController.js";
|
|
41
|
+
import InputControllerSystem from "../../input/ecs/systems/InputControllerSystem.js";
|
|
42
|
+
import { BodyKind } from "../../physics/ecs/BodyKind.js";
|
|
43
|
+
import { Collider } from "../../physics/ecs/Collider.js";
|
|
44
|
+
import { ColliderObserverSystem } from "../../physics/ecs/ColliderObserverSystem.js";
|
|
45
|
+
import { PhysicsSystem } from "../../physics/ecs/PhysicsSystem.js";
|
|
46
|
+
import { RigidBody } from "../../physics/ecs/RigidBody.js";
|
|
47
|
+
import { PhysicsSurfacePoint } from "../../physics/queries/PhysicsSurfacePoint.js";
|
|
48
|
+
import { AudioEmitter } from "../ecs/audio/AudioEmitter.js";
|
|
49
|
+
import { AudioEmitterSystem } from "../ecs/audio/AudioEmitterSystem.js";
|
|
50
|
+
import SoundListener from "../ecs/SoundListener.js";
|
|
51
|
+
import SoundListenerSystem from "../ecs/SoundListenerSystem.js";
|
|
52
|
+
import { SampleAudioClip } from "../sopra/definition/clip/SampleAudioClip.js";
|
|
53
|
+
import { EventDescription } from "../sopra/definition/EventDescription.js";
|
|
54
|
+
import { buildAttenuationCurve } from "../sopra/util/buildAttenuationCurve.js";
|
|
55
|
+
import { configureAcousticSimulation } from "./configureAcousticSimulation.js";
|
|
56
|
+
import { AcousticMaterial } from "./definition/AcousticMaterial.js";
|
|
57
|
+
import { AcousticBody } from "./ecs/AcousticBody.js";
|
|
58
|
+
import { bakeProbeField } from "./probe/bakeProbeField.js";
|
|
59
|
+
import { FoaProbeReverbRenderer } from "./render/FoaProbeReverbRenderer.js";
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Prototype harness for the geometry-driven acoustic solver — a first-person walkaround under a Hosek sky.
|
|
63
|
+
*
|
|
64
|
+
* A platform holding TWO sealed sources with deliberately different acoustics:
|
|
65
|
+
* - a small HOUSE (orchestral loop) — a tight, dead room; leaks from its south DOOR + north WINDOW, with a
|
|
66
|
+
* hard REFLECTOR wall set back from the window that bounces its leak back at you;
|
|
67
|
+
* - a much larger CATHEDRAL (main-menu loop) west across a gap — a tall, hard stone hall with a wide main
|
|
68
|
+
* entrance, side windows, and a TOWER shaft (open to the nave) that gives a long, coupled-volume tail.
|
|
69
|
+
* Every surface is an {@link AcousticBody} occluder, so each source only escapes through its openings — the
|
|
70
|
+
* baked probe-field pathing routes it around corners and out, and the baked per-probe reverb colours the tail.
|
|
71
|
+
*
|
|
72
|
+
* What to listen for, as you walk: the house leak from its door/window (brighter near the reflector); the
|
|
73
|
+
* cathedral's long reverb through its entrance/windows; plain occlusion behind a solid wall or barrier. A
|
|
74
|
+
* RAMP on the house's east side walks you up onto its roof.
|
|
75
|
+
*
|
|
76
|
+
* Controls (same as the first-person gym):
|
|
77
|
+
* - Click the canvas to capture the mouse (pointer lock); ESC to release. The first click also resumes
|
|
78
|
+
* the (autoplay-policy-suspended) audio context, so sound starts on that click.
|
|
79
|
+
* - WASD — move Mouse — look Space — jump
|
|
80
|
+
* - P (or the top-right button) — toggle the probe + visibility-edge overlay
|
|
81
|
+
*
|
|
82
|
+
* The probe field is baked ONCE at startup against the live occluder geometry (a brief synchronous
|
|
83
|
+
* freeze — watch the console for the probe count + bake time). Tune the BAKE_* / scene constants below.
|
|
84
|
+
*
|
|
85
|
+
* @author Alex Goldring
|
|
86
|
+
* @copyright Company Named Limited (c) 2026
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
// -- Scene layout (metres; the platform is centred on the origin) --------
|
|
90
|
+
const SPAWN_X = 0;
|
|
91
|
+
const SPAWN_Z = 10; // player starts south of the house, facing it
|
|
92
|
+
|
|
93
|
+
const SRC = new Vector3(0, 1.2, 0); // the orchestral source, inside the house
|
|
94
|
+
const SRC_DIST_MIN = 3; // full volume within this radius (m)
|
|
95
|
+
const SRC_DIST_MAX = 30; // rolled off to silence by here (m)
|
|
96
|
+
|
|
97
|
+
const HOUSE_HALF = 4; // footprint half-extent (x,z ∈ [-4, 4])
|
|
98
|
+
const WALL_H = 3; // wall height
|
|
99
|
+
const WALL_T = 0.3; // wall thickness
|
|
100
|
+
const WALL_MID_Y = WALL_H / 2;
|
|
101
|
+
|
|
102
|
+
const DOOR_HALF_W = 0.7; // south wall opening: 1.4 m wide, to 2.2 m tall
|
|
103
|
+
const DOOR_H = 2.2;
|
|
104
|
+
const WIN_HALF_W = 0.9; // north wall opening: 1.8 m wide, sill 1.0 → head 2.2
|
|
105
|
+
const WIN_SILL = 1.0;
|
|
106
|
+
const WIN_HEAD = 2.2;
|
|
107
|
+
|
|
108
|
+
// -- Cathedral (a much larger, taller, more reverberant space + a tower) west of the house, across a gap.
|
|
109
|
+
// The small house is a tight, dead room; the cathedral is a big stone hall whose tall nave + a tower shaft
|
|
110
|
+
// (open to the nave through a hole in the roof) give a long, coupled-volume reverb tail — a deliberately
|
|
111
|
+
// different "echo character", à la Šibenik.
|
|
112
|
+
const CATH_X1 = -10; // east face (x=-10) is the entrance, facing the house across the gap
|
|
113
|
+
const CATH_X0 = -38; // back (west) wall — 28 m deep, ≈2× the width, a proper long nave
|
|
114
|
+
const CATH_Z0 = -9, CATH_Z1 = 9; // 28 × 18 footprint
|
|
115
|
+
const CATH_H = 8; // nave wall height (very tall ceiling)
|
|
116
|
+
const CATH_T = 0.4; // wall thickness
|
|
117
|
+
const CATH_ENTRY_HALF_W = 1.75; // main entrance on the east wall: 3.5 m wide, 4.5 m tall
|
|
118
|
+
const CATH_ENTRY_H = 4.5;
|
|
119
|
+
const CATH_WIN_HALF_W = 1.25; // side windows: 2.5 m wide, sill 3.5 → head 5.5
|
|
120
|
+
const CATH_WIN_SILL = 3.5, CATH_WIN_HEAD = 5.5;
|
|
121
|
+
const CATH_WIN_XS = [-15, -21, -27, -33]; // four windows per long side, spread along the longer nave
|
|
122
|
+
const TOWER_X0 = -37, TOWER_X1 = -31; // a 6 × 6 shaft centred at the BACK of the nave (z=0), rising to y=20
|
|
123
|
+
const TOWER_Z0 = -3, TOWER_Z1 = 3;
|
|
124
|
+
const TOWER_BOTTOM = CATH_H - 1; // tower walls drop 1 m below the roof so the roof seam is buried (no z-fight)
|
|
125
|
+
const TOWER_TOP = 20;
|
|
126
|
+
const JUMP_HOLE_X = -22, JUMP_HOLE_Z = 0, JUMP_HOLE_HALF = 1.0; // a 2×2 m hole in the roof to drop through
|
|
127
|
+
|
|
128
|
+
const CATH_SRC = new Vector3(-28, 1.5, 0); // the MainMenu source, deep in the longer nave
|
|
129
|
+
const CATH_SRC_DIST_MIN = 4;
|
|
130
|
+
const CATH_SRC_DIST_MAX = 46; // the long hall carries further than the house source
|
|
131
|
+
|
|
132
|
+
// -- A free-standing wall opposite the house's WINDOW (north face, z=-4), set back far enough to walk between
|
|
133
|
+
// it and the window — a hard REFLECTOR that bounces the window's leaked sound back (a baked early-reflection).
|
|
134
|
+
const REFLECTOR_Z = -12; // 8 m north of the window
|
|
135
|
+
const REFLECTOR_HALF_W = 6; // 12 m wide, x ∈ [-6, 6]
|
|
136
|
+
const REFLECTOR_H = 4;
|
|
137
|
+
|
|
138
|
+
// -- Ramps: ground → house roof (east), and house roof → cathedral roof (over the gap). The prototype's
|
|
139
|
+
// ground resolver snaps the player to whatever surface is underfoot, so any angle is walkable.
|
|
140
|
+
const ROOF_TOP = WALL_H + WALL_T; // the house roof's walking surface (y)
|
|
141
|
+
|
|
142
|
+
// -- Bake (offline probe field, for corner-leak pathing) -----------------
|
|
143
|
+
// bakeProbeField derives its region from the scene (the occluder hull + a margin) — no bounds to configure.
|
|
144
|
+
// minSpacing dominates the one-off startup bake: this big scene is ~400 probes (≈60 s) at spacing 3 but ~200
|
|
145
|
+
// (≈10 s) at spacing 4, because the visibility/portal/lobe passes scale super-linearly in probe count (the
|
|
146
|
+
// reverb ray count barely moves it). 4 keeps the bake tolerable; drop to 3 for finer pathing if you'll wait.
|
|
147
|
+
const BAKE_MIN_SPACING = 2; // probe density hint (m)
|
|
148
|
+
const BAKE_REVERB_RAYS = 1024; // rays/probe for the per-band reverb (cheap at this probe count — keep it high)
|
|
149
|
+
|
|
150
|
+
// Fully-blocking, mildly absorptive surfaces — so the door/window leak is the ONLY exit and the pathing
|
|
151
|
+
// is unambiguous (a tiny transmission would muddy "is this leak or through-wall?").
|
|
152
|
+
const WALL_MATERIAL = AcousticMaterial.from({
|
|
153
|
+
absorption: [0.1, 0.15, 0.25],
|
|
154
|
+
scattering: 0.3,
|
|
155
|
+
transmission: [0.1, 0.02, 0],
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
// The ground platform is an acoustic occluder too — this is load-bearing for the probe bake. WITHOUT a
|
|
159
|
+
// floor in the occluder index the SDF cover treats the y=0 voxel layer as open air and drops ~half the
|
|
160
|
+
// probes onto the ground; visibility rays between two ground probes then graze UNDER the walls (whose
|
|
161
|
+
// bottoms sit at y=0), so inside connects to outside and occlusion is lost. With the floor, probes lift
|
|
162
|
+
// into the wall band and the leak is forced through the door/window. (See demo_scene_probe_placement.spec.js
|
|
163
|
+
// — no-floor: inside→behind-the-east-wall is a near-straight 9 m leak; with-floor: a 19 m detour.) Ground-
|
|
164
|
+
// like absorption (a touch deader + more scattering than the walls).
|
|
165
|
+
const GROUND_MATERIAL = AcousticMaterial.from({
|
|
166
|
+
absorption: [0.3, 0.35, 0.4],
|
|
167
|
+
scattering: 0.7,
|
|
168
|
+
transmission: [0, 0, 0],
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
// Hard, lightly-absorptive STONE for the cathedral — a much longer reverberation tail than the deader house
|
|
172
|
+
// walls (low absorption = little energy lost per bounce → high RT60 in the big tall volume).
|
|
173
|
+
const CATHEDRAL_MATERIAL = AcousticMaterial.from({
|
|
174
|
+
absorption: [0.04, 0.06, 0.1],
|
|
175
|
+
scattering: 0.25,
|
|
176
|
+
transmission: [0.1, 0, 0],
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
// A near-rigid REFLECTOR — almost nothing absorbed, almost no scatter → a clean specular bounce of the window's
|
|
180
|
+
// leaked sound back toward the listener.
|
|
181
|
+
const REFLECTOR_MATERIAL = AcousticMaterial.from({
|
|
182
|
+
absorption: [0.02, 0.03, 0.05],
|
|
183
|
+
scattering: 0.1,
|
|
184
|
+
transmission: [0, 0, 0],
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
// -- A small 3×3 reverb-chamber shack in the open SE: a door (west face) and NO windows. A low, hard little
|
|
188
|
+
// box → a bright, ringy small-room tail, isolated from the rest for an A/B against the big stone cathedral.
|
|
189
|
+
const SHACK_X = 13, SHACK_Z = -13; // clear of the barrier (13,5), the SE block (8,-10) and the reflector
|
|
190
|
+
const SHACK_HALF = 1.5; // 3 × 3 footprint
|
|
191
|
+
const SHACK_H = 2.6, SHACK_T = 0.25;
|
|
192
|
+
const SHACK_DOOR_HALF = 0.5, SHACK_DOOR_H = 2.0; // a 1 m doorway on the west wall (faces the scene)
|
|
193
|
+
|
|
194
|
+
// -- Operable sliding doors (house south DOOR + cathedral east ENTRANCE). They START open (slab slid down into
|
|
195
|
+
// the ground, opening clear); pressing E within range slides it back UP to fill the opening (closed) and down
|
|
196
|
+
// again (open). The slab is a KinematicPosition body AND an AcousticBody, so its occlusion follows it live (the
|
|
197
|
+
// occluder index re-syncs on transform change) — closed it seals the opening, open it clears it.
|
|
198
|
+
const DOOR_T = 0.2; // door slab thickness (sits within the opening)
|
|
199
|
+
const DOOR_SLIDE_SPEED = 3.0; // m/s vertical travel
|
|
200
|
+
const DOOR_OPEN_CLEARANCE = 0.2; // extra drop when open, so the lowered slab's top sinks clear of the floor
|
|
201
|
+
// (y=0) instead of sitting coplanar with it and z-fighting the seam
|
|
202
|
+
|
|
203
|
+
// -- Orbiting external source (WorldMode layer), circling the scene from outside ------------------------
|
|
204
|
+
const ORBIT_CLIP = "data/sounds/music/matsmusic/d1/Fiverr Alexgoldring WorldMode LAYER 1.ogg";
|
|
205
|
+
const ORBIT_CX = -12, ORBIT_CZ = 0; // scene centre (between the cathedral and the east edge)
|
|
206
|
+
const ORBIT_RADIUS = 40; // well outside the platform (x∈[-44,16], z∈[-16,16])
|
|
207
|
+
const ORBIT_HEIGHT = 5; // a touch above the walls, so line-of-sight is wall-gated
|
|
208
|
+
const ORBIT_SPEED = 0.18; // rad/s (~35 s per lap)
|
|
209
|
+
const ORBIT_DIST_MIN = 12, ORBIT_DIST_MAX = 90; // carries far — clearly audible from the centre with LoS
|
|
210
|
+
|
|
211
|
+
// -- Baked indirect lighting (a single shared lightmap). Baked once at startup by path-tracing the scene's
|
|
212
|
+
// UV-atlas texels (mixed mode: indirect bounces + sky only — direct light stays realtime), so the atlas
|
|
213
|
+
// resolution + samples/texel are the bake-cost knobs. After the bake the IBL is switched off
|
|
214
|
+
// (scene.environment = null) so the baked lightmap is the only indirect light — the sky stays as the backdrop.
|
|
215
|
+
//
|
|
216
|
+
// Unlike the old probe volume there are NO bounds to tune: the charter derives the atlas from the geometry
|
|
217
|
+
// itself, so every ShadedGeometry surface is covered. The bake rewrites each mesh with a uv2 channel and points
|
|
218
|
+
// its material at the shared lightmap; the acoustic occluder/collider shapes are untouched (lightmap is visuals
|
|
219
|
+
// only), so the acoustic simulation is unaffected.
|
|
220
|
+
const LIGHTMAP_RESOLUTION = 1024; // shared atlas size (texels per side)
|
|
221
|
+
const LIGHTMAP_SAMPLES = 1024; // hemisphere gather samples per fully-baked texel
|
|
222
|
+
const LIGHTMAP_MAX_BOUNCE = 4; // path-tracer maximum bounce depth
|
|
223
|
+
|
|
224
|
+
// -- Point lights co-located with each emissive source marker (a warm/cool glow in its room) -----------
|
|
225
|
+
const SOURCE_LIGHT_INTENSITY = 6, SOURCE_LIGHT_DISTANCE = 12;
|
|
226
|
+
|
|
227
|
+
// Wired in the configuration callback (needs the EngineConfiguration); baked against in main().
|
|
228
|
+
let acousticSim = null;
|
|
229
|
+
|
|
230
|
+
// The graphics MaterialManager, captured at the top of main(). Every lit scene material is obtained THROUGH it
|
|
231
|
+
// (see litMaterial) so the engine's registered compile-steps patch it — in particular the forward+ clustered-
|
|
232
|
+
// lighting transformer (registered by the LightSystem's forward+ plugin), which is what makes the per-source
|
|
233
|
+
// POINT lights actually illuminate a surface. A bare `new MeshStandardMaterial(...)` skips the compile chain and
|
|
234
|
+
// so receives NO clustered (point/spot) lighting — only the directional sun.
|
|
235
|
+
let materialManager = null;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* A managed lit material: routed through the {@link MaterialManager} so every registered compile-step patches it
|
|
239
|
+
* — notably the forward+ clustered-lighting transformer, so the per-source POINT lights light it. Use this for
|
|
240
|
+
* every lit surface instead of a bare `new MeshStandardMaterial`. The baked lightmap is applied on top by
|
|
241
|
+
* {@link bake_lightmap_for_scene}, which sets `material.lightMap` on the obtained material directly.
|
|
242
|
+
*
|
|
243
|
+
* @param {object} params MeshStandardMaterial parameters (color, roughness, emissive, …)
|
|
244
|
+
* @returns {MeshStandardMaterial} the managed (compiled) material to hand to {@link ShadedGeometry.from}
|
|
245
|
+
*/
|
|
246
|
+
function litMaterial(params) {
|
|
247
|
+
const mat = new MeshStandardMaterial(params);
|
|
248
|
+
return materialManager === null ? mat : materialManager.obtain(mat).getValue();
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
const eh = new EngineHarness();
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Wire the sound + acoustic systems into the engine config. Runs inside {@link EngineHarness.initialize}
|
|
255
|
+
* (which owns the `EngineConfiguration` and `engine.sound` / `engine.assetManager`), before the world is
|
|
256
|
+
* built in {@link main}. `configureAcousticSimulation` needs the config, so it lives here rather than in
|
|
257
|
+
* main()'s `em.addSystem` flow.
|
|
258
|
+
*
|
|
259
|
+
* @param {EngineConfiguration} config
|
|
260
|
+
* @param {Engine} engine
|
|
261
|
+
*/
|
|
262
|
+
function setupSound(config, engine) {
|
|
263
|
+
// Native sopra-backed emitter system. acousticSim is injected by configureAcousticSimulation below,
|
|
264
|
+
// so it is constructed WITHOUT the 4th arg.
|
|
265
|
+
const audioEmitterSystem = new AudioEmitterSystem(engine.assetManager, engine.sound);
|
|
266
|
+
config.addSystem(audioEmitterSystem);
|
|
267
|
+
|
|
268
|
+
// Registers AcousticSimulationSystem (occluders) + AcousticVolumeSystem (media) +
|
|
269
|
+
// AcousticProbeFieldSystem (the baked field), all sharing one simulator, and sets
|
|
270
|
+
// audioEmitterSystem.acousticSim = simulator.
|
|
271
|
+
acousticSim = configureAcousticSimulation(config, audioEmitterSystem);
|
|
272
|
+
acousticSim.rayCount = 32; // a touch crisper occlusion than the default 16
|
|
273
|
+
acousticSim.pathing = false; // corner-leak through the door/window (needs the baked field, set in main)
|
|
274
|
+
|
|
275
|
+
// Poses the WebAudio listener from a SoundListener+Transform entity (the player, built in main).
|
|
276
|
+
config.addSystem(new SoundListenerSystem(engine.sound.context));
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
const _skyScratch = new Float32Array(4);
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* A path-tracer background sampler over the Hosek sky equirectangular texture, by ray direction (+Y up). The
|
|
283
|
+
* lightmap baker's path tracer otherwise has a BLACK background ({@link PathTracedScene} default), so without
|
|
284
|
+
* this the bake captures only the sun bouncing off surfaces — no sky-dome fill. It samples the SAME sharp sky
|
|
285
|
+
* texture the renderer applies, so the baked GI matches the visible sky.
|
|
286
|
+
*
|
|
287
|
+
* @param {THREE.DataTexture} skyTexture equirectangular Float32 RGBA sky (the return of setup_environment_sky_from_ecd)
|
|
288
|
+
* @returns {function(out:number[], out_offset:number, direction:number[], direction_offset:number): void}
|
|
289
|
+
*/
|
|
290
|
+
function makeSkyBackgroundSampler(skyTexture) {
|
|
291
|
+
const sampler = {
|
|
292
|
+
width: skyTexture.image.width,
|
|
293
|
+
height: skyTexture.image.height,
|
|
294
|
+
itemSize: 4, // RGBA Float32
|
|
295
|
+
data: skyTexture.image.data,
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
return (out, out_offset, direction, direction_offset) => {
|
|
299
|
+
sampler2d_sample_equirectangular_direction(
|
|
300
|
+
sampler,
|
|
301
|
+
direction[direction_offset], direction[direction_offset + 1], direction[direction_offset + 2],
|
|
302
|
+
_skyScratch, 0);
|
|
303
|
+
out[out_offset] = _skyScratch[0];
|
|
304
|
+
out[out_offset + 1] = _skyScratch[1];
|
|
305
|
+
out[out_offset + 2] = _skyScratch[2];
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Bake a single shared lightmap against the now-populated scene ({@link bake_lightmap_for_scene} charts every
|
|
311
|
+
* {@link ShadedGeometry} into one UV atlas and path-traces its texels — {@link LIGHTMAP_RESOLUTION} +
|
|
312
|
+
* {@link LIGHTMAP_SAMPLES} drive the cost), overriding the baker's default procedural sky with the Hosek SKY as
|
|
313
|
+
* its background radiance so the baked sky-dome fill matches the visible sky. The bake rewrites each mesh with a
|
|
314
|
+
* uv2 channel and points its material at the shared lightmap, so it lights itself once the texels resolve. Then
|
|
315
|
+
* switch the IBL OFF (`scene.environment = null`) so the baked lightmap is the only indirect light; the sky
|
|
316
|
+
* stays as the visible backdrop (`scene.background`).
|
|
317
|
+
*
|
|
318
|
+
* @param {Engine} engine
|
|
319
|
+
* @param {EntityComponentDataset} ecd
|
|
320
|
+
* @param {THREE.DataTexture} skyTexture the equirectangular sky to sample as the bake's background radiance
|
|
321
|
+
*/
|
|
322
|
+
async function bakeLightmap(engine, ecd, skyTexture) {
|
|
323
|
+
const group = bake_lightmap_for_scene({
|
|
324
|
+
ecd,
|
|
325
|
+
lightmap_resolution: LIGHTMAP_RESOLUTION,
|
|
326
|
+
samples_per_texel: LIGHTMAP_SAMPLES,
|
|
327
|
+
max_bounce: LIGHTMAP_MAX_BOUNCE,
|
|
328
|
+
// Sample the Hosek sky as the bake's background (its default is the procedural RTIW sky) — escaped rays
|
|
329
|
+
// then return the SAME sky the renderer shows, so the baked fill matches the visible sky.
|
|
330
|
+
background: makeSkyBackgroundSampler(skyTexture),
|
|
331
|
+
});
|
|
332
|
+
|
|
333
|
+
// Run the bake on the executor (incremental — the partial atlas uploads each cycle) and wait for it to finish.
|
|
334
|
+
// While it runs, poll the group's progress each frame to drive an unobtrusive corner progress bar + ETA.
|
|
335
|
+
const progress = makeBakeProgressBar();
|
|
336
|
+
const start = performance.now();
|
|
337
|
+
let running = true;
|
|
338
|
+
|
|
339
|
+
engine.executor.runGroup(group);
|
|
340
|
+
|
|
341
|
+
(function poll() {
|
|
342
|
+
if (!running) {
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
progress.set(group.computeProgress(), performance.now() - start);
|
|
346
|
+
requestAnimationFrame(poll);
|
|
347
|
+
})();
|
|
348
|
+
|
|
349
|
+
await group.promise();
|
|
350
|
+
|
|
351
|
+
running = false;
|
|
352
|
+
progress.remove();
|
|
353
|
+
|
|
354
|
+
engine.graphics.scene.environment = null; // IBL off — only the baked lightmap contributes indirect light now
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* A small, unobtrusive lightmap-bake progress bar pinned to the bottom-left corner, showing percent done + a
|
|
359
|
+
* live ETA. The ETA is a linear extrapolation from elapsed time (`elapsed × (1 − p) / p`), reading "estimating…"
|
|
360
|
+
* until there is enough progress to extrapolate. Returns a handle to drive + dismiss it.
|
|
361
|
+
*
|
|
362
|
+
* @returns {{set: function(fraction:number, elapsedMs:number): void, remove: function(): void}}
|
|
363
|
+
*/
|
|
364
|
+
function makeBakeProgressBar() {
|
|
365
|
+
const container = document.createElement("div");
|
|
366
|
+
Object.assign(container.style, {
|
|
367
|
+
position: "absolute", left: "10px", bottom: "10px", zIndex: "1000",
|
|
368
|
+
width: "210px", padding: "8px 10px",
|
|
369
|
+
font: "12px sans-serif", color: "#cfe6ff",
|
|
370
|
+
background: "rgba(18,26,34,0.85)", border: "1px solid #3a6ea5", borderRadius: "4px",
|
|
371
|
+
pointerEvents: "none", userSelect: "none",
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
const label = document.createElement("div");
|
|
375
|
+
label.style.marginBottom = "6px";
|
|
376
|
+
label.style.letterSpacing = "0.3px";
|
|
377
|
+
label.textContent = "Baking lightmap…";
|
|
378
|
+
|
|
379
|
+
const track = document.createElement("div");
|
|
380
|
+
Object.assign(track.style, {
|
|
381
|
+
height: "6px", width: "100%", background: "rgba(255,255,255,0.12)", borderRadius: "3px", overflow: "hidden",
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
const fill = document.createElement("div");
|
|
385
|
+
Object.assign(fill.style, { height: "100%", width: "0%", background: "#5fa8ff", transition: "width 0.1s linear" });
|
|
386
|
+
|
|
387
|
+
track.appendChild(fill);
|
|
388
|
+
container.appendChild(label);
|
|
389
|
+
container.appendChild(track);
|
|
390
|
+
document.body.appendChild(container);
|
|
391
|
+
|
|
392
|
+
return {
|
|
393
|
+
set(fraction, elapsedMs) {
|
|
394
|
+
const p = Math.max(0, Math.min(1, fraction));
|
|
395
|
+
fill.style.width = `${(p * 100).toFixed(1)}%`;
|
|
396
|
+
const eta = p > 0.02 ? formatDuration((elapsedMs / p) * (1 - p)) : "estimating…";
|
|
397
|
+
label.textContent = `Baking lightmap… ${(p * 100).toFixed(0)}% · ETA ${eta}`;
|
|
398
|
+
},
|
|
399
|
+
remove() {
|
|
400
|
+
container.remove();
|
|
401
|
+
},
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/** Format a millisecond duration as a compact "Xm Ys" / "Ys" string for the bake ETA. */
|
|
406
|
+
function formatDuration(ms) {
|
|
407
|
+
const totalSeconds = Math.max(0, Math.round(ms / 1000));
|
|
408
|
+
const minutes = Math.floor(totalSeconds / 60);
|
|
409
|
+
const seconds = totalSeconds % 60;
|
|
410
|
+
return minutes > 0 ? `${minutes}m ${seconds}s` : `${seconds}s`;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
async function main(engine) {
|
|
414
|
+
const em = engine.entityManager;
|
|
415
|
+
const ecd = em.dataset;
|
|
416
|
+
|
|
417
|
+
// Capture the MaterialManager up front: every lit material is obtained through it (see litMaterial) so the
|
|
418
|
+
// engine's compile-steps patch it — notably the forward+ clustered-lighting transformer that lights surfaces
|
|
419
|
+
// with the per-source POINT lights. (That transformer is registered by the LightSystem's forward+ plugin,
|
|
420
|
+
// acquired in buildLights below; the obtain() calls happen later, as the world geometry is built.)
|
|
421
|
+
materialManager = engine.graphics.getMaterialManager();
|
|
422
|
+
|
|
423
|
+
// -- Systems ---------------------------------------------------------
|
|
424
|
+
EngineHarness.addFpsCounter(engine);
|
|
425
|
+
|
|
426
|
+
await EngineHarness.buildLights({
|
|
427
|
+
engine,
|
|
428
|
+
sunIntensity: 1.0,
|
|
429
|
+
ambientIntensity: 0.0,
|
|
430
|
+
shadowmapResolution: 2048,
|
|
431
|
+
sunShadowDistance: 60,
|
|
432
|
+
});
|
|
433
|
+
|
|
434
|
+
// Hosek-Wilkie sky + image-based lighting, sun direction taken from the directional light built above.
|
|
435
|
+
// A clear-ish daytime sky (low turbidity) lit by a touch of ground bounce so the stone reads warmer.
|
|
436
|
+
const skyTexture = setup_environment_sky_from_ecd(engine.graphics, ecd, { turbidity: 2.5, albedo: [0.12, 0.11, 0.1] });
|
|
437
|
+
|
|
438
|
+
engine.plugins.acquire(AmbientOcclusionPostProcessEffect);
|
|
439
|
+
|
|
440
|
+
if (em.getSystem(CameraSystem) === null) {
|
|
441
|
+
await em.addSystem(new CameraSystem(engine.graphics));
|
|
442
|
+
}
|
|
443
|
+
if (em.getSystem(InputControllerSystem) === null) {
|
|
444
|
+
await em.addSystem(new InputControllerSystem(engine.devices));
|
|
445
|
+
}
|
|
446
|
+
if (em.getSystem(ShadedGeometrySystem) === null) {
|
|
447
|
+
await em.addSystem(new ShadedGeometrySystem(engine));
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
// Physics — owns the static occluder/floor bodies, the kinematic player capsule, and serves the
|
|
451
|
+
// first-person ground resolver's downward raycasts (added before the controller so its sensors and
|
|
452
|
+
// mover find it).
|
|
453
|
+
const physicsSystem = new PhysicsSystem();
|
|
454
|
+
await em.addSystem(physicsSystem);
|
|
455
|
+
await em.addSystem(new ColliderObserverSystem(physicsSystem));
|
|
456
|
+
|
|
457
|
+
// Per-frame mover for the orbiting source + the sliding doors, plus the centred "Press E" cue it shows when
|
|
458
|
+
// the player is in a door's trigger zone. (motion.playerEntity is set below, once the player is built.)
|
|
459
|
+
const motion = new PrototypeMotionSystem({ physics: physicsSystem, cue: makeInteractionCue() });
|
|
460
|
+
await em.addSystem(motion);
|
|
461
|
+
|
|
462
|
+
const fpsSystem = new FirstPersonPlayerControllerSystem();
|
|
463
|
+
// The platform is a physics body, not a flat y=0 baseline — let the physics-backed resolver below be
|
|
464
|
+
// the sole ground source (so the house roof / barriers are stood-on correctly).
|
|
465
|
+
fpsSystem.useBuiltInFlatGround = false;
|
|
466
|
+
await em.addSystem(fpsSystem);
|
|
467
|
+
await em.addSystem(new FirstPersonSensorsSystem());
|
|
468
|
+
|
|
469
|
+
// -- World -----------------------------------------------------------
|
|
470
|
+
buildPlatform(ecd);
|
|
471
|
+
buildHouse(ecd);
|
|
472
|
+
buildCathedral(ecd);
|
|
473
|
+
buildReflectorWall(ecd);
|
|
474
|
+
buildRoofRamp(ecd);
|
|
475
|
+
buildScatteredOccluders(ecd);
|
|
476
|
+
buildSmallShack(ecd);
|
|
477
|
+
buildSlidingDoors(ecd); // house door + cathedral entrance, built OPEN (so the bake sees the openings clear)
|
|
478
|
+
|
|
479
|
+
// The three fixed sources' MARKERS (emissive sphere + point light) are built now, before the bake, so the
|
|
480
|
+
// lightmap captures their glow + the rooms they light. Only their AudioEmitter is deferred to the first
|
|
481
|
+
// click (startSources): the engine ticks inside EngineHarness.initialize, so an autoplay emitter built here
|
|
482
|
+
// would link + play on the still-suspended context (the autoplay-policy warning); attaching it on the
|
|
483
|
+
// gesture means its first playEvent lands on a running context. The moving orbiter source is spawned whole
|
|
484
|
+
// on that click (its light moves, so it is not baked).
|
|
485
|
+
const staticSources = buildStaticSourceMarkers(ecd);
|
|
486
|
+
|
|
487
|
+
// -- Player ----------------------------------------------------------
|
|
488
|
+
const player = buildPlayerEntity(ecd);
|
|
489
|
+
fpsSystem.groundResolver = makePhysicsGroundResolver(physicsSystem, player.entity);
|
|
490
|
+
motion.playerEntity = player.entity; // door-proximity overlap tests against the player capsule
|
|
491
|
+
buildInputBindings(ecd, player, motion);
|
|
492
|
+
setupInteraction(engine, ecd, staticSources);
|
|
493
|
+
|
|
494
|
+
// -- Bake the probe field against the now-populated occluder index ----
|
|
495
|
+
// The acoustic entities above linked into acousticSim.occluderIndex on build; bake the visibility
|
|
496
|
+
// graph + per-band reverb over it, then hand the field to the simulator for pathing.
|
|
497
|
+
console.log("%c[acoustic] baking probe field…", "color:#88ddff;font-weight:bold");
|
|
498
|
+
console.time("[acoustic] bake");
|
|
499
|
+
const field = bakeProbeField(
|
|
500
|
+
acousticSim.occluderIndex,
|
|
501
|
+
BAKE_MIN_SPACING,
|
|
502
|
+
BAKE_REVERB_RAYS,
|
|
503
|
+
seededRandom(1),
|
|
504
|
+
);
|
|
505
|
+
console.timeEnd("[acoustic] bake");
|
|
506
|
+
acousticSim.setProbeField(field);
|
|
507
|
+
console.log(`%c[acoustic] ${field.size} probes and ${field.visibilityGraph.adjacency_length} edges baked — pathing ${acousticSim.pathing ? "ON" : "off"}`,
|
|
508
|
+
"color:#88ddff;font-weight:bold");
|
|
509
|
+
|
|
510
|
+
// Probe-baked reverb: a listener-centric (FOA directional) reverb send tapped off the master bus, driven
|
|
511
|
+
// from the listener's nearest probe each frame — the SAME baked field carries the per-band RT60 + arrival
|
|
512
|
+
// direction. Inside the house's enclosed probes it gives a room tail that leans toward the openings; outside
|
|
513
|
+
// (open probes, ~0 RT60) it crossfades dry. Wired AFTER the bake (the renderer needs the field) and fed a
|
|
514
|
+
// copy of the dry mix; its own output goes to the master destination.
|
|
515
|
+
const reverb = new FoaProbeReverbRenderer(engine.sound.context, engine.sound.destination);
|
|
516
|
+
reverb.setProbeField(field);
|
|
517
|
+
engine.sound.sopra.masterBusOutput.connect(reverb.input);
|
|
518
|
+
em.getSystem(AudioEmitterSystem).probeReverb = reverb;
|
|
519
|
+
|
|
520
|
+
// Toggleable probe + visibility-edge overlay (top-right button, or press P). Starts hidden.
|
|
521
|
+
setupProbeVizToggle(makeProbeVisualization(ecd, field));
|
|
522
|
+
|
|
523
|
+
logHelp();
|
|
524
|
+
|
|
525
|
+
// -- Lightmap: bake the indirect GI into a shared atlas against the populated scene, then switch the IBL off
|
|
526
|
+
// so the baked lightmap is the only indirect light. Done LAST (after the audio path is fully wired) — it
|
|
527
|
+
// path-traces the atlas texels over a few seconds; the scene renders IBL-lit and uploads the partial atlas
|
|
528
|
+
// each cycle, then switches to the fully-baked GI when it finishes. -------------------------------------
|
|
529
|
+
console.log("%c[lightmap] baking…", "color:#ffcc66;font-weight:bold");
|
|
530
|
+
console.time("[lightmap] bake");
|
|
531
|
+
await bakeLightmap(engine, ecd, skyTexture);
|
|
532
|
+
console.timeEnd("[lightmap] bake");
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* Downward-raycast ground resolver backed by {@link PhysicsSystem.raycast}, filtered to exclude the
|
|
537
|
+
* player's own capsule. Identical in spirit to the first-person gym's — from just above the feet, cast
|
|
538
|
+
* straight down, return the surface y or null. (Copied from the gym prototype.)
|
|
539
|
+
*
|
|
540
|
+
* @param {PhysicsSystem} physicsSystem
|
|
541
|
+
* @param {number} playerEntity
|
|
542
|
+
* @returns {(x:number, y:number, z:number) => number|null}
|
|
543
|
+
*/
|
|
544
|
+
function makePhysicsGroundResolver(physicsSystem, playerEntity) {
|
|
545
|
+
const PROBE_LIFT = 0.1;
|
|
546
|
+
const PROBE_DOWN = 50;
|
|
547
|
+
const filter = (entity) => entity !== playerEntity;
|
|
548
|
+
const ray = Ray3.from(0, 0, 0, 0, -1, 0, PROBE_DOWN);
|
|
549
|
+
const hit = new PhysicsSurfacePoint();
|
|
550
|
+
return function physicsGroundResolver(x, y, z) {
|
|
551
|
+
ray.setOrigin(x, y + PROBE_LIFT, z);
|
|
552
|
+
if (!physicsSystem.raycast(ray, hit, filter)) return null;
|
|
553
|
+
return (y + PROBE_LIFT) - hit.t;
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
// =====================================================================
|
|
558
|
+
// World construction
|
|
559
|
+
// =====================================================================
|
|
560
|
+
|
|
561
|
+
/**
|
|
562
|
+
* The flat box platform everyone stands on — visible + a static physics body, top face at y=0. Also an
|
|
563
|
+
* acoustic occluder (a real floor): this is what keeps the probe bake from dropping probes onto y=0 and
|
|
564
|
+
* leaking sound under the walls — see {@link GROUND_MATERIAL}.
|
|
565
|
+
*/
|
|
566
|
+
function buildPlatform(ecd) {
|
|
567
|
+
// Sized to hold the cathedral (west, x≈-24..-10), the house (origin), the reflector (north, z=-12) and the
|
|
568
|
+
// roof ramp (east, x≈10) with room to roam — the floor's extent IS the bake's horizontal extent, so it is
|
|
569
|
+
// kept only as large as the scene needs. Centred on x=-7 (between house and cathedral).
|
|
570
|
+
const THICK = 1.0;
|
|
571
|
+
spawnBox(ecd, {
|
|
572
|
+
center: new Vector3(-14, -THICK / 2, 0),
|
|
573
|
+
size: new Vector3(60, THICK, 32), // x ∈ [-44, 16], z ∈ [-16, 16]
|
|
574
|
+
color: 0x5a6b52,
|
|
575
|
+
roughness: 0.97,
|
|
576
|
+
material: GROUND_MATERIAL,
|
|
577
|
+
});
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
/**
|
|
581
|
+
* The house: four 3 m walls + a roof around an 8×8 m room, every surface an acoustic occluder. South wall
|
|
582
|
+
* carries a DOOR (opening to the floor, walk-through); north wall a WINDOW (mid-height opening); east /
|
|
583
|
+
* west walls + roof are solid. Each opening is framed by wall segments so the gap is a real hole in the
|
|
584
|
+
* geometry the solver routes through.
|
|
585
|
+
*/
|
|
586
|
+
function buildHouse(ecd) {
|
|
587
|
+
const color = 0xc9b79a;
|
|
588
|
+
|
|
589
|
+
// -- South wall (z = +HOUSE_HALF) — DOOR, centred on x, open to the floor -----------------
|
|
590
|
+
// left + right jambs (full height), and a lintel above the opening.
|
|
591
|
+
acousticWall(ecd, segCenter(-HOUSE_HALF, -DOOR_HALF_W), WALL_MID_Y, HOUSE_HALF,
|
|
592
|
+
segWidth(-HOUSE_HALF, -DOOR_HALF_W), WALL_H, WALL_T, color);
|
|
593
|
+
acousticWall(ecd, segCenter(DOOR_HALF_W, HOUSE_HALF), WALL_MID_Y, HOUSE_HALF,
|
|
594
|
+
segWidth(DOOR_HALF_W, HOUSE_HALF), WALL_H, WALL_T, color);
|
|
595
|
+
acousticWall(ecd, 0, (DOOR_H + WALL_H) / 2, HOUSE_HALF,
|
|
596
|
+
DOOR_HALF_W * 2, WALL_H - DOOR_H, WALL_T, color); // lintel
|
|
597
|
+
|
|
598
|
+
// -- North wall (z = -HOUSE_HALF) — WINDOW, framed sill + lintel -------------------------
|
|
599
|
+
acousticWall(ecd, segCenter(-HOUSE_HALF, -WIN_HALF_W), WALL_MID_Y, -HOUSE_HALF,
|
|
600
|
+
segWidth(-HOUSE_HALF, -WIN_HALF_W), WALL_H, WALL_T, color);
|
|
601
|
+
acousticWall(ecd, segCenter(WIN_HALF_W, HOUSE_HALF), WALL_MID_Y, -HOUSE_HALF,
|
|
602
|
+
segWidth(WIN_HALF_W, HOUSE_HALF), WALL_H, WALL_T, color);
|
|
603
|
+
acousticWall(ecd, 0, WIN_SILL / 2, -HOUSE_HALF,
|
|
604
|
+
WIN_HALF_W * 2, WIN_SILL, WALL_T, color); // sill (below window)
|
|
605
|
+
acousticWall(ecd, 0, (WIN_HEAD + WALL_H) / 2, -HOUSE_HALF,
|
|
606
|
+
WIN_HALF_W * 2, WALL_H - WIN_HEAD, WALL_T, color); // lintel (above window)
|
|
607
|
+
|
|
608
|
+
// -- East / west walls (solid), inset along z to butt against the N/S walls' inner faces --
|
|
609
|
+
const sideLen = HOUSE_HALF * 2 - WALL_T;
|
|
610
|
+
acousticWall(ecd, HOUSE_HALF, WALL_MID_Y, 0, WALL_T, WALL_H, sideLen, color);
|
|
611
|
+
acousticWall(ecd, -HOUSE_HALF, WALL_MID_Y, 0, WALL_T, WALL_H, sideLen, color);
|
|
612
|
+
|
|
613
|
+
// -- Roof — caps the room so the source is genuinely sealed -------------------------------
|
|
614
|
+
acousticWall(ecd, 0, WALL_H + WALL_T / 2, 0,
|
|
615
|
+
HOUSE_HALF * 2 + 0.6, WALL_T, HOUSE_HALF * 2 + 0.6, 0x8a5a3a);
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
/** Centre of the wall segment spanning [a, b] along one axis. */
|
|
619
|
+
function segCenter(a, b) {
|
|
620
|
+
return (a + b) / 2;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
/** Width of the wall segment spanning [a, b] along one axis. */
|
|
624
|
+
function segWidth(a, b) {
|
|
625
|
+
return b - a;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
/** A house wall slab: a visual + physics + acoustic box from a centre + full extents. */
|
|
629
|
+
function acousticWall(ecd, cx, cy, cz, sx, sy, sz, color) {
|
|
630
|
+
spawnBox(ecd, {
|
|
631
|
+
center: new Vector3(cx, cy, cz),
|
|
632
|
+
size: new Vector3(sx, sy, sz),
|
|
633
|
+
color,
|
|
634
|
+
roughness: 0.85,
|
|
635
|
+
material: WALL_MATERIAL,
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* Free-standing occluders dotted around the platform, away from the house — direct-path occlusion test
|
|
641
|
+
* pieces (duck behind one and the music dampens, no opening involved).
|
|
642
|
+
*/
|
|
643
|
+
function buildScatteredOccluders(ecd) {
|
|
644
|
+
const color = 0x8a8a8a;
|
|
645
|
+
|
|
646
|
+
// A long barrier wall east of the house.
|
|
647
|
+
spawnBox(ecd, { center: new Vector3(13, 1.5, 5), size: new Vector3(WALL_T, 3, 7), color, roughness: 0.8, material: WALL_MATERIAL });
|
|
648
|
+
// A chunky block in the open south-east (clear of the cathedral, the reflector corridor, and the ramp).
|
|
649
|
+
spawnBox(ecd, { center: new Vector3(8, 1.5, -10), size: new Vector3(3, 3, 3), color, roughness: 0.8, material: WALL_MATERIAL });
|
|
650
|
+
// A couple of pillars for parallax + narrow shadows.
|
|
651
|
+
spawnBox(ecd, { center: new Vector3(7, 2, 13), size: new Vector3(1, 4, 1), color, roughness: 0.8, material: WALL_MATERIAL });
|
|
652
|
+
spawnBox(ecd, { center: new Vector3(-7, 2, -14), size: new Vector3(1, 4, 1), color, roughness: 0.8, material: WALL_MATERIAL });
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* A tiny 3×3 m enclosed shack in the open south-east: four hard walls (one with a 1 m doorway, NO windows) and a
|
|
657
|
+
* roof, all {@link CATHEDRAL_MATERIAL}. A deliberately small, hard cavity — a "reverb chamber" test site whose
|
|
658
|
+
* baked tail (short but bright/ringy) contrasts the big stone cathedral and the dead little house. No source
|
|
659
|
+
* inside: walk in with the orbiting source audible, or A/B the room tone against the open platform.
|
|
660
|
+
*/
|
|
661
|
+
function buildSmallShack(ecd) {
|
|
662
|
+
const color = 0xb0a48c;
|
|
663
|
+
const x0 = SHACK_X - SHACK_HALF, x1 = SHACK_X + SHACK_HALF;
|
|
664
|
+
const z0 = SHACK_Z - SHACK_HALF, z1 = SHACK_Z + SHACK_HALF;
|
|
665
|
+
|
|
666
|
+
// West wall (x=x0, faces the scene) — a doorway to the floor, centred on z
|
|
667
|
+
buildWall(ecd, {
|
|
668
|
+
fixedAxis: "x", fixed: x0, from: z0, to: z1, height: SHACK_H, thickness: SHACK_T,
|
|
669
|
+
openings: [{ a: SHACK_Z - SHACK_DOOR_HALF, b: SHACK_Z + SHACK_DOOR_HALF, y0: 0, y1: SHACK_DOOR_H }],
|
|
670
|
+
material: CATHEDRAL_MATERIAL, color,
|
|
671
|
+
});
|
|
672
|
+
// East wall (x=x1) — solid
|
|
673
|
+
buildWall(ecd, {
|
|
674
|
+
fixedAxis: "x", fixed: x1, from: z0, to: z1, height: SHACK_H, thickness: SHACK_T,
|
|
675
|
+
material: CATHEDRAL_MATERIAL, color,
|
|
676
|
+
});
|
|
677
|
+
// North + south walls (z=z0/z1) — solid
|
|
678
|
+
for (const z of [z0, z1]) {
|
|
679
|
+
buildWall(ecd, {
|
|
680
|
+
fixedAxis: "z", fixed: z, from: x0, to: x1, height: SHACK_H, thickness: SHACK_T,
|
|
681
|
+
material: CATHEDRAL_MATERIAL, color,
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
roofSlab(ecd, x0, x1, z0, z1, SHACK_H, SHACK_T, color);
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* The cathedral, west of the house across a ~6 m gap: a big, tall, hard-walled stone hall — a much larger,
|
|
689
|
+
* more reverberant space than the dead little house. A wide MAIN ENTRANCE faces the gap (east wall), a couple
|
|
690
|
+
* of WINDOWS line each long side, and a TOWER shaft rises from the centre of the nave roof's back (open to the nave
|
|
691
|
+
* through a roof hole) — a tall coupled volume that lengthens + colours the tail near it (à la Šibenik). Every
|
|
692
|
+
* surface is a {@link CATHEDRAL_MATERIAL} occluder, so the source within only escapes through the openings.
|
|
693
|
+
*/
|
|
694
|
+
function buildCathedral(ecd) {
|
|
695
|
+
const color = 0xb8b0a0;
|
|
696
|
+
|
|
697
|
+
// -- East wall (x=CATH_X1, faces the house) — the MAIN ENTRANCE, centred, open to the floor -------------
|
|
698
|
+
buildWall(ecd, {
|
|
699
|
+
fixedAxis: "x", fixed: CATH_X1, from: CATH_Z0, to: CATH_Z1, height: CATH_H, thickness: CATH_T,
|
|
700
|
+
openings: [{ a: -CATH_ENTRY_HALF_W, b: CATH_ENTRY_HALF_W, y0: 0, y1: CATH_ENTRY_H }],
|
|
701
|
+
material: CATHEDRAL_MATERIAL, color,
|
|
702
|
+
});
|
|
703
|
+
|
|
704
|
+
// -- West wall (x=CATH_X0) — solid --------------------------------------------------------------------
|
|
705
|
+
buildWall(ecd, {
|
|
706
|
+
fixedAxis: "x", fixed: CATH_X0, from: CATH_Z0, to: CATH_Z1, height: CATH_H, thickness: CATH_T,
|
|
707
|
+
material: CATHEDRAL_MATERIAL, color,
|
|
708
|
+
});
|
|
709
|
+
|
|
710
|
+
// -- North + south long walls (z=CATH_Z0 / CATH_Z1) — four windows each, along the nave -----------------
|
|
711
|
+
const sideWindows = CATH_WIN_XS.map((x) => (
|
|
712
|
+
{ a: x - CATH_WIN_HALF_W, b: x + CATH_WIN_HALF_W, y0: CATH_WIN_SILL, y1: CATH_WIN_HEAD }
|
|
713
|
+
));
|
|
714
|
+
for (const z of [CATH_Z0, CATH_Z1]) {
|
|
715
|
+
buildWall(ecd, {
|
|
716
|
+
fixedAxis: "z", fixed: z, from: CATH_X0, to: CATH_X1, height: CATH_H, thickness: CATH_T,
|
|
717
|
+
openings: sideWindows, material: CATHEDRAL_MATERIAL, color,
|
|
718
|
+
});
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
// -- Roof at y=CATH_H, tiled around two holes: the tower shaft (back centre) and a 2×2 m drop-through -----
|
|
722
|
+
buildRoofWithHoles(ecd, CATH_X0, CATH_X1, CATH_Z0, CATH_Z1, CATH_H, CATH_T, [
|
|
723
|
+
{ x0: TOWER_X0, x1: TOWER_X1, z0: TOWER_Z0, z1: TOWER_Z1 },
|
|
724
|
+
{ x0: JUMP_HOLE_X - JUMP_HOLE_HALF, x1: JUMP_HOLE_X + JUMP_HOLE_HALF, z0: JUMP_HOLE_Z - JUMP_HOLE_HALF, z1: JUMP_HOLE_Z + JUMP_HOLE_HALF },
|
|
725
|
+
], 0x6b5a48);
|
|
726
|
+
|
|
727
|
+
// -- Tower: four walls around the tower roof hole, from TOWER_BOTTOM (1 m below the roof, so the roof
|
|
728
|
+
// seam is buried — no z-fighting) up to TOWER_TOP, capped — open to the nave below -------------------
|
|
729
|
+
const towerMidY = (TOWER_BOTTOM + TOWER_TOP) / 2, towerHeight = TOWER_TOP - TOWER_BOTTOM;
|
|
730
|
+
const towerCz = (TOWER_Z0 + TOWER_Z1) / 2, towerDz = TOWER_Z1 - TOWER_Z0;
|
|
731
|
+
const towerCx = (TOWER_X0 + TOWER_X1) / 2, towerDx = TOWER_X1 - TOWER_X0;
|
|
732
|
+
const tower = (center, size) => spawnBox(ecd, { center, size, color, roughness: 0.8, material: CATHEDRAL_MATERIAL });
|
|
733
|
+
tower(new Vector3(TOWER_X0, towerMidY, towerCz), new Vector3(CATH_T, towerHeight, towerDz));
|
|
734
|
+
tower(new Vector3(TOWER_X1, towerMidY, towerCz), new Vector3(CATH_T, towerHeight, towerDz));
|
|
735
|
+
tower(new Vector3(towerCx, towerMidY, TOWER_Z0), new Vector3(towerDx, towerHeight, CATH_T));
|
|
736
|
+
tower(new Vector3(towerCx, towerMidY, TOWER_Z1), new Vector3(towerDx, towerHeight, CATH_T));
|
|
737
|
+
tower(new Vector3(towerCx, TOWER_TOP + CATH_T / 2, towerCz), new Vector3(towerDx, CATH_T, towerDz)); // cap
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
/**
|
|
741
|
+
* A vertical wall (a slab of `thickness` at `fixed` on `fixedAxis` — 'x' or 'z' — spanning [from,to] on the
|
|
742
|
+
* other horizontal axis, y∈[0,height]) with rectangular `openings` cut out of it. Each opening is `{a, b, y0,
|
|
743
|
+
* y1}` (a,b on the span axis, y0..y1 vertical); the gaps between openings become full-height pillars, and each
|
|
744
|
+
* opening gets a sill below + a lintel above. The same recipe the house door/window are framed with.
|
|
745
|
+
*/
|
|
746
|
+
function buildWall(ecd, { fixedAxis, fixed, from, to, height, thickness, openings = [], material, color }) {
|
|
747
|
+
const ops = openings.slice().sort((p, q) => p.a - q.a);
|
|
748
|
+
|
|
749
|
+
// full-height pillars in the gaps between openings (and at the two ends)
|
|
750
|
+
let cursor = from;
|
|
751
|
+
for (const op of ops) {
|
|
752
|
+
if (op.a > cursor) {
|
|
753
|
+
wallSlab(ecd, fixedAxis, fixed, cursor, op.a, 0, height, thickness, material, color);
|
|
754
|
+
}
|
|
755
|
+
cursor = Math.max(cursor, op.b);
|
|
756
|
+
}
|
|
757
|
+
if (to > cursor) {
|
|
758
|
+
wallSlab(ecd, fixedAxis, fixed, cursor, to, 0, height, thickness, material, color);
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
// sill below + lintel above each opening
|
|
762
|
+
for (const op of ops) {
|
|
763
|
+
if (op.y0 > 0) {
|
|
764
|
+
wallSlab(ecd, fixedAxis, fixed, op.a, op.b, 0, op.y0, thickness, material, color);
|
|
765
|
+
}
|
|
766
|
+
if (op.y1 < height) {
|
|
767
|
+
wallSlab(ecd, fixedAxis, fixed, op.a, op.b, op.y1, height, thickness, material, color);
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
/** One box of a {@link buildWall}: spans [s0,s1] on the span axis, [y0,y1] vertical, `thickness` at `fixed`. */
|
|
773
|
+
function wallSlab(ecd, fixedAxis, fixed, s0, s1, y0, y1, thickness, material, color) {
|
|
774
|
+
const sc = (s0 + s1) / 2, sw = s1 - s0;
|
|
775
|
+
const yc = (y0 + y1) / 2, yh = y1 - y0;
|
|
776
|
+
const center = fixedAxis === "x" ? new Vector3(fixed, yc, sc) : new Vector3(sc, yc, fixed);
|
|
777
|
+
const size = fixedAxis === "x" ? new Vector3(thickness, yh, sw) : new Vector3(sw, yh, thickness);
|
|
778
|
+
spawnBox(ecd, { center, size, color, roughness: 0.8, material });
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
/** A horizontal roof slab over the x/z rectangle, its bottom face at `y`. */
|
|
782
|
+
function roofSlab(ecd, x0, x1, z0, z1, y, thickness, color) {
|
|
783
|
+
spawnBox(ecd, {
|
|
784
|
+
center: new Vector3((x0 + x1) / 2, y + thickness / 2, (z0 + z1) / 2),
|
|
785
|
+
size: new Vector3(x1 - x0, thickness, z1 - z0),
|
|
786
|
+
color, roughness: 0.8, material: CATHEDRAL_MATERIAL,
|
|
787
|
+
});
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* A flat roof over [x0,x1]×[z0,z1] (bottom face at `y`) with rectangular `holes` ({x0,x1,z0,z1}) cut out. Tiled
|
|
792
|
+
* as z-strips split at the holes' z-edges; within each strip the x-span is split around any hole that spans it
|
|
793
|
+
* (so non-overlapping holes at different z are all handled).
|
|
794
|
+
*/
|
|
795
|
+
function buildRoofWithHoles(ecd, x0, x1, z0, z1, y, thickness, holes, color) {
|
|
796
|
+
const zEdges = [z0, z1];
|
|
797
|
+
for (const h of holes) {
|
|
798
|
+
zEdges.push(h.z0, h.z1);
|
|
799
|
+
}
|
|
800
|
+
const bands = Array.from(new Set(zEdges)).sort((a, b) => a - b);
|
|
801
|
+
|
|
802
|
+
for (let i = 0; i < bands.length - 1; i++) {
|
|
803
|
+
const za = bands[i], zb = bands[i + 1];
|
|
804
|
+
// holes spanning this whole z-band → their x-ranges are cut from this strip
|
|
805
|
+
const cuts = holes
|
|
806
|
+
.filter((h) => h.z0 <= za + 1e-6 && h.z1 >= zb - 1e-6)
|
|
807
|
+
.map((h) => ({ a: h.x0, b: h.x1 }))
|
|
808
|
+
.sort((p, q) => p.a - q.a);
|
|
809
|
+
|
|
810
|
+
let cursor = x0;
|
|
811
|
+
for (const cut of cuts) {
|
|
812
|
+
if (cut.a > cursor) {
|
|
813
|
+
roofSlab(ecd, cursor, cut.a, za, zb, y, thickness, color);
|
|
814
|
+
}
|
|
815
|
+
cursor = Math.max(cursor, cut.b);
|
|
816
|
+
}
|
|
817
|
+
if (x1 > cursor) {
|
|
818
|
+
roofSlab(ecd, cursor, x1, za, zb, y, thickness, color);
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
/**
|
|
824
|
+
* A free-standing hard wall opposite the house's WINDOW (north face), set back so you can walk between them —
|
|
825
|
+
* a {@link REFLECTOR_MATERIAL} reflector that bounces the window's leaked sound back at a listener in the gap
|
|
826
|
+
* (the bounce shows up as a baked early reflection / a brighter local reverb between window and wall).
|
|
827
|
+
*/
|
|
828
|
+
function buildReflectorWall(ecd) {
|
|
829
|
+
spawnBox(ecd, {
|
|
830
|
+
center: new Vector3(0, REFLECTOR_H / 2, REFLECTOR_Z),
|
|
831
|
+
size: new Vector3(REFLECTOR_HALF_W * 2, REFLECTOR_H, 0.4),
|
|
832
|
+
color: 0x9aa0a8,
|
|
833
|
+
roughness: 0.6,
|
|
834
|
+
material: REFLECTOR_MATERIAL,
|
|
835
|
+
});
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
/**
|
|
839
|
+
* Two ramps: from the platform up onto the HOUSE roof (east side), and from the house roof across the gap up
|
|
840
|
+
* onto the (taller) CATHEDRAL roof. Walkable static bodies (the ground resolver snaps the player to whatever's
|
|
841
|
+
* underfoot), and acoustic occluders too — the tilted slabs cast their own (rotated-box) shadow, e.g. the
|
|
842
|
+
* gap-spanning ramp shades the gap below it.
|
|
843
|
+
*/
|
|
844
|
+
function buildRoofRamp(ecd) {
|
|
845
|
+
const ROOF_EDGE = HOUSE_HALF + 0.3; // the house roof overhangs its walls to ±(HOUSE_HALF+0.3)
|
|
846
|
+
const CATH_ROOF_TOP = CATH_H + CATH_T; // the cathedral roof's walking surface
|
|
847
|
+
buildRamp(ecd, 10, 0.05, ROOF_EDGE, ROOF_TOP, 0, 2.6, 0x7a6f5e); // platform → house roof
|
|
848
|
+
buildRamp(ecd, -ROOF_EDGE, ROOF_TOP, CATH_X1, CATH_ROOF_TOP, 0, 3.0, 0x7a6f5e); // house roof → cathedral roof
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
/**
|
|
852
|
+
* A ramp whose top face runs from the lower surface point (bx,by) up to the upper one (tx,ty) in the x–y plane
|
|
853
|
+
* at z=`z`, `width` wide: a thin box rotated so its length runs bottom→top. The top end lands EXACTLY on
|
|
854
|
+
* (tx,ty) (so it never pokes through the roof it meets); a short overhang is added only at the BOTTOM to seat
|
|
855
|
+
* it in the lower surface. An acoustic occluder (`WALL_MATERIAL`) — the rotated box is honoured by the occluder
|
|
856
|
+
* index exactly as by the collider.
|
|
857
|
+
*/
|
|
858
|
+
function buildRamp(ecd, bx, by, tx, ty, z, width, color) {
|
|
859
|
+
const dx = tx - bx, dy = ty - by;
|
|
860
|
+
const span = Math.hypot(dx, dy);
|
|
861
|
+
const angle = Math.atan2(dy, dx);
|
|
862
|
+
const overhang = 0.6;
|
|
863
|
+
const ux = dx / span, uy = dy / span; // unit bottom→top
|
|
864
|
+
spawnBox(ecd, {
|
|
865
|
+
// centre shifted half the overhang toward the bottom, so the +x (top) end is exactly (tx,ty)
|
|
866
|
+
center: new Vector3((bx + tx) / 2 - ux * overhang / 2, (by + ty) / 2 - uy * overhang / 2, z),
|
|
867
|
+
size: new Vector3(span + overhang, 0.3, width),
|
|
868
|
+
color,
|
|
869
|
+
roughness: 0.9,
|
|
870
|
+
rotation: Quaternion.fromAxisAngle(new Vector3(0, 0, 1), angle),
|
|
871
|
+
material: WALL_MATERIAL,
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
// =====================================================================
|
|
876
|
+
// Operable sliding doors + the per-frame mover (orbiter + doors + proximity cue)
|
|
877
|
+
// =====================================================================
|
|
878
|
+
|
|
879
|
+
const IDENTITY_QUATERNION = Quaternion.fromAxisAngle(new Vector3(0, 1, 0), 0); // axis-aligned overlap queries
|
|
880
|
+
|
|
881
|
+
/**
|
|
882
|
+
* Build one operable sliding door: a slab filling an opening (centre `center`, full extents `size`), a
|
|
883
|
+
* KinematicPosition body so it can be driven, an {@link AcousticBody} occluder so it seals/clears the opening
|
|
884
|
+
* LIVE as it slides (the occluder index re-syncs on transform change), and a {@link PrototypeMover} (kind
|
|
885
|
+
* "door") so {@link PrototypeMotionSystem} slides it down (open) / up (closed) on E and tracks player proximity
|
|
886
|
+
* to `zoneCenter ± zoneHalf`.
|
|
887
|
+
*
|
|
888
|
+
* @param {EntityComponentDataset} ecd
|
|
889
|
+
* @param {{center:Vector3, size:Vector3, zoneCenter:Vector3, zoneHalf:Vector3, label:string}} p
|
|
890
|
+
*/
|
|
891
|
+
function spawnSlidingDoor(ecd, { center, size, zoneCenter, zoneHalf, label }) {
|
|
892
|
+
const geom = new BoxGeometry(size.x, size.y, size.z);
|
|
893
|
+
const mat = litMaterial({ color: 0x5a4632, roughness: 0.7 });
|
|
894
|
+
const sg = ShadedGeometry.from(geom, mat);
|
|
895
|
+
sg.setFlag(ShadedGeometryFlags.CastShadow);
|
|
896
|
+
sg.setFlag(ShadedGeometryFlags.ReceiveShadow);
|
|
897
|
+
sg.setFlag(ShadedGeometryFlags.Visible);
|
|
898
|
+
|
|
899
|
+
const rigidBody = new RigidBody();
|
|
900
|
+
rigidBody.kind = BodyKind.KinematicPosition; // scripted vertical motion; solid + occluding while raised
|
|
901
|
+
|
|
902
|
+
const collider = new Collider();
|
|
903
|
+
collider.shape = BoxShape3D.from_size(size.x, size.y, size.z);
|
|
904
|
+
|
|
905
|
+
// slid fully below the floor → the opening is clear; the extra DOOR_OPEN_CLEARANCE sinks the slab's top
|
|
906
|
+
// past the floor seam (its open top lands at y = -DOOR_OPEN_CLEARANCE) so it doesn't z-fight the floor.
|
|
907
|
+
const openY = center.y - size.y - DOOR_OPEN_CLEARANCE;
|
|
908
|
+
|
|
909
|
+
// START open (slid down): the doors begin open AND, since the acoustic bake runs after the world is built,
|
|
910
|
+
// it sees the openings clear rather than sealed. E closes them.
|
|
911
|
+
const transform = new Transform();
|
|
912
|
+
transform.position.set(center.x, openY, center.z);
|
|
913
|
+
|
|
914
|
+
const mover = new PrototypeMover();
|
|
915
|
+
mover.kind = "door";
|
|
916
|
+
mover.closedY = center.y;
|
|
917
|
+
mover.openY = openY;
|
|
918
|
+
mover.open = true;
|
|
919
|
+
mover.label = label;
|
|
920
|
+
mover.zoneShape = BoxShape3D.from(zoneHalf.x, zoneHalf.y, zoneHalf.z);
|
|
921
|
+
mover.zoneCenter = zoneCenter;
|
|
922
|
+
|
|
923
|
+
new Entity()
|
|
924
|
+
.add(sg)
|
|
925
|
+
.add(rigidBody)
|
|
926
|
+
.add(collider)
|
|
927
|
+
.add(AcousticBody.from(WALL_MATERIAL))
|
|
928
|
+
.add(mover)
|
|
929
|
+
.add(Tag.fromJSON(["AcousticDemo", "Door"]))
|
|
930
|
+
.add(SerializationMetadata.Transient)
|
|
931
|
+
.add(transform)
|
|
932
|
+
.build(ecd);
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
/** The two operable doors: the house's south DOOR and the cathedral's east ENTRANCE (built OPEN; E closes them). */
|
|
936
|
+
function buildSlidingDoors(ecd) {
|
|
937
|
+
// House south door — fills the 1.4 m × 2.2 m opening at z = +HOUSE_HALF
|
|
938
|
+
spawnSlidingDoor(ecd, {
|
|
939
|
+
center: new Vector3(0, DOOR_H / 2, HOUSE_HALF),
|
|
940
|
+
size: new Vector3(DOOR_HALF_W * 2, DOOR_H, DOOR_T),
|
|
941
|
+
zoneCenter: new Vector3(0, 1.5, HOUSE_HALF),
|
|
942
|
+
zoneHalf: new Vector3(2.5, 2.0, 2.5),
|
|
943
|
+
label: "house door",
|
|
944
|
+
});
|
|
945
|
+
// Cathedral main entrance — fills the 3.5 m × 4.5 m opening at x = CATH_X1
|
|
946
|
+
spawnSlidingDoor(ecd, {
|
|
947
|
+
center: new Vector3(CATH_X1, CATH_ENTRY_H / 2, 0),
|
|
948
|
+
size: new Vector3(DOOR_T, CATH_ENTRY_H, CATH_ENTRY_HALF_W * 2),
|
|
949
|
+
zoneCenter: new Vector3(CATH_X1, 2.2, 0),
|
|
950
|
+
zoneHalf: new Vector3(3.5, 2.5, 3.5),
|
|
951
|
+
label: "cathedral entrance",
|
|
952
|
+
});
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
/** A centred "Press E" hint, shown by the motion system whenever the player is in a door's trigger zone. */
|
|
956
|
+
function makeInteractionCue() {
|
|
957
|
+
const el = document.createElement("div");
|
|
958
|
+
Object.assign(el.style, {
|
|
959
|
+
position: "absolute", left: "50%", top: "60%", transform: "translate(-50%, -50%)",
|
|
960
|
+
zIndex: "1000", padding: "6px 14px", font: "16px sans-serif", color: "#eaf4ff",
|
|
961
|
+
background: "rgba(18,26,34,0.82)", border: "1px solid #3a6ea5", borderRadius: "4px",
|
|
962
|
+
pointerEvents: "none", display: "none", letterSpacing: "0.5px",
|
|
963
|
+
});
|
|
964
|
+
el.textContent = 'Press "E"';
|
|
965
|
+
document.body.appendChild(el);
|
|
966
|
+
return el;
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
/**
|
|
970
|
+
* Per-entity motion record, attached alongside a {@link Transform} and observed by {@link PrototypeMotionSystem}.
|
|
971
|
+
* A tagged record: either an ORBITING source (`kind` "orbit" — circles (cx,cz) at `radius`/`height`, advancing
|
|
972
|
+
* `angle` by `speed`) or a SLIDING door (`kind` "door" — slides between `closedY`/`openY`, `open` toggled by E;
|
|
973
|
+
* `zoneShape`/`zoneCenter` is its proximity trigger). A plain data component; never serialized (the prototype
|
|
974
|
+
* entities are {@link SerializationMetadata.Transient}).
|
|
975
|
+
*/
|
|
976
|
+
class PrototypeMover {
|
|
977
|
+
kind = "orbit";
|
|
978
|
+
// kind "orbit"
|
|
979
|
+
cx = 0;
|
|
980
|
+
cz = 0;
|
|
981
|
+
radius = 0;
|
|
982
|
+
height = 0;
|
|
983
|
+
speed = 0;
|
|
984
|
+
angle = 0;
|
|
985
|
+
// kind "door"
|
|
986
|
+
closedY = 0;
|
|
987
|
+
openY = 0;
|
|
988
|
+
open = false;
|
|
989
|
+
label = "";
|
|
990
|
+
zoneShape = null;
|
|
991
|
+
zoneCenter = null;
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
PrototypeMover.typeName = "PrototypeMover";
|
|
995
|
+
|
|
996
|
+
/**
|
|
997
|
+
* One per-frame mover for the prototype's dynamic pieces (added via {@link EntityManager.addSystem}). It observes
|
|
998
|
+
* ({@link PrototypeMover}, {@link Transform}) — link/unlink keep a working list — and each tick:
|
|
999
|
+
* - ORBIT movers — advance around their circle (the entity's Transform.position is set every frame);
|
|
1000
|
+
* - DOOR movers — slide toward the target (open = down into the ground, closed = up), and the physics is
|
|
1001
|
+
* queried for the player capsule overlapping a door's trigger zone. The nearest in-range door becomes
|
|
1002
|
+
* {@link activeDoor} (E toggles it) and the "Press E" cue is shown. Proximity is a real collider overlap
|
|
1003
|
+
* ({@link PhysicsSystem.overlap} of the zone box vs the player), not a distance test.
|
|
1004
|
+
*
|
|
1005
|
+
* (A system must declare ≥1 dependency — the engine drives it as an entity observer — so the movers are a real
|
|
1006
|
+
* component rather than a side list.)
|
|
1007
|
+
*/
|
|
1008
|
+
class PrototypeMotionSystem extends System {
|
|
1009
|
+
#scratch = new Uint32Array(8);
|
|
1010
|
+
|
|
1011
|
+
constructor({ physics, cue }) {
|
|
1012
|
+
super();
|
|
1013
|
+
this.dependencies = [PrototypeMover, Transform];
|
|
1014
|
+
this.physics = physics;
|
|
1015
|
+
this.cue = cue;
|
|
1016
|
+
this.playerEntity = -1; // set once the player is built
|
|
1017
|
+
this.movers = []; // { mover: PrototypeMover, transform: Transform, entity: number }
|
|
1018
|
+
this.activeDoor = null; // the door mover the player is next to, or null
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
/** EntityObserver callbacks — argument order matches `dependencies`, entity last, `this` = the system. */
|
|
1022
|
+
link(mover, transform, entity) {
|
|
1023
|
+
this.movers.push({ mover, transform, entity });
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
unlink(mover, transform, entity) {
|
|
1027
|
+
const i = this.movers.findIndex((m) => m.entity === entity);
|
|
1028
|
+
if (i !== -1) {
|
|
1029
|
+
this.movers.splice(i, 1);
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
/** E handler — flip the door the player is standing next to (if any). */
|
|
1034
|
+
toggleActiveDoor() {
|
|
1035
|
+
if (this.activeDoor !== null) {
|
|
1036
|
+
this.activeDoor.open = !this.activeDoor.open;
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
update(timeDelta) {
|
|
1041
|
+
const ecd = this.entityManager === null ? null : this.entityManager.dataset;
|
|
1042
|
+
if (ecd === null) {
|
|
1043
|
+
return;
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
let active = null;
|
|
1047
|
+
for (let i = 0; i < this.movers.length; i++) {
|
|
1048
|
+
const mover = this.movers[i].mover;
|
|
1049
|
+
const transform = this.movers[i].transform;
|
|
1050
|
+
|
|
1051
|
+
if (mover.kind === "orbit") {
|
|
1052
|
+
mover.angle += mover.speed * timeDelta;
|
|
1053
|
+
transform.position.set(
|
|
1054
|
+
mover.cx + Math.cos(mover.angle) * mover.radius, mover.height,
|
|
1055
|
+
mover.cz + Math.sin(mover.angle) * mover.radius);
|
|
1056
|
+
continue;
|
|
1057
|
+
}
|
|
1058
|
+
|
|
1059
|
+
// kind "door": proximity (collider overlap vs the player) + slide toward target
|
|
1060
|
+
if (this.playerEntity !== -1 && active === null) {
|
|
1061
|
+
const n = this.physics.overlap(
|
|
1062
|
+
mover.zoneShape, mover.zoneCenter, IDENTITY_QUATERNION, this.#scratch, 0,
|
|
1063
|
+
(entity) => entity === this.playerEntity);
|
|
1064
|
+
if (n > 0) {
|
|
1065
|
+
active = mover;
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
const targetY = mover.open ? mover.openY : mover.closedY;
|
|
1070
|
+
const p = transform.position;
|
|
1071
|
+
const dy = targetY - p.y;
|
|
1072
|
+
if (dy !== 0) {
|
|
1073
|
+
const step = Math.sign(dy) * Math.min(Math.abs(dy), DOOR_SLIDE_SPEED * timeDelta);
|
|
1074
|
+
p.set(p.x, p.y + step, p.z); // onChanged → the kinematic body + acoustic occluder follow
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
this.activeDoor = active;
|
|
1079
|
+
this.cue.style.display = active === null ? "none" : "block";
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
// The MainMenu loop, shared by the house, cathedral and shack sources (same clip, different rooms/acoustics).
|
|
1084
|
+
const MAIN_MENU_CLIP = "data/sounds/music/matsmusic/d1/Fiverr Alexgoldring MainMenu.ogg";
|
|
1085
|
+
|
|
1086
|
+
// The three FIXED sources — house, cathedral and the little SHACK — all play the SAME MainMenu loop (so the
|
|
1087
|
+
// difference you hear is purely the room acoustics). Their markers (an emissive sphere + a co-located point
|
|
1088
|
+
// light) are built at world time so the lightmap BAKES them — both the marker's glow and the room each one
|
|
1089
|
+
// lights. Only the AudioEmitter is deferred to the first click (see startSources). (The paths have spaces — the
|
|
1090
|
+
// browser percent-encodes them on fetch, and the dev server serves it straight from `app/`.)
|
|
1091
|
+
const STATIC_SOURCE_SPECS = [
|
|
1092
|
+
{
|
|
1093
|
+
id: "house-mainmenu",
|
|
1094
|
+
clipPath: MAIN_MENU_CLIP,
|
|
1095
|
+
position: SRC,
|
|
1096
|
+
distanceMin: SRC_DIST_MIN,
|
|
1097
|
+
distanceMax: SRC_DIST_MAX,
|
|
1098
|
+
markerColor: 0xffcc66,
|
|
1099
|
+
markerEmissive: 0xff8800,
|
|
1100
|
+
lightDistance: SOURCE_LIGHT_DISTANCE / 2, // a tighter orange glow in the small dead room
|
|
1101
|
+
},
|
|
1102
|
+
{
|
|
1103
|
+
id: "cathedral-mainmenu",
|
|
1104
|
+
clipPath: MAIN_MENU_CLIP,
|
|
1105
|
+
position: CATH_SRC,
|
|
1106
|
+
distanceMin: CATH_SRC_DIST_MIN,
|
|
1107
|
+
distanceMax: CATH_SRC_DIST_MAX,
|
|
1108
|
+
markerColor: 0x99ccff,
|
|
1109
|
+
markerEmissive: 0x3388ff,
|
|
1110
|
+
},
|
|
1111
|
+
{
|
|
1112
|
+
id: "shack-mainmenu",
|
|
1113
|
+
clipPath: MAIN_MENU_CLIP,
|
|
1114
|
+
position: new Vector3(SHACK_X, 1.2, SHACK_Z),
|
|
1115
|
+
distanceMin: SRC_DIST_MIN,
|
|
1116
|
+
distanceMax: SRC_DIST_MAX,
|
|
1117
|
+
markerColor: 0xcc99ff,
|
|
1118
|
+
markerEmissive: 0x8844cc,
|
|
1119
|
+
},
|
|
1120
|
+
];
|
|
1121
|
+
|
|
1122
|
+
/**
|
|
1123
|
+
* Build the three FIXED sources' visual markers (an emissive sphere + a co-located point light each). Called at
|
|
1124
|
+
* world-build time, BEFORE the lightmap bake, so the bake captures each source's glow and the room it lights.
|
|
1125
|
+
* The audio is attached later, on the first click ({@link startSources}).
|
|
1126
|
+
*
|
|
1127
|
+
* @param {EntityComponentDataset} ecd
|
|
1128
|
+
* @returns {{entity:number, spec:object}[]} one record per static source, consumed by {@link startSources}
|
|
1129
|
+
*/
|
|
1130
|
+
function buildStaticSourceMarkers(ecd) {
|
|
1131
|
+
return STATIC_SOURCE_SPECS.map((spec) => ({ entity: buildSourceMarker(ecd, spec), spec }));
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
/**
|
|
1135
|
+
* Start the audio on the first click, once the context has resumed: attach a (3D, looping, autoplay)
|
|
1136
|
+
* {@link AudioEmitter} to each pre-built static marker — so it links and autoplays on a RUNNING context (routing
|
|
1137
|
+
* is fixed at link, so the emitter must first appear on a resumed context) — and spawn the moving orbiter whole.
|
|
1138
|
+
*
|
|
1139
|
+
* @param {EntityComponentDataset} ecd
|
|
1140
|
+
* @param {{entity:number, spec:object}[]} staticSources the markers built by {@link buildStaticSourceMarkers}
|
|
1141
|
+
*/
|
|
1142
|
+
function startSources(ecd, staticSources) {
|
|
1143
|
+
for (const { entity, spec } of staticSources) {
|
|
1144
|
+
addSourceEmitter(ecd, entity, spec);
|
|
1145
|
+
}
|
|
1146
|
+
spawnOrbiter(ecd);
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
/**
|
|
1150
|
+
* A fourth source that ORBITS the whole scene from outside (a WorldMode layer): acoustic + a long max distance,
|
|
1151
|
+
* so from the centre you hear it swing in and out as buildings break the line of sight. Spawned whole on the
|
|
1152
|
+
* first click (marker + emitter + {@link PrototypeMover}, which drives its position each frame around
|
|
1153
|
+
* (ORBIT_CX, ORBIT_CZ)); because its light MOVES it is deliberately not baked into the lightmap.
|
|
1154
|
+
*
|
|
1155
|
+
* @param {EntityComponentDataset} ecd
|
|
1156
|
+
*/
|
|
1157
|
+
function spawnOrbiter(ecd) {
|
|
1158
|
+
const entity = buildSourceMarker(ecd, {
|
|
1159
|
+
position: new Vector3(ORBIT_CX + ORBIT_RADIUS, ORBIT_HEIGHT, ORBIT_CZ),
|
|
1160
|
+
markerColor: 0x99ff99,
|
|
1161
|
+
markerEmissive: 0x33cc55,
|
|
1162
|
+
lightIntensity: 9,
|
|
1163
|
+
lightDistance: 15, // ~30% smaller than the other markers' default reach
|
|
1164
|
+
});
|
|
1165
|
+
addSourceEmitter(ecd, entity, {
|
|
1166
|
+
id: "orbit-worldmode",
|
|
1167
|
+
clipPath: ORBIT_CLIP,
|
|
1168
|
+
distanceMin: ORBIT_DIST_MIN,
|
|
1169
|
+
distanceMax: ORBIT_DIST_MAX,
|
|
1170
|
+
});
|
|
1171
|
+
|
|
1172
|
+
const mover = new PrototypeMover();
|
|
1173
|
+
mover.kind = "orbit";
|
|
1174
|
+
mover.cx = ORBIT_CX;
|
|
1175
|
+
mover.cz = ORBIT_CZ;
|
|
1176
|
+
mover.radius = ORBIT_RADIUS;
|
|
1177
|
+
mover.height = ORBIT_HEIGHT;
|
|
1178
|
+
mover.speed = ORBIT_SPEED;
|
|
1179
|
+
ecd.addComponentToEntity(entity, mover); // PrototypeMotionSystem links it via (PrototypeMover, Transform)
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
/**
|
|
1183
|
+
* Build a source's visual: a small emissive marker sphere + a co-located point light (its colour taken from the
|
|
1184
|
+
* marker's emissive tint, so each source casts a coloured glow into its room). No {@link AudioEmitter} — that is
|
|
1185
|
+
* attached separately ({@link addSourceEmitter}), so a static marker can be baked into the lightmap while its
|
|
1186
|
+
* audio waits for the first click. Not an acoustic occluder (no {@link AcousticBody}).
|
|
1187
|
+
*
|
|
1188
|
+
* @param {EntityComponentDataset} ecd
|
|
1189
|
+
* @param {{position:Vector3, markerColor:number, markerEmissive:number, lightIntensity?:number,
|
|
1190
|
+
* lightDistance?:number}} p
|
|
1191
|
+
* @returns {number} the spawned entity id (so an emitter / mover can be attached later)
|
|
1192
|
+
*/
|
|
1193
|
+
function buildSourceMarker(ecd, { position, markerColor, markerEmissive,
|
|
1194
|
+
lightIntensity = SOURCE_LIGHT_INTENSITY, lightDistance = SOURCE_LIGHT_DISTANCE }) {
|
|
1195
|
+
const markerGeom = new SphereGeometry(0.3, 16, 16);
|
|
1196
|
+
const markerMat = litMaterial({
|
|
1197
|
+
color: markerColor,
|
|
1198
|
+
emissive: markerEmissive,
|
|
1199
|
+
emissiveIntensity: 1.4,
|
|
1200
|
+
roughness: 0.4,
|
|
1201
|
+
});
|
|
1202
|
+
const sg = ShadedGeometry.from(markerGeom, markerMat);
|
|
1203
|
+
sg.setFlag(ShadedGeometryFlags.Visible);
|
|
1204
|
+
sg.setFlag(ShadedGeometryFlags.CastShadow);
|
|
1205
|
+
|
|
1206
|
+
const light = new Light();
|
|
1207
|
+
light.type.set(Light.Type.POINT);
|
|
1208
|
+
light.color.setRGBUint8((markerEmissive >> 16) & 0xff, (markerEmissive >> 8) & 0xff, markerEmissive & 0xff);
|
|
1209
|
+
light.intensity.set(lightIntensity);
|
|
1210
|
+
light.distance.set(lightDistance);
|
|
1211
|
+
|
|
1212
|
+
const transform = new Transform();
|
|
1213
|
+
transform.position.copy(position);
|
|
1214
|
+
|
|
1215
|
+
const eb = new Entity()
|
|
1216
|
+
.add(sg)
|
|
1217
|
+
.add(light)
|
|
1218
|
+
.add(Tag.fromJSON(["AudioSource"]))
|
|
1219
|
+
.add(SerializationMetadata.Transient)
|
|
1220
|
+
.add(transform);
|
|
1221
|
+
eb.build(ecd);
|
|
1222
|
+
|
|
1223
|
+
return eb.id;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
/**
|
|
1227
|
+
* Attach a 3D looping, acoustic, autoplay {@link AudioEmitter} to a pre-built source marker entity. Done on the
|
|
1228
|
+
* first click, once the context has resumed, so the emitter links (and autoplays) on a RUNNING context — the
|
|
1229
|
+
* autoplay-policy-safe path. It shares the marker's Transform, so it sounds from the marker and tracks it if a
|
|
1230
|
+
* mover drives it.
|
|
1231
|
+
*
|
|
1232
|
+
* @param {EntityComponentDataset} ecd
|
|
1233
|
+
* @param {number} entity the marker built by {@link buildSourceMarker}
|
|
1234
|
+
* @param {{id:string, clipPath:string, distanceMin:number, distanceMax:number}} p
|
|
1235
|
+
*/
|
|
1236
|
+
function addSourceEmitter(ecd, entity, { id, clipPath, distanceMin, distanceMax }) {
|
|
1237
|
+
const event = EventDescription.from(
|
|
1238
|
+
id,
|
|
1239
|
+
SampleAudioClip.from(clipPath, { loop: true }),
|
|
1240
|
+
{
|
|
1241
|
+
is3D: true,
|
|
1242
|
+
distanceMin,
|
|
1243
|
+
distanceMax,
|
|
1244
|
+
// Physically-based (sound-pressure-fitted) rolloff, sampled across [min, max] in metres: full
|
|
1245
|
+
// volume within distanceMin, a natural log-ish falloff to silence at distanceMax. Reuses the
|
|
1246
|
+
// engine's own falloff + curve builder rather than a hand-rolled line.
|
|
1247
|
+
attenuation: buildAttenuationCurve(distanceMin, distanceMax, interpolate_irradiance_smith),
|
|
1248
|
+
},
|
|
1249
|
+
);
|
|
1250
|
+
|
|
1251
|
+
const emitter = new AudioEmitter();
|
|
1252
|
+
emitter.event = event;
|
|
1253
|
+
emitter.acoustic = true; // occlusion / transmission / pathing
|
|
1254
|
+
emitter.sourceRadius = 0.3; // a little volume so occlusion fades in/out rather than popping
|
|
1255
|
+
emitter.autoplay = true;
|
|
1256
|
+
emitter.volume.set(1);
|
|
1257
|
+
|
|
1258
|
+
// (AudioEmitter, Transform) completes on this add → AudioEmitterSystem links it (and autoplays) immediately.
|
|
1259
|
+
ecd.addComponentToEntity(entity, emitter);
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
/**
|
|
1263
|
+
* Add a box to the world: visual ({@link ShadedGeometry}) + a static physics body ({@link RigidBody} +
|
|
1264
|
+
* {@link Collider}). If an {@link AcousticMaterial} is given, it also becomes an {@link AcousticBody}
|
|
1265
|
+
* occluder (the same Collider shape is the occluding geometry). Position is the box centre; Transform is
|
|
1266
|
+
* added LAST so the (RigidBody, Transform) and (AcousticBody, Collider, Transform) tuples complete on it.
|
|
1267
|
+
*
|
|
1268
|
+
* @param {EntityComponentDataset} ecd
|
|
1269
|
+
* @param {object} p
|
|
1270
|
+
* @param {Vector3} p.center
|
|
1271
|
+
* @param {Vector3} p.size full w, h, d
|
|
1272
|
+
* @param {number} p.color
|
|
1273
|
+
* @param {number} [p.roughness]
|
|
1274
|
+
* @param {AcousticMaterial} [p.material] present → also an acoustic occluder
|
|
1275
|
+
* @param {Quaternion} [p.rotation] present → the box is oriented (e.g. a ramp); physics + acoustics use it
|
|
1276
|
+
*/
|
|
1277
|
+
function spawnBox(ecd, { center, size, color, roughness = 0.8, material, rotation }) {
|
|
1278
|
+
const geom = new BoxGeometry(size.x, size.y, size.z);
|
|
1279
|
+
const mat = litMaterial({ color, roughness });
|
|
1280
|
+
const sg = ShadedGeometry.from(geom, mat);
|
|
1281
|
+
sg.setFlag(ShadedGeometryFlags.CastShadow);
|
|
1282
|
+
sg.setFlag(ShadedGeometryFlags.ReceiveShadow);
|
|
1283
|
+
sg.setFlag(ShadedGeometryFlags.Visible);
|
|
1284
|
+
|
|
1285
|
+
const rigidBody = new RigidBody();
|
|
1286
|
+
rigidBody.kind = BodyKind.Static;
|
|
1287
|
+
|
|
1288
|
+
const collider = new Collider();
|
|
1289
|
+
// Explicit half/full-extent box → the closed-form box narrowphase, not GJK+EPA.
|
|
1290
|
+
collider.shape = BoxShape3D.from_size(size.x, size.y, size.z);
|
|
1291
|
+
|
|
1292
|
+
const transform = new Transform();
|
|
1293
|
+
transform.position.copy(center);
|
|
1294
|
+
if (rotation !== undefined) {
|
|
1295
|
+
transform.rotation.copy(rotation); // a tilted box — the renderer, the collider, and the occluder all honour it
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
const eb = new Entity()
|
|
1299
|
+
.add(sg)
|
|
1300
|
+
.add(rigidBody)
|
|
1301
|
+
.add(collider)
|
|
1302
|
+
.add(Tag.fromJSON(["AcousticDemo"]))
|
|
1303
|
+
.add(SerializationMetadata.Transient);
|
|
1304
|
+
|
|
1305
|
+
if (material !== undefined) {
|
|
1306
|
+
eb.add(AcousticBody.from(material));
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
eb.add(transform).build(ecd);
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
// =====================================================================
|
|
1313
|
+
// Player + input (mirrors the first-person gym, minus the parkour abilities)
|
|
1314
|
+
// =====================================================================
|
|
1315
|
+
|
|
1316
|
+
/**
|
|
1317
|
+
* @param {EntityComponentDataset} ecd
|
|
1318
|
+
* @returns {{entity:number, controller:FirstPersonPlayerController}}
|
|
1319
|
+
*/
|
|
1320
|
+
function buildPlayerEntity(ecd) {
|
|
1321
|
+
const transform = new Transform();
|
|
1322
|
+
transform.position.set(SPAWN_X, 0, SPAWN_Z);
|
|
1323
|
+
|
|
1324
|
+
// Plain walk / look / jump — no parkour abilities for this acoustic walkaround.
|
|
1325
|
+
const controller = new FirstPersonPlayerController();
|
|
1326
|
+
|
|
1327
|
+
const bodyCfg = controller.config.body;
|
|
1328
|
+
const radius = bodyCfg.radius;
|
|
1329
|
+
const totalHeight = bodyCfg.height;
|
|
1330
|
+
const cylinderHeight = Math.max(0, totalHeight - 2 * radius);
|
|
1331
|
+
|
|
1332
|
+
const rigidBody = new RigidBody();
|
|
1333
|
+
rigidBody.kind = BodyKind.KinematicPosition;
|
|
1334
|
+
rigidBody.mass = bodyCfg.mass;
|
|
1335
|
+
|
|
1336
|
+
const collider = new Collider();
|
|
1337
|
+
// Capsule bottom at the feet (Transform.position), top at the head — see the gym prototype.
|
|
1338
|
+
collider.shape = TransformedShape3D.from_translation(
|
|
1339
|
+
CapsuleShape3D.from(radius, cylinderHeight),
|
|
1340
|
+
[0, totalHeight / 2, 0],
|
|
1341
|
+
);
|
|
1342
|
+
|
|
1343
|
+
const eb = new Entity()
|
|
1344
|
+
.add(controller)
|
|
1345
|
+
.add(rigidBody)
|
|
1346
|
+
.add(collider)
|
|
1347
|
+
.add(Tag.fromJSON(["Player"]))
|
|
1348
|
+
.add(SerializationMetadata.Transient)
|
|
1349
|
+
.add(transform);
|
|
1350
|
+
|
|
1351
|
+
eb.build(ecd);
|
|
1352
|
+
|
|
1353
|
+
// The acoustic listener rides the CAMERA (eye height), not the feet. Building the player linked the
|
|
1354
|
+
// first-person controller, whose link() created an eye entity — a Camera + a Transform driven to eye
|
|
1355
|
+
// height and look direction every frame — so attaching the SoundListener there makes occlusion / pathing
|
|
1356
|
+
// (and the WebAudio listener pose) test from the EARS. At feet height (Transform.position) a window sill
|
|
1357
|
+
// or a low wall occludes a source the player plainly sees through it; the modelled ears were below the
|
|
1358
|
+
// geometry the eye is above. (Component-add linking is synchronous, so controller.eyeEntity is valid here.)
|
|
1359
|
+
ecd.addComponentToEntity(controller.eyeEntity, new SoundListener());
|
|
1360
|
+
|
|
1361
|
+
return { entity: eb.id, controller };
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1364
|
+
/**
|
|
1365
|
+
* Keyboard + mouse → the controller's intent surface (WASD move, mouse look, space jump).
|
|
1366
|
+
*
|
|
1367
|
+
* @param {EntityComponentDataset} ecd
|
|
1368
|
+
* @param {{entity:number, controller:FirstPersonPlayerController}} player
|
|
1369
|
+
* @param {PrototypeMotionSystem} motion drives the doors; E operates the one the player is next to
|
|
1370
|
+
*/
|
|
1371
|
+
function buildInputBindings(ecd, player, motion) {
|
|
1372
|
+
const ic = new InputController();
|
|
1373
|
+
const intent = player.controller.intent;
|
|
1374
|
+
|
|
1375
|
+
const SENSITIVITY = (Math.PI * 2) / 1200;
|
|
1376
|
+
|
|
1377
|
+
const held = { w: false, a: false, s: false, d: false };
|
|
1378
|
+
|
|
1379
|
+
function recomputeMove() {
|
|
1380
|
+
let mx = 0, my = 0;
|
|
1381
|
+
if (held.d) mx += 1;
|
|
1382
|
+
if (held.a) mx -= 1;
|
|
1383
|
+
if (held.w) my += 1;
|
|
1384
|
+
if (held.s) my -= 1;
|
|
1385
|
+
intent.move.set(mx, my);
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
function bindMoveKey(key, prop) {
|
|
1389
|
+
ic.bind(`keyboard/keys/${key}/down`, () => { held[prop] = true; recomputeMove(); });
|
|
1390
|
+
ic.bind(`keyboard/keys/${key}/up`, () => { held[prop] = false; recomputeMove(); });
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
bindMoveKey("w", "w");
|
|
1394
|
+
bindMoveKey("a", "a");
|
|
1395
|
+
bindMoveKey("s", "s");
|
|
1396
|
+
bindMoveKey("d", "d");
|
|
1397
|
+
|
|
1398
|
+
ic.bind("keyboard/keys/space/down", () => { intent.jump = true; });
|
|
1399
|
+
ic.bind("keyboard/keys/space/up", () => { intent.jump = false; });
|
|
1400
|
+
|
|
1401
|
+
// Sprint — hold Shift while moving (the controller reads intent.sprint; see prototype_first_person_controller).
|
|
1402
|
+
ic.bind("keyboard/keys/shift/down", () => { intent.sprint = true; });
|
|
1403
|
+
ic.bind("keyboard/keys/shift/up", () => { intent.sprint = false; });
|
|
1404
|
+
|
|
1405
|
+
// E — operate the door the player is standing next to (the motion system tracks which one is in range).
|
|
1406
|
+
ic.bind("keyboard/keys/e/down", () => { motion.toggleActiveDoor(); });
|
|
1407
|
+
|
|
1408
|
+
ic.bind("pointer/on/move", (position, event, delta) => {
|
|
1409
|
+
if (document.pointerLockElement === null) return;
|
|
1410
|
+
intent.look._add(delta.x * SENSITIVITY, delta.y * SENSITIVITY);
|
|
1411
|
+
});
|
|
1412
|
+
|
|
1413
|
+
ic.on.unlinked.add(() => {
|
|
1414
|
+
intent.move.set(0, 0);
|
|
1415
|
+
intent.look.set(0, 0);
|
|
1416
|
+
intent.jump = false;
|
|
1417
|
+
intent.sprint = false;
|
|
1418
|
+
});
|
|
1419
|
+
|
|
1420
|
+
new Entity()
|
|
1421
|
+
.add(ic)
|
|
1422
|
+
.add(Tag.fromJSON(["FirstPersonInputBindings"]))
|
|
1423
|
+
.add(SerializationMetadata.Transient)
|
|
1424
|
+
.build(ecd);
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
/**
|
|
1428
|
+
* Wire the canvas click to (a) start audio and (b) capture the mouse.
|
|
1429
|
+
*
|
|
1430
|
+
* The autoplay policy requires a user gesture before audio: the engine creates the context suspended and
|
|
1431
|
+
* starts ticking immediately, so we must not let a source play before the first click. On that click we resume
|
|
1432
|
+
* the context and — only once `resume()` has actually resolved — start the sources (attach emitters to the
|
|
1433
|
+
* pre-built markers + spawn the orbiter), so their first `playEvent` lands on a running context (no autoplay
|
|
1434
|
+
* warning). Pointer lock is (re)requested every click; ESC (browser default) releases it.
|
|
1435
|
+
*
|
|
1436
|
+
* @param {Engine} engine
|
|
1437
|
+
* @param {EntityComponentDataset} ecd
|
|
1438
|
+
* @param {{entity:number, spec:object}[]} staticSources the static source markers to attach emitters to
|
|
1439
|
+
*/
|
|
1440
|
+
function setupInteraction(engine, ecd, staticSources) {
|
|
1441
|
+
const el = engine.graphics.domElement;
|
|
1442
|
+
const captureEl = engine.viewStack.el;
|
|
1443
|
+
|
|
1444
|
+
let audioStarted = false;
|
|
1445
|
+
|
|
1446
|
+
captureEl.addEventListener("click", () => {
|
|
1447
|
+
if (!audioStarted) {
|
|
1448
|
+
audioStarted = true;
|
|
1449
|
+
// resume() returns the context.resume() promise — start the sources (attach emitters to the pre-built
|
|
1450
|
+
// markers + spawn the orbiter) only after it resolves, so the first playEvent lands on a running context.
|
|
1451
|
+
engine.sound.resumeContext().then(() => startSources(ecd, staticSources));
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
if (document.pointerLockElement === el || !el.requestPointerLock) return;
|
|
1455
|
+
let p;
|
|
1456
|
+
try {
|
|
1457
|
+
p = el.requestPointerLock({ unadjustedMovement: true });
|
|
1458
|
+
} catch (e) {
|
|
1459
|
+
el.requestPointerLock();
|
|
1460
|
+
return;
|
|
1461
|
+
}
|
|
1462
|
+
if (p && typeof p.catch === "function") {
|
|
1463
|
+
p.catch(() => { el.requestPointerLock(); });
|
|
1464
|
+
}
|
|
1465
|
+
});
|
|
1466
|
+
|
|
1467
|
+
captureEl.addEventListener("contextmenu", (e) => e.preventDefault());
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
function logHelp() {
|
|
1471
|
+
/* eslint-disable no-console */
|
|
1472
|
+
console.log("%cAcoustic solver — first-person walkaround",
|
|
1473
|
+
"color:#88ddff;font-weight:bold;font-size:14px");
|
|
1474
|
+
console.log("Click the canvas to capture the mouse (and start audio). ESC to release.");
|
|
1475
|
+
console.log("WASD = move | Shift = sprint | Mouse = look | Space = jump | E = operate a door | P = probe overlay");
|
|
1476
|
+
console.log("");
|
|
1477
|
+
console.log("%cThree sources + a tiny chamber — listen as you move:", "font-weight:bold");
|
|
1478
|
+
console.log(" • HOUSE (main-menu) — a tight, dead room; leaks from its DOOR (south) + WINDOW (north); a");
|
|
1479
|
+
console.log(" REFLECTOR wall north of the window bounces the window leak back at you");
|
|
1480
|
+
console.log(" • CATHEDRAL (main-menu, west across the gap) — a tall stone hall: long reverb + a coupled");
|
|
1481
|
+
console.log(" TOWER tail. SAME loop as the house, so the difference you hear is purely the room");
|
|
1482
|
+
console.log(" • ORBITER (WorldMode) — circles the scene from outside; fades in/out as buildings break LoS");
|
|
1483
|
+
console.log(" • SHACK (south-east) — a tiny hard reverb chamber; step in for a bright, ringy room tone");
|
|
1484
|
+
console.log(" • DOORS — walk up to the house door / cathedral entrance and press E to lower/raise it");
|
|
1485
|
+
console.log(" • RAMPS up onto the house roof + across to the cathedral roof; duck behind a barrier to occlude");
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
// =====================================================================
|
|
1489
|
+
// Probe visualization (toggleable debug overlay)
|
|
1490
|
+
// =====================================================================
|
|
1491
|
+
|
|
1492
|
+
/**
|
|
1493
|
+
* Toggleable debug overlay for the baked field: the probe positions (small 3-axis crosses) and the
|
|
1494
|
+
* visibility-graph edges (line segments between mutually-visible probes). Mimics
|
|
1495
|
+
* {@link visualize_tetrahedral_mesh} / {@link lpv_visualize_probes} — built as {@link DrawMode.LineSegments}
|
|
1496
|
+
* {@link ShadedGeometry}, and ADDED/REMOVED on toggle (so there is zero cost while hidden, and no reliance
|
|
1497
|
+
* on live flag mutation).
|
|
1498
|
+
*
|
|
1499
|
+
* @param {EntityComponentDataset} ecd
|
|
1500
|
+
* @param {AcousticProbeField} field
|
|
1501
|
+
* @returns {{toggle: function(): void, shown: boolean}}
|
|
1502
|
+
*/
|
|
1503
|
+
function makeProbeVisualization(ecd, field) {
|
|
1504
|
+
let ids = null; // [edgesEntity, probesEntity] while shown; null while hidden
|
|
1505
|
+
|
|
1506
|
+
function show() {
|
|
1507
|
+
// Magenta edges read clearly against the blue sky (cyan washed out); probe crosses stay amber.
|
|
1508
|
+
const edges = lineSegmentsEntity(buildVisibilityEdgesGeometry(field), 0xff00ff, 0.7);
|
|
1509
|
+
const probes = lineSegmentsEntity(buildProbeMarkersGeometry(field, 0.18), 0xffdd33, 1.0);
|
|
1510
|
+
edges.build(ecd);
|
|
1511
|
+
probes.build(ecd);
|
|
1512
|
+
ids = [edges.id, probes.id];
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
function hide() {
|
|
1516
|
+
for (const id of ids) {
|
|
1517
|
+
ecd.removeEntity(id);
|
|
1518
|
+
}
|
|
1519
|
+
ids = null;
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1522
|
+
return {
|
|
1523
|
+
toggle() {
|
|
1524
|
+
if (ids === null) {
|
|
1525
|
+
show();
|
|
1526
|
+
} else {
|
|
1527
|
+
hide();
|
|
1528
|
+
}
|
|
1529
|
+
},
|
|
1530
|
+
get shown() {
|
|
1531
|
+
return ids !== null;
|
|
1532
|
+
},
|
|
1533
|
+
};
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
/**
|
|
1537
|
+
* A LineSegments {@link ShadedGeometry} entity over `geometry` — the unlit, shadowless, no-depth-write
|
|
1538
|
+
* debug-draw recipe from {@link visualize_tetrahedral_mesh}. Geometry positions are absolute world coords,
|
|
1539
|
+
* so the entity carries an identity {@link Transform}.
|
|
1540
|
+
*/
|
|
1541
|
+
function lineSegmentsEntity(geometry, color, opacity) {
|
|
1542
|
+
const material = new LineBasicMaterial({ color, transparent: true, opacity, depthWrite: false });
|
|
1543
|
+
const sg = ShadedGeometry.from(geometry, material, DrawMode.LineSegments);
|
|
1544
|
+
sg.clearFlag(ShadedGeometryFlags.CastShadow);
|
|
1545
|
+
sg.clearFlag(ShadedGeometryFlags.ReceiveShadow);
|
|
1546
|
+
|
|
1547
|
+
return new Entity()
|
|
1548
|
+
.add(sg)
|
|
1549
|
+
.add(Tag.fromJSON(["ProbeViz"]))
|
|
1550
|
+
.add(SerializationMetadata.Transient)
|
|
1551
|
+
.add(new Transform());
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
/** LineSegments geometry: one segment per visibility-graph edge (each undirected edge emitted once). */
|
|
1555
|
+
function buildVisibilityEdgesGeometry(field) {
|
|
1556
|
+
const positions = [];
|
|
1557
|
+
const graph = field.visibilityGraph;
|
|
1558
|
+
|
|
1559
|
+
if (graph !== null) {
|
|
1560
|
+
const addresses = graph.edge_addresses;
|
|
1561
|
+
const adjacency = graph.adjacency;
|
|
1562
|
+
|
|
1563
|
+
for (let v = 0; v < graph.vertex_count; v++) {
|
|
1564
|
+
const end = addresses[v + 1];
|
|
1565
|
+
for (let k = addresses[v]; k < end; k++) {
|
|
1566
|
+
const u = adjacency[k];
|
|
1567
|
+
if (v < u) { // CSR is symmetric — emit each undirected edge once
|
|
1568
|
+
positions.push(field.probeX(v), field.probeY(v), field.probeZ(v));
|
|
1569
|
+
positions.push(field.probeX(u), field.probeY(u), field.probeZ(u));
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
return lineGeometry(positions);
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1578
|
+
/** LineSegments geometry: a small 3-axis cross (3 segments) at each probe position. */
|
|
1579
|
+
function buildProbeMarkersGeometry(field, r) {
|
|
1580
|
+
const positions = [];
|
|
1581
|
+
|
|
1582
|
+
for (let i = 0; i < field.size; i++) {
|
|
1583
|
+
const x = field.probeX(i);
|
|
1584
|
+
const y = field.probeY(i);
|
|
1585
|
+
const z = field.probeZ(i);
|
|
1586
|
+
|
|
1587
|
+
positions.push(x - r, y, z, x + r, y, z);
|
|
1588
|
+
positions.push(x, y - r, z, x, y + r, z);
|
|
1589
|
+
positions.push(x, y, z - r, x, y, z + r);
|
|
1590
|
+
}
|
|
1591
|
+
|
|
1592
|
+
return lineGeometry(positions);
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
/** A BufferGeometry with a single position attribute (3 floats/vertex). */
|
|
1596
|
+
function lineGeometry(positions) {
|
|
1597
|
+
const geometry = new BufferGeometry();
|
|
1598
|
+
geometry.setAttribute("position", new Float32BufferAttribute(positions, 3));
|
|
1599
|
+
return geometry;
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1602
|
+
/**
|
|
1603
|
+
* On-screen toggle for the probe overlay: a top-right button plus the P key. (The button can't be clicked
|
|
1604
|
+
* while the pointer is locked — the OS hides the cursor — so the key is the in-play toggle; ESC unlocks to
|
|
1605
|
+
* reach the button.)
|
|
1606
|
+
*
|
|
1607
|
+
* @param {{toggle: function(): void, shown: boolean}} viz
|
|
1608
|
+
*/
|
|
1609
|
+
function setupProbeVizToggle(viz) {
|
|
1610
|
+
const button = document.createElement("button");
|
|
1611
|
+
Object.assign(button.style, {
|
|
1612
|
+
position: "absolute",
|
|
1613
|
+
top: "10px",
|
|
1614
|
+
right: "10px",
|
|
1615
|
+
zIndex: "1000",
|
|
1616
|
+
padding: "8px 12px",
|
|
1617
|
+
font: "13px sans-serif",
|
|
1618
|
+
color: "#cfe6ff",
|
|
1619
|
+
background: "rgba(18,26,34,0.85)",
|
|
1620
|
+
border: "1px solid #3a6ea5",
|
|
1621
|
+
borderRadius: "4px",
|
|
1622
|
+
cursor: "pointer",
|
|
1623
|
+
});
|
|
1624
|
+
|
|
1625
|
+
function sync() {
|
|
1626
|
+
button.textContent = `Probes: ${viz.shown ? "ON" : "off"} (P)`;
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
sync();
|
|
1630
|
+
|
|
1631
|
+
button.addEventListener("click", (e) => {
|
|
1632
|
+
e.stopPropagation(); // don't let the canvas capture-click also fire (pointer lock)
|
|
1633
|
+
viz.toggle();
|
|
1634
|
+
sync();
|
|
1635
|
+
});
|
|
1636
|
+
|
|
1637
|
+
document.body.appendChild(button);
|
|
1638
|
+
|
|
1639
|
+
window.addEventListener("keydown", (e) => {
|
|
1640
|
+
if (e.code === "KeyP") {
|
|
1641
|
+
viz.toggle();
|
|
1642
|
+
sync();
|
|
1643
|
+
}
|
|
1644
|
+
});
|
|
1645
|
+
}
|
|
1646
|
+
|
|
1647
|
+
async function init() {
|
|
1648
|
+
await eh.initialize({ configuration: setupSound });
|
|
1649
|
+
await main(eh.engine);
|
|
1650
|
+
}
|
|
1651
|
+
|
|
1652
|
+
init();
|