Fix some solver issues

- Fix the wrong codepath taken  by the solver for contacts involving a collider without parent.
- Properly adress the non-linear treatment of the friction direction
- Simplify the sleeping strategy
- Add an impulse resolution multiplier
This commit is contained in:
Sébastien Crozet
2022-01-16 16:40:59 +01:00
parent 4454a845e9
commit 0703e5527f
43 changed files with 936 additions and 229 deletions

View File

@@ -70,11 +70,8 @@ impl Index {
///
/// Providing arbitrary values will lead to malformed indices and ultimately
/// panics.
pub fn from_raw_parts(a: u32, b: u32) -> Index {
Index {
index: a,
generation: b,
}
pub fn from_raw_parts(index: u32, generation: u32) -> Index {
Index { index, generation }
}
/// Convert this `Index` into its raw parts.

View File

@@ -29,6 +29,10 @@ impl<T> Coarena<T> {
self.data.get(index as usize).map(|(_, t)| t)
}
pub(crate) fn get_gen(&self, index: u32) -> Option<u32> {
self.data.get(index as usize).map(|(gen, _)| *gen)
}
/// Deletes an element for the coarena and returns its value.
///
/// This method will reset the value to the given `removed_value`.