Collision response

Uses your system voice; voice and rate in settings.

Q5147505Snapshot

≈ 8 min read

Names in other languages

  • EnglishCollision response
  • 中文碰撞響應

Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.

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.

Background

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.

A force \mathbf{f}(t)\in \mathbb{R}^3 , dependent on time t \in\mathbb{R} , acting on a body of assumed constant mass m \in \mathbb{R} for a time interval \lbrack t_0 , t_1 \rbrack generates a change in the body’s momentum \mathbf{p}(t)=m\mathbf{v}(t) , where \mathbf{v}(t) is the resulting change in velocity.

The change in momentum, termed an impulse and denoted by \mathbf{j} \in \mathbb{R}^3 is thus computed as \mathbf{j}=\int_{t_0}^{t_1}\mathbf{f}dt For fixed impulse \mathbf{j} , the equation suggests that t_1 \rightarrow t_0 \Rightarrow \left | \mathbf{f} \right | \rightarrow \infty , 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 \mathbf{f} can be found which is equal to 0 everywhere except at t_0 , and such that the limit \lim_{t_1 \rightarrow t_0} \int_{t_0}^{t_1}\mathbf{f}dt exists and is equal to \mathbf{j} , the notion of instantaneous impulses may be introduced to simulate an instantaneous change in velocity after a collision. \mathbf{j}_r=\int_{t_0}^{t_1}\mathbf{f}_r dt 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 \mathbf{p}_r\in \mathbb{R}^3 is \mathbf{j}_r , the counter impulse applied by the second body on the first is -\mathbf{j}_r .

The decomposition \pm \mathbf{j}_r = \pm j_r \mathbf{\hat{n}} into the impulse magnitude j_r \in \mathbb{R} and direction along the contact normal \mathbf{\hat{n}} and its negation - \mathbf{\hat{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, \mathbf{\hat{n}} is always assumed to point away from body 1 and towards body 2 at the contact point.

Assuming the collision impulse magnitude j_r is given and using Newton's laws of motion the relation between the bodies' pre- and post- linear velocities are as follows where, for the i th body, \mathbf{v}_{i}\in \mathbb{R}^3 is the pre-collision linear velocity, \mathbf{v'}_{i} \in \mathbb{R}^3 is the post-collision linear velocity.

Similarly for the angular velocities where, for the i th body, {\omega}_i\in \mathbb{R}^3 is the angular pre-collision velocity, {\omega'}_i\in \mathbb{R}^3 is the angular post-collision velocity, \mathbf{I}_i\in \mathbb{R}^{3 \times 3} is the inertia tensor in the world frame of reference, and \mathbf{r}_i \in \mathbb{R}^3 is offset of the shared contact point \mathbf{p} from the centre of mass.

The velocities v_{p1},v_{p2} \in \mathbb{R}^3 of the bodies at the point of contact may be computed in terms of the respective linear and angular velocities, using for i = 1,2 .

The coefficient of restitution e relates the pre-collision relative velocity \mathbf{v}_r = \mathbf{v}_{p2} - \mathbf{v}_{p1} of the contact point to the post-collision relative velocity \mathbf{v'}_r = \mathbf{v'}_{p2} - \mathbf{v'}_{p1} along the contact normal \mathbf{\hat{n}} as follows Substituting equations (1a), (1b), (2a), (2b) and (3) into equation (4) and solving for the reaction impulse magnitude j_r yields Compute the reaction impulse vector \mathbf{j}_r in terms of its magnitude j_r and contact normal \mathbf{\hat{n}} using \mathbf{j}_r = j_r \mathbf{\hat{n}} .

Compute new linear velocities \mathbf{v'}_i in terms of old velocities \mathbf{v}_i , masses m_i and reaction impulse vector \mathbf{j}_r using equations (1a) and (1b) Compute new angular velocities \mathbf{\omega'}_i in terms of old angular velocities \mathbf{\omega}_i , inertia tensors \mathbf{I}_i and reaction impulse j_r using equations (2a) and (2b) One of the most popular models for describing friction is the Coulomb friction model.

This model defines coefficients of static friction {\mu}_s \in \mathbb{R} and dynamic friction {\mu}_d \in \mathbb{R} such that {\mu}_s > {\mu}_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 f_s, f_d \in \mathbb{R} are computed in terms of the reaction force magnitude f_r=|\mathbf{f}_r| as follows The value f_s 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 f_d 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 \mathbf{\hat{n}} \in \mathbb{R}^3 and relative velocity \mathbf{v}_r \in \mathbb{R}^3 of the contact point, a tangent vector \mathbf{\hat{t}} \in \mathbb{R}^3 , orthogonal to \mathbf{\hat{n}} , may be defined such that & \mathbf{v}_r \cdot \mathbf{\hat{n}} \neq 0 & \\ \frac{\mathbf{f}_e - (\mathbf{f}_e \cdot \mathbf{\hat{n}})\mathbf{\hat{n}}} & \mathbf{v}_r \cdot \mathbf{\hat{n}} = 0 & \mathbf{f}_e \cdot \mathbf{\hat{n}} \neq 0 \\ \mathbf{0} & \mathbf{v}_r \cdot \mathbf{\hat{n}} = 0 & \mathbf{f}_e \cdot \mathbf{\hat{n}} = 0 \\ \end{matrix}\right. |width="33%" align="right"|(7) |} where \mathbf{f}_e \in \mathbb{R}^3 is the sum of all external forces on the body.

The multi-case definition of \mathbf{\hat{t}} is required for robustly computing the actual friction force \mathbf{f}_f \in \mathbb{R}^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 \mathbf{\hat{n}} . If this component is zero, the second case derives \mathbf{\hat{t}} in terms of the tangent component of the external force \mathbf{f}_e \in \mathbb{R}^3 .

If there is no tangential velocity or external forces, then no friction is assumed, and \mathbf{\hat{t}} may be set to the zero vector. Thus, \mathbf{f}_f \in \mathbb{R}^3 is computed as 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 \mathbf{j}_f \in \mathbb{R}^3 , acting along the tangent \mathbf{\hat{t}} , to the reaction impulse \mathbf{j}_r \in \mathbb{R}^3 . Integrating (6a) and (6b) over the collision time interval [t_0..t_1] yields where j_r=|\mathbf{j}_r | is the magnitude of the reaction impulse acting along contact normal \mathbf{\hat{n}} .

Similarly, by assuming \mathbf{\hat{t}} constant throughout the time interval, the integration of (8) yields 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 {\mu}_s and {\mu}_d as higher values may introduce additional kinetic energy into the system. C.

How it works

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.

Text derived from https://en.wikipedia.org/w/index.php?oldid=1301083929 under CC BY-SA 4.0; modifications have been made.

Provenance

snapshot collision-response-586583-28e78c413f01bc1d · hash 28e78c413f01bc1d7c1162da5105ff9ca28f6871b2eda08af789448cfd4a1d75 · captured 1752792732.0 · version history

Cite this page as: encyclopegia.org, “Collision response”, snapshot collision-response-586583-28e78c413f01bc1d. https://encyclopegia.org/a/collision-response

Sources cited in this revision

1 named source(s) extracted from the cited revision. A source with no author is shown by its publication; nothing is invented.