joints example bug reproduction + a 'fix' in userspace#536
Closed
ThierryBerger wants to merge 1 commit into
Closed
joints example bug reproduction + a 'fix' in userspace#536ThierryBerger wants to merge 1 commit into
ThierryBerger wants to merge 1 commit into
Conversation
Contributor
Author
|
closed in favor of dimforge/rapier#659 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
code for investigation on #535.
What I did in this PR:
app.update()), code is in comments.My hypotheses:
NaNtranslation/rotation arrive during the simulation, a call to rapier function. So either it's a bug from rapier, or the state calling of the rapier context is invalid somehow. Either way, debugging this is overwhelming and resolution for that would benefit including a debugging helper (error messages, CI, examples...).delta_timebeing0is the cause forNaNvalues 🎉 !investigation for inconsistent rapier state
the dynamic body is getting
NaNtranslation/rotation after the first simulation run:🟢 The deltatime of
integration_parametersbeing0is causing the simulation to return theNaNvalues. If I force set it to0.0000001before the first simulation, the behaviour works as expected 🎉 !Now for the proper fix, we have several options:
NaNvalues and fix that. 🔍 Currently investigating.Opened dimforge/rapier#660 to fix that within rapier.
investigation on system order ambiguities
Helpful to get a feeling about current ambiguities: ThierryBerger#21
Current ambiguities reported by bevy detection:
2024-06-20T08:07:28.639475Z WARN bevy_ecs::schedule::schedule: Schedule PostUpdate has ambiguities. 43 pairs of systems with conflicting data access have indeterminate execution order. Consider adding `before`, `after`, or `ambiguous_with` relationships between these: -- add_clusters (in set AddClusters) and camera_system<PerspectiveProjection> (in set CameraUpdateSystem) conflict on: ["bevy_render::camera::camera::Camera"] -- add_clusters (in set AddClusters) and camera_system<OrthographicProjection> (in set CameraUpdateSystem) conflict on: ["bevy_render::camera::camera::Camera"] -- add_clusters (in set AddClusters) and camera_system<Projection> (in set CameraUpdateSystem) conflict on: ["bevy_render::camera::camera::Camera"] -- no_automatic_morph_batching and apply_deferred (in set SyncBackend) conflict on: bevy_ecs::world::World -- no_automatic_skin_batching and apply_deferred (in set SyncBackend) conflict on: bevy_ecs::world::World -- compute_slices_on_sprite_change (in set ComputeSlices) and apply_deferred (in set SyncBackend) conflict on: bevy_ecs::world::World -- compute_slices_on_asset_event (in set ComputeSlices) and apply_deferred (in set SyncBackend) conflict on: bevy_ecs::world::World -- check_msaa and apply_deferred (in set SyncBackend) conflict on: bevy_ecs::world::World -- inherit_weights and apply_deferred (in set SyncBackend) conflict on: bevy_ecs::world::World -- reset_view_visibility (in set VisibilityPropagate) and apply_deferred (in set SyncBackend) conflict on: bevy_ecs::world::World -- setup_physics and apply_deferred (in set SyncBackend) conflict on: bevy_ecs::world::World -- visibility_propagate_system (in set VisibilityPropagate) and apply_deferred (in set SyncBackend) conflict on: bevy_ecs::world::World -- insert_deferred_lighting_pass_id_component and apply_deferred (in set SyncBackend) conflict on: bevy_ecs::world::World -- sync_removals and update_character_controls (in set SyncBackend) conflict on: ["bevy_rapier2d::plugin::context::RapierContext"] -- sync_removals and init_rigid_bodies (in set SyncBackend) conflict on: ["bevy_rapier2d::plugin::context::RapierContext"] -- sync_removals and init_colliders (in set SyncBackend) conflict on: ["bevy_rapier2d::plugin::context::RapierContext"] -- sync_removals and init_joints (in set SyncBackend) conflict on: ["bevy_rapier2d::plugin::context::RapierContext"] -- sync_removals and sync_removals (in set SyncBackend) conflict on: ["bevy_rapier2d::plugin::context::RapierContext", "bevy_ecs::event::Events<bevy_rapier2d::dynamics::rigid_body::MassModifiedEvent>"] -- sync_removals and apply_deferred (in set SyncBackend) conflict on: bevy_ecs::world::World -- sync_removals and apply_collider_user_changes (in set SyncBackend) conflict on: ["bevy_rapier2d::plugin::context::RapierContext", "bevy_ecs::event::Events<bevy_rapier2d::dynamics::rigid_body::MassModifiedEvent>"] -- sync_removals and apply_rigid_body_user_changes (in set SyncBackend) conflict on: ["bevy_rapier2d::plugin::context::RapierContext", "bevy_ecs::event::Events<bevy_rapier2d::dynamics::rigid_body::MassModifiedEvent>"] -- sync_removals and apply_joint_user_changes (in set SyncBackend) conflict on: ["bevy_rapier2d::plugin::context::RapierContext"] -- sync_removals and apply_initial_rigid_body_impulses (in set SyncBackend) conflict on: ["bevy_rapier2d::plugin::context::RapierContext"] -- sync_removals and step_simulation<()> (in set StepSimulation) conflict on: ["bevy_rapier2d::plugin::context::RapierContext"] -- sync_removals and writeback_rigid_bodies (in set Writeback) conflict on: ["bevy_rapier2d::plugin::context::RapierContext"] -- sync_removals and writeback_mass_properties (in set Writeback) conflict on: ["bevy_rapier2d::plugin::context::RapierContext", "bevy_ecs::event::Events<bevy_rapier2d::dynamics::rigid_body::MassModifiedEvent>"] -- sync_removals and event_update_system<MassModifiedEvent> (in set Writeback) conflict on: ["bevy_ecs::event::Events<bevy_rapier2d::dynamics::rigid_body::MassModifiedEvent>"] -- sync_removals and debug_render_scene conflict on: ["bevy_rapier2d::plugin::context::RapierContext"] -- camera_system<PerspectiveProjection> (in set CameraUpdateSystem) and apply_deferred (in set SyncBackend) conflict on: bevy_ecs::world::World -- camera_system<PerspectiveProjection> (in set CameraUpdateSystem) and process_output_system (in set ProcessOutput) conflict on: ["bevy_window::window::Window"] -- camera_system<OrthographicProjection> (in set CameraUpdateSystem) and apply_deferred (in set SyncBackend) conflict on: bevy_ecs::world::World -- camera_system<OrthographicProjection> (in set CameraUpdateSystem) and process_output_system (in set ProcessOutput) conflict on: ["bevy_window::window::Window"] -- camera_system<Projection> (in set CameraUpdateSystem) and apply_deferred (in set SyncBackend) conflict on: bevy_ecs::world::World -- camera_system<Projection> (in set CameraUpdateSystem) and process_output_system (in set ProcessOutput) conflict on: ["bevy_window::window::Window"] -- window_closed (in set Update) and apply_deferred (in set SyncBackend) conflict on: bevy_ecs::world::World -- update_accessibility_nodes (in set Update) and apply_deferred (in set SyncBackend) conflict on: bevy_ecs::world::World -- update_accessibility_nodes (in set Update) and process_output_system (in set ProcessOutput) conflict on: ["bevy_window::window::Window"] -- poll_receivers (in set Update) and apply_deferred (in set SyncBackend) conflict on: bevy_ecs::world::World -- exit_on_all_closed and apply_deferred (in set SyncBackend) conflict on: bevy_ecs::world::World -- exit_on_all_closed and process_output_system (in set ProcessOutput) conflict on: ["bevy_window::window::Window"] -- apply_deferred (in set SyncBackend) and process_output_system (in set ProcessOutput) conflict on: bevy_ecs::world::World -- apply_deferred (in set SyncBackend) and update_egui_textures_system conflict on: bevy_ecs::world::World -- writeback_rigid_bodies (in set Writeback) and writeback_mass_properties (in set Writeback) conflict on: ["bevy_rapier2d::plugin::context::RapierContext"]