use enum variants rather than casting to u8 for comparisons (#781)

This commit is contained in:
Thierry Berger
2025-03-28 12:19:42 +01:00
committed by GitHub
parent 2f9d9ba94b
commit d291041278
2 changed files with 18 additions and 13 deletions

View File

@@ -969,14 +969,14 @@ impl NarrowPhase {
let friction = CoefficientCombineRule::combine(
co1.material.friction,
co2.material.friction,
co1.material.friction_combine_rule as u8,
co2.material.friction_combine_rule as u8,
co1.material.friction_combine_rule,
co2.material.friction_combine_rule,
);
let restitution = CoefficientCombineRule::combine(
co1.material.restitution,
co2.material.restitution,
co1.material.restitution_combine_rule as u8,
co2.material.restitution_combine_rule as u8,
co1.material.restitution_combine_rule,
co2.material.restitution_combine_rule,
);
let zero = RigidBodyDominance(0); // The value doesn't matter, it will be MAX because of the effective groups.