From my Client_TMBI mod on rtb
function tmbi_getfocuspos()
{
%dist = getfocusdistance();
%eye = tmbi_getmyeyepoint();
%vec = serverconnection.getcontrolobject().getmuzzlevector(0);
%vec = vectorscale(%vec, %dist);
return vectoradd(%eye, %vec);
}
function tmbi_getmyeyepoint()
{
%player = serverconnection.getcontrolobject();
if(!isobject(%player))
return "0 0 0";
%pos = %player.getposition();
%vec = %player.getforwardvector();
%scale = %player.getscale();
%x = getword(%pos, 0) + (getword(%vec, 0)*0.14 + 0.002)*getword(%scale, 0); //me no likey
%y = getword(%pos, 1) + (getword(%vec, 1)*0.14 + 0.002)*getword(%scale, 1);
%z = getword(%pos, 2) + (getword(%player.getdatablock().boundingbox, 2)/4.92 - $mvtriggercount3*1.53 + 0.002)*getword(%scale, 2); //optimized for standard blockhead, good luck otherwise
return %x SPC %y SPC %z;
}
note that this messes up slightly if the player is sitting