Allow collider modification after its insersion to the ColliderSet.

This commit is contained in:
Crozet Sébastien
2021-03-29 14:54:54 +02:00
parent dec3e4197f
commit 8173e7ada2
16 changed files with 744 additions and 247 deletions

View File

@@ -21,6 +21,16 @@ pub enum CoefficientCombineRule {
}
impl CoefficientCombineRule {
pub fn from_value(val: u8) -> Self {
match val {
0 => CoefficientCombineRule::Average,
1 => CoefficientCombineRule::Min,
2 => CoefficientCombineRule::Multiply,
3 => CoefficientCombineRule::Max,
_ => panic!("Invalid coefficient combine rule."),
}
}
pub(crate) fn combine(coeff1: Real, coeff2: Real, rule_value1: u8, rule_value2: u8) -> Real {
let effective_rule = rule_value1.max(rule_value2);