Game Development Community

AIPlayer eyeVector to Waypoint Vector problem

by Katrina Rose · in General Discussion · 08/10/2004 (9:27 am) · 1 replies

Hi,

How do I get a vector from the AIPlayer's eye vector to the waypoint vector, and then see if there are any objects in the way? I would like to check to see if there are any unmovable objects between the bot and the waypoint so I can have it find an different path. I know how to get the vector for the Bot's eye and the Vector for the Waypoint, but I don't know how to get a vector between the two, and I also don't know how to see if there are any objects between them.

Thanks in advance for your help.

Marrion Cox

#1
08/10/2004 (9:34 am)
You could try using a rayCast:

%hitInfo = containerRayCast( %begin, %end, TypeMask );
//TypeMask is the type masks of the types of objects you want to 
//test collision of the ray with

//%hitInfo now contains "object x y z"
//where x y x is the location the ray intersects the object