Shooting..

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
VinZ
Posts: 21
Joined: Sat Jul 29, 2006 11:16 am
Location: India

Shooting..

Post by VinZ »

how do i find collision detection between gun and enemy..
I created all the sceans including shooting, but i am not abel to destroy the enemy when i shoot.
can any one help..
thanks in advance
Watcher
Posts: 40
Joined: Sat Jul 01, 2006 9:44 am
Location: Czech republic

Post by Watcher »

Maybe you should try to detect collision using getCollisionPoint. It detects collision on the line.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

That's good if your projectiles you're firing are very fast, like bullets, and hit their target straight after being fired, but if they are slow projectiles then that's not such a good way to do it, unless every frame you check how far along the line of flight the projectile has flown and see if that went through any enemies.

What i do (currently) is every frame check if the projectile's position is within an enemy's bounding box. That's for slow projectiles
Image Image Image
VinZ
Posts: 21
Joined: Sat Jul 29, 2006 11:16 am
Location: India

Cannot find which enemy

Post by VinZ »

hi,
If i use fast shooting, i can find only triangle. How can i find which enemy i shooted to destroy.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

You could check the bullets collision line against each individual enemy's triangle selector individually maybe or is it possible to get the triangle and then cycle through each enemy's triangle selector to find out which one it came from?
Image Image Image
crackingod
Posts: 15
Joined: Fri Aug 04, 2006 11:36 am

Post by crackingod »

I'm new to Irrlicht, but what I used to do with other engines, if you are doing a FPS, is just check if the mousepick is on the ennemy mesh. (Maybe won't work very well for network based games)
Post Reply