I believe avoid can be multiple things, in fact I remember it being inside dumpConsoleFuncs...
... virtual string containerRayCast( Point3F start, Point3F end, bitset mask, SceneObject exempt=NULL,exempt2,exempt3,exempt4,exempt5,exempt6 ) {} ...
That's really not important right now though. Just pointing it out.
Even though Port did a nice job summing up what raycasts do and how to use them, you must still be wondering how to implement it so that it activates when a player clicks. It's really easy- you can just package player::activateStuff(), do the vector math, and trace from there. Here's an example that I wrote from the top of my head:
package activateStuffPackage
{
function Player::activateStuff(%player)
{
%lengthOfRay = 4;
%start = %player.getEyePoint();
%end = vectorAdd(%start, vectorScale(%player.getEyeVector(), %lengthOfRay));
%hit = containerRayCast(%start, %end, $TypeMasks::PlayerObjectType, %player);
if(!isObject(%hit))
{
return Parent::activateStuff(%player);
}
//do checks & stuff to %hit
return Parent::activateStuff(%player);
}
};