Use contact ids instead of contact reordering in order to identify the impulse writeback location.

This commit is contained in:
Crozet Sébastien
2021-02-22 17:51:40 +01:00
parent d31a327b45
commit ad5c10672e
6 changed files with 52 additions and 45 deletions

View File

@@ -110,6 +110,8 @@ pub struct ContactManifoldData {
#[derive(Copy, Clone, Debug)]
#[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))]
pub struct SolverContact {
/// The index of the manifold contact used to generate this solver contact.
pub contact_id: u8,
/// The world-space contact point.
pub point: Point<Real>,
/// The distance between the two original contacts points along the contact normal.
@@ -203,3 +205,9 @@ impl ContactManifoldData {
// manifold.data.warmstart_multiplier = Self::min_warmstart_multiplier()
// }
}
/// A contact manifold that can be modified by the user.
pub struct ModifiableContactManifold<'a> {
manifold: &'a super::ContactManifold,
solver_contacts: &'a mut Vec<SolverContact>,
}