Best way to test for bullet collide with moving object?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Domarius
Posts: 178
Joined: Thu Mar 11, 2004 9:51 am
Location: Brisbane, QLD, Australia

Best way to test for bullet collide with moving object?

Post by Domarius »

I am using the examples as starting points for everything I try.

I noticed the bullets in the TechDemo are fired using an animate function. A line collision tests where the wall is where the player is looking, and the start of the animation is set to the camera position, and the end of the animation is where the collision with the wall is. When the bullet reaches the end of the animation, it explodes.

This seems really efficient, but what about for testing collision between moving objects?

The only way I know how to do this is test the bullet position for an overlap with the aabounding box of the moving object. To do this, I'd have to check every bullet against every moving object that is active.

Is there a better way? I found this related post, but I don't understand it because it involves somethings called "triangle selectors" - a term which I'm not familar with yet (but am willing to learn)
Caecus
Posts: 36
Joined: Fri Aug 22, 2003 6:33 am
Location: California, USA

Post by Caecus »

"To do this, I'd have to check every bullet against every moving object that is active."

Yep, you would. There is no way to tell if a bullet collides if you dont test it. And since you have multiple entities your going to have to test against all of them.
Domarius
Posts: 178
Joined: Thu Mar 11, 2004 9:51 am
Location: Brisbane, QLD, Australia

Post by Domarius »

All good. Thanks, I just wanted to check I wasn't missing out on some new, really efficient way. (besides seperating the level into grid cells and only checking against all objects in the current cell, which I'm going to do anyway)
Post Reply