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.

Rob,

making new cars is easy so i assume you really want to just focus on collision between non static objects such as other cars.

what i had envisioned was to use the verlets current x,y,z coords as a vertice for a real-time build on the fly deformable mesh. this part concept was completed in a much earlier version of the verlet code that is no longer shown here. but it did work and worked well for that matter. it has the benefit of being very low in poly count (as opposed to using the highly detailed mesh of the car for collision) and it would conform to the points we would collide against for the verlets.

now for the hard part =(

blitz's internal collision routines do not allow for two, or more, moving non sperical entities to collide. it will simply pass right thru it. so you would have to write your own collision routines.

if im not mistaken only two routines are needed.
1) moving sphere to moving poly (the sphere is the verlet of vehicle 1 and the poly is the polymesh of the second vehicle whos vertices are the coordinates of the verlets)
2) moving poly to moving sphere (just a reversal of the above)

but it gets more complicated...

if the sphere collides with a mesh the sphere is moved, the verlets position is updated to the new location of the collided sphere and energy, or velocity, is added to the system. this part works. but what about the poly on the second vehicle that the firsts vehicles sphere collided against? best guess i have is that the poly AND ALL its connected verlets are moved and each connected verlet is updated and velocity is inferred. not a very good solution but it may work assuming you had the above described routine.

currently i dont have a clue how to write such a routine.

ohh last thought. the problem is not collision detection between the two cars. the old code i had did that. it used meshesintersect to detect if one poly cage collided with another poly cage. however the problem is how to react after a collision is detected.