Skip to content

Conversation

@philiplinden
Copy link
Member

Custom simulation schedule --> Bevy

I am switching to Bevy for the simulation. Bevy is a game engine built upon an ECS framework. It allows for high performance, multi-threaded, dynamic simulations with 3D graphics and rich interactive GUIs.

The first reason is that I want to be able to spend more time on the interactions between the HAB components and less time on the fundamental physics and simulation scheduling loop. Bevy has a very nice schedule system that allows for easy parallelization of systems. It also has a component system that allows me to keep all the logic for the physics systems close to the objects that they act on. For example, all of the solid bodies that will need to have drag applied will have a Body component, and the logic to calculate the drag on those bodies will be computed from the their mesh using custom colliders and forces on top of the physics engine, Avian, that takes care of equations of motion, collisions, and constraints.

The second reason is that I want to be able to run the simulation in a web browser. Bevy has a web backend that allows for this and very nice tools for visualizing the simulation state. It also has first-class support for Egui which is a library for building interactive GUIs with Bevy Egui, and first-class support for loading assets like configs, 3D models, and textures.

These changes aim to enhance the simulation's performance, maintainability, and user experience by leveraging Bevy's capabilities and improving the organization of physics components.

Other notable changes

  • CI workflows have been added. They are based on recommended actions for building Bevy apps.
  • Release vs dev build optimizations have been added to Cargo.toml

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.

1 participant