useless cam functions
This commit is contained in:
@@ -58,6 +58,7 @@ public:
|
|||||||
void SetCamAngularMovement(const Vec2f& mov);
|
void SetCamAngularMovement(const Vec2f& mov);
|
||||||
void SetCamMovement(const Vec2f& lastCursorPos, const Vec2f& currentCursorPos);
|
void SetCamMovement(const Vec2f& lastCursorPos, const Vec2f& currentCursorPos);
|
||||||
void SetCamLook(const Vec2f& worldPos);
|
void SetCamLook(const Vec2f& worldPos);
|
||||||
|
void ResetCamLook();
|
||||||
|
|
||||||
void SetBackgroundColor(const Vec3f& color) { m_BackgroundColor = color; }
|
void SetBackgroundColor(const Vec3f& color) { m_BackgroundColor = color; }
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ public:
|
|||||||
void Update();
|
void Update();
|
||||||
void Render();
|
void Render();
|
||||||
|
|
||||||
|
void ResetCam();
|
||||||
void SetCamPos(float camX, float camY);
|
void SetCamPos(float camX, float camY);
|
||||||
|
|
||||||
void MoveCam(float relativeX, float relativeY);
|
void MoveCam(float relativeX, float relativeY);
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ void ClientGame::HandlePacket(const protocol::WorldDataPacket* packet) {
|
|||||||
m_WorldRenderer.LoadModels();
|
m_WorldRenderer.LoadModels();
|
||||||
// set cam pos to player spawn
|
// set cam pos to player spawn
|
||||||
const game::Spawn& spawn = m_World->GetTeam(m_Player->GetTeamColor()).GetSpawn();
|
const game::Spawn& spawn = m_World->GetTeam(m_Player->GetTeamColor()).GetSpawn();
|
||||||
|
m_WorldRenderer.ResetCam();
|
||||||
m_WorldRenderer.SetCamPos(spawn.GetCenterX(), spawn.GetCenterY());
|
m_WorldRenderer.SetCamPos(spawn.GetCenterX(), spawn.GetCenterY());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -107,6 +107,10 @@ void Renderer::SetCamMovement(const Vec2f& lastCursorPos, const Vec2f& currentCu
|
|||||||
SetCamLook(m_Camera.CamLook - movement);
|
SetCamLook(m_Camera.CamLook - movement);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Renderer::ResetCamLook() {
|
||||||
|
m_Camera = Camera();
|
||||||
|
}
|
||||||
|
|
||||||
void Renderer::SetCamPos(const Vec3f& newPos) {
|
void Renderer::SetCamPos(const Vec3f& newPos) {
|
||||||
|
|
||||||
Vec3f front = {
|
Vec3f front = {
|
||||||
|
|||||||
@@ -130,6 +130,10 @@ void WorldRenderer::RenderTooltips() const {
|
|||||||
RenderCastleTooltip();
|
RenderCastleTooltip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WorldRenderer::ResetCam() {
|
||||||
|
m_Renderer->ResetCamLook();
|
||||||
|
}
|
||||||
|
|
||||||
void WorldRenderer::MoveCam(float relativeX, float relativeY) {
|
void WorldRenderer::MoveCam(float relativeX, float relativeY) {
|
||||||
if (m_WorldVao == nullptr)
|
if (m_WorldVao == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user