[Modify] 미니맵 회전 수정

This commit is contained in:
qordlsgur
2025-12-08 14:46:06 +09:00
parent 2e379d4ef2
commit 1c810cf744
5 changed files with 10 additions and 23 deletions
@@ -23,6 +23,7 @@ float g_fAlpha;
float g_fOwnerAlpha;
float g_fCanvasAlpha;
float g_fAngle;
float g_fMapAngle;
float g_fCoolTime;
float g_fHp;
@@ -507,11 +508,11 @@ PS_OUT PS_Rotation(PS_IN In)
float2 center = float2(0.5f, 0.5f);
float2 uv = In.vTexcoord - center;
float2 Rotation = In.vTexcoord;
Rotation.x = uv.x * cos(g_fAngle) - uv.y * sin(g_fAngle);
Rotation.y = uv.x * sin(g_fAngle) + uv.y * cos(g_fAngle);
Rotation.x = uv.x * cos(g_fMapAngle) - uv.y * sin(g_fMapAngle);
Rotation.y = uv.x * sin(g_fMapAngle) + uv.y * cos(g_fMapAngle);
Rotation += center;
float4 tex1 = g_Texture.Sample(DefaultSampler , Rotation);
float4 tex1 = g_Texture.Sample(ClampSampler , Rotation);
color = tex1;
@@ -199,17 +199,6 @@ void CInfoInstance::Event_CallBack(_wstring EventName, void* pArg)
}
}
void CInfoInstance::Set_Camera_Angle(_float Angle)
{
m_fCameraAngle = Angle;
}
_float CInfoInstance::Get_Camera_Angle()
{
return m_fCameraAngle;
}
#pragma endregion
LEVEL CInfoInstance::Get_RestartLevel()
{
@@ -84,8 +84,7 @@ void CMiniMap_TrimBorder::Update(_float fTimeDelta)
m_fAlpha = 0.f;
}
}
m_fAngle = m_pInfoInstance->Get_Camera_Angle();
//CMyTools::
m_fAngle = -atan2(m_pInfoInstance->Get_CameraCoordinateSystem().first.x, m_pInfoInstance->Get_CameraCoordinateSystem().first.z);
m_fTime += fTimeDelta * m_fTimeMult;
__super::Update(fTimeDelta);
}
@@ -163,7 +162,7 @@ HRESULT CMiniMap_TrimBorder::Bind_ShaderResources()
{
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_fAngle", &m_fAngle, sizeof(_float))))
if (FAILED(m_pShaderCom->Bind_RawValue("g_fMapAngle", &m_fAngle, sizeof(_float))))
{
return E_FAIL;
}
@@ -54,8 +54,6 @@ DECLARE_SINGLETON(CInfoInstance)
void Set_UISTATE(UI_STATE eState);
void Add_Event(_wstring EventName, function<void(void*)> Event);
void Event_CallBack(_wstring EventName, void* pArg = nullptr);
void Set_Camera_Angle(_float Angle);
_float Get_Camera_Angle();
#pragma endregion
private:
CGameInstance* m_pGameInstance = { nullptr };
@@ -71,7 +69,6 @@ DECLARE_SINGLETON(CInfoInstance)
UI_STATE m_eUI_State;
_float m_fCameraAngle{};
// 임시로 이벤트 1개 만들어 둠
multimap<_wstring, function<void(void*)>> UI_Event;
#ifdef _DEBUG
@@ -23,6 +23,7 @@ float g_fAlpha;
float g_fOwnerAlpha;
float g_fCanvasAlpha;
float g_fAngle;
float g_fMapAngle;
float g_fCoolTime;
float g_fHp;
@@ -507,11 +508,11 @@ PS_OUT PS_Rotation(PS_IN In)
float2 center = float2(0.5f, 0.5f);
float2 uv = In.vTexcoord - center;
float2 Rotation = In.vTexcoord;
Rotation.x = uv.x * cos(g_fAngle) - uv.y * sin(g_fAngle);
Rotation.y = uv.x * sin(g_fAngle) + uv.y * cos(g_fAngle);
Rotation.x = uv.x * cos(g_fMapAngle) - uv.y * sin(g_fMapAngle);
Rotation.y = uv.x * sin(g_fMapAngle) + uv.y * cos(g_fMapAngle);
Rotation += center;
float4 tex1 = g_Texture.Sample(DefaultSampler , Rotation);
float4 tex1 = g_Texture.Sample(ClampSampler , Rotation);
color = tex1;