Skip to content

Commit cf6a974

Browse files
committed
Fix early return
1 parent c25fa02 commit cf6a974

File tree

9 files changed

+36
-1
lines changed

9 files changed

+36
-1
lines changed

bevy_rapier3d/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ serde = { version = "1", features = [ "derive" ], optional = true}
4646
bevy = { version = "0.11", default-features = false, features = ["x11"]}
4747
approx = "0.5.1"
4848
glam = { version = "0.24", features = [ "approx" ] }
49+
bevy-inspector-egui = "0.19"
4950

5051
[package.metadata.docs.rs]
5152
# Enable all the features when building the docs on docs.rs

bevy_rapier3d/examples/boxes3.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ fn main() {
1212
DefaultPlugins,
1313
RapierPhysicsPlugin::<NoUserData>::default(),
1414
RapierDebugRenderPlugin::default(),
15+
bevy_inspector_egui::quick::WorldInspectorPlugin::default(),
1516
))
1617
.add_systems(Startup, (setup_graphics, setup_physics))
1718
.run();
@@ -33,6 +34,7 @@ pub fn setup_physics(mut commands: Commands) {
3334
let ground_height = 0.1;
3435

3536
commands.spawn((
37+
Name::new("Ground"),
3638
TransformBundle::from(Transform::from_xyz(0.0, -ground_height, 0.0)),
3739
Collider::cuboid(ground_size, ground_height, ground_size),
3840
));
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
use bevy::prelude::*;
2+
use bevy_rapier3d::prelude::*;
3+
4+
fn main() {
5+
App::new()
6+
.add_plugins(DefaultPlugins)
7+
.add_plugins(RapierPhysicsPlugin::<NoUserData>::default())
8+
.add_plugins(RapierDebugRenderPlugin::default())
9+
.insert_resource(RapierConfiguration::default())
10+
.add_systems(Startup, setup)
11+
.add_systems(Update, test)
12+
.run();
13+
}
14+
15+
fn test(ctx: Res<RapierContext>, query: Query<(Entity, &Transform), With<RigidBody>>) {
16+
for (entity, transform) in &query {
17+
info!("transform: {:.1?}", transform.translation);
18+
}
19+
}
20+
21+
fn setup(mut commands: Commands) {
22+
commands.spawn(Camera3dBundle {
23+
transform: Transform::from_xyz(-3.0, 3.0, 10.0).looking_at(Vec3::ZERO, Vec3::Y),
24+
..Default::default()
25+
});
26+
27+
commands
28+
.spawn(RigidBody::KinematicVelocityBased)
29+
.insert(Collider::ball(0.5))
30+
.insert(Velocity::linear(Vec3::Y * -1.81))
31+
.insert(TransformBundle::from(Transform::from_xyz(0.0, 1.0, 0.0)));
32+
}

new.tracy

9.66 MB
Binary file not shown.

novelocity.tracy

9.75 MB
Binary file not shown.

src/plugin/systems.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ pub fn writeback_rigid_bodies(
538538
let context = &mut *context;
539539
let scale = context.physics_scale;
540540

541-
if config.physics_pipeline_active {
541+
if !config.physics_pipeline_active {
542542
return;
543543
}
544544

writeback-2.tracy

3.13 MB
Binary file not shown.

writeback-3.tracy

14.4 MB
Binary file not shown.

writeback.tracy

10 MB
Binary file not shown.

0 commit comments

Comments
 (0)