-
-
Notifications
You must be signed in to change notification settings - Fork 251
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
Conversation
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.
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. |
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.
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).
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.
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, ()>, |
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.
Could you please open an issue on parry for adding HashSet
?
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.
follow up to #692