Game Development Community

How do I find the point of a collision?

by Aidan Sliney · in Torque Game Engine · 03/09/2009 (9:22 am) · 2 replies

How do I find the point of collision between two objects or between the player an object? I've rendered an OpenGL object on the C++ side and now when the player collides with it I want to find the exact point of collision.


Thanks in advance!

#1
03/10/2009 (3:46 pm)
The collision is done using the collision meshes (box/sphere/etc). If you dont have one maybe you can simulate the collision by doing a ray cast betwuuen your object. If you have the collision mesh then you can analyze the point in the onCollision callback for the object.

Luck!
Guimo
#2
03/11/2009 (4:10 am)
Thanks for the help. How do i do a ray cast? Will that give me the polygon I've hit too? I've created a cube using Matt's resource http://www.garagegames.com/community/blogs/view/5414. Are you refering to convexes when you say the collision mesh?