verlet physics update

Blitz3D Forums/Blitz3D Programming/verlet physics update

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

swift heres a more detailed explanation of im doing (and most importantly it is working well).

prep phase
1) build the verlet structure
2) store off each verelets position relative to the structures CG.
3) create a distance value that defines if the verlet is about to collapse. we will call this DangerDistance
4) create a distance value that defines if the verlet HAS collapsed. we will call this CollapseTrue


begin simulation

1) each simulation tick record how far the verlet has travelled.
2) if the verlet has travelled beyond the DangerDistance but less than the CollapseTrue distance, run a loop that relaxes the structure and updates collision information per iteration of the loop.
3) if the verlet has travelled beyond CollapseTrue then reset its position from the original stored location and relax structure

this technique is often used in physics simulation. the way it basically works is you use low fidelity collision information until it reaches a critical threshold, then you turn on the high fidelity collision routines to gain frame by frame control.

my method is not perfect for sure. still could use alot of refinement but if you try not to allow the structure to collapse in the first place the springs will auto-solve the problem for you. now to make this even better we should start to use the techniques of sim time control that are common in impulse based physics simulation. basically what happens in impulse based sims, is you run it using low fidelity as stated above and when a collision is detected you back up the simulation until the entity is just barely in contact with the colliding surface. then you run a high fidelity collision response code.

im currently not using any impulse time correction. thats for the next go around. what i got coded right now is working for 90 percent of the situations. that last ten percent will be corrected later with impulse time control.