void MOCamera::updateProjMatrix(void) { MRenderingContext * render = MEngine::getInstance()->getRenderingContext(); render->getViewport(m_currentViewport); float ratio = (m_currentViewport[2] / (float)m_currentViewport[3]); // perspective view if(! isOrtho()) { // normal perspective projection createPerspectiveView(&m_currentProjMatrix, m_fov, ratio, m_clippingNear, m_clippingFar); return; } // ortho view float height = m_fov * 0.5f; float width = height * ratio; createOrthoView(&m_currentProjMatrix, -width, width, -height, height, m_clippingNear, m_clippingFar); }
// Shortcut method for connecting to a GlobalEventManager command void XYWndManager::createNewOrthoView() { createOrthoView(XY); }