Announcement

Collapse
No announcement yet.

Visual FOV like CS:GO

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Visual FOV like CS:GO

    Code by darkko

    Somewhere or before CalcRefDef:

    Code:
    #define VectorMul(vec,num,res){(res)[0]=(vec)[0]*(num);(res)[1]=(vec)[1]*(num);(res)[2]=(vec)[2]*(num);}
    void fov(struct ref_params_s *pparams)
    {
    Vector Offset(0,0,0);
    Vector r,u,b;
    
    VectorMul(pparams->right,0,r);
    VectorMul(pparams->up,0,u);
    VectorMul(pparams->forward,-(gCvar.visualfov),b);
    
    Offset=Offset+r;
    Offset=Offset+u;
    Offset=Offset+b;
    
    pparams->vieworg[0]+=Offset[0];
    pparams->vieworg[1]+=Offset[1];
    pparams->vieworg[2]+=Offset[2];
    }

    PostV_CalcRefDef:
    Code:
     if(gCvar.visualfov)
    {
    fov(pparams);
    }
Working...
X