top of page

Understanding 2D Physics Engines with Phaser 3, Part 4.2: Collision Response (Friction)

  • cedarcantab
  • Feb 16, 2022
  • 1 min read

Updated: May 21, 2023

Simulating Friction


In the previous post we looked at how impulse can be applied along the collision normal to effect "bounce".


By applying impulse along the collision tangent, we can actually simulate friction.


Tangent component of J

We can adopt a similar approach to calculating the tangential component of J.


First perform the dot product with the t vector on both sides of the impulse equation.






Following similar steps adopted for the normal component, we get:




If we (very crudely) assume that:


where f is a "friction factor", which if f=1, the velocity along the tangent is perfectly maintained and if f = 0, the velocity along the tangent is "killed off", ie very very strong friction.


Then we can say that:



Collecting the terms and solving for j(t), the impulse in the tangent direction result in the following:





 
 
 

Recent Posts

See All
p2 naive broadphase

var Broadphase = require('../collision/Broadphase'); module.exports = NaiveBroadphase; /** * Naive broadphase implementation. Does N^2...

 
 
 
p2 contact material

module.exports = Material; /** * Defines a physics material. To be used with {{#crossLink "ContactMaterial"}}{{/crossLink}}. * @class...

 
 
 

Comments


記事: Blog2_Post

Subscribe Form

Thanks for submitting!

  • Facebook
  • Twitter
  • LinkedIn

©2021 by Cozy Cozy World。Wix.com で作成されました。

bottom of page