Camera2::Camera2( glm::vec3& position, glm::vec3& target, glm::vec3& up, GLfloat near, GLfloat far, GLfloat fieldOfView, const char* cameraName) : m_vCameraPosition(position), m_vCameraDirection(target), m_vCameraUp(up), m_fNearClippingPlane(near), m_fFarClippingPlane(far), m_fFOV(fieldOfView) { m_bFirstUpdate = true; m_fYaw = -90.0f; m_fPitch = 0.0f; CameraName = new char[strlen(cameraName) + 1]; strcpy_s(CameraName, strlen(cameraName) + 1, cameraName); LoadIndentity(); SetProjection(m_fFOV, WINDOW_WIDTH, WINDOW_HEIGHT, m_fNearClippingPlane, m_fFarClippingPlane); SetOrthoProjection(0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f); }
//***Default camera*** // Position 0.0f, 0.0f, 0.0f // Target 1.0f, 0.0f, 1.0f // Up 0.0f, 1.0f, 0.0f // NearClip 0.1f // FarClip 3000.0f // WindowWidth Default // WindowHeight Default Camera2::Camera2(const char* cameraName) : m_vCameraPosition(0.0f, 0.0f, 50.0f), m_vCameraDirection(0.0f, 0.0f, -1.0f), m_vCameraUp(0.0f, 1.0f, 0.0f), m_fNearClippingPlane(0.1f), m_fFarClippingPlane(3000.0f), m_fFOV(45.0f) { m_bFirstUpdate = true; m_fYaw = -90.0f; m_fPitch = 0.0f; CameraName = new char[strlen(cameraName) + 1]; strcpy_s(CameraName, strlen(cameraName) + 1, cameraName); LoadIndentity(); SetProjection(m_fFOV, WINDOW_WIDTH, WINDOW_HEIGHT, m_fNearClippingPlane, m_fFarClippingPlane); SetOrthoProjection(0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 1.0f); }
Transform::Transform() : manipulator_{nullptr} { LoadIndentity(); }