Skip to content

Commit c2da9f2

Browse files
committed
add custom friction rules needed for godot symetry
1 parent 2196944 commit c2da9f2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/dynamics/coefficient_combine_rule.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ pub enum CoefficientCombineRule {
1717
Min,
1818
/// The two coefficients are multiplied.
1919
Multiply,
20+
/// The sum of the two coefficients.
21+
Sum,
2022
/// The greatest coefficient is chosen.
2123
Max,
2224
}
@@ -27,8 +29,9 @@ impl CoefficientCombineRule {
2729

2830
match effective_rule {
2931
0 => (coeff1 + coeff2) / 2.0,
30-
1 => coeff1.min(coeff2),
32+
1 => coeff1.min(coeff2).abs(),
3133
2 => coeff1 * coeff2,
34+
3 => (coeff1 + coeff2).clamp(0.0, 1.0),
3235
_ => coeff1.max(coeff2),
3336
}
3437
}

0 commit comments

Comments
 (0)