playrho::GaussSeidel Namespace Reference
Functions | |
Momentum | SolveVelocityConstraint (d2::VelocityConstraint &vc) |
d2::PositionSolution | SolvePositionConstraint (const d2::PositionConstraint &pc, const bool moveA, const bool moveB, ConstraintSolverConf conf) |
Function Documentation
◆ SolveVelocityConstraint()
Momentum playrho::GaussSeidel::SolveVelocityConstraint | ( | d2::VelocityConstraint & | vc | ) |
Solves the velocity constraint.
This updates the tangent and normal impulses of the velocity constraint points of the given velocity constraint and updates the given velocities.
- Warning
- Behavior is undefined unless the velocity constraint point count is 1 or 2.
- Note
- Linear velocity is only changed if the inverse mass of either body is non-zero.
- Angular velocity is only changed if the inverse rotational inertia of either body is non-zero.
-
Inlining this function may yield a 10% speed boost in the
World.TilesComesToRest
unit test.
- Precondition
- The velocity constraint must have a valid normal, a valid tangent, valid point relative positions, and valid velocity biases.
Definition at line 481 of file ContactSolver.cpp.
◆ SolvePositionConstraint()
d2::PositionSolution playrho::GaussSeidel::SolvePositionConstraint | ( | const d2::PositionConstraint & | pc, |
const bool | moveA, | ||
const bool | moveB, | ||
ConstraintSolverConf | conf | ||
) |
Solves the given position constraint.
This pushes apart the two given positions for every point in the contact position constraint and returns the minimum separation value from the position solver manifold for each point.
- Returns
- Minimum separation distance of the position constraint's manifold points (prior to "solving").
Definition at line 494 of file ContactSolver.cpp.