19 #ifndef B2_CONTACT_SOLVER_H
20 #define B2_CONTACT_SOLVER_H
22 #include <Box2D/Common/b2Math.h>
24 #include <Box2D/Dynamics/b2TimeStep.h>
29 struct b2ContactPositionConstraint;
31 struct b2VelocityConstraintPoint
35 float32 normalImpulse;
36 float32 tangentImpulse;
42 struct b2ContactVelocityConstraint
50 float32 invMassA, invMassB;
59 struct b2ContactSolverDef
64 b2Position* positions;
65 b2Velocity* velocities;
72 b2ContactSolver(b2ContactSolverDef* def);
75 void InitializeVelocityConstraints();
78 void SolveVelocityConstraints();
81 bool SolvePositionConstraints();
82 bool SolveTOIPositionConstraints(int32 toiIndexA, int32 toiIndexB);
85 b2Position* m_positions;
86 b2Velocity* m_velocities;
88 b2ContactPositionConstraint* m_positionConstraints;
89 b2ContactVelocityConstraint* m_velocityConstraints;