Rename SolverFlags::COMPUTE_FORCES to SolverFlags::COMPUTE_IMPULSES.
This is closer to what the solver actually does.
This commit is contained in:
@@ -15,7 +15,7 @@ bitflags::bitflags! {
|
|||||||
pub struct SolverFlags: u32 {
|
pub struct SolverFlags: u32 {
|
||||||
/// The constraint solver will take this contact manifold into
|
/// The constraint solver will take this contact manifold into
|
||||||
/// account for force computation.
|
/// account for force computation.
|
||||||
const COMPUTE_FORCES = 0b01;
|
const COMPUTE_IMPULSES = 0b01;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -405,7 +405,7 @@ impl NarrowPhase {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if co1.solver_groups.test(co2.solver_groups) {
|
if co1.solver_groups.test(co2.solver_groups) {
|
||||||
SolverFlags::COMPUTE_FORCES
|
SolverFlags::COMPUTE_IMPULSES
|
||||||
} else {
|
} else {
|
||||||
SolverFlags::empty()
|
SolverFlags::empty()
|
||||||
}
|
}
|
||||||
@@ -454,7 +454,9 @@ impl NarrowPhase {
|
|||||||
for manifold in &mut inter.weight.manifolds {
|
for manifold in &mut inter.weight.manifolds {
|
||||||
let rb1 = &bodies[manifold.body_pair.body1];
|
let rb1 = &bodies[manifold.body_pair.body1];
|
||||||
let rb2 = &bodies[manifold.body_pair.body2];
|
let rb2 = &bodies[manifold.body_pair.body2];
|
||||||
if manifold.solver_flags.contains(SolverFlags::COMPUTE_FORCES)
|
if manifold
|
||||||
|
.solver_flags
|
||||||
|
.contains(SolverFlags::COMPUTE_IMPULSES)
|
||||||
&& manifold.num_active_contacts() != 0
|
&& manifold.num_active_contacts() != 0
|
||||||
&& (rb1.is_dynamic() || rb2.is_dynamic())
|
&& (rb1.is_dynamic() || rb2.is_dynamic())
|
||||||
&& (!rb1.is_dynamic() || !rb1.is_sleeping())
|
&& (!rb1.is_dynamic() || !rb1.is_sleeping())
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ pub trait ContactPairFilter: Send + Sync {
|
|||||||
/// not compute any contact manifolds for it.
|
/// not compute any contact manifolds for it.
|
||||||
/// If this returns `Some`, then the narrow-phase will compute contact manifolds for
|
/// If this returns `Some`, then the narrow-phase will compute contact manifolds for
|
||||||
/// this pair of colliders, and configure them with the returned solver flags. For
|
/// this pair of colliders, and configure them with the returned solver flags. For
|
||||||
/// example, if this returns `Some(SolverFlags::COMPUTE_FORCES)` then the contacts
|
/// example, if this returns `Some(SolverFlags::COMPUTE_IMPULSES)` then the contacts
|
||||||
/// will be taken into account by the constraints solver. If this returns
|
/// will be taken into account by the constraints solver. If this returns
|
||||||
/// `Some(SolverFlags::empty())` then the constraints solver will ignore these
|
/// `Some(SolverFlags::empty())` then the constraints solver will ignore these
|
||||||
/// contacts.
|
/// contacts.
|
||||||
|
|||||||
Reference in New Issue
Block a user