~armagetronad-ct/armagetronad/0.4-advrim

« back to all changes in this revision

Viewing changes to src/engine/eCamera.cpp

  • Committer: Voodoo
  • Date: 2013-04-11 10:46:24 UTC
  • Revision ID: voodoo-20130411104624-zse1f33o7ten188z
merge -r 1454..1476 lp:armagetronad/0.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
897
897
    pos=pos+dir*mf*.25+dir.Turn(eCoord(0,ml*.25));
898
898
 
899
899
    fov/=zi;
900
 
    if (fov>120) fov=120;
 
900
    if (fov>160 && zi < 1) fov=160;
901
901
 
902
 
    if (fov<30) fov=30;
 
902
    if (fov<30 && zi > 1) fov=30;
903
903
 
904
904
 
905
905
    switch(mode){
2085
2085
            if ( Center() &&  wrongDirection > 0 )
2086
2086
            {
2087
2087
                // if so, turn to the side using the last driving direction
2088
 
                newdir = newdir + Center()->LastDirection()*(wrongDirection*ts*turnSpeed*customTurnSpeed180);
 
2088
                eCoord normedLastDir = Center()->LastDirection();
 
2089
                REAL wrongWrongDirection = -eCoord::F(cycleDir, normedLastDir);
 
2090
                if( wrongWrongDirection > 0)
 
2091
                {
 
2092
                    normedLastDir = normedLastDir + cycleDir * (wrongWrongDirection/cycleDir.NormSquared());
 
2093
                    REAL n = normedLastDir.NormSquared();
 
2094
                    if(n > 0)
 
2095
                    {
 
2096
                        normedLastDir *= 1/sqrt(n);
 
2097
                    }
 
2098
                }
 
2099
                newdir = newdir + normedLastDir*(wrongDirection*ts*turnSpeed*customTurnSpeed180);
2089
2100
            }
2090
2101
        }
2091
2102
        else