2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 21:07:42 +00:00

Implement most of CTargetingManager

This commit is contained in:
Jack Andersen
2017-10-28 20:21:52 -10:00
parent bb10aa9844
commit 6eff4f2e01
13 changed files with 943 additions and 122 deletions

View File

@@ -1,31 +1,46 @@
#include "CTargetingManager.hpp"
#include "Camera/CGameCamera.hpp"
#include "CStateManager.hpp"
#include "Graphics/CBooRenderer.hpp"
#include "GameGlobalObjects.hpp"
namespace urde
{
CTargetingManager::CTargetingManager(const CStateManager&)
{
}
CTargetingManager::CTargetingManager(const CStateManager& mgr)
: x0_targetReticule(mgr) {}
bool CTargetingManager::CheckLoadComplete()
{
return false;
return (x0_targetReticule.CheckLoadComplete() && x21c_orbitPointMarker.CheckLoadComplete());
}
void CTargetingManager::Update(float dt, const CStateManager& stateMgr)
{
x0_targetReticule.Update(dt, stateMgr);
x21c_orbitPointMarker.Update(dt, stateMgr);
}
void CTargetingManager::Draw(const CStateManager& stateMgr, bool hideLockon) const
void CTargetingManager::Draw(const CStateManager& mgr, bool hideLockon) const
{
CGraphics::SetAmbientColor(zeus::CColor::skWhite);
CGraphics::DisableAllLights();
x21c_orbitPointMarker.Draw(mgr);
const CGameCamera* curCam = mgr.GetCameraManager()->GetCurrentCamera(mgr);
zeus::CTransform camXf = mgr.GetCameraManager()->GetCurrentCameraTransform(mgr);
CGraphics::SetViewPointMatrix(camXf);
zeus::CFrustum frustum;
frustum.updatePlanes(camXf, zeus::SProjPersp(zeus::degToRad(curCam->GetFov()),
curCam->GetAspectRatio(), 1.f, 100.f));
g_Renderer->SetClippingPlanes(frustum);
g_Renderer->SetPerspective(curCam->GetFov(), g_Viewport.x8_width, g_Viewport.xc_height,
curCam->GetNearClipDistance(), curCam->GetFarClipDistance());
x0_targetReticule.Draw(mgr, hideLockon);
}
void CTargetingManager::Touch() const
void CTargetingManager::Touch()
{
x0_targetReticule.Touch();
}
}