I am having trouble determining what object gets hit first by the bullet when it is shot. I use really long 3d boxes as bullets, but the problem comes when they intersect 2 objects. This would be fine, unless the enemy that gets hit is in a building. The bullet should hit the wall, but the only way of referencing proximity to the shooter is by each object position. But the position of the structure is farther away than the enemies. If you don't understand, here is a drawing:
____________________________________________
o / o |
+-----BULLET---|-->+ +(position |
/ |___/__________________of building)__________|
Shooter enemy
So, as you can (hopefully) see from my really bad representation, the enemies position is closer than the building's but the wall should get hit first.
If anyone has a better way of fps shooting, that is greatly appreciated.