Collision advice

Post Reply
Bishop
Posts: 2
Joined: Wed Feb 03, 2010 4:29 am

Collision advice

Post by Bishop »

Hi, I'm pretty new to Bullet but I've managed to get a good demo working on my iphone with picking and point to point constraints, so I know enough to be dangerous. :) I'm working on a game very similar to minesweeper and I've been looking over the demos for collision implementations, but I'm still lacking in understanding. My question is what would be the best way to handle collisions for these two modes of play;

The first mode is just like the original minesweeper game. The user will "click" on a square and the object will be chosen by means of a pick ray collision.

In the second mode, the user will "click" on a location to send a character navigating the mine field and the collision will be between the character and the objects in the field.

I'm just not sure how I'm going to make a connection between my algorithm for "sweeping" the mine field and the collision feedback I get from Bullet. Any help would be greatly appreciated.

Thanks
mako90
Posts: 28
Joined: Tue Jan 05, 2010 12:41 pm

Re: Collision advice

Post by mako90 »

Hi,
I think, it would be easier and more performance tolerant not to use bullet for such a job. Why don't you remember the coordinated of all the mines and check: for mine in mines do: if character.location = mine.location: boom!!!;

BR.
Bishop
Posts: 2
Joined: Wed Feb 03, 2010 4:29 am

Re: Collision advice

Post by Bishop »

That's a good point... and I do have a bad habit of over complicating things :) ... but my thinking was that Bullet already had a collision system employed and it might be more efficient for me to take advantage of it. Thanks for the quick reply.
mako90
Posts: 28
Joined: Tue Jan 05, 2010 12:41 pm

Re: Collision advice

Post by mako90 »

Hi,
yes, you are right about bullet. But the point is that it's really too complicated. The collision system involves creation of bodies, their form, location, weight, velocities, the size of the world, etc. are considered when collisions are detected.
All this involves sophisticated mathematics calculations and lots of RAM.
You can look at 2D physics libraries, if you are convinced, that physics is required. That would much increase the performance.

BR.
Post Reply