top of page
Search
cedarcantab

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

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:





7 views0 comments

Recent Posts

See All

p2 naive broadphase

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

sopiro motor constranit

import { Matrix2, Vector2 } from "./math.js"; import { RigidBody } from "./rigidbody.js"; import { Settings } from "./settings.js";...

コメント


記事: Blog2_Post
bottom of page