Game Development Community

Is their anyway to detect an incomming collision?

by Vince Gee · in Torque Game Engine · 01/30/2006 (7:23 am) · 3 replies

Dunno if it's possible,

But I would like to know if their are any projectiles w/in say 10 meters of a character where are inpending collision.

Figure it like radar on a projectile.

So a script function would be like Player.getincommingcollisions()

and it would return an array or collection of all projectile id's which are incomming.

Any ideas on where to start looking or if it's been done yet?

Vince

#1
01/30/2006 (7:40 am)
I would start with the radar code you already mentioned. It does a radius search for item types that are defined in the code. Use this radar code as you beginning for implementing it in the player class.

Martin
#2
01/30/2006 (7:41 am)
Misread and martin beat me to it.
#3
01/31/2006 (2:15 am)
The other way around would be to put impending collision detection on the projectile, so they warn the target when they are a certain distance. The biggest caveat to either system might be the fact that projectiles usually move pretty quickly, if you detected one 10 meters out, chances are very good that it's a split second away from hitting you.

Given a decent number of projectiles, I think it would require much less processing for the projectile to notify its target as opposed to the players looping through them all when the majority might not even be aimed at them.