Verlet Collision Response

BlitzMax Forums/BlitzMax Beginners Area/Verlet Collision Response

UnderwoodNullium(Posted 2008) [#1]
I know this has been covered pretty well in these forums, and I believe a module is (was?) being created as well, but I'm in need of a little help.

I currently have a verlet-based physics program, and everything is working great except for the collision detection and response. I originally thought that testing a line-line intersect algorithm using each constraint with each point and it's old position were going to do the trick, but soon realized that the constraints were moving as well (duh!)...

Is there anybody who has any way of moving the three points (two constraint points and the 'bad' point) in the proper direction / force?

Thanks, if you help me get this working, I will seriously love you forever. No kidding.

Thanks,
Blain


UnderwoodNullium(Posted 2008) [#2]
I don't mean to be a pest, but I've looked again over many Blitz threads about Verlet collisions, and on many other forums. I've been trying many different methods, still with no luck.

Does anyone have an idea for the above problem, just a way to do it? That's pretty much all I need.

Thanks,
Blain


tonyg(Posted 2008) [#3]
OK, you're doing this in BlitzMax. Is that right?
If so, are you using an existing physics engine implementation or your own engine? If its an existing engine then which one?
What is the simplest code you can provide which shows the problem?What is the actual problem you are getting?


UnderwoodNullium(Posted 2008) [#4]
Yes, it's in BlitzMax.
I'm using my own engine, and the points and constraints work well right now. The actual problem is I'm trying to get the 'point's' collision to be detected and its response.

The first way I tried was testing if the constraints were intersecting, but it wasn't working correctly, so I deleted that function.

The second was testing if a point's old position and current position line and each constraint line were intersecting, but I forgot that the constraints were moving as well, so that was scratched.

I think the original way was right, but after I get a detection, I'm not sure what to do.

I think I have to expel the point by the normal angle of the constraint, but I'm not sure.

Thanks for responding, you've proved very helpful to me in the past! And sorry if that's still unclear/not enough.

Thanks,
Blain


tonyg(Posted 2008) [#5]
The first way I tried was testing if the constraints were intersecting, but it wasn't working correctly, so I deleted that function.


In what way was it not working?
I know nothing about physics simulations but a) you've put it in beginner's and b) you've followed up your own post so I will have a stab at it.
Does this help? It gives collision code and then information on what to do next.
Personally, I would use line/line tests using something like this on the constraints.


UnderwoodNullium(Posted 2008) [#6]
Yes! That helped tremendously! I found out what the problem was and got it colliding. I'll play around with it later, and I didn't notice Oddball's functions. I'm about to go to class soon.

I love you forever Tony, Seriously thanks for your infinite wisdom and power. ;)

Thanks,
Blain