-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: master-bevy_0.15
Are you sure you want to change the base?
Conversation
065af11
to
8e616d9
Compare
.insert_resource(TimestepMode::Variable { | ||
max_dt: 100f32, | ||
time_scale: 1f32, | ||
substeps: 10, | ||
}) |
There was a problem hiding this comment.
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(), |
There was a problem hiding this comment.
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.
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 | ||
} |
There was a problem hiding this comment.
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.
8e616d9
to
66c0b2e
Compare
There was a problem hiding this comment.
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
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