Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / fps shooting problems

Author
Message
BN2 Productions
22
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 10th Mar 2007 20:35 Edited at: 11th Mar 2007 02:35
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:
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.
luke810
19
Years of Service
User Offline
Joined: 4th Sep 2006
Location: United States
Posted: 11th Mar 2007 01:11
Using raycasting for collision would make bullet collision much easier. It also solves the problem you described above because raycasting will give you the object that the polygon the ray collides with belongs to. I suggest using Sparky's DBC Collision Dll because the command are simple, east to use, and work relatively fast.
BN2 Productions
22
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 11th Mar 2007 02:33
ummmm what is raycasting?
RUCCUS
21
Years of Service
User Offline
Joined: 11th Dec 2004
Location: Canada
Posted: 11th Mar 2007 03:42
BN2, meet effort. Effort, meat BN2. I hope you two get along .

Search on google, and the answers will come.

Login to post a reply

Server time is: 2026-07-06 01:20:05
Your offset time is: 2026-07-06 01:20:05