Open glklimmer opened 2 months ago
The panics do not seem to be related to WindowPlugin.
Info for you and anyone else who lands here trying to do the same in the future:
There's a few things missing when launching with MinimalPlugins
that cause a panic:
AssetPlugin
ScenePlugin
Assets<Mesh> resource
Also missing but doesn't cause a panic:
TransformPlugin
These requirements are implicitly codified in tests.rs::create_app here, but this information isn't easy to find.
With the following changes I was able to get your code above running:
fn main() {
App::new()
.add_plugins(MinimalPlugins.set(ScheduleRunnerPlugin::run_once()))
+ .add_plugins((
+ TransformPlugin,
+ bevy::asset::AssetPlugin::default(),
+ bevy::scene::ScenePlugin,
+ ))
+ .init_resource::<Assets<Mesh>>()
.add_systems(Update, hello_world_system)
.add_plugins(PhysicsPlugins::default())
.run();
}
If you don't need mesh colliders, you can avoid the need for Assets<Mesh>
resource and ScenePlugin
if you disable the bevy_scene
and collider-from-mesh
features.
I don't see a way that it could be possible to remove the reliance on TransformPlugin since so much of Avian works with GlobalTransform.
Description:
Bevy provides a
MinimalPlugins
plugin bundle for headless bevy applications. Headless applications can be used to implement a game server for example. When trying to add the default AvianPhysicsPlugins
Plugin Bundle Bevy a panics.Minimal Example:
Here is a minimal example for a simple headless bevy application.
Which results in the following error.
Is this a bug?
Does
PhysicsPlugins::default()
include plugins that can not be used withoutbevy_window::WindowPlugin
maybe? If yes, would it make sense to also provide aMinimalPlugins
bundle for avian physics? What plugins would I need to exclude?Thanks!