Conversation
Version pins bumped from 0.18.0 to 0.19.0. API adaptations: - SceneRoot -> WorldAssetRoot - TextFont: font_size: f32 -> FontSize::Px - TextLayout::new_with_justify -> TextLayout::justify - DirectionalLight: shadows_enabled -> shadow_maps_enabled - Skybox::image is now Option<Handle<Image>> - Hdr moved from bevy::render::view to bevy::camera - SystemState::get_mut is now fallible; tests unwrap Add a multi_threaded feature that passes through to bevy_ecs, bevy_tasks, and bevy_transform, since Bevy 0.19 no longer implies parallel transform propagation via std. Derive Clone on BigSpace and Default + Clone + Copy + Debug on FloatingOrigin so both are usable in bsn! scene templates (blanket-implemented for Default + Clone components). Grid and CellCoord were already compatible. Fix Rust 1.97 clippy lints: while_let_loop in stationary::mark_ancestor_grids and some_filter in BigSpace::validate_floating_origin. Fix first_frame_spawn_waits_for_fixed_update by pausing Time<Virtual> so FixedUpdate cannot tick between Frame 0 and Frame 1 on a loaded machine. Bump big_space to 0.13.0, add compat row to README. Co-authored-by: Martin Edlund <edlund@netzwerkplan.de> Co-authored-by: Alex Rozgo <alex.rozgo@gmail.com>
Runs each example in alphabetical order, waiting for its window to close
before launching the next. Discovers examples at runtime by scanning
examples/*.rs, so new examples are picked up automatically.
Uses env!("CARGO") + std::process::Command, so it works on any host
without a shell. Run with: cargo run --bin run_examples
BigSpaceDebugPlugin's cell visualization reads PartitionLookup<F>, which comes from PartitionPlugin<F> backed by CellHashingPlugin<F>. Those are deliberately not added here because spatial hashing has runtime cost that should stay an explicit opt-in. Previously, a caller who added BigSpaceDebugPlugin without also adding the two hashing plugins silently got no cell visualization. This adds a Plugin::finish check that logs a warning naming the missing plugin(s) with their exact SpatialHashFilter parameterization. Every example that uses BigSpaceDefaultPlugins now installs the two plugins explicitly so the warning does not fire for shipped examples.
…arch nearest_via_partitions iterates entities tracked by CellHashingPlugin, which only tracks entities with CellCoord. Scenes loaded via WorldAssetRoot put the mesh on a descendant of the CellCoord root, so the mesh's Aabb was invisible to the search and the camera failed to slow down near GLTF-loaded objects (the planets example spaceship). When a partition entity has no Aabb of its own, walk its descendants and stop at the first Aabb-carrying one. Under the existing invariant that objects fit inside their cell, that first hit is a valid proxy for the whole object. When the partition entity does have its own Aabb (the inline-mesh case), the walk is skipped, so this costs one extra Query::contains check on entities that had a match anyway. The brute-force fallback path already handled this because it iterates every entity matching the objects query directly.
Fixes several defects in the descendant walk of the partition-accelerated nearest-object search: - It stopped at the first Aabb-carrying descendant even when that descendant was rejected by the candidate filters (render layer, visibility, camera's own children), hiding valid sibling meshes of the same scene. Replaced with a depth-first walk that considers every Aabb-bearing node. - The walk was unbounded for a partition entity whose subtree had no Aabb. It now prunes nested CellCoord subtrees, since each is a distinct spatial object visited through its own cell entry; this bounds the walk to one object's hierarchy and avoids considering an entity twice. - entity_nearest_distance scaled the Aabb by the entity's local Transform, ignoring ancestor scale, so a mesh under a scaled WorldAssetRoot reported the wrong size. It now uses the world scale from GlobalTransform. - The partition path did a redundant contains() then get() per entity, and duplicated the candidate-filter logic already in the brute-force path. Both paths now share candidate_distance() and a NearestCtx context, and the unused Transform is dropped from the objects query. Also replace Unicode arrows and dashes in code comments with ASCII.
BigSpaceDefaultPlugins previously auto-added BigSpaceDebugPlugin::<()> under the debug feature. That was invisible to the caller and caused two friction points: users with a filtered hashing setup saw a startup warning about the ()-parameterized dependencies they never asked for, and users who followed the debug plugin's docs and added it explicitly alongside the default group panicked on Bevy's duplicate-plugin check. Remove the auto-add and introduce BigSpaceDebugPlugins, a group that bundles CellHashingPlugin::<()>, PartitionPlugin::<()>, and BigSpaceDebugPlugin::default(). Debug visualization is now a single explicit opt-in that arrives complete, and the debug plugin's docstring points at the group as the recommended path. Every example that used to hand-roll the three plugins now uses the group. spatial_hash keeps its explicit composition because it uses the hashing infrastructure for its own demonstration rather than for gizmos.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bevy 0.19 update itself:
bevy_*pins from0.18.0to0.19.0and adapts to the renamed/moved APIs (SceneRoot->WorldAssetRoot,FontSize::Px,TextLayout::justify,shadow_maps_enabled,Skybox::imagenow optional,Hdrinbevy::camera, fallibleSystemState::get_mut).multi_threadedfeature that passes through tobevy_ecs,bevy_tasks, andbevy_transform, since 0.19 no longer implies parallel transform propagation viastd.CloneonBigSpaceandDefault + Clone + Copy + DebugonFloatingOriginso both are usable in 0.19'sbsn!scene templates.GridandCellCoordwere already compatible.while_let_loop,some_filter) that would fail-D warningson the current stable.first_frame_spawn_waits_for_fixed_updateby pausingTime<Virtual>soFixedUpdatecannot tick between Frame 0 and Frame 1 on a loaded machine.big_spaceto0.13.0and adds a compat row to the README.Also included (pre-existing issues surfaced while manually validating each example):
run_examplesbinary.cargo run --bin run_exampleswalks everyexamples/*.rssequentially, waiting for each window to close before launching the next. Discovers examples at runtime; new ones show up automatically. Cross-platform, no shell.BigSpaceDebugPluginsgroup.BigSpaceDefaultPluginsno longer auto-addsBigSpaceDebugPlugin; instead the new group bundlesCellHashingPlugin::<()>,PartitionPlugin::<()>, andBigSpaceDebugPlugin::default(). Debug visualization is now a single explicit opt-in that arrives complete, avoiding the hidden auto-add that caused startup warnings for filtered-hashing setups and duplicate-plugin panics for callers who added the debug plugin explicitly.BigSpaceDebugPluginalso warns at startup ifCellHashingPlugin<F>orPartitionPlugin<F>are missing, as a safety net for callers who add the raw plugin without the group.nearest_via_partitionsnow walksCellCoorddescendants (depth-first, considering everyAabb-bearing node, pruning at nestedCellCoordboundaries), so scenes loaded viaWorldAssetRootparticipate in the search. Previously the camera failed to slow near GLTF objects because the mesh sits on a descendant of theCellCoordroot. Also fixes a related issue whereentity_nearest_distancescaled theAabbby the entity's localTransformand missed ancestor scale, so a mesh under a scaledWorldAssetRootreported the wrong size (usesGlobalTransform::scale()now). Brute-force and partition paths share a single candidate-filter helper so they can't drift.Closes #73 and closes #77 with credit to @m-edlund and @rozgo (co-authored on the first commit). The Bevy 0.19 update itself is deliberately scoped narrower than #77. It leaves out the bundle removals, new required components, debug cell labels, BSN example, and additional plugin installations. Those changes from #77 are worth discussing on their own merit in follow-up PRs rather than folded into a version bump.