Constructor for an Equation
The Jacobian entry of this equation. 6 numbers, 3 per body (x,y,angle).
First body participating in the constraint
Second body participating in the constraint
Vector from body i center of mass to the contact point.
World-oriented vector from body A center of mass to the contact point.
Whether this equation is enabled or not. If true, it will be added to the solver.
This property is set to true if this is the first impact between the bodies (not persistant contact).
Cap the constraint violation (G*q) to this value.
Max force to apply when solving.
Minimum force to apply when solving.
The resulting constraint multiplier from the last solve. This is mostly equivalent to the force produced by the constraint.
Indicates if stiffness or relaxation was changed.
The normal vector, pointing out of body i
Relative velocity.
The number of time steps needed to stabilize the constraint equation. Typically between 3 and 5 time steps.
The restitution to use (0=no bounciness, 1=max bounciness).
The shape in body i that triggered this contact.
The stiffness of this equation. Typically chosen to a large number (~1e7), but can be chosen somewhat freely to get a stable simulation.
The default relaxation when creating a new Equation.
The default stiffness when creating a new Equation.
Add constraint velocity to the bodies.
Computes the RHS of the SPOOK equation
Computes G*W, where W are the body velocities
Computes G*Wlambda, where W are the body velocities
Computes G*inv(M)*G'
Computes G*inv(M)*f, where M is the mass matrix with diagonal blocks for each body, and f are the forces on the bodies.
Computes G*q, where q are the generalized body coordinates
Compute the denominator part of the SPOOK equation: C = G*inv(M)*G' + eps
Get the relative velocity along the normal vector.
Non-penetration constraint equation. Tries to make the contactPointA and contactPointB vectors coincide, while keeping the applied force repulsive.