shapes-0.1.0.0: physics engine and other tools for 2D shapes

Safe HaskellNone
LanguageHaskell2010

Physics.Constraints.SolutionProcessors

Description

SolutionProcessors take incremental and accumulated constraint solutions and use rules to determine what incremental impulse (constraint solution) to apply to an object.

For example, a solution processor might enforce that the total accumulated impulse is nonnegative.

Synopsis

Documentation

simple :: Lagrangian -> Lagrangian -> Processed Lagrangian Source #

Apply the entire newly-calculated Lagrangian.

positive :: Lagrangian -> Lagrangian -> Processed Lagrangian Source #

Ensure that the sum of the applied Lagrangians is always positive. This is useful if a constraint should only apply impulse in one direction. e.g. Non-penetration should resist penetration but have no effect on separation.

clampAbs :: Lagrangian -> Lagrangian -> Lagrangian -> Processed Lagrangian Source #

Ensure that the magnitude of the sum of the applied Lagrangians never exceeds a threshold. This is useful if there's a limit to the force a constraint can apply. e.g. Friction resists sliding motion, but this force is limited.