PlayRho  2.0.0
An interactive physics engine & library.
ContactSolver.hpp File Reference

Declarations of the velocity and position constraint solver functions. More...

Include dependency graph for ContactSolver.hpp:

Namespaces

 playrho
 
 playrho::d2
 

Functions

d2::PositionSolution playrho::GaussSeidel::SolvePositionConstraint (const d2::PositionConstraint &pc, bool moveA, bool moveB, const Span< d2::BodyConstraint > &bodies, const ConstraintSolverConf &conf)
 
Momentum playrho::GaussSeidel::SolveVelocityConstraint (d2::VelocityConstraint &vc, const Span< d2::BodyConstraint > &bodies)
 Solves the velocity constraint. More...
 

Detailed Description

Declarations of the velocity and position constraint solver functions.

Function Documentation

◆ SolvePositionConstraint()

d2::PositionSolution playrho::GaussSeidel::SolvePositionConstraint ( const d2::PositionConstraint pc,
bool  moveA,
bool  moveB,
const Span< d2::BodyConstraint > &  bodies,
const 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.

See also
http://allenchou.net/2013/12/game-physics-resolution-contact-constraints/
Returns
Minimum separation distance of the position constraint's manifold points (prior to "solving").

Referenced by playrho::GaussSeidel::SolvePositionConstraint().

◆ SolveVelocityConstraint()

Momentum playrho::GaussSeidel::SolveVelocityConstraint ( d2::VelocityConstraint vc,
const Span< d2::BodyConstraint > &  bodies 
)

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.

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.
Parameters
vcVelocity constraint to solve for.
bodiesCollection of bodies containing the two for the velocity constraint.
Precondition
vc must have a valid normal, a valid tangent, valid point relative positions, valid velocity biases, and 1 or 2 point counts.

Referenced by playrho::GaussSeidel::SolveVelocityConstraint().