//Construct the camera; Camera3D::Camera3D(BlackHole *bh, double *position, double *look, int coord, int cameratype, int pixh, int pixv, double fovh, double fovv, double zoomh1, double zoomh2, double zoomv1, double zoomv2) { directions[1] = 1.0; directions[2] = 0.0; directions[3] = 0.0; directions[4] = 0.0; directions[5] = 0.0; directions[6] = 1.0; directions[7] = 0.0; directions[8] = 0.0; directions[9] = 0.0; directions[10] = 0.0; directions[11] = 1.0; directions[12] = 0.0; directions[13] = 0.0; directions[14] = 0.0; directions[15] = 0.0; directions[16] = 1.0; blackhole = bh; this->fovh = fovh; this->fovv = fovv; this->zoomh1 = zoomh1; this->zoomh2 = zoomh2; this->zoomv1 = zoomv1; this->zoomv2 = zoomv2; this->pixh = pixh; this->pixv = pixv; GenerateCamera(position, look, coord, cameratype); }
const Matrix4f Pipeline::UsePCW(){ GeneratePerspective(); GenerateCamera(); GenerateWorld(); if(m_PCWdirty){ m_PCWModel = m_matrixPerspective * m_matrixCamera * m_matrixWorld; glUniformMatrix4fv(m_PipelineModelLocation, 1, GL_TRUE, m_PCWModel.m_data[0]); SetUniformWorld(); SetUniformCameraPosition(); } return m_PCWModel; }
const Matrix4f Pipeline::UsePC(){ GeneratePerspective(); GenerateCamera(); return m_matrixPerspective * m_matrixCamera; }
const Matrix4f Pipeline::UseCW(){ GenerateCamera(); GenerateWorld(); return m_matrixCamera * m_matrixWorld; }