Rework module structure, and improve documentation and Rotation
#370
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.
Objective
Note: This PR targets the
avian
branch instead ofmain
. This is intended, as this is a part of an ongoing rework.The current module structure is not ideal.
components
just contains a bunch of components with no clear separation of concerns, and some components are still stored elsewhere, so it's not even comprehensive at all.resources
has the same issue; no separation of concerns, and it's pretty random which resources are there vs. elsewhere.constraints
a top-level module? It's mainly a solver implementation detail.plugins
is weird, because it has sub-folders with sub-plugins, and really it's just a folder for basically all functionality in the engine.The lack of separation of concerns harms the modularity of the engine and can make it harder to find things. For a project at this scale, modules like
components
are bad.Solution
plugins
,components
, andresources
, flatten the module structure.collision
.dynamics
schedule
.dynamics
module for encapsulating rigid body dynamics (solver, sleeping, rigid body components, etc.), which also gives a nice place for more high-level docs.This PR also contains some other miscallaneous improvements:
PhysicsSetupPlugin
intoPhysicsSchedulePlugin
andPhysicsTypeRegistrationPlugin
Rotation
type, making it closer match Bevy's newRot2
.Migration Guide
prelude
should work like before, but explicit import paths may be broken.PhysicsSetupPlugin
has been split intoPhysicsSchedulePlugin
andPhysicsTypeRegistrationPlugin
.