> > > >

fm_is_in_viewcone | fakemeta_util | AMX X Documentation

Includes

    1. Stocks
    1. Natives
    2. Forwards
    1. Natives
    2. Stocks
    1. Natives
    2. Stocks
    1. Natives
    1. Natives
    2. Stocks
    1. Natives
    1. Natives
    2. Forwards
    3. Stocks
    1. Natives
    2. Forwards
    1. Natives
    1. Natives
    1. Natives
    2. Stocks
    1. Natives
    2. Forwards
    1. Natives
    1. Natives
    2. Forwards
    1. Natives
    2. Forwards
    1. Stocks
    1. Natives
    1. Natives
    2. Stocks
    1. Stocks
    1. Stocks
    1. Natives
    1. Natives
    2. Forwards
    3. Stocks
    1. Natives
    1. Natives
    1. Natives
    1. Natives
    2. Stocks
    1. Natives
    1. Natives
    1. Stocks
    1. Natives
    1. Natives
    1. Natives
    2. Forwards
    1. Natives
    1. Natives
    1. Natives
    1. Natives
    1. Natives
    1. Natives
    1. Natives
    2. Forwards
    1. Natives
    2. Stocks
    1. Natives
    1. Natives
    1. Natives
    2. Stocks
    1. Natives
    1. Stocks
    1. Natives
    1. Natives
    1. Natives
    1. Natives
    2. Forwards
    3. Stocks
    1. Stocks
    1. Natives
    2. Forwards
    3. Stocks
    1. Natives
    1. Natives
    2. Forwards
    3. Stocks
    1. Natives
    1. Natives
    2. Stocks
    1. Stocks

fm_is_in_viewcone

Syntax
									// the dot product is performed in 2d, making the view cone infinitely tall
stock bool:fm_is_in_viewcone(index, const Float:point[3]) {
									new Float:angles[3];
     pev(index, pev_angles, angles);
     engfunc(EngFunc_MakeVectors, angles);
     global_get(glb_v_forward, angles);
     angles[2] = 0.0;

     new Float:origin[3], Float:diff[3], Float:norm[3];
     pev(index, pev_origin, origin);
     xs_vec_sub(point, origin, diff);
     diff[2] = 0.0;
     xs_vec_normalize(diff, norm);

     new Float:dot, Float:fov;
     dot = xs_vec_dot(norm, angles);
     pev(index, pev_fov, fov);
     if (dot >= floatcos(fov * M_PI / 360))
          return true;

     return false;
}
								
Variable Description
No arguments

Description
HLSDK functions
> > > >