• Advertisement
Sign in to follow this  

Physics engine order

This topic is 4264 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, this week I'm going to try my hand at my first physics engine! First of all can any of you give me advice or important points? and my main question, in my engine I'll have 5 main parts: force calculation, collision detection, collision response, integration, rendering. Is that the correct order? If not what order should I do them in? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
I looked at "this paper" and it was very interesting. I liked how it handeled collision detection. But there was something I didn't understand they say:
Quote:

Instead, our algorithm uses a novel fixed-time integration scheme, where we allow for penetration between bodies inside a simulation step. A simple Euler integration scheme with time step 0.01s has shown to be sufficiently robust for all our tests. Our algorithm splits the collision and resting contact phases, where only the velocities are updated between both:

Algorithm 1: Fixed-time integration scheme
Collision detection and resolution.
Update velocities.
Resting contact resolution.
Update positions.
Update time.
Basically, both stages 1 and 3 perform a collision resolution step, but the only difference between both is the coefficient of restitution used in the impulse computation. In the contact resolution phase, we model the collision as completely plastic (ε = 0).

what is the difference between Collision detection and resolution and Resting Contact resolution. Do I define some velocity threashhold that if the Colliding bodys are moving slower than it they are in "resting contact"? Or do I also have to define a minimum collision the below it turns into contact? And when do I do Contact detection - in the third step or in the first?
Thanks!

Share this post


Link to post
Share on other sites
At the risk of seeming not very helpful - it's all explained quite well in the paper...

However - bear in mind their implementation seems designed for non-real-time animation, and they seem to do multiple collision detections per time-step. For real-time simulation you can get away with just one (seems to work just as well anyway).

There's also some "notes" I made a while back here, though they may not be completely up to date with my implementation.

Share this post


Link to post
Share on other sites
MrRowl, you're demo's and movies are incredible!!
I read you're algorithm:
Quote:

The basic order of integration is this:
-Get all forces acting on the bodies.
-Integrate velocity using the forces. Use the new velocities integrate positions. Detect collisions (ideally a swept test from old positions to new ones... but I currently just do an overlap test with the new positions).
-Restore positions and velocity to their original values.
-Process (see below) all collisions and constraints using impulses, iterating a few times over the list. These impulses update the velocities, but not the positions, of course.
-Integrate the velocities (again) using the forces.
-Process all collisions and constraints using impulses again, except now treat all collisions as inelastic, iterating a few times over the list.
-Do a "shock" step - see below. This allows objects to stack up even when the number of iterations in the previous steps is small.
-Integrate the positions using the new velocities.

I can see how you'd do that with Euler integration but how do you implement that with RK4? how do you first do the velocity and then the postion?
Thanks.

Share this post


Link to post
Share on other sites
Quote:
Original post by daniel_i_l
I can see how you'd do that with Euler integration but how do you implement that with RK4?


Unfortunately, I don't have an answer to that. Wish I did...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement