Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions bevy_rapier2d/examples/testbed2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ mod rope_joint2;
mod voxels2;

use bevy::{
camera::visibility::RenderLayers,
ecs::world::error::{EntityDespawnError, EntityMutableFetchError},
prelude::*,
};
use bevy_egui::{egui, EguiContexts, EguiPlugin};
use bevy_egui::{egui, EguiContexts, EguiPlugin, EguiPrimaryContextPass};
use bevy_inspector_egui::quick::WorldInspectorPlugin;
use bevy_rapier2d::prelude::*;

Expand Down Expand Up @@ -90,6 +91,17 @@ fn main() {
(Examples::PlayerMovement2, "PlayerMovement2").into(),
]))
.init_resource::<ExampleSelected>()
.add_systems(PreStartup, |mut commands: Commands| {
commands.spawn((
Camera2d,
bevy_egui::PrimaryEguiContext,
Camera {
order: 999,
..Default::default()
},
RenderLayers::none(),
));
})
//
//boxes2
.add_systems(
Expand Down Expand Up @@ -240,7 +252,7 @@ fn main() {
)
.add_systems(OnExit(Examples::None), init)
.add_systems(
Update,
EguiPrimaryContextPass,
(
ui_example_system,
change_example.run_if(resource_changed::<ExampleSelected>),
Expand Down
21 changes: 15 additions & 6 deletions bevy_rapier3d/examples/testbed3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ mod static_trimesh3;
mod voxels3;

use bevy::{
camera::visibility::RenderLayers,
ecs::world::error::{EntityDespawnError, EntityMutableFetchError},
prelude::*,
};
use bevy_egui::{egui, EguiContexts, EguiPlugin};
use bevy_egui::{egui, EguiContexts, EguiPlugin, EguiPrimaryContextPass};
use bevy_inspector_egui::quick::WorldInspectorPlugin;
use bevy_rapier3d::prelude::*;

Expand Down Expand Up @@ -67,10 +68,7 @@ fn main() {
app.init_resource::<ExamplesRes>()
.add_plugins((
DefaultPlugins,
EguiPlugin {
enable_multipass_for_primary_context: false,
..Default::default()
},
EguiPlugin::default(),
RapierPhysicsPlugin::<NoUserData>::default(),
RapierDebugRenderPlugin::default(),
WorldInspectorPlugin::new(),
Expand All @@ -95,6 +93,17 @@ fn main() {
(Examples::StaticTrimesh3, "StaticTrimesh3").into(),
]))
.init_resource::<ExampleSelected>()
.add_systems(PreStartup, |mut commands: Commands| {
commands.spawn((
Camera2d,
bevy_egui::PrimaryEguiContext,
Camera {
order: 999,
..Default::default()
},
RenderLayers::none(),
));
})
//
// boxes3
.add_systems(
Expand Down Expand Up @@ -235,7 +244,7 @@ fn main() {
)
.add_systems(OnExit(Examples::None), init)
.add_systems(
Update,
EguiPrimaryContextPass,
(
ui_example_system,
change_example.run_if(resource_changed::<ExampleSelected>),
Expand Down