Skip to content

Update to Bevy 0.19 - #78

Merged
aevyrie merged 8 commits into
mainfrom
bevy-0.19
Oct 8, 2026
Merged

aevyrie merged 8 commits into
mainfrom
bevy-0.19

Conversation

@aevyrie

@aevyrie aevyrie commented Jul 16, 2026 •

Copy link
Copy Markdown
Owner

Updates big_space to Bevy 0.19, released as 0.13.0.

Changes

Bevy 0.19 API changes:

  • SceneRoot is now WorldAssetRoot
  • font sizes use FontSize::Px
  • TextLayout::new_with_justify is now TextLayout::justify
  • shadows_enabled is now shadow_maps_enabled
  • the skybox image is optional
  • Hdr moved to bevy::camera
  • SystemState::get_mut returns a Result

New multi_threaded feature. Bevy 0.19 no longer enables parallel transform propagation through std, so this feature forwards to the Bevy ECS, task, and transform crates.

BigSpace derives Clone and FloatingOrigin derives Default, Clone, Copy, and Debug, so both work in BSN scenes.

Breaking: the default plugin group no longer adds the debug plugin. Add BigSpaceDebugPlugins instead, which includes the cell hashing and partition plugins the debug plugin needs. The old automatic add caused warnings with filtered spatial hashes and panicked if you added the debug plugin yourself.

The camera's nearest-object search now checks descendants of entities with a cell coordinate, so it slows down near loaded GLTFs. It also uses the global scale instead of the local one.

cargo run --bin run_examples runs every example in turn.

Also fixes two new Rust 1.97 clippy lints, a flaky stationary test, and the error and planets examples missing the debug feature requirement.

Testing

Unit tests pass, and I checked every example by eye with run_examples. Wasm is only build-checked.

Closes #73 and #77. Co-authored by @m-edlund, @rozgo, and @Lethja. The parts of #77 beyond the version bump can go in separate PRs.

aevyrie and others added 6 commits July 15, 2026 23:38
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.
@JViggiani

Copy link
Copy Markdown

Hello, what's the status of this, is it ready for merging?

@salixsalicaceae salixsalicaceae left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this branch, everything works after the Cargo.toml change.

Comment thread examples/error.rs
.add_plugins((
DefaultPlugins.build().disable::<TransformPlugin>(),
BigSpaceDefaultPlugins,
BigSpaceDebugPlugins::default(),

@salixsalicaceae salixsalicaceae Oct 7, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be made available by adding the debug feature to this example.

Comment thread Cargo.toml

[[example]]
name = "error"
path = "examples/error.rs"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
path = "examples/error.rs"
required-features = ["debug"]

Both examples use BigSpaceDebugPlugins, which only exists with the debug feature, so cargo check --no-default-features failed. Both now list debug in required-features.
Moves the unreleased notes under v0.13.0, adds the debug plugin group, Stationary, and propagation changes, and restores the missing v0.11.0 and v0.12.0 headings.
@aevyrie
aevyrie merged commit 1cdf1ad into main Oct 8, 2026
9 checks passed
@aevyrie
aevyrie deleted the bevy-0.19 branch October 8, 2026 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants