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

ImpulseJointSet::get_mut option to wake up connected bodies #716

Merged
merged 3 commits into from
Sep 13, 2024

Conversation

Vrixyz
Copy link
Contributor

@Vrixyz Vrixyz commented Aug 12, 2024

follow up to #692

Copy link
Member

@sebcrozet sebcrozet left a comment

Choose a reason for hiding this comment

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

Thank you!

@@ -42,7 +44,7 @@ pub struct ImpulseJointSet {
rb_graph_ids: Coarena<RigidBodyGraphIndex>,
joint_ids: Arena<TemporaryInteractionIndex>, // Map joint handles to edge ids on the graph.
joint_graph: InteractionGraph<RigidBodyHandle, ImpulseJoint>,
pub(crate) to_wake_up: Vec<RigidBodyHandle>, // A set of rigid-body handles to wake-up during the next timestep.
pub(crate) to_wake_up: HashSet<RigidBodyHandle>, // A set of rigid-body handles to wake-up during the next timestep.
Copy link
Member

@sebcrozet sebcrozet Sep 6, 2024

Choose a reason for hiding this comment

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

We can’t use std::collections::HashSet here because that would break determinism due to internal randomness and unstable iteration order. Instead it should use parry::utils::HashMap<RigidBodyHandle, ()> (unfortunately, parry::utils doesn’t have a HashSet. But we could add one in parry and switch it here afterward).

@Vrixyz Vrixyz requested a review from sebcrozet September 9, 2024 08:07
Copy link
Member

@sebcrozet sebcrozet left a comment

Choose a reason for hiding this comment

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

Looking good now, thanks!

joint_graph: InteractionGraph<RigidBodyHandle, ImpulseJoint>,
pub(crate) to_wake_up: Vec<RigidBodyHandle>, // A set of rigid-body handles to wake-up during the next timestep.
/// A set of rigid-body handles to wake-up during the next timestep.
pub(crate) to_wake_up: HashMap<RigidBodyHandle, ()>,
Copy link
Member

Choose a reason for hiding this comment

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

Could you please open an issue on parry for adding HashSet ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Vrixyz Vrixyz merged commit c714ff8 into dimforge:master Sep 13, 2024
8 checks passed
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.

2 participants