void CCCameraBase::setupViewport(const float x, const float y, const float width, const float height) { const float invY = ( 1.0f-height ) - y; const float backBufferWidth = gEngine->renderer->getBackBufferWidth(); const float backBufferHeight = gEngine->renderer->getBackBufferHeight(); const float definedWidth = width * backBufferWidth; const float definedHeight = height * backBufferHeight; viewport[0] = x * backBufferWidth; viewport[1] = invY * backBufferHeight; viewport[2] = definedWidth; viewport[3] = definedHeight; cameraX = x; cameraY = y; cameraW = width; cameraH = height; invCameraW = 1.0f / cameraW; invCameraH = 1.0f / cameraH; aspectRatio = definedWidth / definedHeight; GluPerspective( 60.0f, aspectRatio ); }
void CCCameraBase::setPerspective(const float perspective) { this->perspective = perspective; GluPerspective( perspective, aspectRatio ); }
void CCCameraBase::setNearFar(const float zNear, const float zFar) { this->zNear = zNear; this->zFar = zFar; GluPerspective( 60.0f, aspectRatio ); }