Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpolation exploration #28

Open
wants to merge 2 commits into
base: master-bevy_0.15
Choose a base branch
from

Conversation

Vrixyz
Copy link
Owner

@Vrixyz Vrixyz commented Nov 25, 2024

Current interpolation within bevy_rapier is complex to understand in which schedules it takes place, and how it interact with those. Using bevy_transform_interpolate could help with simplifying bevy_rapier codebase and offer a better experience for users.

Screencast.from.11-25-2024.04.11.24.PM.webm

Comment on lines +17 to +21
.insert_resource(TimestepMode::Variable {
max_dt: 100f32,
time_scale: 1f32,
substeps: 10,
})
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ends up in a warning recommending using fixed timestamp, but that doesn´t make much sense because then we use Time<Fixed> ; also, TimestepMode::Variable allows us to modify time_scale.

.add_plugins((
DefaultPlugins,
TransformInterpolationPlugin::default(),
RapierPhysicsPlugin::<NoUserData>::pixels_per_meter(100.0).in_fixed_schedule(),
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bevy_transform_interpolation wouldn't work if we used Update ; but it makes no sense to interpolate when using Update schedule.

Comment on lines +164 to +177
DebugRenderObject::RigidBody(h, ..) => {
let Some(collider) = self.context.bodies.get(h) else {
return false;
};
let entity = Entity::from_bits(collider.user_data as u64);

let collider_debug =
if let Ok(collider_override) = self.override_visibility.get(entity) {
*collider_override
} else {
self.default_collider_debug
};
collider_debug == ColliderDebug::AlwaysRender
}
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is outside of this PR's scope, but helps with suppressing debug drawing for rigidbodies ; we could parameterize more the ColliderDebug but I'm leaving it as a future exercise on user feedback for now.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example should be added to scraped examples

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