**3.1.1 Contact model**

Contacts between objects can be represented with few entities that do not depend on the geometrical representation and the collision detection algorithm. For two contacting objects A and B we identify the two points P and Q that are computed as the innermost points of collision respectively on the two objects. The normal of contacting surfaces can be a general n vector not necessarily directed along QP, and assumed to be toward the inner part of A. In addition, the velocities of the two points are provided, all in world coordinates. The Signorini law of contact expresses the contact of two generic objects by means of two functions: the first is the stress exerted on an object at a given point, and the second is the gap, or penetration depth, that is the projection of the QP vector on the normal. For the assumptions before a positive gap means that the two objects are penetrating. The Signorini model states that, when the contact is resolved, the gap is zero and the object B exerts a pressure toward the object A at point P, or the gap is negative and there is no pressure. When pressure is exerted it can be represented by a force directed along the normal n.

In general, contact is characterized by an impulsive phase and later by a contact force. The impulsive phase takes into account Signorini law and restitution coefficient of the material, providing an impulsive force that separates the two objects. Later, the contact has to be taken into account during the evolution of the system. In literature this is addressed in two ways. The first way is a penalty function that applies a force directed along the contact direction and proportional to the computed penetration, expressed in terms of penetration depth or volume. Its simplicity is balanced by the fact of reduction of realism. The second way transforms the collision into a constraint equation that prevents the two objects to penetrate. This model is formulated as an additional equation in the Linear Complementarity Problem (LCP) that is used to describe the body dynamics.
