Best Method of Collision Detection?
by Nathan · in Torque Game Engine · 02/23/2008 (4:57 pm) · 3 replies
Is this considered the best method of detecting bullet collisions?
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=6538
Or is there a better way? I'm messing around with a FPS game with sniper rifles, so accurate collisions would be nice.
Thanks,
Nathan
http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=6538
Or is there a better way? I'm messing around with a FPS game with sniper rifles, so accurate collisions would be nice.
Thanks,
Nathan
#2
Plus, you can add this resource into other classes besides Player. I haven't looked into other resources to see if this is the case with them as well, but either way, it's a bonus.
02/23/2008 (11:42 pm)
I also think this resource is the best for hitbxes. There are others, but less flexible, or far more complicated.Plus, you can add this resource into other classes besides Player. I haven't looked into other resources to see if this is the case with them as well, but either way, it's a bonus.
Torque Owner Henry Todd
Atomic Walrus
Be aware that these instructions don't include adding support for actually using the hitbox ID for anything in particular; all this does is have the raycast return the hitbox # when it hits a Player object; you'll still need to have the projectile feed this data back to its onCollision call in order to use it for anything.
Projectile uses castRay to check if it's hit something each tick, until it finally does collide with an object. At this point you'll want to make sure that object is a Player, and add the hitbox # to the set of parameters which get sent to the script call of projectile::onCollision.
Also, remember to make sure your hitboxes are animating with the bones correctly or you'll get some pretty odd results.