diff --git a/source/graphics/CameraController.cpp b/source/graphics/CameraController.cpp index 374de29ac1..6fdd27e926 100644 --- a/source/graphics/CameraController.cpp +++ b/source/graphics/CameraController.cpp @@ -298,7 +298,7 @@ void CCameraController::Update(const float deltaRealTime) float zoomDelta = -m_Zoom.Update(deltaRealTime); if (zoomDelta) { - CVector3D forwards = m_Camera.m_Orientation.GetIn(); + CVector3D forwards = m_Camera.GetOrientation().GetIn(); m_PosX.AddSmoothly(forwards.X * zoomDelta); m_PosY.AddSmoothly(forwards.Y * zoomDelta); m_PosZ.AddSmoothly(forwards.Z * zoomDelta); @@ -319,7 +319,7 @@ void CCameraController::Update(const float deltaRealTime) CTerrain* pTerrain = g_Game->GetWorld()->GetTerrain(); CVector3D pivot = GetSmoothPivot(targetCam); - CVector3D delta = targetCam.m_Orientation.GetTranslation() - pivot; + CVector3D delta = targetCam.GetOrientation().GetTranslation() - pivot; CVector3D desiredPivot = pivot; @@ -364,7 +364,7 @@ void CCameraController::Update(const float deltaRealTime) CVector3D upwards(0.0f, 1.0f, 0.0f); CVector3D pivot = GetSmoothPivot(targetCam); - CVector3D delta = targetCam.m_Orientation.GetTranslation() - pivot; + CVector3D delta = targetCam.GetOrientation().GetTranslation() - pivot; CQuaternion q; q.FromAxisAngle(upwards, rotateYDelta); @@ -384,10 +384,10 @@ void CCameraController::Update(const float deltaRealTime) float rotateXDelta = m_RotateX.Update(deltaRealTime); if (rotateXDelta) { - CVector3D rightwards = targetCam.m_Orientation.GetLeft() * -1.0f; + CVector3D rightwards = targetCam.GetOrientation().GetLeft() * -1.0f; CVector3D pivot = GetSmoothPivot(targetCam); - CVector3D delta = targetCam.m_Orientation.GetTranslation() - pivot; + CVector3D delta = targetCam.GetOrientation().GetTranslation() - pivot; CQuaternion q; q.FromAxisAngle(rightwards, rotateXDelta); @@ -428,7 +428,7 @@ void CCameraController::Update(const float deltaRealTime) CVector3D CCameraController::GetSmoothPivot(CCamera& camera) const { - return camera.m_Orientation.GetTranslation() + camera.m_Orientation.GetIn() * m_Zoom.GetSmoothedValue(); + return camera.GetOrientation().GetTranslation() + camera.GetOrientation().GetIn() * m_Zoom.GetSmoothedValue(); } CVector3D CCameraController::GetCameraPivot() const @@ -538,10 +538,10 @@ void CCameraController::ResetCameraAngleZoom() SetupCameraMatrixNonSmooth(&targetCam.m_Orientation); // Compute the zoom adjustment to get us back to the default - CVector3D forwards = targetCam.m_Orientation.GetIn(); + CVector3D forwards = targetCam.GetOrientation().GetIn(); CVector3D pivot = GetSmoothPivot(targetCam); - CVector3D delta = pivot - targetCam.m_Orientation.GetTranslation(); + CVector3D delta = pivot - targetCam.GetOrientation().GetTranslation(); float dist = delta.Dot(forwards); m_Zoom.AddSmoothly(m_ViewZoomDefault - dist); @@ -591,8 +591,8 @@ void CCameraController::FocusHeight(bool smooth) CCamera targetCam = m_Camera; SetupCameraMatrixSmoothRot(&targetCam.m_Orientation); - const CVector3D position = targetCam.m_Orientation.GetTranslation(); - const CVector3D forwards = targetCam.m_Orientation.GetIn(); + const CVector3D position = targetCam.GetOrientation().GetTranslation(); + const CVector3D forwards = targetCam.GetOrientation().GetIn(); // horizontal view radius const float radius = sqrtf(forwards.X * forwards.X + forwards.Z * forwards.Z) * m_Zoom.GetSmoothedValue(); diff --git a/source/graphics/MapWriter.cpp b/source/graphics/MapWriter.cpp index 5683efd8fc..fe2593b4b1 100644 --- a/source/graphics/MapWriter.cpp +++ b/source/graphics/MapWriter.cpp @@ -286,13 +286,13 @@ void CMapWriter::WriteXML(const VfsPath& filename, XMLWriter_Element cameraTag(xmlMapFile, "Camera"); { XMLWriter_Element positionTag(xmlMapFile, "Position"); - CVector3D pos = pCamera->m_Orientation.GetTranslation(); + CVector3D pos = pCamera->GetOrientation().GetTranslation(); positionTag.Attribute("x", pos.X); positionTag.Attribute("y", pos.Y); positionTag.Attribute("z", pos.Z); } - CVector3D in = pCamera->m_Orientation.GetIn(); + CVector3D in = pCamera->GetOrientation().GetIn(); // Convert to spherical coordinates float rotation = atan2(in.X, in.Z); float declination = atan2(sqrt(in.X*in.X + in.Z*in.Z), in.Y) - static_cast(M_PI / 2); diff --git a/source/gui/ObjectTypes/CMiniMap.cpp b/source/gui/ObjectTypes/CMiniMap.cpp index 66f7467152..d2f0e8669a 100644 --- a/source/gui/ObjectTypes/CMiniMap.cpp +++ b/source/gui/ObjectTypes/CMiniMap.cpp @@ -231,7 +231,7 @@ void CMiniMap::SetCameraPos() float CMiniMap::GetAngle() const { - CVector3D cameraIn = m_Camera->m_Orientation.GetIn(); + CVector3D cameraIn = m_Camera->GetOrientation().GetIn(); return -atan2(cameraIn.X, cameraIn.Z); } diff --git a/source/renderer/ModelRenderer.cpp b/source/renderer/ModelRenderer.cpp index 8ddbe569e4..344537a465 100644 --- a/source/renderer/ModelRenderer.cpp +++ b/source/renderer/ModelRenderer.cpp @@ -366,7 +366,7 @@ void ShaderModelRenderer::Render(const RenderModifierPtr& modifier, const CShade return; CMatrix3D worldToCam; - g_Renderer.GetViewCamera().m_Orientation.GetInverse(worldToCam); + g_Renderer.GetViewCamera().GetOrientation().GetInverse(worldToCam); /* * Rendering approach: diff --git a/source/renderer/OverlayRenderer.cpp b/source/renderer/OverlayRenderer.cpp index aa5f72efaa..d1f07c8d62 100644 --- a/source/renderer/OverlayRenderer.cpp +++ b/source/renderer/OverlayRenderer.cpp @@ -594,8 +594,8 @@ void OverlayRenderer::RenderForegroundOverlays(const CCamera& viewCamera) glEnable(GL_BLEND); glDisable(GL_DEPTH_TEST); - CVector3D right = -viewCamera.m_Orientation.GetLeft(); - CVector3D up = viewCamera.m_Orientation.GetUp(); + CVector3D right = -viewCamera.GetOrientation().GetLeft(); + CVector3D up = viewCamera.GetOrientation().GetUp(); glColor4f(1.0f, 1.0f, 1.0f, 1.0f); diff --git a/source/renderer/ParticleRenderer.cpp b/source/renderer/ParticleRenderer.cpp index 824ff7c210..d8c007f6c7 100644 --- a/source/renderer/ParticleRenderer.cpp +++ b/source/renderer/ParticleRenderer.cpp @@ -113,7 +113,7 @@ void ParticleRenderer::PrepareForRendering(const CShaderDefines& context) // Sort back-to-front by distance from camera PROFILE("sort emitters"); CMatrix3D worldToCam; - g_Renderer.GetViewCamera().m_Orientation.GetInverse(worldToCam); + g_Renderer.GetViewCamera().GetOrientation().GetInverse(worldToCam); std::stable_sort(m->emitters[cullGroup].begin(), m->emitters[cullGroup].end(), SortEmitterDistance(worldToCam)); } diff --git a/source/renderer/Renderer.cpp b/source/renderer/Renderer.cpp index 1a1ee11848..767c4f854b 100644 --- a/source/renderer/Renderer.cpp +++ b/source/renderer/Renderer.cpp @@ -348,7 +348,7 @@ public: void SetOpenGLCamera(const CCamera& camera) { CMatrix3D view; - camera.m_Orientation.GetInverse(view); + camera.GetOrientation().GetInverse(view); const CMatrix3D& proj = camera.GetProjection(); #if CONFIG2_GLES @@ -910,7 +910,7 @@ void CRenderer::SetObliqueFrustumClipping(CCamera& camera, const CVector4D& worl { // First, we'll convert the given clip plane to camera space, then we'll // Get the view matrix and normal matrix (top 3x3 part of view matrix) - CMatrix3D normalMatrix = camera.m_Orientation.GetTranspose(); + CMatrix3D normalMatrix = camera.GetOrientation().GetTranspose(); CVector4D camPlane = normalMatrix.Transform(worldPlane); CMatrix3D matrix = camera.GetProjection(); diff --git a/source/renderer/TerrainRenderer.cpp b/source/renderer/TerrainRenderer.cpp index fe1c4427ac..20883c85c7 100644 --- a/source/renderer/TerrainRenderer.cpp +++ b/source/renderer/TerrainRenderer.cpp @@ -789,7 +789,7 @@ bool TerrainRenderer::RenderFancyWater(const CShaderDefines& context, int cullGr m->fancyWaterShader->Uniform(str_repeatScale, 1.0f / repeatPeriod); m->fancyWaterShader->Uniform(str_losMatrix, losTexture.GetTextureMatrix()); - m->fancyWaterShader->Uniform(str_cameraPos, camera.m_Orientation.GetTranslation()); + m->fancyWaterShader->Uniform(str_cameraPos, camera.GetOrientation().GetTranslation()); if (WaterMgr->m_WaterRealDepth) { m->fancyWaterShader->Uniform(str_zNear, camera.GetNearPlane()); diff --git a/source/tools/atlas/GameInterface/Handlers/CameraCtrlHandlers.cpp b/source/tools/atlas/GameInterface/Handlers/CameraCtrlHandlers.cpp index 1af97c2a09..a15f3f602f 100644 --- a/source/tools/atlas/GameInterface/Handlers/CameraCtrlHandlers.cpp +++ b/source/tools/atlas/GameInterface/Handlers/CameraCtrlHandlers.cpp @@ -232,7 +232,7 @@ QUERYHANDLER(GetView) info.pY = focus.Y; info.pZ = focus.Z; - CQuaternion quatRot = g_Game->GetView()->GetCamera()->m_Orientation.GetRotation(); + CQuaternion quatRot = g_Game->GetView()->GetCamera()->GetOrientation().GetRotation(); quatRot.Normalize(); CVector3D rotation = quatRot.ToEulerAngles(); diff --git a/source/tools/atlas/GameInterface/Handlers/CinemaHandler.cpp b/source/tools/atlas/GameInterface/Handlers/CinemaHandler.cpp index e41af2666c..9af2dc6996 100644 --- a/source/tools/atlas/GameInterface/Handlers/CinemaHandler.cpp +++ b/source/tools/atlas/GameInterface/Handlers/CinemaHandler.cpp @@ -144,15 +144,15 @@ void SetCurrentPaths(const std::vector& atlasPaths) QUERYHANDLER(GetCameraInfo) { sCameraInfo info; - CMatrix3D* cam = &g_Game->GetView()->GetCamera()->m_Orientation; + const CMatrix3D& cameraOrientation = g_Game->GetView()->GetCamera()->GetOrientation(); - CQuaternion quatRot = cam->GetRotation(); + CQuaternion quatRot = cameraOrientation.GetRotation(); quatRot.Normalize(); CVector3D rotation = quatRot.ToEulerAngles(); rotation.X = RADTODEG(rotation.X); rotation.Y = RADTODEG(rotation.Y); rotation.Z = RADTODEG(rotation.Z); - CVector3D translation = cam->GetTranslation(); + CVector3D translation = cameraOrientation.GetTranslation(); info.pX = translation.X; info.pY = translation.Y;