Handling Penetration in Physics Demo with Cubes

  • Context: Undergrad 
  • Thread starter Thread starter bkenwright
  • Start date Start date
  • Tags Tags
    Penetration
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 3K views
bkenwright
Messages
7
Reaction score
0
Hi all,
I'm currently trying to write a simple physics demo with cubes, and am looking for the best way to handle penetration.

One method I was looking at is to back-track the collision detection till we find the point of intersection within some limit.. i.e.

collision at dt, so we step back dt/2 again and again till we have a hit within some limit...the only problem I'm having is...what if you have an object hitting the ground at dt of 0...doen's this mean our time step value is 0?...so the object increment is 0...hmmm.

Any ideas would be great.

Thanx

Ben

=)
 
Physics news on Phys.org
A comprehensible description would be just as nice.

What kind of cubes? Polynomial?

What is penetrating what?

Is dt a differential or measurement?

Etc.

What is the problem as presented by the instructor?
 
Well the case I'm trying to deal with is penetration on a general scale. For example, let's say you have a cube bouncing on a plane, and you have large time steps...and you use eulers integration...and just do each vertex point being below the plane to detect a collision.

Now, because the timesteps are large enough, for each time step when a collision is detected, there will be a small error where the cube penetrates the plane.

To solve this, I could back track the simulation to where the collision detection is just on the surface...ie.

store values
update dt (integrate)
while (penetrating)
{
restore values
dt = dt/2
update dt (use half dt)
}

But using this method, if the object is really close to the surface...then for any timestep greater than 0 its going to penetrate the surface due to gravity...so this will result in the above method reduce dt to almost 0...and hence its updates will fail :-/

Thanx for any help on this.

Ben

:)