Collision improvments,. . just some ideas.

If there is something important you think is missing in the current version of ZGameEditor then you can post a feature request here!

Moderator: Moderators

Post Reply
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Collision improvments,. . just some ideas.

Post 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.
iterationGAMES.com
User avatar
VilleK
Site Admin
Posts: 2355
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post 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.
User avatar
Kjell
Posts: 1915
Joined: Sat Feb 23, 2008 11:15 pm

Post 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
User avatar
VilleK
Site Admin
Posts: 2355
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post 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.
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

nice

Post 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,. .
iterationGAMES.com
Post Reply