MCPcopy Create free account
hub / github.com/assaultcube/AC / setperspective

Function setperspective

source/src/rendergl.cpp:922–936  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

920VARP(specthudgun, 0, 1, 1);
921
922void setperspective(float fovy, float aspect, float nearplane, float farplane)
923{
924 GLdouble ydist = nearplane * tan(fovy/2*RAD), xdist = ydist * aspect;
925 if(player1->isspectating() && player1->spectatemode == SM_OVERVIEW)
926 {
927 int gdim = max(clmapdims.xspan, clmapdims.yspan);
928 if(!gdim) gdim = ssize/2;
929 int orthd = 2 + gdim/2;
930 glOrtho(-orthd, orthd, -orthd, orthd, 0, (clmapdims.maxceil - clmapdims.minfloor) + 2); // depth of map +2 covered
931 }
932 else
933 {
934 glFrustum(-xdist, xdist, -ydist, ydist, nearplane, farplane);
935 }
936}
937
938void sethudgunperspective(bool on)
939{

Callers 3

sethudgunperspectiveFunction · 0.85
gl_drawframeFunction · 0.85
drawstencilshadowsFunction · 0.85

Calls 2

maxFunction · 0.85
isspectatingMethod · 0.80

Tested by

no test coverage detected