Collision response

Short description: Models and algorithms for simulating collision and reaction

In the context of classical mechanics simulations and physics engines employed within video games, collision response deals with models and algorithms for simulating the changes in the motion of two solid bodies following collision and other forms of contact.

## Contents

* 1 Rigid body contact
* 2 Contact forces
* 2.1 Reaction
* 2.2 Friction
* 2.2.1 Applied force
* 2.2.2 Normal force
* 2.2.3 Frictional force
* 3 Impulse-based contact model
* 3.1 Impulse-based reaction model
* 3.2 Computing impulse-based reaction
* 3.3 Impulse-based friction model
* 4 See also
* 5 Notes
* 6 References

## Rigid body contact

The compression and expansion phases of a collision between two solid bodies

Two rigid bodies in unconstrained motion, potentially under the action of forces, may be modelled by solving their equations of motion using numerical integration techniques. On collision, the kinetic properties of two such bodies seem to undergo an instantaneous change, typically resulting in the bodies rebounding away from each other, sliding, or settling into relative static contact, depending on the elasticity of the materials and the configuration of the collision.

## Contact forces

The origin of the rebound phenomenon, or reaction, may be traced to the behaviour of real bodies that, unlike their perfectly rigid idealised counterparts, do undergo minor compression on collision, followed by expansion, prior to separation. The compression phase converts the kinetic energy of the bodies into potential energy and to an extent, heat. The expansion phase converts the potential energy back to kinetic energy.

During the compression and expansion phases of two colliding bodies, each body generates reactive forces on the other at the points of contact, such that the sum reaction forces of one body are equal in magnitude but opposite in direction to the forces of the other, as per the Newtonian principle of action and reaction. If the effects of friction are ignored, a collision is seen as affecting only the component of the velocities that are directed along the contact normal and as leaving the tangential components unaffected

### Reaction

The degree of relative kinetic energy retained after a collision, termed the restitution, is dependent on the elasticity of the bodies‟ materials. The coefficient of restitution between two given materials is modeled as the ratio e∈[0..1] of the relative post-collision speed of a point of contact along the contact normal, with respect to the relative pre-collision speed of the same point along the same normal. These coefficients are typically determined empirically for different material pairs, such as wood against concrete or rubber against wood. Values for e close to zero indicate inelastic collisions such as a piece of soft clay hitting the floor, whereas values close to one represent highly elastic collisions, such as a rubber ball bouncing off a wall. The kinetic energy loss is relative to one body with respect to the other. Thus the total momentum of both bodies with respect to some common reference is unchanged after the collision, in line with the principle of conservation of momentum.

### Friction

Friction due to surface microstructure imperfections

Another important contact phenomenon is surface-to-surface friction, a force that impedes the relative motion of two surfaces in contact, or that of a body in a fluid. In this section we discuss surface-to-surface friction of two bodies in relative static contact or sliding contact. In the real world, friction is due to the imperfect microstructure of surfaces whose protrusions interlock into each other, generating reactive forces tangential to the surfaces.

To overcome the friction between two bodies in static contact, the surfaces must somehow lift away from each other. Once in motion, the degree of surface affinity is reduced and hence bodies in sliding motion tend to offer lesser resistance to motion. These two categories of friction are respectively termed static friction and dynamic friction.

#### Applied force

It is a force which is applied to an object by another object or by a person. The direction of the applied force depends on how the force is applied.

#### Normal force

It is the support force exerted upon an object which is in contact with another stable object. Normal force is sometimes referred to as the pressing force since its action presses the surface together. Normal force is always directed towards the object and acts perpendicularly with the applied force.

#### Frictional force

It is the force exerted by a surface as an object moves across it or makes an effort to move across it. The friction force opposes the motion of the object. Friction results when two surfaces are pressed together closely, causing attractive intermolecular forces between the molecules of the two different surface. As such, friction depends upon the nature of the two surfaces and upon the degree to which they are pressed together. Friction always acts parallel to the surface in contact and opposite the direction of motion. The friction force can be calculated using the equation.

## Impulse-based contact model

