Collision detection on both side of a polygon mesh
by Liu Yi · in Torque Game Engine · 05/19/2006 (1:09 am) · 1 replies
This is what I want to achieve:
I have a big Item object in the game world. The player shoots missiles to this object. I've made changes to the engine code, so that when the missile his the object, onCollision method is called, but the missile doesn't explode, instead, it penetrates the surface of this big object and goes inside. I hope that when the missile flies out, onCollision method can be called again. But it seems the engine only detect the collision between the projectile and other scene object on front side of the polygon mesh. When the projectile collide with the object from back of the polygon mesh, the collision is not detected.
Is there anyway to detect this collision as well?
Thanks.
I have a big Item object in the game world. The player shoots missiles to this object. I've made changes to the engine code, so that when the missile his the object, onCollision method is called, but the missile doesn't explode, instead, it penetrates the surface of this big object and goes inside. I hope that when the missile flies out, onCollision method can be called again. But it seems the engine only detect the collision between the projectile and other scene object on front side of the polygon mesh. When the projectile collide with the object from back of the polygon mesh, the collision is not detected.
Is there anyway to detect this collision as well?
Thanks.
Torque 3D Owner Eric Roberts
For this custom object you need to overload the castRay method call (this will be called by the projecttile). Check out the Collision Tutorial Resource for an explination of castRay and what it's supposed to do. Ideally you need to check against all polys regardless of CCW or CW orientation, usually rayCasts only check for something CW oriented IIRC.
So it requires some custom engine coding - but entirely possible.
Good luck!
- Eric