Page 1 of 1

Collision improvments,. . just some ideas.

Posted: Tue Dec 16, 2008 2:48 pm
by jph_wacheski
for 2d collisions;
One idea I had was to add a Circle2D collision that would work WITH the Rect2D_OBB collition,. . this would make rotating models (w/ the Circ2D setting) not get stuck in angled walls/buildings that are checked with the Rect2D_OBB. (as square are apt to, try it!) This also would be very usefull on its own as most of the game ideas I have call for round object collisions,. .
Another way to deal with the same issue, as well as many others, is to add a new Action in the DefineCollision; MoveOutOf - this would move the objects involved in the hit BACK, the way they where moveing, untill they do not collide. (therfore if a moveing object hits a still wall the wall does not move!) And while we are thinking of it, how about a Bounce Action? Like MoveOutOf with a direction impulse thrown in,. .

and for 3d;
A Box3D_OBB would very much rock! of course it should do all the above like mix with Sphere3D etc,. .

just some ideas for you to consider.

Posted: Wed Dec 17, 2008 10:15 am
by VilleK
The "Stop" action is designed to move out of collisions. However a hard to find bug makes it often not succeed.

I ran into the problem with getting stuck in walls then making the FpsDemo-project. That is the reason I use Sphere3D vs Box3D for moving object against walls.

Circle2D is a good idea. If anyone wants to help I could use a reference on how to make circle vs OBB collisions tests in 2D.

Posted: Wed Dec 17, 2008 10:24 am
by Kjell
Hej,

You can find sources on a wide variety of intersections here. Written in C++, but useful nevertheless. Or in case you have some of "the" programming books lying around, this page will probably be quite useful.

K

Posted: Fri Dec 19, 2008 12:41 pm
by VilleK
Thanks for the links Kjell.

I now updated the beta with a new collisionstyle: Circle2D.

I have not touched the code that is supposed to move objects out of collisions. If you have a small project that have the problem with objects getting stuck then please send it to me so that I can try to fix it.

nice

Posted: Fri Dec 19, 2008 9:13 pm
by jph_wacheski
Very cool! I will test this out,. does is work with the Rect2D_OBB ? I was not aware that the 3DSpear and Box played together,. I will try some stuff with that as well.., humm with this and my new technique for finding nearest instances I may be able to do the game I have been pineing to do,. it's an action stratagy game with turret building etc,. probably be a mostly 3 quarters view 3rd person view type thing., . off to run some test,. .