A force 𝐟(t)∈ℝ3, dependent on time t∈ℝ, acting on a body of assumed constant mass m∈ℝ for a time interval [t0,t1] generates a change in the body’s momentum 𝐩(t)=m𝐯(t), where 𝐯(t) is the resulting change in velocity. The change in momentum, termed an impulse and denoted by 𝐣∈ℝ3 is thus computed as

𝐣=∫t0t1𝐟dt

For fixed impulse 𝐣, the equation suggests that t1->t0⇒|𝐟|->∞, that is, a smaller time interval must be compensated by a stronger reaction force to achieve the same impulse. When modelling a collision between idealized rigid bodies, it is impractical to simulate the compression and expansion phases of the body geometry over the collision time interval. However, by assuming that a force 𝐟 can be found which is equal to 0 everywhere except at t0, and such that the limit

limt1->t0∫t0t1𝐟dt

exists and is equal to 𝐣, the notion of instantaneous impulses may be introduced to simulate an instantaneous change in velocity after a collision.

### Impulse-based reaction model

The application of impulses at the point of collision

The effect of the reaction force 𝐟r(t)∈ℝ3 over the interval of collision [t0,t1] may hence be represented by an instantaneous reaction impulse 𝐣r(t)∈ℝ3, computed as

𝐣r=∫t0t1𝐟rdt

By deduction from the principle of action and reaction, if the collision impulse applied by the first body on the second body at a contact point 𝐩r∈ℝ3 is 𝐣r, the counter impulse applied by the second body on the first is −𝐣r. The decomposition ±𝐣r=±jrn^ into the impulse magnitude jr∈ℝ and direction along the contact normal n^ and its negation −n^ allows for the derivation of a formula to compute the change in linear and angular velocities of the bodies resulting from the collision impulses. In the subsequent formulas, n^ is always assumed to point away from body 1 and towards body 2 at the contact point.

Assuming the collision impulse magnitude jr is given and using Newton's laws of motion the relation between the bodies' pre- and post- linear velocities are as follows

| 𝐯′1=𝐯1−jrm1n^ | (1a)

|
|

| 𝐯′2=𝐯2+jrm2n^ | (1b)

where, for the ith body, 𝐯i∈ℝ3 is the pre-collision linear velocity, 𝐯′i∈ℝ3 is the post-collision linear velocity.

Similarly for the angular velocities

| ω′1=ω1−jr𝐈1−1(𝐫1×n^) | (2a)

|
|

| ω′2=ω2+jr𝐈2−1(𝐫2×n^) | (2b)

where, for the ith body, ωi∈ℝ3 is the angular pre-collision velocity, ω′i∈ℝ3 is the angular post-collision velocity, 𝐈i∈ℝ3×3 is the inertia tensor in the world frame of reference, and 𝐫i∈ℝ3 is offset of the shared contact point 𝐩 from the centre of mass.

The velocities vp1,vp2∈ℝ3 of the bodies at the point of contact may be computed in terms of the respective linear and angular velocities, using

| 𝐯pi=𝐯i+ωi×𝐫i | (3)

|
|

for i=1,2. The coefficient of restitution e relates the pre-collision relative velocity 𝐯r=𝐯p2−𝐯p1 of the contact point to the post-collision relative velocity 𝐯′r=𝐯′p2−𝐯′p1 along the contact normal n^ as follows

| 𝐯′r⋅n^=−e𝐯r⋅n^ | (4)

|
|

Substituting equations (1a), (1b), (2a), (2b) and (3) into equation (4) and solving for the reaction impulse magnitude jr yields[1]

| jr=−(1+e)𝐯r⋅n^m1−1+m2−1+(𝐈1−1(𝐫1×n^)×𝐫1+𝐈2−1(𝐫2×n^)×𝐫2)⋅n^ | (5)

|
|

### Computing impulse-based reaction

Thus, the procedure for computing the post-collision linear velocities 𝐯′i and angular velocities ω′i is as follows:

1. Compute the reaction impulse magnitude jr in terms of 𝐯r, m1, m2, 𝐈1, 𝐈2, 𝐫1, 𝐫2, n^ and e using equation (5)
2. Compute the reaction impulse vector 𝐣r in terms of its magnitude jr and contact normal n^ using 𝐣r=jrn^.
3. Compute new linear velocities 𝐯′i in terms of old velocities 𝐯i, masses mi and reaction impulse vector 𝐣r using equations (1a) and (1b)
4. Compute new angular velocities ω′i in terms of old angular velocities ωi, inertia tensors 𝐈i and reaction impulse jr using equations (2a) and (2b)

