Game Development Community

Collision Detection overview

by Kyle "Nonsense" Watson · in Technical Issues · 10/17/2002 (8:45 pm) · 3 replies

how do I: find out if a point has collided with the terrain, and if it has to move it above the terrain where is collided


X (need to move it here)
---------------------------------------------- (terrain)

X (point)


thanks for your help
-kyle

#1
10/18/2002 (7:43 am)
In the C++, it's getContainer()->castRay(), and in script, containerCastRay (or something very similar).

They'll let you specify a line to test along (such as from the point to a point very high above it), an exclusion mask (so you can say, only test for terrain), and return the location and normal for the point they struck. Hope that helps.
#2
10/18/2002 (8:53 am)
is RayInfo an struct that holds the intersectiona and normal for the collision?
#3
10/18/2002 (10:40 pm)
Yeah.