Simple rigid body collision reaction

Click For Summary
The discussion focuses on improving a physics engine's collision response by moving from a simplistic teleportation method to a more accurate impulse-based approach, in line with Newton's third law. The user recognizes the importance of applying equal and opposite impulses based on the masses and velocities of the colliding objects. They express uncertainty about how to calculate the appropriate impulse and address the challenge of interpenetration during collisions in a discrete frame model. The user considers adapting their current method to account for collision surfaces to prevent ongoing interpenetration. They seek advice on effectively implementing these concepts in their engine.
Nanako
Messages
39
Reaction score
0
Simple rigid body collision reaction (Newton III)

Hi everyone! I'm writing a physics engine as part of a game I'm making. Up until this point I've implemented inter object collisions in a rather quick and dirty manner. Whenever something moves into something else, it is simply teleported back out to the edge. This implementation worked for a while, but amongst other problems, it causes anything not currently moving to be an immovable object, which is not good.

I already have written support for forces and impulses (and friction), and i believe this is the more correct way to go. I had a long discussion with a friend who educated me a bit on the subject. I understand that Newton's third law is integral here. that any two colliding objects have an equal(but opposite) impulse applied to them, and that this impulse is dependant on their relative masses and velocities

he also talked a lot about the concept of a collision surface, which is something i didn't get quite as well. I understand it to be a point between the two objects, that is weighted according to their masses, and that travels in a straight ttrajectory

At this point, i feel that I've got a handle on the basics. I'm not certain exactly what to do, but i feel i'd be able to understand it if i had a little more help . So i come to you wonderful people hoping for a little assistance in that regard.

essentially, i need to figure out what impulse to apply to a colliding pair of objects.

in addition, there's a problem that i don't fully understand. I've designed my engine using what i now now to be the A posteriori (Discrete) model, which means that it processes things in discrete frames, moving all objects, resolving collisions and altering velocities, before moving them again at the start of the next frame.

An issue i see with this model is that when two objects collide, they are inside each other. And if I'm going to be using impulses to move them out again, there does seem to be the possibility of them not colliding with enough energy, so that the impulse isn't strong enough, so that the objects are STILL interpenetrating after being moved in the next frame. This would lead to the impulse being applied multiple times, which is not good. I'm wondering if it would be best to keep my current approach of teleporting things out as well, but adapt it to move the objects to relative positions based on the collision surface (essentially fastforwarding their motion through however many frames it would take to make them stop colliding). does that make sense or seem bad ?

Any advice in these matters is appreciated.
 
Last edited:
Physics news on Phys.org
bump! can anyone help? maybe i should have tried the general physics forum :(
 
For simple comparison, I think the same thought process can be followed as a block slides down a hill, - for block down hill, simple starting PE of mgh to final max KE 0.5mv^2 - comparing PE1 to max KE2 would result in finding the work friction did through the process. efficiency is just 100*KE2/PE1. If a mousetrap car travels along a flat surface, a starting PE of 0.5 k th^2 can be measured and maximum velocity of the car can also be measured. If energy efficiency is defined by...

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 35 ·
2
Replies
35
Views
4K