Constraint Solver... solves constraints.
More...
#include <Constraint_solver.h>
Constraint Solver... solves constraints.
This class is based entirely on the Sequential Impulse technique described by Erin Catto http://box2d.org/ And as pre-digested and explained by Ming-Lun "Allen" Chou http://allenchou.net/game-physics-series/
Dubious::Physics::Constraint_solver::Constraint_solver |
( |
float |
time_step, |
|
|
float |
beta, |
|
|
float |
cor, |
|
|
float |
slop |
|
) |
| |
The heart of constraint solving.
Given two objects that are known to be colliding, and up to 4 points that are in the contact manifold. Figures out all of the forces at each point.
- Parameters
-
a | - [in,out] The first object in the colliding pair. Its velocities will be updated. |
b | - [in,out] The second object in the colliding pair. Its velocities will be updated. |
contact_manifold | - [in,out] Up to 4 points that define the collision. Its forces will be updated |
Re-apply forces from previous time step.
See the discussion by Allen Chou on his web page. The general idea is that often the previous time step's forces are mostly pertinent to the current time step. For exmaple a bunch of blocks at rest all have the same gravity every time step. So this just re-applies the same force. Allen Chou says he actually applies a fraction of the previous force, so this should probably be updated at some point. But in my current tests it gets good results
- Parameters
-
a | - [in,out] The first object in the colliding pair. Its velocities will be updated. |
b | - [in,out] The second object in the colliding pair. Its velocities will be updated. |
contact_manifold | - [in] Up to 4 points that define the collision |
The documentation for this class was generated from the following files: