Skip to content

update to bevy 0.19 - #66

Closed
m-edlund wants to merge 1 commit into
aevyrie:mainfrom
m-edlund:bevy-0.19
Closed

m-edlund wants to merge 1 commit into
aevyrie:mainfrom
m-edlund:bevy-0.19

Conversation

@m-edlund

Copy link
Copy Markdown
Contributor

This PR still depends on aevyrie/big_space#73 and aevyrie/bevy_framepace#77 once those two crates have been released for bevy 0.19, this PR can be updated.

Only minor changes for examples and crate were required to get it working. CAD example required exchanging the specular and diffuse maps with the versions from bevy.

virtualritz added a commit to virtualritz/monster-step-viewer that referenced this pull request Aug 15, 2026
Bumps bevy 0.18 -> 0.19.1, bevy_egui 0.39 -> 0.41 (egui 0.32 -> 0.35,
wgpu 27 -> 29) and monstertruck to a `[patch.crates-io]` git overlay.
bevy_editor_cam has no bevy 0.19 release -- 0.9.1 and upstream `main`
both still pin 0.18 -- so it tracks the open upstream PR
(aevyrie/bevy_editor_cam#66) until that lands. glam stays at 0.32, which
bevy 0.19 also uses, collapsing the previous duplicate (0.30 + 0.32).

The API churn this forced:

- egui 0.35 attaches panels to a `Ui` rather than the `Context`, and
  merged `SidePanel`/`TopBottomPanel` into `Panel`. `ui_system` now builds
  one root `Ui` spanning the viewport and threads it through `viewer_ui`
  and `browser_ui`. `PanelState::rect` became `outer_rect` (egui aliases
  the old key, so stored panel widths still load) and `width_range` became
  `size_range`.
- `EguiContextSettings::scale_factor` is gone; Ctrl +/-/0 drives
  `Context::set_zoom_factor` instead, which orphaned the settings query.
- bevy 0.19 renames `ShaderStorageBuffer` -> `ShaderBuffer` and
  `DirectionalLight::shadows_enabled` -> `shadow_maps_enabled`, and
  `Assets::get_mut` now hands back a guard.
- `OrbitConstraint::Fixed::up` is a `DVec3` as of bevy_editor_cam 0.9.

Separately, the quality slider did nothing on shells whose faces are all
untrimmed. Such files carry no cartesian vertices and no edge curves --
our STEP exporter writes those faces as a `FACE_SURFACE` bounded by a
degenerate `VERTEX_LOOP` over a `POINT_ON_SURFACE` -- so
`compute_shell_bounds` came up empty, `diameter * factor` collapsed to
the `TOLERANCE` floor of 1e-6, and every slider position tessellated
identically. On a 852-patch creased cube that was 6.5M triangles and
~2GB at *every* setting, and re-tessellating held two copies live, which
exhausted memory. It now delegates to monstertruck's
`bounding_box_with`, which falls back to sampling face surfaces when
there is no topology to walk; mapping each sampled point keeps the box
exact, where transforming a finished box's corners would inflate it by
up to sqrt(3) and weaken `mesh_fits_shell_bounds`. The tolerance sites
use `relative_tolerance`, deriving from the untransformed shell -- which
is what tessellation actually runs on. Coarse/default/fine now give
1704 / 4884 / 402872 triangles instead of 6494096 throughout.

Also switches the loader's hash containers to `ahash` behind
`crate::HashMap`/`HashSet` (std types with ahash's hasher, so rayon's
`FromParallelIterator` and friends still apply), and makes a left-drag
orbit so a single-finger touchpad drag works -- right-drag needs an
awkward two-finger click and middle-drag for pan is often impossible.
Click-to-select is unaffected: selection is decided on release against
the existing 4px threshold.

These are one commit because the changes interleave within scene.rs and
step_loader.rs; no intermediate split was independently verified.

check.sh passes: native, wasm, fmt, clippy -D warnings, 40 tests, doc
tests, trunk build.
@aevyrie aevyrie mentioned this pull request Oct 8, 2026
@aevyrie

aevyrie commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Bevy 0.19 support is now merged in #72. That PR includes this migration and preserves Martin Edlund (@m-edlund) as the author of the original commit. Closing this superseded PR.

@aevyrie aevyrie closed this Oct 8, 2026
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.

2 participants