### Impulse-based friction model

Coulomb friction model - friction cone

One of the most popular models for describing friction is the Coulomb friction model. This model defines coefficients of static friction μs∈ℝ and dynamic friction μd∈ℝ such that μs>μd. These coefficients describe the two types of friction forces in terms of the reaction forces acting on the bodies. More specifically, the static and dynamic friction force magnitudes fs,fd∈ℝ are computed in terms of the reaction force magnitude fr=|𝐟r| as follows

| fs=μsfr | (6a)

|
|

| fd=μdfr | (6b)

The value fs defines a maximum magnitude for the friction force required to counter the tangential component of any external sum force applied on a relatively static body, such that it remains static. Thus, if the external force is large enough, static friction is unable to fully counter this force, at which point the body gains velocity and becomes subject to dynamic friction of magnitude fd acting against the sliding velocity.

The Coulomb friction model effectively defines a friction cone within which the tangential component of a force exerted by one body on the surface of another in static contact, is countered by an equal and opposite force such that the static configuration is maintained. Conversely, if the force falls outside the cone, static friction gives way to dynamic friction.

Given the contact normal n^∈ℝ3 and relative velocity 𝐯r∈ℝ3 of the contact point, a tangent vector t^∈ℝ3, orthogonal to n^, may be defined such that

t^={𝐯r−(𝐯r⋅n^)n^|𝐯r−(𝐯r⋅n^)n^|𝐯r⋅n^≠0𝐟e−(𝐟e⋅n^)n^|𝐟e−(𝐟e⋅n^)n^|𝐯r⋅n^=0𝐟e⋅n^≠0𝟎𝐯r⋅n^=0𝐟e⋅n^=0

| (7)

|
|

where 𝐟e∈ℝ3 is the sum of all external forces on the body. The multi-case definition of t^ is required for robustly computing the actual friction force 𝐟f∈ℝ3 for both the general and particular states of contact. Informally, the first case computes the tangent vector along the relative velocity component perpendicular to the contact normal n^. If this component is zero, the second case derives t^ in terms of the tangent component of the external force 𝐟e∈ℝ3. If there is no tangential velocity or external forces, then no friction is assumed, and t^ may be set to the zero vector. Thus, 𝐟f∈ℝ3 is computed as

𝐟f={−(𝐟e⋅t^)t^𝐯r⋅t^=0𝐟e⋅t^≤fs−fdt^(otherwise)

| (8)

|
|

Equations (6a), (6b), (7) and (8) describe the Coulomb friction model in terms of forces. By adapting the argument for instantaneous impulses, an impulse-based version of the Coulomb friction model may be derived, relating a frictional impulse 𝐣f∈ℝ3, acting along the tangent t^, to the reaction impulse 𝐣r∈ℝ3. Integrating (6a) and (6b) over the collision time interval [t0..t1] yields

| js=μsjr | (9a)

|
|

| jd=μdjr | (9b)

where jr=|𝐣r| is the magnitude of the reaction impulse acting along contact normal n^. Similarly, by assuming t^ constant throughout the time interval, the integration of (8) yields

𝐣f={−(m𝐯r⋅t^)t^𝐯r⋅t^=0m𝐯r⋅t^≤js−jdt^(otherwise)

| (10)

|
|

Equations (5) and (10) define an impulse-based contact model that is ideal for impulse-based simulations. When using this model, care must be taken in the choice of μs and μd as higher values may introduce additional kinetic energy into the system.

## See also

* Collision detection

## Notes

1. ↑ An Introduction to Physically Based Modeling (David Baraff Robotics Institute Carnegie Mellon University)

## References

* C. Vella, "Gravitas: An extensible physics engine framework using object-oriented and design pattern-driven software architecture principles," Master in Information Technology Thesis, University of Malta, Msida, 2008.

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Collision response. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Physics:Collision_response&oldid=4108562"