diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index e0f824a57..aef919e5d 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -1167,24 +1167,20 @@ PS_OUT PS_Spell_Drag(PS_IN In) float4 Color = float4(1.f, 1.f, 1.f, 1.f); float4 tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord); - float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); - float4 tex2Color = g_Texture3.Sample(DefaultSampler, In.vTexcoord); + float tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord).r; + float4 tex2Color = g_Texture2.Sample(DefaultSampler, In.vTexcoord); - Color = tex1; - tex2.rgb = tex2Color; + tex2Color.a = tex2; + Color = lerp(tex1, tex2Color, tex2Color.a); - Color = lerp(Color, tex2, tex2.a); - - float2 Imagetexpos1 = g_fImageUV.xy / g_fCurrent_Size; - float2 Imagetexsize1 = g_fImageUV.zw / g_fCurrent_Size; - float2 Imagelocal = (In.vTexcoord - Imagetexpos1) / Imagetexsize1; - bool inside1 = all(Imagelocal >= 0.0f && Imagelocal <= 1.0f); - float4 tex3 = g_Texture2.Sample(DefaultSampler, In.vTexcoord); + float2 atlasUV = g_fImageUV.xy + In.vTexcoord * (g_fImageUV.zw - g_fImageUV.xy); + //float2 center = (g_fImageUV.xy + g_fImageUV.zw) * 0.5f; + //float2 uv = atlasUV - center; + //uv *= 0.7f; + //uv += center; + float4 tex3 = g_Texture3.Sample(ClampSampler, atlasUV); - if (inside1) - { - Color = lerp(Color, tex3, tex3.a); - } + Color = lerp(Color, tex3, tex3.a); Color.a *= Alpha; diff --git a/Jusin154_Team3D/Client/Default/Broom_States.cpp b/Jusin154_Team3D/Client/Default/Broom_States.cpp index 315aad225..25a45f5b9 100644 --- a/Jusin154_Team3D/Client/Default/Broom_States.cpp +++ b/Jusin154_Team3D/Client/Default/Broom_States.cpp @@ -58,8 +58,8 @@ HRESULT CBroom::InputKeyUpMove() HRESULT CBroom::InputSpell() { if ( - m_pGameInstance->Key_Down(DIK_1) - || m_pGameInstance->Key_Down(DIK_2) +/* m_pGameInstance->Key_Down(DIK_1) + ||*/ m_pGameInstance->Key_Down(DIK_2) || m_pGameInstance->Key_Down(DIK_3) || m_pGameInstance->Key_Down(DIK_4) ) diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj b/Jusin154_Team3D/Client/Default/Client.vcxproj index 352d08506..b4cf14b63 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj @@ -242,6 +242,7 @@ call Update_Resources.bat + @@ -255,6 +256,7 @@ call Update_Resources.bat + @@ -264,6 +266,7 @@ call Update_Resources.bat + @@ -365,6 +368,7 @@ call Update_Resources.bat + @@ -378,6 +382,7 @@ call Update_Resources.bat + @@ -387,6 +392,7 @@ call Update_Resources.bat + diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters index b673d2dcc..63bd5807c 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters @@ -355,7 +355,18 @@ 02.GameObjects\Item\Troll_Rock - + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Spell_Drag + + + 04.Mechanic\State\State_Combat\State_Swing + + + 04.Mechanic\State\State_Combat\State_Blink + + + 02.GameObjects\Item\Goblin_Dagger + @@ -765,6 +776,12 @@ {7d6fe51e-3d6d-4fed-9e5d-27e257672e01} + + {f109c973-c532-4549-9680-d0d6495b0fa8} + + + {27251db2-19f2-4492-a3a4-32c11526f413} + @@ -1115,7 +1132,18 @@ 02.GameObjects\Item\Troll_Rock - + + 04.Mechanic\State\State_Combat\State_Swing + + + 04.Mechanic\State\State_Combat\State_Blink + + + 02.GameObjects\Item\Goblin_Dagger + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Spell_Drag + diff --git a/Jusin154_Team3D/Client/Private/Action_Panel.cpp b/Jusin154_Team3D/Client/Private/Action_Panel.cpp index ccc5aea7d..be9576acf 100644 --- a/Jusin154_Team3D/Client/Private/Action_Panel.cpp +++ b/Jusin154_Team3D/Client/Private/Action_Panel.cpp @@ -10,6 +10,7 @@ #include "Spell_UI.h" #include "Potion.h" #include "Magic_Item.h" +#include "InfoInstance.h" CAction_Panel::CAction_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CPanelObject(pDevice, pContext) @@ -17,7 +18,8 @@ CAction_Panel::CAction_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContex } CAction_Panel::CAction_Panel(const CAction_Panel& rhs) - :CPanelObject(rhs) + :CPanelObject(rhs), + m_pInfoInstance(CInfoInstance::GetInstance()) { } @@ -54,7 +56,10 @@ HRESULT CAction_Panel::Initialize(void* pArg) Magic_Meter_UV(); Magic_Meter_Visible(1, true); Magic_Meter_Visible(5, true); - m_bActive = true; + Visible(true); + ElementAllVisible(true); + m_pInfoInstance->Add_Event(TEXT("Spell"), [this](void* p) {this->Use_Spell(*reinterpret_cast<_int*>(p)); }); + m_pInfoInstance->Add_Event(TEXT("GetSpell"), [this](void* p) {this->Spell_Setting(p); }); return S_OK; } @@ -175,6 +180,50 @@ void CAction_Panel::Matic_Meter_Move() } +void CAction_Panel::Use_Spell(_int Index) +{ + switch (Index) + { + case 1: + static_cast(m_pSpell_Overlay1)->Use_Spell(); + break; + case 2: + static_cast(m_pSpell_Overlay2)->Use_Spell(); + break; + case 3: + static_cast(m_pSpell_Overlay3)->Use_Spell(); + break; + case 4: + static_cast(m_pSpell_Overlay4)->Use_Spell(); + break; + default: + break; + } +} + +void CAction_Panel::Spell_Setting(void* pArg) +{ + GETSKILLINFO Info = *static_cast(pArg); + + switch (Info.iSlotIndexX + 1) + { + case 1: + static_cast(m_pSpell_Overlay1)->Spell_Setting(Info.iSlotIndexY, Info.iSpellIndex); + break; + case 2: + static_cast(m_pSpell_Overlay2)->Spell_Setting(Info.iSlotIndexY, Info.iSpellIndex); + break; + case 3: + static_cast(m_pSpell_Overlay3)->Spell_Setting(Info.iSlotIndexY, Info.iSpellIndex); + break; + case 4: + static_cast(m_pSpell_Overlay4)->Spell_Setting(Info.iSlotIndexY, Info.iSpellIndex); + break; + default: + break; + } +} + HRESULT CAction_Panel::Bind_ShaderResources() { return S_OK; @@ -192,11 +241,29 @@ HRESULT CAction_Panel::Ready_Element(void* pArg) return E_FAIL; } Add_Element(TEXT("Spell_Slot"), m_pSpell_Slot); - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Overlay)))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Overlay1)))) { return E_FAIL; } - Add_Element(TEXT("Spell_Overlay"), m_pSpell_Overlay); + Add_Element(TEXT("Spell_Overlay1"), m_pSpell_Overlay1); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Overlay2)))) + { + return E_FAIL; + } + static_cast(m_pSpell_Overlay2)->MoveX(481.f); + Add_Element(TEXT("Spell_Overlay2"), m_pSpell_Overlay2); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Overlay3)))) + { + return E_FAIL; + } + static_cast(m_pSpell_Overlay3)->MoveX(582.f); + Add_Element(TEXT("Spell_Overlay3"), m_pSpell_Overlay3); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Overlay4)))) + { + return E_FAIL; + } + static_cast(m_pSpell_Overlay4)->MoveX(683.f); + Add_Element(TEXT("Spell_Overlay4"), m_pSpell_Overlay4); if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSlot_Number)))) { return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Bombard.cpp b/Jusin154_Team3D/Client/Private/Bombard.cpp index 62263cde9..c052d2b4d 100644 --- a/Jusin154_Team3D/Client/Private/Bombard.cpp +++ b/Jusin154_Team3D/Client/Private/Bombard.cpp @@ -67,13 +67,6 @@ void CBombard::Update(_float fTimeDelta) pPJTransform->Translation(m_vCameraLook * 2.f); - - if (true == m_pGameInstance->SphereCast(0.125f, XMLoadFloat4(&m_vStartPos), m_vCameraLook, XMVectorGetX(XMVector3Length(m_vCameraLook * 2.f)) - , PSX::PxHitFlag::ePOSITION | PSX::PxHitFlag::eNORMAL, PSX::PxQueryFlag::eSTATIC, hitBuffer)) - { - OnCollision(); - } - } void CBombard::Late_Update(_float fTimeDelta) @@ -85,11 +78,19 @@ void CBombard::Late_Update(_float fTimeDelta) XMStoreFloat4(&m_vEndPos, m_pLight_Projectile->Get_WorldPostion()); + _vector vDir = XMLoadFloat4(&m_vEndPos) - XMLoadFloat4(&m_vStartPos); + + if (true == m_pGameInstance->SphereCast(0.125, XMLoadFloat4(&m_vStartPos), XMVector3Normalize(vDir), XMVectorGetX(XMVector3Length(vDir)) + , PSX::PxHitFlag::ePOSITION | PSX::PxHitFlag::eNORMAL, PSX::PxQueryFlag::eDYNAMIC | PSX::PxQueryFlag::eSTATIC, m_Hitbuffer)) + { + OnCollision(); + } + } -HRESULT CBombard::Pre_Setting(CGameObject* pObject) +HRESULT CBombard::Pre_Setting(CGameObject* pObject, void* pArg) { - if (FAILED(__super::Pre_Setting(pObject))) + if (FAILED(__super::Pre_Setting(pObject, nullptr))) return E_FAIL; CWand* pWand = static_cast(m_pOwner)->Get_PartObject(); @@ -113,6 +114,8 @@ HRESULT CBombard::Pre_Setting(CGameObject* pObject) m_pLight_Projectile->Set_Visible(true); + // 건드린 친구들 순서대로 다 가져옴 ( 정렬은 안되어있음 ) + return S_OK; } @@ -160,12 +163,17 @@ CGameObject* CBombard::Clone(void* pArg, CGameObject* pOwner) void CBombard::OnCollision(CGameObject* pOther, void* pDesc) { + _int iIndex = CollisionCheck(); + + if (iIndex < 0) + return; + if (m_isCollisionEnter == true) return; m_isCollisionEnter = true; - _vector vPos = XMVectorSet(hitBuffer.block.position.x, hitBuffer.block.position.y, hitBuffer.block.position.z, 1.f); + _vector vPos = XMVectorSet(m_Hitbuffer.touches[iIndex].position.x, m_Hitbuffer.touches[iIndex].position.y, m_Hitbuffer.touches[iIndex].position.z, 1.f); for (auto& pPair : m_PartObjects) diff --git a/Jusin154_Team3D/Client/Private/BombardSide.cpp b/Jusin154_Team3D/Client/Private/BombardSide.cpp index 3bba24974..874685464 100644 --- a/Jusin154_Team3D/Client/Private/BombardSide.cpp +++ b/Jusin154_Team3D/Client/Private/BombardSide.cpp @@ -48,11 +48,21 @@ HRESULT CBombardSide::Initialize(void* pArg) SAFE_ADDREF(m_pWandTrail); SAFE_ADDREF(m_pWandParticle); - m_fDuration = 1.f; + m_fDuration = 2.5f; - m_Events.emplace(0.4f, [&](){ - m_pWandTrail->Set_Visible(false); - }); + m_Events.emplace(0.6f, [&]() { + m_isParticleEnd = true; + m_pWandParticle->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(0.f, -500.f, 0.f, 1.f)); + + CWand* pWand = static_cast(m_pOwner); + + if (pWand == nullptr) + return; + + m_isTrailEnd = true; + + XMStoreFloat4x4(&m_TrailStopMat, pWand->Get_WorldMatrix()); + }); return S_OK; } @@ -78,10 +88,16 @@ void CBombardSide::Update(_float fTimeDelta) if (pWand == nullptr) return; + m_pWandLight->Get_Component()->Set_State(STATE::POSITION, pWand->Get_WorldPostion()); - m_pWandTrail->Get_Component()->Trail_Update(fTimeDelta, pWand->Get_WorldMatrix()); - m_pWandParticle->Get_Component()->Set_WorldMatrix(pWand->Get_WorldMatrix()); + // 파티클생성이 막히면 실행되지 않음 + if (m_isParticleEnd == false) + m_pWandParticle->Get_Component()->Set_WorldMatrix(pWand->Get_WorldMatrix()); + + // 트레일이 종료되면 위치를 고정함 + _matrix TrailMat = m_isTrailEnd ? XMLoadFloat4x4(&m_TrailStopMat) : pWand->Get_WorldMatrix(); + m_pWandTrail->Trail_Update(TrailMat, fTimeDelta); } @@ -95,9 +111,9 @@ void CBombardSide::Late_Update(_float fTimeDelta) } -HRESULT CBombardSide::Pre_Setting(CGameObject* pObject) +HRESULT CBombardSide::Pre_Setting(CGameObject* pObject, void* pArg) { - if (FAILED(__super::Pre_Setting(pObject))) + if (FAILED(__super::Pre_Setting(pObject, nullptr))) return E_FAIL; @@ -107,11 +123,13 @@ HRESULT CBombardSide::Pre_Setting(CGameObject* pObject) return E_FAIL; m_pWandParticle->Set_Visible(true); + m_isParticleEnd = false; // 파티클이 일정시간이 되면 나오지 않게 하려고 m_pWandLight->Set_Visible(true); /*트레일 초기화 */ m_pWandTrail->Set_Visible(true); + m_isTrailEnd = false; m_pWandTrail->Get_Component()->Reset_Trail(); /*_vector pPos = pPlayer->Get_WandPos().r[3];*/ diff --git a/Jusin154_Team3D/Client/Private/Current_Slot_Number.cpp b/Jusin154_Team3D/Client/Private/Current_Slot_Number.cpp index e084a8135..64db13a77 100644 --- a/Jusin154_Team3D/Client/Private/Current_Slot_Number.cpp +++ b/Jusin154_Team3D/Client/Private/Current_Slot_Number.cpp @@ -47,7 +47,6 @@ HRESULT CCurrent_Slot_Number::Initialize(void* pArg) m_pVIBufferCom->Set_Pos(-805.f, 380.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); m_pVIBufferCom->Set_ImageUV(pUVDesc); - m_bActive = true; return S_OK; } @@ -113,7 +112,7 @@ HRESULT CCurrent_Slot_Number::Render() { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ALPHABLEND)))) + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::UVALPHABLEND)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Private/Current_Spell_Slot.cpp b/Jusin154_Team3D/Client/Private/Current_Spell_Slot.cpp index ed1b5f8a7..6b28415f3 100644 --- a/Jusin154_Team3D/Client/Private/Current_Spell_Slot.cpp +++ b/Jusin154_Team3D/Client/Private/Current_Spell_Slot.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include "Current_Spell_Slot.h" #include "GameInstance.h" +#include "InfoInstance.h" CCurrent_Spell_Slot::CCurrent_Spell_Slot(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CElementObject(pDevice, pContext) @@ -8,7 +9,8 @@ CCurrent_Spell_Slot::CCurrent_Spell_Slot(ID3D11Device* pDevice, ID3D11DeviceCont } CCurrent_Spell_Slot::CCurrent_Spell_Slot(const CCurrent_Spell_Slot& rhs) - :CElementObject(rhs) + :CElementObject(rhs), + m_pInfoInstance(CInfoInstance::GetInstance()) { } @@ -47,7 +49,11 @@ HRESULT CCurrent_Spell_Slot::Initialize(void* pArg) m_pVIBufferCom->Set_Cloned(true); m_pVIBufferCom->Set_Pos(-780.f, 340.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); - m_bActive = true; + m_bChangeSlot = false; + m_iSpellType = -1; + m_iSkill_Index = -1; + Clear(-1); + static_cast(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SkillType(*reinterpret_cast<_int*>(p)); }); return S_OK; } @@ -91,6 +97,43 @@ void CCurrent_Spell_Slot::Update(_float fTimeDelta) } } m_fTime += fTimeDelta * m_fTimeMult; + Hover(); + + + if (m_bHover == true) + { + if (m_pGameInstance->Mouse_Down(DIM_LBUTTON) && m_bClick == false) + { + m_bClick = true; + m_iSkill_Index = Chack_Slot(m_iSlot_Index); + static_cast(m_pOwner)->Function_Callback(TEXT("Current_Hover"), &m_iSkill_Index); + } + } + + if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) + { + if (m_bHover == true) + { + if (m_iSpellType != -1) + { + Get_Skill(m_iSpellType, m_iSlot_Index); + } + + if (m_iSkill_Index != -1) + { + Get_Skill(m_iSkill_Index, m_iSlot_Index); + m_iSkill_Index = -1; + } + m_bHover = false; + m_bClick = false; + m_iSkill_Index = -1; + } + else + { + m_iSkill_Index = -1; + static_cast(m_pOwner)->Function_Callback(TEXT("Current_Hover"), &m_iSkill_Index); + } + } __super::Update(fTimeDelta); } @@ -113,7 +156,7 @@ HRESULT CCurrent_Spell_Slot::Render() { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::DEFAULT)))) + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::SPELL_SLOT)))) { return E_FAIL; } @@ -153,6 +196,114 @@ void CCurrent_Spell_Slot::SizeUpdate(_float fSizeX, _float fSizeY) m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); } +void CCurrent_Spell_Slot::Hover() +{ + POINT ptMouse{}; + GetCursorPos(&ptMouse); + ScreenToClient(g_hWnd, &ptMouse); + _float2 fMouse; + fMouse.x = ptMouse.x - (g_iWinSizeX * 0.5f); + fMouse.y = -(ptMouse.y - (g_iWinSizeY * 0.5f)); + + // 엘리먼트의 월드 위치를 더해주면 엘리먼트 좌표계 기준이 됨 + fMouse.x -= m_pOwner->Get_WorldPostion().m128_f32[0]; + fMouse.y -= m_pOwner->Get_WorldPostion().m128_f32[1]; + + m_iSlot_Index = m_pVIBufferCom->Set_Mouse_Hover(fMouse); + if (m_iSlot_Index != -1) + { + m_bHover = true; + } + else + { + m_bHover = false; + m_bClick = false; + } +} + +void CCurrent_Spell_Slot::Click_Slot(_bool bClick) +{ + if (bClick == true) + { + m_bClick = true; + } + else + { + m_bClick = false; + } +} + +void CCurrent_Spell_Slot::Get_Skill(_int SpellIndex, _int SlotIndex) +{ + if (SlotIndex == -1) + return; + + if (SpellIndex == -1) + return; + + _int iSlotx = 4; + + _int x = SlotIndex % iSlotx; + _int y = SlotIndex / iSlotx; + + m_GetSkillInfo.iSlotIndexX = x; + m_GetSkillInfo.iSlotIndexY = y; + m_GetSkillInfo.iSpellIndex = SpellIndex; + + m_iSpell[y][x] = SpellIndex; + m_pVIBufferCom->Set_Equip_Index(SlotIndex); + m_vUV.fUV = UV(SpellIndex); + m_pVIBufferCom->Set_Index_Color(SlotIndex, static_cast<_float>(m_pInfoInstance->Get_Spell_Info(SpellIndex).iSpell_Type)); + m_pVIBufferCom->Set_Index_ImageUV(SlotIndex, m_vUV); + m_pInfoInstance->Event_CallBack(TEXT("GetSpell"), &m_GetSkillInfo); +} + +_int CCurrent_Spell_Slot::Chack_Slot(_int Index) const +{ + _int iSlotx = 4; + + _int x = Index % iSlotx; + _int y = Index / iSlotx; + + return m_iSpell[y][x]; +} + +void CCurrent_Spell_Slot::Clear(_int iValue) +{ + for (_int i = 0; i < 4; ++i) + { + for (_int j = 0; j < 4; ++j) + { + m_iSpell[i][j] = iValue; + } + } +} + +_float4 CCurrent_Spell_Slot::UV(_int SpellID) +{ + _float2 fImage_Size = { 1024.f, 1792.f }; + + _uint iCountX = 4; + _uint iCountY = 7; + + _float iImageX = 256.f; + _float iImageY = 256.f; + + _uint iframeX = SpellID % iCountX; + _uint iframeY = SpellID / iCountX; + + _float2 UVStart; + UVStart.x = iframeX * iImageX / fImage_Size.x; + UVStart.y = iframeY * iImageY / fImage_Size.y; + + _float2 UVEnd; + UVEnd.x = UVStart.x + (iImageX / fImage_Size.x); + UVEnd.y = UVStart.y + (iImageY / fImage_Size.y); + + _float4 UV = _float4{ UVStart.x, UVStart.y, UVEnd.x, UVEnd.y }; + return UV; +} + HRESULT CCurrent_Spell_Slot::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) @@ -171,6 +322,14 @@ HRESULT CCurrent_Spell_Slot::Bind_ShaderResources() { return E_FAIL; } + if (FAILED(m_pDiffuse_TextureCom1->Bind_ShaderResource(m_pShaderCom, "g_Texture1", 0))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom2->Bind_ShaderResource(m_pShaderCom, "g_Texture2", 0))) + { + return E_FAIL; + } if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { return E_FAIL; @@ -201,7 +360,15 @@ HRESULT CCurrent_Spell_Slot::Ready_Components(void* pArg) { return E_FAIL; } - if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_ActionItemGoldleaf_4K"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_SpellType_Generic"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_Atlas_Spell"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_ActionItemGoldleaf_4K"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) { return E_FAIL; } @@ -244,6 +411,8 @@ void CCurrent_Spell_Slot::Free() __super::Free(); SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pDiffuse_TextureCom1); + SAFE_RELEASE(m_pDiffuse_TextureCom2); SAFE_RELEASE(m_pShaderCom); SAFE_RELEASE(m_pVIBufferCom); } diff --git a/Jusin154_Team3D/Client/Private/Decendo.cpp b/Jusin154_Team3D/Client/Private/Decendo.cpp index 848f4c444..fc7ad908e 100644 --- a/Jusin154_Team3D/Client/Private/Decendo.cpp +++ b/Jusin154_Team3D/Client/Private/Decendo.cpp @@ -7,15 +7,18 @@ #include "Wand.h" #include "Player.h" +#include "InfoInstance.h" CDecendo::CDecendo(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CEffect_Container{ pDevice, pContext } + { } CDecendo::CDecendo(const CDecendo& rhs) - : CEffect_Container(rhs) + : CEffect_Container(rhs), + m_pInfoInstance(CInfoInstance::GetInstance()) { } @@ -46,7 +49,7 @@ HRESULT CDecendo::Initialize(void* pArg) SAFE_ADDREF(m_pProjectile_Blur); SAFE_ADDREF(m_pProjectile); - m_fDuration = 2.5f; + m_fDuration = 3.5f; return S_OK; } @@ -67,26 +70,23 @@ void CDecendo::Update(_float fTimeDelta) Update_Event(fTimeDelta); - m_pProjectile_Blur->Get_Component()->Translation(m_vCameraLook * 0.5f); - m_pProjectile->Get_Component()->Translation(m_vCameraLook * 0.5f); + _vector vDirection = XMLoadFloat3(&m_vCameraLook); + // 선속도 + m_pProjectile_Blur->Get_Component()->Translation(vDirection * m_fLinearSpeed * fTimeDelta); + m_pProjectile->Get_Component()->Translation(vDirection * m_fLinearSpeed * fTimeDelta); - if (m_fAccTime > XM_2PI) + //Up벡터 방향으로 파이만큼 이동 + + if (m_fRotateAccTime > XM_2PI) return; - m_fAccTime += fTimeDelta * 7.5f; + m_fRotateAccTime += fTimeDelta * m_fAngularSpeed; - m_pProjectile_Blur->Get_Component()->Translation(m_vRotateUp * 0.2f * sinf(m_fAccTime)); - m_pProjectile->Get_Component()->Translation(m_vRotateUp * 0.2f * sinf(m_fAccTime)); + m_pProjectile_Blur->Get_Component()->Translation(XMLoadFloat3(&m_vRotateUp) * sinf(m_fRotateAccTime) * 0.1f); + m_pProjectile->Get_Component()->Translation(XMLoadFloat3(&m_vRotateUp) * sinf(m_fRotateAccTime) * 0.1f); - //TODO : 다시 위치 잡기 - if (true == m_pGameInstance->SphereCast(0.125f, XMLoadFloat4(&m_vStartPos), m_vCameraLook, XMVectorGetX(XMVector3Length(m_vCameraLook * 0.5f)) - , PSX::PxHitFlag::ePOSITION | PSX::PxHitFlag::eNORMAL, PSX::PxQueryFlag::eSTATIC, hitBuffer)) - { - OnCollision(); - } - } void CDecendo::Late_Update(_float fTimeDelta) @@ -98,58 +98,104 @@ void CDecendo::Late_Update(_float fTimeDelta) XMStoreFloat4(&m_vEndPos, m_pProjectile->Get_WorldPostion()); + _vector vDir = XMLoadFloat4(&m_vEndPos) - XMLoadFloat4(&m_vStartPos); + + if (true == m_pGameInstance->SphereCast(0.125, XMLoadFloat4(&m_vStartPos), XMVector3Normalize(vDir), XMVectorGetX(XMVector3Length(vDir)) + , PSX::PxHitFlag::ePOSITION | PSX::PxHitFlag::eNORMAL, PSX::PxQueryFlag::eDYNAMIC | PSX::PxQueryFlag::eSTATIC, m_Hitbuffer)) + { + OnCollision(); + } + __super::Late_Update(fTimeDelta); } -HRESULT CDecendo::Pre_Setting(CGameObject* pObject) +HRESULT CDecendo::Pre_Setting(CGameObject* pObject, void* pArg) { - if (FAILED(__super::Pre_Setting(pObject))) + if (FAILED(__super::Pre_Setting(pObject, nullptr))) return E_FAIL; - CWand* pWand = static_cast(m_pOwner)->Get_PartObject(); + CWand* pWand = static_cast(m_pOwner); if (pWand == nullptr) return E_FAIL; - CPartObject* pCircle0 = Get_PartObject(); - CPartObject* pWandLight = Get_PartObject("Decendo_Wand_Light"); - - - /* 초기 객체 위치 초기화 */ pCircle0->Get_Component()->Set_State(STATE::POSITION, pWand->Get_WorldPostion()); pWandLight->Get_Component()->Set_State(STATE::POSITION, pWand->Get_WorldPostion()); - m_pProjectile->Get_Component()->Set_State(STATE::POSITION, pWand->Get_WorldPostion()); - m_pProjectile_Blur->Get_Component()->Set_State(STATE::POSITION, pWand->Get_WorldPostion()); - - /* 초기 객체 비지블 */ pCircle0->Set_Visible(true); pWandLight->Set_Visible(true); + /* 초기 위치 저장 */ + _vector vStartPos = m_pOwner->Get_WorldPostion(); + XMStoreFloat4(&m_vStartPos, vStartPos); + + /* 초기 객체 위치 초기화 */ + + m_pProjectile->Get_Component()->Set_State(STATE::POSITION, vStartPos); + m_pProjectile_Blur->Get_Component()->Set_State(STATE::POSITION, vStartPos); + + /* 초기 객체 비지블 */ m_pProjectile->Set_Visible(true); m_pProjectile_Blur->Set_Visible(true); - /*트레일 초기화 */ Get_PartObject()->Set_Visible(true); Get_PartObject()->Get_Component()->Reset_Trail(); - //나아가는 벡터와 한점을 가져와 수직인 평면상에 하나의 점으로 DIR 을 만듬 - m_vCameraLook = XMVector3Normalize(m_pOwner->Get_Component()->Get_State(STATE::LOOK)); + _vector vDirection = m_pOwner->Get_Owner()->Get_Component()->Get_State(STATE::LOOK); + + XMStoreFloat3(&m_vCameraLook, vDirection); + + { /* 대상 위치 지정 */ + + CUnit* pTargetUnit = m_pInfoInstance->Get_LockOnUnit(); + if (nullptr != pTargetUnit) { + + XMStoreFloat4(&m_vTargetPos, pTargetUnit->Get_WorldPostion()); + + XMStoreFloat3(&m_vCameraLook, XMVector3Normalize(XMLoadFloat4(&m_vTargetPos) - XMLoadFloat4(&m_vStartPos))); + } + else { + // 타겟이 없다면 현재위치 -> 카메라 룩벡터 * duration간 예상 이동거리 를 대상으로 지정 + XMStoreFloat4(&m_vTargetPos, vStartPos + vDirection * m_fLinearSpeed * 0.5f); + } + } + + + /* 대상 거리 계산 */ + + m_fRotateAccTime = 0.f; + _vector vUp = XMVectorSet(0.f, 1.f, 0.f, 0.f); + _vector vRight = XMVectorSet(1.f, 0.f, 0.f, 0.f); - _vector vQuaternion = XMQuaternionRotationAxis(m_vCameraLook, m_pGameInstance->Random_Float(0.f, XM_PIDIV2)); + _vector vQuaternion = XMQuaternionRotationAxis(XMLoadFloat3(&m_vCameraLook), XMConvertToRadians(m_pGameInstance->Random_Float(0, 360.f))); - m_vRotateUp = XMVector3Rotate(vUp, vQuaternion); - m_vRotateUp = XMVector3Normalize(m_vRotateUp); + XMStoreFloat3(&m_vRotateUp, XMVector3Normalize(XMVector3Rotate(vUp, vQuaternion))); + /* 내속도를 알고 잇음*/ + + /* 거리 / 속도 = 시간 */ + + _float fDistance = XMVectorGetX(XMVector3Length(XMLoadFloat4(&m_vTargetPos) - XMLoadFloat4(&m_vStartPos))); + + m_fTimeRate = fDistance / m_fLinearSpeed; + + //내가 적에게까지 갈때까지 걸리는 시간을 암 + + //그러므로 내가 0 ~ 파이 까지 러프하는 과정이 그 시간동안 이루어져야 함 + + //그 속도가 파이 / 시간 이므로 이걸 프레임마다 누적함 + + m_fAngularSpeed = XM_2PI / m_fTimeRate; // 프레임마다 누적할 시간 + return S_OK; } @@ -197,12 +243,17 @@ CGameObject* CDecendo::Clone(void* pArg, CGameObject* pOwner) void CDecendo::OnCollision(CGameObject* pOther, void* pDesc) { + _int iIndex = CollisionCheck(); + + if (iIndex < 0) + return; + if (m_isCollisionEnter == true) return; m_isCollisionEnter = true; - _vector vPos = XMVectorSet(hitBuffer.block.position.x, hitBuffer.block.position.y, hitBuffer.block.position.z, 1.f); + _vector vPos = XMVectorSet(m_Hitbuffer.touches[iIndex].position.x, m_Hitbuffer.touches[iIndex].position.y, m_Hitbuffer.touches[iIndex].position.z, 1.f); for (auto& pPair : m_PartObjects) @@ -217,7 +268,7 @@ void CDecendo::OnCollision(CGameObject* pOther, void* pDesc) m_pProjectile->Set_Visible(false); - CWand* pWand = static_cast(m_pOwner)->Get_PartObject(); + CWand* pWand = static_cast(m_pOwner); if (pWand == nullptr) return; @@ -229,6 +280,9 @@ void CDecendo::OnCollision(CGameObject* pOther, void* pDesc) pCircle0->Get_Component()->Set_State(STATE::POSITION, pWand->Get_WorldPostion()); pWandLight->Get_Component()->Set_State(STATE::POSITION, pWand->Get_WorldPostion()); + pCircle0->Set_Visible(false); + pWandLight->Set_Visible(false); + _vector vPlayerPos = m_pOwner->Get_Component()->Get_State(STATE::POSITION); @@ -254,6 +308,20 @@ void CDecendo::Free() #ifdef _DEBUG void CDecendo::Describe_Entity() { + GUI::Begin("DECENDO"); + + GUI::InputFloat("Speed", &m_fLinearSpeed); + + _float fDistance = XMVectorGetX(XMVector3Length(XMLoadFloat4(&m_vTargetPos) - XMLoadFloat4(&m_vStartPos))); + + GUI::InputFloat("DISTANCE", &fDistance); + GUI::InputFloat("AngularSpeed", &m_fAngularSpeed); + GUI::InputFloat("TimeRate", &m_fTimeRate); + + + GUI::InputFloat3("TargetPos", (_float*)&m_vTargetPos); + + GUI::End(); } #endif diff --git a/Jusin154_Team3D/Client/Private/DecendoSide.cpp b/Jusin154_Team3D/Client/Private/DecendoSide.cpp index f63f497eb..346b95904 100644 --- a/Jusin154_Team3D/Client/Private/DecendoSide.cpp +++ b/Jusin154_Team3D/Client/Private/DecendoSide.cpp @@ -10,6 +10,7 @@ CDecendoSide::CDecendoSide(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CEffect_Container{ pDevice, pContext } + { } @@ -45,7 +46,18 @@ HRESULT CDecendoSide::Initialize(void* pArg) SAFE_ADDREF(m_pWandLight); SAFE_ADDREF(m_pWandTrail); - m_fDuration = 1.f; + m_fDuration = 2.f; + + m_Events.emplace(0.6f, [&]() { + CWand* pWand = static_cast(m_pOwner); + + if (pWand == nullptr) + return; + + m_isTrailEnd = true; + + XMStoreFloat4x4(&m_TrailStopMat, pWand->Get_WorldMatrix()); + }); return S_OK; } @@ -73,7 +85,8 @@ void CDecendoSide::Update(_float fTimeDelta) m_pWandLight->Get_Component()->Set_State(STATE::POSITION, pWand->Get_WorldPostion()); - m_pWandTrail->Get_Component()->Trail_Update(fTimeDelta, pWand->Get_WorldMatrix()); + _matrix TrailMat = m_isTrailEnd ? XMLoadFloat4x4(&m_TrailStopMat) : pWand->Get_WorldMatrix(); + m_pWandTrail->Trail_Update(TrailMat, fTimeDelta); } @@ -87,9 +100,9 @@ void CDecendoSide::Late_Update(_float fTimeDelta) } -HRESULT CDecendoSide::Pre_Setting(CGameObject* pObject) +HRESULT CDecendoSide::Pre_Setting(CGameObject* pObject, void* pArg) { - if (FAILED(__super::Pre_Setting(pObject))) + if (FAILED(__super::Pre_Setting(pObject, nullptr))) return E_FAIL; @@ -98,6 +111,8 @@ HRESULT CDecendoSide::Pre_Setting(CGameObject* pObject) if (pWand == nullptr) return E_FAIL; + m_isTrailEnd = false; + m_pWandLight->Set_Visible(true); /*트레일 초기화 */ @@ -108,7 +123,6 @@ HRESULT CDecendoSide::Pre_Setting(CGameObject* pObject) m_pWandLight->Get_Component()->Set_State(STATE::POSITION, pWand->Get_WorldPostion()); - return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Eessential_Spell.cpp b/Jusin154_Team3D/Client/Private/Eessential_Spell.cpp index c07574d2f..97b5f2e73 100644 --- a/Jusin154_Team3D/Client/Private/Eessential_Spell.cpp +++ b/Jusin154_Team3D/Client/Private/Eessential_Spell.cpp @@ -49,7 +49,6 @@ HRESULT CEessential_Spell::Initialize(void* pArg) m_pVIBufferCom->Set_Pos(-731.f, -300.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); m_pVIBufferCom->Set_ImageUV(pUVDesc); - m_bActive = true; return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Eessential_Spell_Slot.cpp b/Jusin154_Team3D/Client/Private/Eessential_Spell_Slot.cpp index 97ed2abec..05e63d6d7 100644 --- a/Jusin154_Team3D/Client/Private/Eessential_Spell_Slot.cpp +++ b/Jusin154_Team3D/Client/Private/Eessential_Spell_Slot.cpp @@ -48,7 +48,6 @@ HRESULT CEessential_Spell_Slot::Initialize(void* pArg) m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); m_fDelayTime = 0.5f; m_iPerSpell_Slot = -1; - m_bActive = true; return S_OK; } @@ -92,7 +91,7 @@ void CEessential_Spell_Slot::Update(_float fTimeDelta) } } - Hover(fTimeDelta); + Hover(); m_fTime += fTimeDelta * m_fTimeMult; __super::Update(fTimeDelta); @@ -157,7 +156,7 @@ void CEessential_Spell_Slot::SizeUpdate(_float fSizeX, _float fSizeY) m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); } -void CEessential_Spell_Slot::Hover(_float fTimeDelta) +void CEessential_Spell_Slot::Hover() { POINT ptMouse{}; GetCursorPos(&ptMouse); @@ -186,7 +185,7 @@ void CEessential_Spell_Slot::Hover(_float fTimeDelta) Info.iHover_Index = m_iSpellType + ENUM_CLASS(SKILL_TYPE::JAP); static_cast(m_pOwner)->Function_Callback(TEXT("Hover"), &Info); - } + } } diff --git a/Jusin154_Team3D/Client/Private/EffectObject.cpp b/Jusin154_Team3D/Client/Private/EffectObject.cpp index 2a6b5d2a6..fcc3408e5 100644 --- a/Jusin154_Team3D/Client/Private/EffectObject.cpp +++ b/Jusin154_Team3D/Client/Private/EffectObject.cpp @@ -464,7 +464,6 @@ HRESULT CEffectObject::Load(const _char* pFilePath, LEVEL eLevel) HRESULT CEffectObject::Bind_ShaderResources() { - if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) return E_FAIL; @@ -736,8 +735,6 @@ HRESULT CEffectObject::Bind_ShaderResources() } - - return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/EffectPool.cpp b/Jusin154_Team3D/Client/Private/EffectPool.cpp index 9d0a698cb..0006b58c4 100644 --- a/Jusin154_Team3D/Client/Private/EffectPool.cpp +++ b/Jusin154_Team3D/Client/Private/EffectPool.cpp @@ -63,6 +63,8 @@ void CEffectPool::Priority_Update(_float fTimeDelta) (*iter)->Priority_Update(fTimeDelta); ++iter; } + + } } @@ -128,6 +130,7 @@ HRESULT CEffectPool::Ready_Effect() return pEffect;} ))) return E_FAIL; +#ifndef 기무리 if (FAILED(Create_Effect(SKILL_TYPE::BOMBARDA, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel)-> CEffect_Container* { @@ -135,7 +138,7 @@ HRESULT CEffectPool::Ready_Effect() pEffect = m_pGameInstance->Clone_Prototype(iPrototypeLevel, nullptr); - return pEffect;} + return pEffect; } ))) return E_FAIL; if (FAILED(Create_Effect(SKILL_TYPE::DESCENDO, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel)-> CEffect_Container* { @@ -144,7 +147,7 @@ HRESULT CEffectPool::Ready_Effect() pEffect = m_pGameInstance->Clone_Prototype(iPrototypeLevel, nullptr); - return pEffect;} + return pEffect; } ))) return E_FAIL; if (FAILED(Create_Effect(SKILL_TYPE::PROTEGO, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel)-> CEffect_Container* { @@ -223,6 +226,8 @@ HRESULT CEffectPool::Ready_Effect() return pEffect; } ))) return E_FAIL; +#endif // 기무리 + return S_OK; @@ -245,7 +250,7 @@ HRESULT CEffectPool::Create_Effect(SKILL_TYPE eType, _uint iNumEffect, _uint iPr return S_OK; } -HRESULT CEffectPool::Use_Skill(SKILL_TYPE eType, CGameObject* pOwner) +HRESULT CEffectPool::Use_Skill(SKILL_TYPE eType, CGameObject* pOwner, void* pArg) { if (pOwner == nullptr) return S_OK; @@ -255,7 +260,7 @@ HRESULT CEffectPool::Use_Skill(SKILL_TYPE eType, CGameObject* pOwner) if (pSkill->Get_Visible() == true) continue; - pSkill->Pre_Setting(pOwner); + pSkill->Pre_Setting(pOwner, pArg); m_ActiveEffectList.push_back(pSkill); Safe_AddRef(pSkill); diff --git a/Jusin154_Team3D/Client/Private/Effect_Container.cpp b/Jusin154_Team3D/Client/Private/Effect_Container.cpp index 6ba42c4b4..aa58b0846 100644 --- a/Jusin154_Team3D/Client/Private/Effect_Container.cpp +++ b/Jusin154_Team3D/Client/Private/Effect_Container.cpp @@ -206,7 +206,7 @@ HRESULT CEffect_Container::Load_Package(const _char* pPath) return S_OK; } -HRESULT CEffect_Container::Pre_Setting(CGameObject* pObject) +HRESULT CEffect_Container::Pre_Setting(CGameObject* pObject, void* pArg) { if (pObject == nullptr) return E_FAIL; @@ -272,6 +272,65 @@ HRESULT CEffect_Container::Reset_EffectParts() return S_OK; } +_int CEffect_Container::CollisionCheck() +{ + _bool bIsCollide = { false }; + + // 건드린 친구들 순서대로 다 가져옴 ( 정렬은 안되어있음 ) + for (PSX::PxU32 i = 0; i < m_Hitbuffer.nbTouches; ++i) + { + const PSX::PxSweepHit& Hit = m_Hitbuffer.touches[i]; + /* 기타 로직 */ + + PSX::PxRigidActor* pActor = Hit.actor; + PSX::PxShape* pShape = Hit.shape; + + if (nullptr != pActor && nullptr != pActor->userData) { + + PhsXUserData* pUserData = static_cast(pActor->userData); + + if (pUserData->iSubKind >= UINT_MAX - 1) { + continue; + } + + switch (PXOBJECT(pUserData->eKind)) + { + case PXOBJECT::PLAYER: + continue; + case PXOBJECT::MONSTER: + case PXOBJECT::GOBLIN_WARRIOR: + case PXOBJECT::TROLL: + case PXOBJECT::WALL: + + { + return i; + } + break; + default: + break; + } + + switch (pUserData->eKind) + { + + case PHYSX_KIND::BODY_STATIC: + case PHYSX_KIND::BODY_DYNAMIC: + { + return i; + } + break; + case PHYSX_KIND::CCTActor: + break; + default: + break; + } + } + } + + return -1; + +} + void CEffect_Container::Update_Event(_float fTimeDelta) { diff --git a/Jusin154_Team3D/Client/Private/GamePlay_Canvas.cpp b/Jusin154_Team3D/Client/Private/GamePlay_Canvas.cpp index 2ba2436c6..26378f14d 100644 --- a/Jusin154_Team3D/Client/Private/GamePlay_Canvas.cpp +++ b/Jusin154_Team3D/Client/Private/GamePlay_Canvas.cpp @@ -44,8 +44,7 @@ HRESULT CGamePlay_Canvas::Initialize(void* pArg) { return E_FAIL; } - m_bVisible = true; - m_bActive = true; + Visible(true); return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Goblin.cpp b/Jusin154_Team3D/Client/Private/Goblin.cpp index ae034b5a6..d7e8292c0 100644 --- a/Jusin154_Team3D/Client/Private/Goblin.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin.cpp @@ -2,6 +2,8 @@ #include "Goblin.h" #include "GameInstance.h" +#include "Goblin_Dagger.h" +#include "Effect_Container.h" #pragma region STATE #include "State_Idle.h" @@ -12,6 +14,7 @@ #include "State_Combat.h" #pragma endregion + CGoblin::CGoblin(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CMonster(pDevice, pContext) { @@ -35,6 +38,9 @@ HRESULT CGoblin::Initialize(void* pArg) if (FAILED(Ready_Components())) return E_FAIL; + if (FAILED(Ready_Parts())) + return E_FAIL; + Add_FSM(); Set_Anim(); @@ -53,7 +59,7 @@ HRESULT CGoblin::Initialize(void* pArg) - m_pCharacter_Controller->Set_Position(XMVectorSet(m_pGameInstance->Random_Float(-20.f, 20.f), 0.f, m_pGameInstance->Random_Float(-20.f, 20.f), 1.f)); + m_pCharacter_Controller->Set_Position(XMVectorSet(m_pGameInstance->Real_Random_Float(-20.f, 20.f), 0.f, m_pGameInstance->Real_Random_Float(-20.f, 20.f), 1.f)); return S_OK; } @@ -71,6 +77,8 @@ void CGoblin::Update(_float fTimeDelta) m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); + Play_Event(); + GUI::Text("%d", m_pCharacter_Controller->IsActive()); GUI::Text("%f %f", m_vStunTimer.x, m_vStunTimer.y); if (true == m_pCharacter_Controller->IsActive()) { @@ -94,6 +102,9 @@ void CGoblin::Update(_float fTimeDelta) Describe_Entity(); #endif // _DEBUG + for (_uint i = 0; i < ENUM_CLASS(GOBLIN_SKILL::END); i++) + m_fSkillCoolTime[i] = max(0.f, m_fSkillCoolTime[i] - fTimeDelta); + } void CGoblin::Late_Update(_float fTimeDelta) @@ -103,7 +114,7 @@ void CGoblin::Late_Update(_float fTimeDelta) m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_FootPosition()); } else { - m_pTransformCom->Set_WorldMatrix(m_pRigidBody->Get_Actor()->getGlobalPose()); + m_pTransformCom->Set_WorldMatrix(m_pRigidBody->Get_FootPositionPxTransform()); } m_pTransformCom->LookAt_Horizontal(XMLoadFloat4(&m_vTargetPos)); @@ -113,6 +124,9 @@ void CGoblin::Late_Update(_float fTimeDelta) HRESULT CGoblin::Render() { + + if (!m_bVisible) + return S_OK; if (FAILED(Bind_ShaderResources())) { return E_FAIL; } @@ -169,7 +183,30 @@ void CGoblin::OnCollision(CGameObject* pOther, void* pDesc) _float fLength = {}; // 작용된 힘 m_pCharacter_Controller->ConvertToDO(*m_pRigidBody); - m_pRigidBody->Add_Force(vHitDir * fLength * 100.f, PSX::PxForceMode::eIMPULSE); + m_pRigidBody->Add_Force(vHitDir * fLength * 10000.f, PSX::PxForceMode::eFORCE); + + //m_pCharacter_Controller->ConvertToDO(*m_pRigidBody); + //m_pRigidBody->Add_Force(vHitDir * fLength * 100.f, PSX::PxForceMode::eIMPULSE); + _uint iSkillType = dynamic_cast(pOther)->Get_SkillType(); + switch (iSkillType) + { + case ENUM_CLASS(SKILL_TYPE::DESCENDO): + m_eHitSpell = STATEANIM::KNOCKDOWN_FWD; + break; + case ENUM_CLASS(SKILL_TYPE::FLIPENDO): + m_eHitSpell = STATEANIM::TUMBLE2; + break; + case ENUM_CLASS(SKILL_TYPE::JAP): + m_eHitSpell = STATEANIM::HIT_LEVIOSO; + break; + case ENUM_CLASS(SKILL_TYPE::LEVIOSO): + m_eHitSpell = STATEANIM::HIT_LEVIOSO; + break; + default: + m_eHitSpell = STATEANIM::KNOCKDOWN_FWD; + break; + } + m_pFSM->Change_State(FSMSTATE::HIT); } @@ -228,6 +265,24 @@ HRESULT CGoblin::Ready_Components() return S_OK; } +HRESULT CGoblin::Ready_Parts() +{ + CGoblin_Dagger::GOBLINDAGGER_DESC Goblin_DaggerDesc{}; + + Goblin_DaggerDesc.pParentTransform = m_pTransformCom; + Goblin_DaggerDesc.pSocketMatrices = m_pModelCom->Get_BoneMatrixPtr("LeftHand"); + + if (FAILED(Add_PartObject("Goblin_Dagger", g_iStaticLevel, nullptr, &Goblin_DaggerDesc))) + { + return E_FAIL; + } + + + Get_PartObject()->Set_Visible(false); + + return S_OK; +} + HRESULT CGoblin::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { @@ -290,9 +345,33 @@ void CGoblin::Free() void CGoblin::Describe_Entity() { + GUI::Begin("Goblin"); + + GUI::Checkbox("LookAt", &m_bLookAt); + + string AnimList = m_pModelCom->Get_AnimList(m_pModelCom->Get_AnimIndex()); + GUI::Text(AnimList.c_str()); + + GUI::Text("AnimTrack %.2f", m_pModelCom->Get_CurrentTrackPosition()); + GUI::Text("AnimRatio %.2f", m_pModelCom->Get_CurrentTrackProgressRatio()); + _float4 vMomentum = {}; XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum()); - GUI::Text("GoblinMomentum %.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w); + GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w); + + _float3 Pos; + XMStoreFloat3(&Pos, Get_WorldPostion()); + + if (GUI::DragFloat3("Pos", (_float*)&Pos)) + { + m_pCharacter_Controller->Set_Position(XMLoadFloat3(&Pos)); + } + + + GUI::TextColored(ImVec4(1.f, 0.f, 0.f, 1.f), "Distance %.2f", m_fTargetDistance); + + + GUI::End(); } #endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Goblin_Dagger.cpp b/Jusin154_Team3D/Client/Private/Goblin_Dagger.cpp index 06f4f6746..a444f8a1d 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Dagger.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Dagger.cpp @@ -113,7 +113,7 @@ HRESULT CGoblin_Dagger::Ready_Components() CTransform::TRANSFORM_DESC Desc = {}; - Desc.fSpeedPerSec = 18.f; + Desc.fSpeedPerSec = 25.f; Desc.fRotationPerSec = XMConvertToRadians(180.0f); Desc.fRadius = 10.f; diff --git a/Jusin154_Team3D/Client/Private/Goblin_States.cpp b/Jusin154_Team3D/Client/Private/Goblin_States.cpp index 8d927aaff..0f05af6be 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_States.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_States.cpp @@ -3,6 +3,7 @@ #include "GameInstance.h" #include "Player.h" +#include "Goblin_Dagger.h" #pragma region STATE #include "State_Idle.h" @@ -11,6 +12,10 @@ #include "State_Land.h" #include "State_Move.h" #include "State_Combat.h" +#include "State_Swing.h" +#include "State_Throw.h" +#include "State_Blink.h" +#include "State_Hit.h" #pragma endregion @@ -24,7 +29,7 @@ void CGoblin::Behavior_IdleEnter() HRESULT CGoblin::Behavior_IdleExitCheck() { - if (m_fTargetDistance <= 15.f) + if (m_fTargetDistance <= 20.f /*&& m_fTargetDistance != 0.f*/) m_pFSM->Change_State(FSMSTATE::MOVE); return E_FAIL; @@ -38,19 +43,22 @@ void CGoblin::Behavior_IdleExit() void CGoblin::Behavior_MoveEnter() { pair<_uint, _bool> pairAnimInfo = {}; - m_pFSM->Enable_State(FSMSTATE::MOVE); + m_pFSM->Enable_State(FSMSTATE::JOG); - pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + } HRESULT CGoblin::Behavior_MoveExitCheck() { - if (m_fTargetDistance <= 7.f &&m_fTargetDistance !=0.f) - m_pFSM->Change_State(FSMSTATE::COMBAT); + pair<_uint, _bool> pairAnimInfo = {}; + _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + if (iCurrAnimIndex == m_Animation[STATEANIM::JOG_FWD].first) { + if (m_fTargetDistance <= 15.f && m_fTargetDistance != 0.f) + m_pFSM->Change_State(FSMSTATE::COMBAT); + } return E_FAIL; } @@ -63,28 +71,235 @@ void CGoblin::Behavior_MoveExit() void CGoblin::Behavior_CombatEnter() { pair<_uint, _bool> pairAnimInfo = {}; - m_pFSM->Enable_State(FSMSTATE::COMBAT); - m_pFSM->Enable_State(FSMSTATE::SKILL2); - - pairAnimInfo = m_Animation[STATEANIM::SKILL2]; - - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + m_bLookAt = true; + if (m_fTargetDistance <= 7.f && m_fSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::SWING)] <= 0.f) + { + m_pFSM->Change_State(FSMSTATE::SWING); + } + else if (m_fTargetDistance >= 7.f && m_fTargetDistance <= 12.f && m_fSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::THROW)] <= 0.f) + { + m_pFSM->Change_State(FSMSTATE::SKILL); + } + else if (m_fTargetDistance <= 15.f && m_fSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::TP)] <= 0.f) + { + m_pFSM->Change_State(FSMSTATE::BLINK); + } + else { + pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + } } -HRESULT CGoblin::Behavior_CombatExitCheck() +HRESULT CGoblin::Behavior_CombatExitCheck(_float fTimeDelta) { - if (m_pModelCom->IsFinishedAnim()) + pair<_uint, _bool> pairAnimInfo = {}; + _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + m_bLookAt = true; + + if (m_fTargetDistance > 25.f && m_fTargetDistance != 0.f) + m_pFSM->Change_State(FSMSTATE::MOVE); + + else if (m_fTargetDistance > 30.f && m_fTargetDistance != 0.f) + m_pFSM->Change_State(FSMSTATE::MOVE); + else { - m_pFSM->Change_State(FSMSTATE::IDLE); + m_pFSM->Disable_State(FSMSTATE::COMBAT); + m_pFSM->Change_State(FSMSTATE::COMBAT); } + return E_FAIL; } void CGoblin::Behavior_CombatExit() { - m_pFSM->Disable_State(FSMSTATE::COMBAT | FSMSTATE::SKILL | FSMSTATE::SKILL2); + m_pFSM->Disable_State(FSMSTATE::COMBAT); +} + +void CGoblin::Behavior_SwingEnter() +{ + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::SWING); + pairAnimInfo = m_Animation[STATEANIM::SWING_FWD]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_fSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::SWING)] = m_fMaxSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::SWING)]; + Add_Event(pairAnimInfo.first, + [this]() {m_bStep = false; }, + 0.2f); +} + +HRESULT CGoblin::Behavior_SwingExitCheck(_float fTimeDelta) +{ + pair<_uint, _bool> pairAnimInfo = {}; + if (m_pFSM->IsEnable(FSMSTATE::SWING) && m_bStep) + { + _float fDesiredRange = 0.5f; + _float dist = m_fTargetDistance; + + if (dist > fDesiredRange) + { + _vector vPos = Get_WorldPostion(); + _vector vDistance = XMLoadFloat4(&m_vTargetPos) - vPos; + vDistance = XMVector4Normalize(vDistance); + _float step = dist - fDesiredRange; + + m_pTransformCom->AccumulateMomentum(vDistance * step *fTimeDelta*1.5f); + } + } + + if (m_pModelCom->IsFinishedAnim()) + { + m_bLookAt = true; + m_bStep = true; + m_pFSM->Change_State(FSMSTATE::COMBAT); + return E_FAIL; + } + + return E_FAIL; +} + +void CGoblin::Behavior_SwingExit() +{ + m_pFSM->Disable_State(FSMSTATE::SWING); +} + +void CGoblin::Behavior_ThrowEnter() +{ + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::SKILL); + pairAnimInfo = m_Animation[STATEANIM::SKILL]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_fSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::THROW)] = m_fMaxSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::THROW)]; + + Add_Event(pairAnimInfo.first, + [this]() { + Get_PartObject()->Set_Visible(true); + Get_PartObject()->Set_Attach(false); }, + 0.3f); +} + +HRESULT CGoblin::Behavior_ThrowExitCheck(_float fTimeDelta) +{ + if (m_pModelCom->IsFinishedAnim()) + { + m_bLookAt = true; + m_bStep = true; + m_pFSM->Change_State(FSMSTATE::COMBAT); + return E_FAIL; + } + + return E_FAIL; +} + +void CGoblin::Behavior_ThrowExit() +{ + m_pFSM->Disable_State(FSMSTATE::SKILL); + Get_PartObject()->Set_Attach(true); + Get_PartObject()->Set_Visible(false); +} + +void CGoblin::Behavior_BlinkEnter() +{ + m_bVisible = false; + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::BLINK); + m_fSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::TP)] = m_fMaxSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::TP)]; + _float3 vRandomPos = _float3(m_pGameInstance->Real_Random_Float(-1.5f, 1.5f), 1.f, m_pGameInstance->Real_Random_Float(-1.5f, 1.5f)); + _vector vRandPos = XMLoadFloat3(&vRandomPos); + m_pCharacter_Controller->Set_Position(XMLoadFloat4(&m_vTargetPos) + vRandPos); +} + +HRESULT CGoblin::Behavior_BlinkExitCheck(_float fTimeDelta) +{ + pair<_uint, _bool> pairAnimInfo = {}; + _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + m_fTpTime += fTimeDelta; + if (m_fTpTime >= 2.f) + { + m_bVisible = true; + m_fTpTime = 0.f; + pairAnimInfo = m_Animation[STATEANIM::BLINK]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + } + + if (m_pModelCom->IsFinishedAnim() && iCurrAnimIndex == m_Animation[STATEANIM::BLINK].first) + { + m_bLookAt = true; + m_pFSM->Change_State(FSMSTATE::COMBAT); + return E_FAIL; + } + + return E_FAIL; +} + +void CGoblin::Behavior_BlinkExit() +{ + m_pFSM->Disable_State(FSMSTATE::BLINK); +} + +void CGoblin::Behavior_HitEnter() +{ + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::HIT); + + switch (m_eHitSpell) + { + case STATEANIM::KNOCKDOWN_FWD: + pairAnimInfo = m_Animation[STATEANIM::KNOCKDOWN_FWD]; + break; + case STATEANIM::TUMBLE2: + pairAnimInfo = m_Animation[STATEANIM::TUMBLE2]; + break; + case STATEANIM::HIT_LEVIOSO: + { + pairAnimInfo = m_Animation[STATEANIM::HIT_LEVIOSO]; + break; + } + default: + pairAnimInfo = m_Animation[STATEANIM::KNOCKDOWN_FWD]; + break; + } + + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); +} + +HRESULT CGoblin::Behavior_HitExitCheck(_float fTimeDelta) +{ + pair<_uint, _bool> pairAnimInfo = {}; + _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + + if (iCurrAnimIndex == m_Animation[STATEANIM::KNOCKDOWN_FWD].first) + { + if (m_pModelCom->Get_CurrentTrackProgressRatio() >= 0.5f) + { + pairAnimInfo = m_Animation[STATEANIM::KNOCKDOWN_FWD_SPLT]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f); + } + } + + if (iCurrAnimIndex == m_Animation[STATEANIM::HIT_LEVIOSO].first) + { + if (m_pModelCom->Get_CurrentTrackProgressRatio() >= 0.31f) + { + pairAnimInfo = m_Animation[STATEANIM::LAND]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f); + } + } + + + if (m_pModelCom->IsFinishedAnim()) + { + m_bLookAt = true; + m_pFSM->Change_State(FSMSTATE::IDLE); + return E_FAIL; + } + return E_FAIL; +} + +void CGoblin::Behavior_HitExit() +{ + m_pFSM->Disable_State(FSMSTATE::HIT); } @@ -107,10 +322,7 @@ void CGoblin::Add_FSM() Desc.funcEnterEvent = [this]() { Behavior_MoveEnter(); }; Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(); }; Desc.funcExitEvent = [this]() { Behavior_MoveExit(); }; - Desc.funcPriorityUpdate = [this](_float fTimeDelta) { - if (m_pGameInstance->Key_Pressing(DIK_A)) { m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); } - if (m_pGameInstance->Key_Pressing(DIK_D)) { m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); }; - }; + Desc.funcPriorityUpdate = nullptr; Desc.funcLateUpdate = nullptr; m_States.emplace(FSMSTATE::MOVE, CState_Move::Create(&Desc)); } @@ -120,17 +332,65 @@ void CGoblin::Add_FSM() CState_Combat::STATE_COMBAT_DESC Desc{}; Desc.pOwner = this; Desc.funcEnterEvent = [this]() { Behavior_CombatEnter(); }; - Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_CombatExitCheck(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_CombatExitCheck(fTimedelta); }; Desc.funcExitEvent = [this]() { Behavior_CombatExit(); }; Desc.funcPriorityUpdate = nullptr; Desc.funcLateUpdate = nullptr; m_States.emplace(FSMSTATE::COMBAT, CState_Combat::Create(&Desc)); } + + { + CState_Swing::STATE_SWING_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_SwingEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_SwingExitCheck(fTimedelta); }; + Desc.funcExitEvent = [this]() { Behavior_SwingExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::SWING, CState_Swing::Create(&Desc)); + } + + { + CState_Throw::STATE_THROW_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_ThrowEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_ThrowExitCheck(fTimedelta); }; + Desc.funcExitEvent = [this]() { Behavior_ThrowExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::SKILL, CState_Throw::Create(&Desc)); + } + + { + CState_Blink::STATE_BLINK_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_BlinkEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_BlinkExitCheck(fTimedelta); }; + Desc.funcExitEvent = [this]() { Behavior_BlinkExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::BLINK, CState_Blink::Create(&Desc)); + } #pragma endregion #pragma region Behavior_Combat_Focus #pragma endregion +#pragma region Hit + { + CState_Hit::STATE_HIT_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_HitEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_HitExitCheck(fTimedelta); }; + Desc.funcExitEvent = [this]() { Behavior_HitExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::HIT, CState_Hit::Create(&Desc)); + } + +#pragma endregion + + } void CGoblin::Set_Anim() @@ -141,18 +401,21 @@ void CGoblin::Set_Anim() m_Animation[STATEANIM::IDLE_TURN_R] = { 30, false }; m_Animation[STATEANIM::WALK_FWD] = { 50,true }; + m_Animation[STATEANIM::WALK_START] = { 57,false }; m_Animation[STATEANIM::WALK_STOP] = { 58,false }; m_Animation[STATEANIM::WALK_BWD] = { 49, true }; - m_Animation[STATEANIM::JOG_FWD] = { 46,true }; + m_Animation[STATEANIM::JOG_FWD] = { 147,true }; + m_Animation[STATEANIM::JOG_START] = { 157,false }; m_Animation[STATEANIM::JOG_BWD] = { 154,false }; m_Animation[STATEANIM::DODGE_LEFT] = { 125, false }; m_Animation[STATEANIM::DODGE_RIGHT] = { 126, false }; m_Animation[STATEANIM::SPRINT] = { 90, true }; - m_Animation[STATEANIM::SKILL] = { 70,false }; // 도끼 스윙 - m_Animation[STATEANIM::SKILL2] = { 85,false }; // 나이프 던지기 + m_Animation[STATEANIM::SKILL] = { 85,false }; // 나이프 던지기 + m_Animation[STATEANIM::BLINK] = { 426,false }; // 텔레포트 + m_Animation[STATEANIM::SWING_FWD] = { 100,false }; // 도끼 스윙 444 m_Animation[STATEANIM::HIT_FWD] = { 353, false }; m_Animation[STATEANIM::HIT_BWD] = { 352, false }; @@ -182,9 +445,12 @@ void CGoblin::Set_Anim() m_Animation[STATEANIM::KNOCKBACK] = { 377, true }; m_Animation[STATEANIM::KNOCKBACK2] = { 378, true }; m_Animation[STATEANIM::TUMBLE] = { 379, true }; - m_Animation[STATEANIM::TUMBLE2] = { 380, true }; + m_Animation[STATEANIM::TUMBLE2] = { 380, true };// 원래 true 였음 m_Animation[STATEANIM::PETRIFICUSED_START] = { 383, false }; + m_Animation[STATEANIM::LAND] = { 376, false }; + m_Animation[STATEANIM::HIT_LEVIOSO] = { 381, false }; + m_Animation[STATEANIM::DEAD_BWD] = { 317, false }; m_Animation[STATEANIM::DEAD_BWD2] = { 318, false }; m_Animation[STATEANIM::DEAD_FWD] = { 319, false }; @@ -193,4 +459,32 @@ void CGoblin::Set_Anim() m_Animation[STATEANIM::DEAD_L2] = { 322, false }; m_Animation[STATEANIM::DEAD_R] = { 323, false }; m_Animation[STATEANIM::DEAD_R2] = { 324, false }; + + //Tp 426 + + + + + + + + + + // 걷기 시작 57 + // 걷기 루프 50 + // 뛰기 시작 157 + // 뛰기 루프 45 + // 나이프 던지기 85 + // 도끼 공격 444 + // 도끼 공격 후 76 + // 도끼 찍기 439 + // + + // 텀블링 히트 380 + // 디센도 찍기전 띄우기 371 + // 디센도 찍기 372 + + // 레비오소 피격 381 + // 착지 376 + } diff --git a/Jusin154_Team3D/Client/Private/HpBarBG.cpp b/Jusin154_Team3D/Client/Private/HpBarBG.cpp index b0ba7def3..81c4232a8 100644 --- a/Jusin154_Team3D/Client/Private/HpBarBG.cpp +++ b/Jusin154_Team3D/Client/Private/HpBarBG.cpp @@ -48,7 +48,6 @@ HRESULT CHpBarBG::Initialize(void* pArg) m_fHpBGPos = _float2(0.f, 13.f); m_fHpBG = _float2(0, m_fSizeX); SizeUpX(240.f); - m_bActive = true; return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/InfoInstance.cpp b/Jusin154_Team3D/Client/Private/InfoInstance.cpp index b4ea9fe05..a0cb435ac 100644 --- a/Jusin154_Team3D/Client/Private/InfoInstance.cpp +++ b/Jusin154_Team3D/Client/Private/InfoInstance.cpp @@ -99,13 +99,59 @@ SPELL_INFO CInfoInstance::Get_Spell_Info(_int Spell_Info) { return m_pSkillInfo->Get_Info(Spell_Info); } + +_int CInfoInstance::Update_Spell(_int SpellIndex) +{ + return m_pSkillInfo->Update_Spell(SpellIndex); +} + +_float CInfoInstance::Get_CoolTime(_int SpellID) +{ + return m_pSkillInfo->Get_CoolTime(SpellID); +} void CInfoInstance::Change_Canvas() { } + void CInfoInstance::Key_Input(_uint Input) { m_eInput = Input; + + switch (m_eInput) + { + case ENUM_CLASS(KEYINPUT::INPUT_1): + case ENUM_CLASS(KEYINPUT::INPUT_2): + case ENUM_CLASS(KEYINPUT::INPUT_3): + case ENUM_CLASS(KEYINPUT::INPUT_4): + Event_CallBack(TEXT("Spell"), &m_eInput); + break; + case ENUM_CLASS(KEYINPUT::INPUT_T): + break; + case ENUM_CLASS(KEYINPUT::INPUT_G): + + break; + case ENUM_CLASS(KEYINPUT::INPUT_TAB): + + break; + + default: + break; + } +} + +void CInfoInstance::Add_Event(_wstring EventName, function Event) +{ + UI_Event.emplace(EventName, Event); +} + +void CInfoInstance::Event_CallBack(_wstring EventName, void* pArg) +{ + auto range = UI_Event.equal_range(EventName); + for (auto it = range.first; it != range.second; ++it) + { + it->second(pArg); + } } #pragma endregion diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index bde3b5a5c..60fe7b1ef 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -44,7 +44,7 @@ HRESULT CLevel_GamePlay::Initialize(void* pArg) return E_FAIL; } //플레이어보다 먼저 생성해야함! - if (FAILED(Reday_Layer_EffectPool())) { + if (FAILED(Reday_Layer_EffectPool())) { return E_FAIL; } // 이것도 플레이어보다 먼저 생성해야함! @@ -138,7 +138,7 @@ HRESULT CLevel_GamePlay::Render() HRESULT CLevel_GamePlay::Ready_Lights() { - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_LIGHT))){ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_LIGHT))) { return E_FAIL; } @@ -161,9 +161,9 @@ HRESULT CLevel_GamePlay::Ready_Background() /* Map Containters */ /* 테스트용 맵 */ - //CInfoInstance::GetInstance()->Load_MapObjects("ClientTest"); + CInfoInstance::GetInstance()->Load_MapObjects("ClientTest"); /* 전체 맵 */ - CInfoInstance::GetInstance()->Load_MapObjects("Map1129"); + //CInfoInstance::GetInstance()->Load_MapObjects("Map1129"); /* 조명 오브젝트 */ CInfoInstance::GetInstance()->Load_LightElements("LightElement"); @@ -250,6 +250,8 @@ HRESULT CLevel_GamePlay::Ready_Background() HRESULT CLevel_GamePlay::Ready_Layer_UI(const _wstring& strLayerTag) { + CInfoInstance::GetInstance()->Load_SpellInfo("../Bin/Resources/Data/UI/Spell/SpellInfo.xml"); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, g_iStaticLevel, LAYER_UI))) { return E_FAIL; } @@ -274,7 +276,7 @@ HRESULT CLevel_GamePlay::Ready_Layer_Camera() Camera_Desc.pLookTarget = { nullptr }; CCamera_Debug* pCamera = { nullptr }; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &Camera_Desc, nullptr, &pCamera))){ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &Camera_Desc, nullptr, &pCamera))) { return E_FAIL; } @@ -300,7 +302,7 @@ HRESULT CLevel_GamePlay::Ready_Markers() HRESULT CLevel_GamePlay::Ready_Layer_Player(const _wstring& strLayerTag) { - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag))){ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag))) { return E_FAIL; } @@ -319,7 +321,7 @@ HRESULT CLevel_GamePlay::Ready_Layer_Item(const _wstring& strLayerTag) HRESULT CLevel_GamePlay::Ready_Layer_SkyBox(const _wstring& strLayerTag) { - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_SKYBOX))){ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_SKYBOX))) { return E_FAIL; } @@ -337,9 +339,9 @@ HRESULT CLevel_GamePlay::Ready_Layer_SkyBox(const _wstring& strLayerTag) HRESULT CLevel_GamePlay::Ready_Layer_Monster() { - for (_uint i = 0; i < 2; ++i) + for (_uint i = 0; i < 1; ++i) { - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER,&i))) { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) { return E_FAIL; } } diff --git a/Jusin154_Team3D/Client/Private/Level_Logo.cpp b/Jusin154_Team3D/Client/Private/Level_Logo.cpp index c26fdbc90..5b56ffe97 100644 --- a/Jusin154_Team3D/Client/Private/Level_Logo.cpp +++ b/Jusin154_Team3D/Client/Private/Level_Logo.cpp @@ -23,6 +23,10 @@ HRESULT CLevel_Logo::Initialize() void CLevel_Logo::Update(_float fTimeDelta) { +#ifdef 기무리 + m_pGameInstance->Set_LevelToChange(); +#endif // 기무리 + if (m_pGameInstance->Key_Up(DIK_F1)) { m_pGameInstance->Set_LevelToChange(); diff --git a/Jusin154_Team3D/Client/Private/Levioso.cpp b/Jusin154_Team3D/Client/Private/Levioso.cpp index e8c192743..d08f3e328 100644 --- a/Jusin154_Team3D/Client/Private/Levioso.cpp +++ b/Jusin154_Team3D/Client/Private/Levioso.cpp @@ -79,11 +79,7 @@ void CLevioso::Update(_float fTimeDelta) m_pTrail_PT_0->Get_Component()->Translation(m_vOwnerLook * 0.25f); - if (true == m_pGameInstance->SphereCast(0.0f, XMLoadFloat4(&m_vStartPos), m_vOwnerLook, XMVectorGetX(XMVector3Length(m_vOwnerLook * 1.f)) - , PSX::PxHitFlag::ePOSITION | PSX::PxHitFlag::eNORMAL, PSX::PxQueryFlag::eSTATIC, hitBuffer)) - { - OnCollision(); - } + _matrix WorldMat = m_pTrail_PT_0->Get_Component()->Get_XMWorldMatrix(); @@ -96,26 +92,25 @@ void CLevioso::Late_Update(_float fTimeDelta) if (m_bVisible == false) return; - CPlayer* pPlayer = static_cast(m_pOwner); - - if (pPlayer == nullptr) - return; - - _matrix WandWorld = pPlayer->Get_WandPos(); - - //m_pLeviosoTrail->Get_Component()->Fixed_Trail(WandWorld); - XMStoreFloat4(&m_vEndPos, m_pLeviosoPJ_0->Get_WorldPostion()); + _vector vDir = XMLoadFloat4(&m_vEndPos) - XMLoadFloat4(&m_vStartPos); + + if (true == m_pGameInstance->SphereCast(0.125, XMLoadFloat4(&m_vStartPos), XMVector3Normalize(vDir), XMVectorGetX(XMVector3Length(vDir)) + , PSX::PxHitFlag::ePOSITION | PSX::PxHitFlag::eNORMAL, PSX::PxQueryFlag::eDYNAMIC | PSX::PxQueryFlag::eSTATIC, m_Hitbuffer)) + { + OnCollision(); + } + __super::Late_Update(fTimeDelta); } -HRESULT CLevioso::Pre_Setting(CGameObject* pObject) +HRESULT CLevioso::Pre_Setting(CGameObject* pObject, void* pArg) { - if (FAILED(__super::Pre_Setting(pObject))) + if (FAILED(__super::Pre_Setting(pObject, nullptr))) return E_FAIL; CPlayer* pPlayer = static_cast(m_pOwner); @@ -126,6 +121,8 @@ HRESULT CLevioso::Pre_Setting(CGameObject* pObject) _vector WandPos = pPlayer->Get_WandPos().r[3]; CEffectParts* pWandSmoke = Get_PartObject("Levioso_Wand0"); + CEffectParts* pWandLight = Get_PartObject("Levioso_Wand_Light"); + m_pLeviosoPJ_0->Get_Component()->Set_WorldMatrix(m_pOwner->Get_Component()->Get_XMWorldMatrix()); m_pTrail_PT_0->Get_Component()->Set_WorldMatrix(m_pOwner->Get_Component()->Get_XMWorldMatrix()); @@ -134,10 +131,12 @@ HRESULT CLevioso::Pre_Setting(CGameObject* pObject) m_pLeviosoPJ_0->Get_Component()->Set_State(STATE::POSITION, WandPos); m_pTrail_PT_0->Get_Component()->Set_State(STATE::POSITION, WandPos); pWandSmoke->Get_Component()->Set_State(STATE::POSITION, pPlayer->Get_PartObject()->Get_WorldPostion()); + pWandLight->Get_Component()->Set_State(STATE::POSITION, pPlayer->Get_PartObject()->Get_WorldPostion()); m_pLeviosoPJ_0->Set_Visible(true); m_pTrail_PT_0->Set_Visible(true); pWandSmoke->Set_Visible(true); + pWandLight->Set_Visible(true); m_pLeviosoTrail->Set_Visible(true); m_pLeviosoTrail->Get_Component()->Reset_Trail(); @@ -191,12 +190,17 @@ CGameObject* CLevioso::Clone(void* pArg, CGameObject* pOwner) void CLevioso::OnCollision(CGameObject* pOther, void* pDesc) { + _int iIndex = CollisionCheck(); + + if (iIndex < 0) + return; + if (m_isCollisionEnter == true) return; m_isCollisionEnter = true; - _vector vPos = XMVectorSet(hitBuffer.block.position.x, hitBuffer.block.position.y, hitBuffer.block.position.z, 1.f); + _vector vPos = XMVectorSet(m_Hitbuffer.touches[iIndex].position.x, m_Hitbuffer.touches[iIndex].position.y, m_Hitbuffer.touches[iIndex].position.z, 1.f); for (auto& pPair : m_PartObjects) @@ -208,6 +212,16 @@ void CLevioso::OnCollision(CGameObject* pOther, void* pDesc) m_fAccTime = 0.f; m_fDuration = 3.f; //적중하면 지속시간 3초 + CPlayer* pPlayer = static_cast(m_pOwner); + + if (pPlayer == nullptr) + return; + + _vector WandPos = pPlayer->Get_WandPos().r[3]; + + CEffectParts* pWandLight = Get_PartObject("Levioso_Wand_Light"); + pWandLight->Get_Component()->Set_State(STATE::POSITION, pPlayer->Get_PartObject()->Get_WorldPostion()); + //CEffectParts* pLevioso_Hit = Get_PartObject("Levioso_Hit"); //CEffectParts* pLevioso_Bottom_Wind = Get_PartObject("Levioso_Bottom_Wind"); //CEffectParts* pLevioso_Rotate0 = Get_PartObject("Levioso_Rotate0"); @@ -233,6 +247,12 @@ void CLevioso::Free() void CLevioso::Describe_Entity() { + GUI::Begin("LEVIOSO"); + + GUI::DragFloat("TURN SPEED", &m_fTurnSpeed); + GUI::DragFloat("RANGE", &m_fRange); + GUI::End(); + } #endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/LeviosoSide.cpp b/Jusin154_Team3D/Client/Private/LeviosoSide.cpp index f39e74d46..a49fc9a6e 100644 --- a/Jusin154_Team3D/Client/Private/LeviosoSide.cpp +++ b/Jusin154_Team3D/Client/Private/LeviosoSide.cpp @@ -88,7 +88,7 @@ void CLeviosoSide::Late_Update(_float fTimeDelta) } -HRESULT CLeviosoSide::Pre_Setting(CGameObject* pObject) +HRESULT CLeviosoSide::Pre_Setting(CGameObject* pObject, void* pArg) { if (FAILED(__super::Pre_Setting(pObject))) return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Light_Main.cpp b/Jusin154_Team3D/Client/Private/Light_Main.cpp index 0eef743b6..c3964fb26 100644 --- a/Jusin154_Team3D/Client/Private/Light_Main.cpp +++ b/Jusin154_Team3D/Client/Private/Light_Main.cpp @@ -39,7 +39,9 @@ void CLight_Main::Priority_Update(_float fTimeDelta) void CLight_Main::Update(_float fTimeDelta) { GUI::Begin("Main_Light"); +#ifdef _DEBUG m_pLightCom->Describe_Entity(); +#endif // _DEBUG GUI::End(); } diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index 796005487..efd8cdf28 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -16,6 +16,7 @@ #include "SkyBox.h" #include "Troll_Weapon.h" #include "Troll_Rock.h" +#include "Goblin_Dagger.h" #include "Wand.h" #pragma region ACTOR @@ -29,9 +30,21 @@ #pragma region UI +#include "Skill_Data.h" #include "UI_Manager.h" #include "GamePlay_Canvas.h" + +#include "Mission_Panel.h" +//#include "MissionBanner_Border.h" +//#include "MissionBanner_Key.h" +//#include "Mission_Icon.h" +//#include "Mouse_Cursor.h" +#include "MiniMap_TrimBorder.h" + +#include "MiniMap_Panel.h" +#include "NoMountIcon.h" + #include "Loading_Panel.h" #include "LoadingWidget.h" #include "LoadingWidget_Flame.h" @@ -47,12 +60,6 @@ #include "Spell_UI.h" #include "Magic_Item.h" -#include "MiniMap_Panel.h" -#include "MiniMap_TrimBorder.h" -#include "NoMountIcon.h" - -#include "Mission_Panel.h" - #include "Spell_Canvas.h" #include "Spell_Panel.h" #include "Current_Spell_Slot.h" @@ -69,6 +76,8 @@ #include "Spell_Vidio_Border.h" #include "Spell_Anim.h" #include "Current_Slot_Number.h" +#include "Spell_Drag.h" + #pragma endregion @@ -1162,7 +1171,7 @@ HRESULT CLoader::Loading_For_GamePlay() Desc.ePxMaterialTypes = { PXMATERIAL::DEFAULT }; Desc.vMatInfo = { 0.5f, 0.5f, 0.6f }; Desc.fContactOffset = { 0.05f }; - Desc.vhalfGeometryInfo = { 1.f, 1.f, 1.f }; + Desc.vhalfGeometryInfo = { 0.5f, 0.5f, 0.5f }; Desc.fDensity = 1.f; Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY()); Desc.eLockFlag = {}; @@ -1220,7 +1229,7 @@ HRESULT CLoader::Loading_For_GamePlay() return E_FAIL; if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Goblin_Dagger_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Object/Goblin_Dagger/Goblin_Dagger.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) + CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Object/Goblin_Dagger/Goblin_Dagger.bin", XMMatrixScaling(0.0002f, 0.0002f, 0.0002f) * XMMatrixRotationX(XMConvertToRadians(90.f)) * XMMatrixIdentity())))) return E_FAIL; @@ -1653,6 +1662,11 @@ HRESULT CLoader::Loading_For_GamePlay() return E_FAIL; } + /* For.Prototype_GameObject_UI_Manager*/ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSkill_Data::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + /* For.Prototype_GameObject_GamePlay_Canvas*/ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CGamePlay_Canvas::Create(m_pDevice, m_pContext)))) { return E_FAIL; @@ -1803,6 +1817,10 @@ HRESULT CLoader::Loading_For_GamePlay() { return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Drag::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } /* For.Prototype_GameObject_SkyBox */ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSkyBox::Create(m_pDevice, m_pContext)))) @@ -2003,6 +2021,10 @@ HRESULT CLoader::Loading_For_GamePlay() if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CTroll_Rock::Create(m_pDevice, m_pContext)))) return E_FAIL; + /* For.Prototype_GameObject_Goblin_Dagger */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CGoblin_Dagger::Create(m_pDevice, m_pContext)))) + return E_FAIL; + /* For.Prototype_GameObject_Broom */ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CBroom::Create(m_pDevice, m_pContext)))) return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/LoadingWidget.cpp b/Jusin154_Team3D/Client/Private/LoadingWidget.cpp index 7f16a0561..3fdd94bb7 100644 --- a/Jusin154_Team3D/Client/Private/LoadingWidget.cpp +++ b/Jusin154_Team3D/Client/Private/LoadingWidget.cpp @@ -47,7 +47,7 @@ HRESULT CLoadingWidget::Initialize(void* pArg) m_iImageFrameX = 6; // 이미지의 x 갯수 m_iImageFrameY = 6; // 이미지의 y 갯수 - //m_bActive = true; + m_bActive = false; return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/LoadingWidget_Flame.cpp b/Jusin154_Team3D/Client/Private/LoadingWidget_Flame.cpp index 93623a688..f45001382 100644 --- a/Jusin154_Team3D/Client/Private/LoadingWidget_Flame.cpp +++ b/Jusin154_Team3D/Client/Private/LoadingWidget_Flame.cpp @@ -49,7 +49,6 @@ HRESULT CLoadingWidget_Flame::Initialize(void* pArg) m_iImageFrameX = 3; // 이미지의 x 갯수 m_iImageFrameY = 3; // 이미지의 y 갯수 - m_bActive = true; // 이 친구는 FadeIn을 해주면 알아서 한번 깜빡이고 들어감 // 조절을 할꺼면 나중에 제대로 확인을 한 다음에 할 예정 Set_FadeIn(); diff --git a/Jusin154_Team3D/Client/Private/Loading_Panel.cpp b/Jusin154_Team3D/Client/Private/Loading_Panel.cpp index a39128f96..b4c71ab91 100644 --- a/Jusin154_Team3D/Client/Private/Loading_Panel.cpp +++ b/Jusin154_Team3D/Client/Private/Loading_Panel.cpp @@ -41,7 +41,6 @@ HRESULT CLoading_Panel::Initialize(void* pArg) { return E_FAIL; } - m_bActive = true; return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Lumos.cpp b/Jusin154_Team3D/Client/Private/Lumos.cpp index 0375114d0..a296efff4 100644 --- a/Jusin154_Team3D/Client/Private/Lumos.cpp +++ b/Jusin154_Team3D/Client/Private/Lumos.cpp @@ -80,7 +80,7 @@ void CLumos::Late_Update(_float fTimeDelta) } -HRESULT CLumos::Pre_Setting(CGameObject* pObject) +HRESULT CLumos::Pre_Setting(CGameObject* pObject, void* pArg) { if (FAILED(__super::Pre_Setting(pObject))) return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Magic_Icon.cpp b/Jusin154_Team3D/Client/Private/Magic_Icon.cpp index b06a7c3d6..6c17c2683 100644 --- a/Jusin154_Team3D/Client/Private/Magic_Icon.cpp +++ b/Jusin154_Team3D/Client/Private/Magic_Icon.cpp @@ -40,7 +40,6 @@ HRESULT CMagic_Icon::Initialize(void* pArg) m_fTimeMult = 3.f; m_fAlpha = 1.f; m_fAlphaTime = 3.f; - m_bActive = true; return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Magic_Item.cpp b/Jusin154_Team3D/Client/Private/Magic_Item.cpp index 8102488dd..4b081f9ae 100644 --- a/Jusin154_Team3D/Client/Private/Magic_Item.cpp +++ b/Jusin154_Team3D/Client/Private/Magic_Item.cpp @@ -47,7 +47,6 @@ HRESULT CMagic_Item::Initialize(void* pArg) m_iArratCount = 2; Compute_UV(0); Compute_Image(); - m_bActive = true; return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Magic_Meter.cpp b/Jusin154_Team3D/Client/Private/Magic_Meter.cpp index 5ee0715f5..f706a140e 100644 --- a/Jusin154_Team3D/Client/Private/Magic_Meter.cpp +++ b/Jusin154_Team3D/Client/Private/Magic_Meter.cpp @@ -43,8 +43,6 @@ HRESULT CMagic_Meter::Initialize(void* pArg) m_fAlphaTime = 1.f; m_fMaxGauge = 20.f; m_fCurrentGauge = 10.f; - Visible(false); - m_bActive = true; return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/MiniMap_Panel.cpp b/Jusin154_Team3D/Client/Private/MiniMap_Panel.cpp index 82ac9609d..f47084c13 100644 --- a/Jusin154_Team3D/Client/Private/MiniMap_Panel.cpp +++ b/Jusin154_Team3D/Client/Private/MiniMap_Panel.cpp @@ -40,8 +40,8 @@ HRESULT CMiniMap_Panel::Initialize(void* pArg) { return E_FAIL; } - - m_bActive = true; + Visible(true); + ElementAllVisible(true); return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/MiniMap_TrimBorder.cpp b/Jusin154_Team3D/Client/Private/MiniMap_TrimBorder.cpp index a02ef979b..1216c67d9 100644 --- a/Jusin154_Team3D/Client/Private/MiniMap_TrimBorder.cpp +++ b/Jusin154_Team3D/Client/Private/MiniMap_TrimBorder.cpp @@ -40,8 +40,6 @@ HRESULT CMiniMap_TrimBorder::Initialize(void* pArg) m_fTimeMult = 3.f; m_fAlpha = 1.f; m_fAlphaTime = 3.f; - - m_bActive = true; return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/NoMountIcon.cpp b/Jusin154_Team3D/Client/Private/NoMountIcon.cpp index ccb7ce9fd..9c015b9f8 100644 --- a/Jusin154_Team3D/Client/Private/NoMountIcon.cpp +++ b/Jusin154_Team3D/Client/Private/NoMountIcon.cpp @@ -40,8 +40,6 @@ HRESULT CNoMountIcon::Initialize(void* pArg) m_fTimeMult = 3.f; m_fAlpha = 0.7f; m_fAlphaTime = 3.f; - - m_bActive = true; return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/NomalJap.cpp b/Jusin154_Team3D/Client/Private/NomalJap.cpp index 455c5cca2..a0c330c42 100644 --- a/Jusin154_Team3D/Client/Private/NomalJap.cpp +++ b/Jusin154_Team3D/Client/Private/NomalJap.cpp @@ -57,7 +57,10 @@ HRESULT CNomalJap::Initialize(void* pArg) void CNomalJap::Priority_Update(_float fTimeDelta) { __super::Priority_Update(fTimeDelta); - XMStoreFloat4(&m_vSrcPos, m_pProjectile->Get_Component()->Get_State(STATE::POSITION)); + + + XMStoreFloat4(&m_vStartPos, m_pProjectile->Get_WorldPostion()); + } void CNomalJap::Update(_float fTimeDelta) @@ -69,57 +72,48 @@ void CNomalJap::Update(_float fTimeDelta) __super::Update(fTimeDelta); Update_Event(fTimeDelta); - if (m_fAccMoveTime > m_fDuration) { - SAFE_RELEASE(m_pTargetUnit); - } - _vector vDirection = XMLoadFloat3(&m_vDirection); - //_vector vStartPos = Get_WorldPostion(); - //_float3 vfStartPos = {}; - //XMStoreFloat3(&vfStartPos, Get_WorldPostion()); + _vector vDirection = XMLoadFloat3(&m_vCameraLook); + // 선속도 m_pProjectile_Side->Get_Component()->Translation(vDirection * m_fLinearSpeed * fTimeDelta); m_pProjectile->Get_Component()->Translation(vDirection * m_fLinearSpeed * fTimeDelta); - //_vector vEndPos = Get_WorldPostion(); - - //_float3 vfEndPos = {}; - //XMStoreFloat3(&vfEndPos, Get_WorldPostion()); - - //_float3 vDir = {}; - //XMStoreFloat3(&vDir, vEndPos - vStartPos); - - //m_pGameInstance->SphereCast(0.125f, vfStartPos, vDir, XMVectorGetX(XMVector3Length(vEndPos - vStartPos)), ) - - - if (false == m_bTrailPulseEnded && m_fAccMoveTime > m_fDuration * 0.3f) { - m_bTrailPulseEnded = true; - - if (nullptr != m_pTargetUnit && false == m_pTargetUnit->isDead()) { - _vector vCurrentPos = m_pProjectile->Get_WorldPostion(); - _vector vTargetPos = m_pTargetUnit->Get_WorldPostion(); - XMStoreFloat4(&m_vTargetPos, vTargetPos); - XMStoreFloat3(&m_vDirection, XMVector4Normalize(vTargetPos - vCurrentPos)); - - _float fDistance = XMVectorGetX(XMVector3Length(vTargetPos - vCurrentPos)); - m_fLinearSpeed = fDistance / (m_fDuration - m_fAccMoveTime) * 10 / 3; - SAFE_RELEASE(m_pTargetUnit); - } + //Up벡터 방향으로 파이만큼 이동 + if (m_fAccRotateTime > XM_2PI) return; - } - if (true == m_bTrailPulseEnded) { - return; - } - _vector vRotateUp = XMLoadFloat3(&m_vRotateUp); - m_fAccMoveTime += fTimeDelta; + m_fAccRotateTime += fTimeDelta * m_fAngularSpeed; - // 각속도 - m_pProjectile_Side->Get_Component()->Translation(vRotateUp * 0.6f * sinf(m_fAngularSpeed * m_fAccMoveTime)); - m_pProjectile->Get_Component()->Translation(vRotateUp * 0.6f * sinf(m_fAngularSpeed * m_fAccMoveTime)); + m_pProjectile_Side->Get_Component()->Translation(XMLoadFloat3(&m_vRotateUp) * sinf(m_fAccRotateTime) * m_fRotateAmount); + m_pProjectile->Get_Component()->Translation(XMLoadFloat3(&m_vRotateUp) * sinf(m_fAccRotateTime) * m_fRotateAmount); + + // 내 라이트 방향으로 좌우무빙 하도록 해보자 + + + if (m_fAccZigZagTime > XM_2PI) + m_fAccZigZagTime = 0.f; + + m_fAccZigZagTime += fTimeDelta * m_fZigZagSpeed; + + m_pProjectile_Side->Get_Component()->Translation(XMLoadFloat3(&m_vRotateRight) * sinf(m_fAccZigZagTime) * m_fZigZagAmount); + m_pProjectile->Get_Component()->Translation(XMLoadFloat3(&m_vRotateRight) * sinf(m_fAccZigZagTime) * m_fZigZagAmount); + + + + XMStoreFloat4(&m_vEndPos, m_pProjectile->Get_WorldPostion()); + + + _vector vDir = XMLoadFloat4(&m_vEndPos) - XMLoadFloat4(&m_vStartPos); + + if (true == m_pGameInstance->SphereCast(0.125, XMLoadFloat4(&m_vStartPos), XMVector3Normalize(vDir), XMVectorGetX(XMVector3Length(vDir)) + , PSX::PxHitFlag::ePOSITION | PSX::PxHitFlag::eNORMAL, PSX::PxQueryFlag::eDYNAMIC | PSX::PxQueryFlag::eSTATIC, m_Hitbuffer)) + { + OnCollision(); + } } @@ -128,150 +122,27 @@ void CNomalJap::Late_Update(_float fTimeDelta) if (m_bVisible == false) { return; } - _vector vSrcPos = XMLoadFloat4(&m_vSrcPos); - _vector vDstPos = m_pProjectile->Get_Component()->Get_State(STATE::POSITION); - _vector vDir = vDstPos - vSrcPos; - _float vDistance = XMVectorGetX(XMVector3Length(vDir)); - vDir = XMVector4Normalize(vDir); - PSX::PxSweepBufferN<12> pxBuffer = {}; // 쿼리할 갯수를 템플릿 인자로 넣ㅇ름 - _bool bHit = m_pGameInstance->SphereCast(0.5f, vSrcPos, vDir, vDistance, PSX::PxHitFlag::ePOSITION | PSX::PxHitFlag::eNORMAL, PSX::PxQueryFlag::eDYNAMIC, pxBuffer); - - // 가장 가까운 block (있으면) - //if (true == bHit) { - // const PSX::PxSweepHit& hit = pxBuffer.block; - // PSX::PxRigidActor* pActor = hit.actor; - // PSX::PxShape* pShape = hit.shape; - // if (nullptr != pActor && nullptr != pActor->userData) { - // PhsXUserData* pUserData = static_cast(pActor->userData); - // switch (pUserData->eKind) - // { - // case PHYSX_KIND::CCTActor: - // { - // switch (PXOBJECT(pUserData->iSubKind)) - // { - // case PXOBJECT::MONSTER: - // case PXOBJECT::GOBLIN_WARRIOR: - // case PXOBJECT::TROLL: - // { - // ON_COLLISION_INFO Desc; - // pUserData->pOwner->OnCollision(); - // GUI::Text("HitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHit"); - // } break; - // case PXOBJECT::PLAYER: - // GUI::Text("ㅛㄸㄴㅛㄸㄴㅛㄸㄴㅛㄸㄴㅛㄸㄴㅛㄸㄴㅛㄸㄴㅛㄸㄴㅛㄸㄴㅛㄸㄴㅛㄸㄴㅛㄸㄴㅛㄸㄴㅛㄸㄴㅛㄸㄴㅛㄸㄴㅛㄸㄴㅛㄸㄴㅛㄸㄴㅛㄸㄴ"); - // break; - // default: - // break; - // } - // } break; - // default: - // break; - // } - // } - //} - - // 건드린 친구들 순서대로 다 가져옴 ( 정렬은 안되어있음 ) - for (PSX::PxU32 i = 0; i < pxBuffer.nbTouches; ++i) - { - const PSX::PxSweepHit& Hit = pxBuffer.touches[i]; - /* 기타 로직 */ - - PSX::PxRigidActor* pActor = Hit.actor; - PSX::PxShape* pShape = Hit.shape; - - if (nullptr != pActor && nullptr != pActor->userData) { - PhsXUserData* pUserData = static_cast(pActor->userData); - - switch (pUserData->eKind) - { - case PHYSX_KIND::CCTActor: - { - switch (PXOBJECT(pUserData->iSubKind)) - { - case PXOBJECT::MONSTER: - case PXOBJECT::GOBLIN_WARRIOR: - case PXOBJECT::TROLL: - { - ON_COLLISION_INFO Desc; - pUserData->pOwner->OnCollision(); - GUI::Text("HitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHitHit"); - } break; - case PXOBJECT::PLAYER: - GUI::Text("NONONONONONONONONONONONONONONONONONONONONONONONONONONONONONONONONONONONONONONONONONONONONONONO"); - break; - default: - break; - } - } break; - default: - break; - } - } - } - - - //if (nullptr != m_pTargetUnit && false == m_pTargetUnit->isDead()) { - // _vector vStartPos = m_pProjectile->Get_WorldPostion(); - - // _vector vEndPos = m_pTargetUnit->Get_WorldPostion(); - - // _vector vDir = { vEndPos - vStartPos }; - - // _float fDistance = XMVectorGetX(XMVector3Length(vEndPos - vStartPos)); - - // PSX::PxSweepBuffer pxBuffer = {}; - - // _bool bHit = m_pGameInstance->SphereCast(0.1f, vStartPos, vDir, fDistance, PSX::PxHitFlag::ePOSITION | PSX::PxHitFlag::eNORMAL, PSX::PxQueryFlag::eDYNAMIC, pxBuffer); - - // if (bHit) { - // const PSX::PxSweepHit& hit = pxBuffer.block; - // PSX::PxRigidActor* pActor = hit.actor; - // PSX::PxShape* pShape = hit.shape; - - // if (nullptr != pActor && nullptr != pActor->userData) - // { - // PhsXUserData* pUserData = static_cast(pActor->userData); - - // switch (pUserData->eKind) - // { - // case PHYSX_KIND::CCTActor: - // { - // switch (PXOBJECT(pUserData->iSubKind)) - // { - // case PXOBJECT::MONSTER: - // case PXOBJECT::GOBLIN_WARRIOR: - // break; - // case PXOBJECT::TROLL: - // { - // ON_COLLISION_INFO Desc; - // pUserData->pOwner->OnCollision(); - // } - // break; - // } - // } - // } - // } - // } - - //} - Get_PartObject()->Trail_Update(m_pProjectile->Get_Component()->Get_XMWorldMatrix(), fTimeDelta); + __super::Late_Update(fTimeDelta); } -HRESULT CNomalJap::Pre_Setting(CGameObject* pObject) +HRESULT CNomalJap::Pre_Setting(CGameObject* pObject, void* pArg) { - if (FAILED(__super::Pre_Setting(pObject))) + if (FAILED(__super::Pre_Setting(pObject, nullptr))) return E_FAIL; - m_bTrailPulseEnded = false; m_fAccMoveTime = 0.f; + m_fAccRotateTime = 0.f; - /* 초기 객체 위치 초기화 */ + /* 초기 위치 저장 */ _vector vStartPos = m_pOwner->Get_WorldPostion(); XMStoreFloat4(&m_vStartPos, vStartPos); + + /* 초기 객체 위치 초기화 */ + m_pProjectile->Get_Component()->Set_State(STATE::POSITION, vStartPos); m_pProjectile_Side->Get_Component()->Set_State(STATE::POSITION, vStartPos); @@ -283,40 +154,74 @@ HRESULT CNomalJap::Pre_Setting(CGameObject* pObject) Get_PartObject()->Set_Visible(true); Get_PartObject()->Get_Component()->Reset_Trail(); - //나아가는 벡터와 한점을 가져와 수직인 평면상에 하나의 점으로 DIR 을 만듬 - pair<_float3, _float3> pairCameraLook = m_pInfoInstance->Get_CameraCoordinateSystem(); - _vector vDirection = XMVector3Normalize(XMLoadFloat3(&pairCameraLook.first)); - _vector vUp = XMVectorSet(0.f, 1.f, 0.f, 0.f); - XMStoreFloat3(&m_vDirection, vDirection); + _uint iIndex = *static_cast<_uint*>(pArg); - //Get_PartObject("Circle_Particle_Red")->Set_Visible(true); - //Get_PartObject("Circle_Particle_Red")->Get_Component()->Set_WorldMatrix(m_pOwner->Get_Component()->Get_XMWorldMatrix()); - _vector vQuaternion = XMQuaternionRotationAxis(vDirection, m_pGameInstance->Random_Float(0.f, XM_PIDIV2)); + m_fLinearSpeed = m_vJapData[iIndex].x; + m_fAngle = XMConvertToRadians(m_vJapData[iIndex].y); + m_fZigZagSpeed = m_vJapData[iIndex].z; + m_fZigZagAngle = XMConvertToRadians(m_vJapData[iIndex].w); + + + _vector vDirection = m_pOwner->Get_Owner()->Get_Component()->Get_State(STATE::LOOK); + + XMStoreFloat3(&m_vCameraLook, vDirection); + { /* 대상 위치 지정 */ - SAFE_RELEASE(m_pTargetUnit); - m_pTargetUnit = m_pInfoInstance->Get_LockOnUnit(); - if (nullptr != m_pTargetUnit) { - SAFE_ADDREF(m_pTargetUnit); // 타겟이 있다면 타겟 위치로 지정 - XMStoreFloat4(&m_vTargetPos, m_pTargetUnit->Get_WorldPostion()); + + CUnit* pTargetUnit = m_pInfoInstance->Get_LockOnUnit(); + if (nullptr != pTargetUnit) { + + XMStoreFloat4(&m_vTargetPos, pTargetUnit->Get_WorldPostion()); + + if(XMVectorGetX(XMVector3Length(XMLoadFloat4(&m_vTargetPos) - XMLoadFloat4(&m_vStartPos))) >= 35.f) //거리가 일정 이상이라면 그냥 정면으로 발사 + XMStoreFloat4(&m_vTargetPos, vStartPos + vDirection * m_fLinearSpeed * 0.5f); + + XMStoreFloat3(&m_vCameraLook, XMVector3Normalize(XMLoadFloat4(&m_vTargetPos) - XMLoadFloat4(&m_vStartPos))); + + } else { // 타겟이 없다면 현재위치 -> 카메라 룩벡터 * duration간 예상 이동거리 를 대상으로 지정 - XMStoreFloat4(&m_vTargetPos, vStartPos + vDirection * m_pTransformCom->Get_Speed() * m_fDuration); + XMStoreFloat4(&m_vTargetPos, vStartPos + vDirection * m_fLinearSpeed * 0.5f); } } - { /* 대상 거리 계산 */ - _float fDistance = XMVectorGetX(XMVector3Length(XMLoadFloat4(&m_vTargetPos) - XMLoadFloat4(&m_vStartPos))); - m_fLinearSpeed = fDistance / m_fDuration; - // 전체 duration 의 0.3 지점에서 2π 회전하도록 각속도 설정 - _float fTargetRatio = 0.3f; - m_fAngularSpeed = m_pGameInstance->Random_Float(2.f, 2.8f) * XM_2PI / (m_fDuration * fTargetRatio); - } + + /* 대상 거리 계산 */ + + _vector vUp = XMVectorSet(0.f, 1.f, 0.f, 0.f); + _vector vRight = XMVectorSet(1.f, 0.f, 0.f, 0.f); + + + _vector vQuaternion = XMQuaternionRotationAxis(XMLoadFloat3(&m_vCameraLook), m_fAngle); XMStoreFloat3(&m_vRotateUp, XMVector3Normalize(XMVector3Rotate(vUp, vQuaternion))); + vQuaternion = XMQuaternionRotationAxis(XMLoadFloat3(&m_vRotateUp), m_fAngle); + + XMStoreFloat3(&m_vRotateRight, XMVector3Normalize(XMVector3Rotate(vRight, vQuaternion))); + + + /* 내속도를 알고 잇음*/ + + /* 거리 / 속도 = 시간 */ + + _float fDistance = XMVectorGetX(XMVector3Length(XMLoadFloat4(&m_vTargetPos) - XMLoadFloat4(&m_vStartPos))); + + m_fTimeRate = fDistance / m_fLinearSpeed; + + //내가 적에게까지 갈때까지 걸리는 시간을 암 + + //그러므로 내가 0 ~ 파이 까지 러프하는 과정이 그 시간동안 이루어져야 함 + + //그 속도가 파이 / 시간 이므로 이걸 프레임마다 누적함 + + m_fAngularSpeed = XM_2PI / m_fTimeRate; // 프레임마다 누적할 시간 + + m_fAccZigZagTime = 0.f; + return S_OK; } @@ -364,23 +269,28 @@ CGameObject* CNomalJap::Clone(void* pArg, CGameObject* pOwner) void CNomalJap::OnCollision(CGameObject* pOther, void* pDesc) { + int iIndex = CollisionCheck(); + + if (iIndex < 0) + return; + if (m_isCollisionEnter == true) return; m_isCollisionEnter = true; - ON_COLLISION_INFO* CollisionDesc = static_cast(pDesc); + _vector vPos = XMVectorSet(m_Hitbuffer.touches[iIndex].position.x, m_Hitbuffer.touches[iIndex].position.y, m_Hitbuffer.touches[iIndex].position.z, 1.f); + for (auto& pPair : m_PartObjects) { pPair.second->Set_Visible(true); - pPair.second->Get_Component()->Set_State(STATE::POSITION, CollisionDesc->vWorldPos); + pPair.second->Get_Component()->Set_State(STATE::POSITION, vPos); } Get_PartObject("JapPT0")->Get_Component()->LookAt(m_pOwner->Get_WorldPostion()); - SAFE_RELEASE(m_pTargetUnit); m_pProjectile_Side->Set_Visible(false); m_pProjectile->Set_Visible(false); Get_PartObject("Circle_Particle_Red")->Set_Visible(false); @@ -394,7 +304,6 @@ void CNomalJap::Free() { __super::Free(); - SAFE_RELEASE(m_pTargetUnit); Safe_Release(m_pProjectile); Safe_Release(m_pProjectile_Side); @@ -403,7 +312,25 @@ void CNomalJap::Free() void CNomalJap::Describe_Entity() { + GUI::Begin("Jap"); + GUI::InputFloat("Speed", &m_fLinearSpeed); + + if (GUI::InputFloat("Angle", &m_fAngle)) + m_fAngle = XMConvertToRadians(m_fAngle); + + + GUI::InputFloat("ZigTime", &m_fAccZigZagTime); + + GUI::InputFloat("ZigSpeed", &m_fZigZagSpeed); + + GUI::InputFloat("ZigAmount", &m_fZigZagAmount); + + if (GUI::InputFloat("ZigZagAngle", &m_fZigZagAngle)) + m_fZigZagAngle = XMConvertToRadians(m_fZigZagAngle); + + + GUI::End(); } #endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/NomalJapSide.cpp b/Jusin154_Team3D/Client/Private/NomalJapSide.cpp index 5fdcff80c..31f938912 100644 --- a/Jusin154_Team3D/Client/Private/NomalJapSide.cpp +++ b/Jusin154_Team3D/Client/Private/NomalJapSide.cpp @@ -48,7 +48,26 @@ HRESULT CNomalJapSide::Initialize(void* pArg) SAFE_ADDREF(m_pWandTrail); SAFE_ADDREF(m_pWandParticle); - m_fDuration = 1.f; + m_Events.emplace(0.6f, [&]() { + + // 파티클 제어 + m_isParticleEnd = true; + m_pWandParticle->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(0.f, -500.f, 0.f, 1.f)); + + + // 트레일 제어 + CWand* pWand = static_cast(m_pOwner); + + if (pWand == nullptr) + return; + + m_isTrailEnd = true; + + XMStoreFloat4x4(&m_TrailStopMat, pWand->Get_WorldMatrix()); + + }); + + m_fDuration = 2.f; return S_OK; } @@ -76,8 +95,13 @@ void CNomalJapSide::Update(_float fTimeDelta) m_pWandLight->Get_Component()->Set_State(STATE::POSITION, pWand->Get_WorldPostion()); - m_pWandTrail->Get_Component()->Trail_Update(fTimeDelta, pWand->Get_WorldMatrix()); - m_pWandParticle->Get_Component()->Set_WorldMatrix(pWand->Get_WorldMatrix()); + // 파티클생성이 막히면 실행되지 않음 + if (m_isParticleEnd == false) + m_pWandParticle->Get_Component()->Set_WorldMatrix(pWand->Get_WorldMatrix()); + + // 트레일이 종료되면 위치를 고정함 + _matrix TrailMat = m_isTrailEnd ? XMLoadFloat4x4(&m_TrailStopMat) : pWand->Get_WorldMatrix(); + m_pWandTrail->Trail_Update(TrailMat, fTimeDelta); } @@ -91,9 +115,9 @@ void CNomalJapSide::Late_Update(_float fTimeDelta) } -HRESULT CNomalJapSide::Pre_Setting(CGameObject* pObject) +HRESULT CNomalJapSide::Pre_Setting(CGameObject* pObject, void* pArg) { - if (FAILED(__super::Pre_Setting(pObject))) + if (FAILED(__super::Pre_Setting(pObject, nullptr))) return E_FAIL; @@ -103,11 +127,13 @@ HRESULT CNomalJapSide::Pre_Setting(CGameObject* pObject) return E_FAIL; m_pWandParticle->Set_Visible(true); + m_isParticleEnd = false; // 파티클이 일정시간이 되면 나오지 않게 하려고 m_pWandLight->Set_Visible(true); /*트레일 초기화 */ m_pWandTrail->Set_Visible(true); + m_isTrailEnd = false; m_pWandTrail->Get_Component()->Reset_Trail(); /*_vector pPos = pPlayer->Get_WandPos().r[3];*/ diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index 33660074d..572b8de96 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -103,6 +103,9 @@ HRESULT CPlayer::Initialize(void* pArg) m_Batch = make_unique>(m_pContext); #endif // _DEBUG + // UI 연동 추가 + m_pInfoInstance->Add_Event(TEXT("JAP"), [this](void* p) {this->Get_Spell(*reinterpret_cast<_int*>(p)); }); + return S_OK; } @@ -136,7 +139,6 @@ __super::Update(fTimeDelta); m_pCharacter_Controller->Move(fTimeDelta); m_pCallBack_HitReport->Set_CurrentSlop(); } - TestKeyInput(fTimeDelta); } void CPlayer::Late_Update(_float fTimeDelta) diff --git a/Jusin154_Team3D/Client/Private/Player_States.cpp b/Jusin154_Team3D/Client/Private/Player_States.cpp index 8488e6df4..29f11d420 100644 --- a/Jusin154_Team3D/Client/Private/Player_States.cpp +++ b/Jusin154_Team3D/Client/Private/Player_States.cpp @@ -30,38 +30,10 @@ #pragma region States -void CPlayer::TestKeyInput(_float fTimeDelta) +// UI 연동 추가 +void CPlayer::Get_Spell(_int SkillIndex) { - if (m_pGameInstance->Key_Down(DIK_F1)) - { - m_eSpell = STATEANIM::ACCIO; - } - if (m_pGameInstance->Key_Down(DIK_F2)) - { - m_eSpell = STATEANIM::DESCENDO; - } - if (m_pGameInstance->Key_Down(DIK_F3)) - { - m_eSpell = STATEANIM::DEPULSO; - } - if (m_pGameInstance->Key_Down(DIK_F4)) - { - m_eSpell = STATEANIM::DIFFINDO; - } - if (m_pGameInstance->Key_Down(DIK_F5)) - { - m_eSpell = STATEANIM::DISILLUSION_ENTER; - } - if (m_pGameInstance->Key_Down(DIK_F6)) - { - m_eSpell = STATEANIM::DISILLUSION_EXIT; - } - if (m_pGameInstance->Key_Down(DIK_F7)) - { - m_eSpell = STATEANIM::LUMOS; - - m_pEffectPool->Use_Skill(SKILL_TYPE::LUMOS, Get_PartObject()); - } + m_eSpell = SkillIndex; } HRESULT CPlayer::InputAction() @@ -323,7 +295,6 @@ void CPlayer::Behavior_MoveEnter() } else { - m_pFSM->Enable_State(FSMSTATE::JOG); m_bSprintToggle = false; m_bWalkToggle = false; @@ -738,7 +709,7 @@ void CPlayer::Behavior_CombatEnter() if (m_pModelCom->Get_SecondAnimIndex() == m_Animation[STATEANIM::LUMOS].first) { m_pModelCom->Set_Second_AnimationIndex(-1, ENUM_CLASS(BLEND_BONE::SHOULDER_R)); - m_eSpell = STATEANIM::END; + m_eSpell = ENUM_CLASS(SKILL_TYPE::END); } if (m_pGameInstance->Key_Down(DIK_R)) { m_pFSM->Enable_State(FSMSTATE::SKILL); @@ -756,66 +727,48 @@ void CPlayer::Behavior_CombatEnter() m_pFSM->Enable_State(FSMSTATE::LIGHT_ATTACK); pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK]; - Add_Event(pairAnimInfo.first, [this]() { m_pEffectPool->Use_Skill(SKILL_TYPE::JAP, Get_PartObject()); }, 0.1f); + Add_Event(pairAnimInfo.first, [this]() {_uint iIndex = 0; m_pEffectPool->Use_Skill(SKILL_TYPE::JAP, Get_PartObject(), &iIndex); }, 0.1f); Add_Event(pairAnimInfo.first, [this]() { m_pEffectPool->Use_Skill(SKILL_TYPE::JAP_SIDE, Get_PartObject()); }, 0.0f); } else if (SUCCEEDED(InputSpell())) { m_pFSM->Enable_State(FSMSTATE::SPELL); - if (m_eSpell != STATEANIM::END) + if (m_eSpell != ENUM_CLASS(SKILL_TYPE::END)) { + pairAnimInfo = m_Animation[STATEANIM::SPELL]; switch (m_eSpell) { - case STATEANIM::ACCIO: - - pairAnimInfo = m_Animation[STATEANIM::SPELL]; - + case ENUM_CLASS(SKILL_TYPE::BOMBARDA): Add_Event(pairAnimInfo.first, - [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::BOMBARDA_SIDE, Get_PartObject()); }, + [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::BOMBARDA, this); }, + 0.2f); + Add_Event(pairAnimInfo.first, + [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::BOMBARDA_SIDE, Get_PartObject());}, 0.f); break; - - case STATEANIM::DESCENDO: - - pairAnimInfo = m_Animation[STATEANIM::SPELL]; - + case ENUM_CLASS(SKILL_TYPE::DESCENDO): + Add_Event(pairAnimInfo.first, + [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::DESCENDO, Get_PartObject()); }, + 0.2f); Add_Event(pairAnimInfo.first, [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::DESCENDO_SIDE, Get_PartObject()); }, 0.f); - - Add_Event(pairAnimInfo.first, - [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::DESCENDO, this); }, - 0.4f); - break; - case STATEANIM::DEPULSO: - pairAnimInfo = m_Animation[STATEANIM::DEPULSO]; - - + case ENUM_CLASS(SKILL_TYPE::LEVIOSO): Add_Event(pairAnimInfo.first, [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::LEVIOSO, this); }, 0.2f); - Add_Event(pairAnimInfo.first, [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::LEVIOSO_SIDE, Get_PartObject()); }, 0.f); - - m_eSpell = STATEANIM::END; - break; - case STATEANIM::DIFFINDO: + case ENUM_CLASS(SKILL_TYPE::DIFFINDO): pairAnimInfo = m_Animation[STATEANIM::DIFFINDO]; - m_eSpell = STATEANIM::END; break; - case STATEANIM::DISILLUSION_ENTER: + case ENUM_CLASS(SKILL_TYPE::DISILLUSIONMENT): pairAnimInfo = m_Animation[STATEANIM::DISILLUSION_ENTER]; - m_eSpell = STATEANIM::END; break; - case STATEANIM::DISILLUSION_EXIT: - pairAnimInfo = m_Animation[STATEANIM::DISILLUSION_EXIT]; - m_eSpell = STATEANIM::END; - break; - case STATEANIM::LUMOS: + case ENUM_CLASS(SKILL_TYPE::LUMOS): if (m_pModelCom->Get_SecondAnimIndex() != m_Animation[STATEANIM::LUMOS].first) { if (SUCCEEDED(InputMove())) @@ -833,6 +786,9 @@ void CPlayer::Behavior_CombatEnter() else { pairAnimInfo = m_Animation[STATEANIM::IDLE]; } + Add_Event(pairAnimInfo.first, + [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::LUMOS, Get_PartObject()); }, + 0.f); m_pModelCom->Set_Second_AnimationIndex(m_Animation[STATEANIM::LUMOS].first, ENUM_CLASS(BLEND_BONE::SHOULDER_R), true); } else @@ -857,13 +813,13 @@ void CPlayer::Behavior_CombatEnter() } break; default: - pairAnimInfo = m_Animation[STATEANIM::SPELL]; + pairAnimInfo = m_Animation[STATEANIM::SPELL_FAIL]; break; } } else { - pairAnimInfo = m_Animation[STATEANIM::SPELL]; + pairAnimInfo = m_Animation[STATEANIM::SPELL_FAIL]; } } else if (m_pGameInstance->Key_Down(DIK_V)) { @@ -925,10 +881,14 @@ HRESULT CPlayer::Behavior_CombatExitCheck() pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK]; pairAnimInfo.first = iIndex + 1; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + Add_Event(pairAnimInfo.first, [this]() { - m_pEffectPool->Use_Skill(SKILL_TYPE::JAP, this);}, - 0.1f); + _uint iIndex = m_pModelCom->Get_AnimIndex() - m_Animation[STATEANIM::LIGHT_ATTACK].first; + m_pEffectPool->Use_Skill(SKILL_TYPE::JAP, Get_PartObject(), &iIndex); }, + 0.05f); + + Add_Event(pairAnimInfo.first, [this]() { m_pEffectPool->Use_Skill(SKILL_TYPE::JAP_SIDE, Get_PartObject()); }, 0.0f); } } } @@ -983,42 +943,24 @@ HRESULT CPlayer::Behavior_CombatExitCheck() if (m_pFSM->IsEnable(FSMSTATE::SPELL) && IsCurrentKeyFrame("Combat")) { - if (m_eSpell != STATEANIM::END) + if (m_eSpell != ENUM_CLASS(SKILL_TYPE::END)) { switch (m_eSpell) { - case STATEANIM::ACCIO: - { + case ENUM_CLASS(SKILL_TYPE::ACCIO): pairAnimInfo = m_Animation[STATEANIM::ACCIO]; - Add_Event(pairAnimInfo.first, - [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::BOMBARDA, this);}, - 0.15f); - - m_eSpell = STATEANIM::END; - - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); - } break; - case STATEANIM::DESCENDO: - { + case ENUM_CLASS(SKILL_TYPE::DESCENDO): pairAnimInfo = m_Animation[STATEANIM::DESCENDO]; - m_eSpell = STATEANIM::END; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); - } break; - - case STATEANIM::DEPULSO: - { - pairAnimInfo = m_Animation[STATEANIM::DEPULSO]; - - - m_eSpell = STATEANIM::END; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); - } - break; default: + m_eSpell = ENUM_CLASS(SKILL_TYPE::END); + return S_OK; break; } + + m_eSpell = ENUM_CLASS(SKILL_TYPE::END); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } } @@ -1296,11 +1238,11 @@ void CPlayer::Add_FSM() Desc.funcExitEvent = [this]() { Behavior_MoveExit(); }; Desc.funcPriorityUpdate = [this](_float fTimeDelta) { { - /*if (!m_pFSM->IsEnable(FSMSTATE::STOP)) + if (!m_pFSM->IsEnable(FSMSTATE::STOP)) { _float3 fMove = m_pGameInstance->Get_MouseMove(); m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta * fMove.x * 0.05f); - }*/ + } } }; @@ -1482,6 +1424,8 @@ void CPlayer::Set_Anim() m_Animation[STATEANIM::DISILLUSION_EXIT] = { 586,false }; m_Animation[STATEANIM::ANCIENT_THROW] = { 919,false }; + m_Animation[STATEANIM::SPELL_FAIL] = { 906,false }; + m_Animation[STATEANIM::HIT_L] = { 1124,false }; m_Animation[STATEANIM::HIT_R] = { 1125,false }; @@ -1524,6 +1468,8 @@ void CPlayer::Set_Anim() //738 착지 + //906 마법 실패 + } diff --git a/Jusin154_Team3D/Client/Private/Protego.cpp b/Jusin154_Team3D/Client/Private/Protego.cpp index 4d487fd63..e5002ac27 100644 --- a/Jusin154_Team3D/Client/Private/Protego.cpp +++ b/Jusin154_Team3D/Client/Private/Protego.cpp @@ -106,7 +106,7 @@ void CProtego::Late_Update(_float fTimeDelta) } -HRESULT CProtego::Pre_Setting(CGameObject* pObject) +HRESULT CProtego::Pre_Setting(CGameObject* pObject, void* pArg) { if (FAILED(__super::Pre_Setting(pObject))) return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Revelio.cpp b/Jusin154_Team3D/Client/Private/Revelio.cpp index 9cd2df2f4..b8d35c78a 100644 --- a/Jusin154_Team3D/Client/Private/Revelio.cpp +++ b/Jusin154_Team3D/Client/Private/Revelio.cpp @@ -92,7 +92,7 @@ void CRevelio::Late_Update(_float fTimeDelta) } -HRESULT CRevelio::Pre_Setting(CGameObject* pObject) +HRESULT CRevelio::Pre_Setting(CGameObject* pObject, void* pArg) { if (FAILED(__super::Pre_Setting(pObject))) return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Skill_Data.cpp b/Jusin154_Team3D/Client/Private/Skill_Data.cpp index 885b8b7bf..8f086ddcf 100644 --- a/Jusin154_Team3D/Client/Private/Skill_Data.cpp +++ b/Jusin154_Team3D/Client/Private/Skill_Data.cpp @@ -4,8 +4,6 @@ #include "UIObject.h" #include "tinyxml2.h" -; - CSkill_Data::CSkill_Data() { } @@ -13,7 +11,6 @@ CSkill_Data::CSkill_Data() HRESULT CSkill_Data::Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex) { - return S_OK; } @@ -22,14 +19,52 @@ const SPELL_INFO& CSkill_Data::Get_Info(_uint SpellID) const return SpellInfo[SpellID]; } +_int CSkill_Data::Update_Spell(_int SpellID) +{ + if (SpellID < 0 || SpellID > m_iSpell_Count) + return ENUM_CLASS(SKILL_TYPE::END); + + if (SpellInfo[SpellID].bUse_Skill == false) + return -1; + + SpellInfo[SpellID].bUse_Skill = false; + m_iSpell_CoolTime[SpellID] = 0.f; + + return SpellInfo[SpellID].iSkill_Type; +} + void CSkill_Data::Update(_float fTimeDelta) { + for (_int i = 0; i < m_iSpell_Count; ++i) + { + if (SpellInfo[i].bUse_Skill == false) + { + if (m_iSpell_CoolTime[i] <= 1.f) + { + m_iSpell_CoolTime[i] += fTimeDelta * (1.f / SpellInfo[i].fSpell_CoolTime); + } + else + { + SpellInfo[i].bUse_Skill = true; + } + + } + } + } void CSkill_Data::Change_Level() { } +_float CSkill_Data::Get_CoolTime(_int SpellID) +{ + if (SpellID < 0 || SpellID > m_iSpell_Count) + return 0.f; + + return m_iSpell_CoolTime[SpellID]; +} + HRESULT CSkill_Data::Load_SpellInfo(const _char* pFilePath) { tinyxml2::XMLDocument doc; @@ -62,13 +97,16 @@ HRESULT CSkill_Data::Load_SpellInfo(const _char* pFilePath) pSpell->QueryFloatAttribute("Duration", &SpellInfo[id].fDuration); pSpell->QueryIntAttribute("AnimNum", &SpellInfo[id].iAnimNum); SpellInfo[id].pSpellInfo = CMyTools::ToWstring(pSpell->Attribute("SpellInfo")); - int lock = 0, equip = 0; + int lock = 0, equip = 0, use = 0; pSpell->QueryIntAttribute("Spell_Lock", &lock); pSpell->QueryIntAttribute("Equip_Spell", &equip); + pSpell->QueryIntAttribute("Use_Skill", &use); SpellInfo[id].bSpell_Lock = lock != 0; SpellInfo[id].bEquip_Spell = equip != 0; - + SpellInfo[id].bUse_Skill = use != 0; pSpell = pSpell->NextSiblingElement("Spell"); + m_iSpell_Count++; + m_iSpell_CoolTime[id] = 1.2f; } return S_OK; diff --git a/Jusin154_Team3D/Client/Private/Slot_Number.cpp b/Jusin154_Team3D/Client/Private/Slot_Number.cpp index 0e7a0d043..1cfe3c454 100644 --- a/Jusin154_Team3D/Client/Private/Slot_Number.cpp +++ b/Jusin154_Team3D/Client/Private/Slot_Number.cpp @@ -47,7 +47,6 @@ HRESULT CSlot_Number::Initialize(void* pArg) m_pVIBufferCom->Set_Pos(350.f, 10.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); m_pVIBufferCom->Set_ImageUV(pUVDesc); - m_bActive = true; return S_OK; } @@ -102,7 +101,7 @@ void CSlot_Number::Late_Update(_float fTimeDelta) } if (m_bVisible) { - m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); } __super::Late_Update(fTimeDelta); } @@ -113,7 +112,7 @@ HRESULT CSlot_Number::Render() { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ALPHABLEND)))) + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::UVALPHABLEND)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Private/Spell_Anim.cpp b/Jusin154_Team3D/Client/Private/Spell_Anim.cpp index ae831bcc0..5ce3998bf 100644 --- a/Jusin154_Team3D/Client/Private/Spell_Anim.cpp +++ b/Jusin154_Team3D/Client/Private/Spell_Anim.cpp @@ -51,7 +51,6 @@ HRESULT CSpell_Anim::Initialize(void* pArg) static_cast(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SkillType(*reinterpret_cast<_int*>(p)); }); static_cast(m_pOwner)->Add_Function(TEXT("FadeIn"), [this](void* p) {this->Set_FadeIn(); }); static_cast(m_pOwner)->Add_Function(TEXT("FadeOut"), [this](void* p) {this->Set_FadeOut(); }); - m_bActive = true; return S_OK; } @@ -183,6 +182,8 @@ void CSpell_Anim::Set_SkillType(_int eType) m_iCurrentFrame = 0; Change_Image(eType); } + else if (eType == -1) + m_iPerSpell = eType; } HRESULT CSpell_Anim::Bind_ShaderResources() @@ -228,7 +229,7 @@ HRESULT CSpell_Anim::Ready_Components(void* pArg) { return E_FAIL; } - if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Arresto_Momentum"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Accio"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Private/Spell_Canvas.cpp b/Jusin154_Team3D/Client/Private/Spell_Canvas.cpp index c44c70c76..756b5f9af 100644 --- a/Jusin154_Team3D/Client/Private/Spell_Canvas.cpp +++ b/Jusin154_Team3D/Client/Private/Spell_Canvas.cpp @@ -39,6 +39,7 @@ HRESULT CSpell_Canvas::Initialize(void* pArg) { return E_FAIL; } + Visible(false); return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Spell_Drag.cpp b/Jusin154_Team3D/Client/Private/Spell_Drag.cpp new file mode 100644 index 000000000..a010e7c99 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Spell_Drag.cpp @@ -0,0 +1,413 @@ +#include "pch.h" +#include "Spell_Drag.h" +#include "GameInstance.h" +#include "InfoInstance.h" + +CSpell_Drag::CSpell_Drag(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Drag::CSpell_Drag(const CSpell_Drag& rhs) + :CElementObject(rhs), + m_pInfoInstance(CInfoInstance::GetInstance()) + +{ +} + +HRESULT CSpell_Drag::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Drag::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 105.f; + Desc.fSizeY = 105.f; + + m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) }; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + + m_fTimeMult = 3.f; + m_fAlpha = 1.f; + m_fAlphaTime = 1.f; + m_fDelayTime = 0.2f; + m_fSortZ = 0.f; + m_iSkillType = ENUM_CLASS(SKILL_TYPE::ARRESTO_MOMENTUM); + Compute_UI(m_iSkillType); + m_bMove = false; + m_bClick = false; + m_iSpellType = -1; + m_iCurrent_Slot_Index = -1; + static_cast(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SpellType(*reinterpret_cast<_int*>(p)); }); + static_cast(m_pOwner)->Add_Function(TEXT("Current_Hover"), [this](void* p) {this->Set_Current_Slot(*reinterpret_cast<_int*>(p)); }); + return S_OK; +} + +void CSpell_Drag::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Drag::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + + if (m_bFadeIn == true) + { + if (m_fAlpha <= 1.f) + m_fAlpha += fTimeDelta * m_fAlphaTime; + + if (m_fAlpha >= 1.f) + { + m_bFadeIn = false; + m_fAlpha = 1.f; + } + } + + if (m_bFadeOut == true) + { + if (m_fAlpha >= 0.f) + m_fAlpha -= fTimeDelta; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + m_fTime += fTimeDelta * m_fTimeMult; + + if (m_pGameInstance->Mouse_Down(DIM_LBUTTON)) + { + if (m_iSpellType == -1 && m_iCurrent_Slot_Index == -1) + { + m_bFalse = true; + return; + } + + m_vStart_MousePos = XMVectorSet(0.f, 0.f, 0.f, 0.f); + + POINT m_pPt{}; + GetCursorPos(&m_pPt); + ScreenToClient(g_hWnd, &m_pPt); + _float2 fMouse{}; + fMouse.x = m_pPt.x - (g_iWinSizeX * 0.5f); + fMouse.y = m_pPt.y - (g_iWinSizeY * 0.5f); + + m_vStart_MousePos = XMVectorSet(fMouse.x, fMouse.y, 0.f, 1.f); + m_bFalse = false; + } + + if (m_bFalse == false && (m_bHover == true || m_bCurrent_Hover == true)) + { + if (m_pGameInstance->Mouse_Pressing(DIM_LBUTTON)) + { + POINT pt{}; + GetCursorPos(&pt); + ScreenToClient(g_hWnd, &pt); + + float moveX = pt.x - (g_iWinSizeX * 0.5f); + float moveY = pt.y - (g_iWinSizeY * 0.5f); + + m_vMove_MousePos = XMVectorSet(moveX, moveY, 0.f, 1.f); + + _vector Dir = m_vMove_MousePos - m_vStart_MousePos; + _float fLength2 = XMVectorGetX(XMVector2Dot(Dir, Dir)); + + if (fLength2 >= 50.f) + { + m_bMove = true; + } + m_bClick = true; + + } + } + else + { + m_iSpellType = -1; + } + + if (m_bMove == true) + { + MoveX(Get_MousePos().x); + MoveY(Get_MousePos().y); + } + + + if (m_pGameInstance->Mouse_Up(DIM_LBUTTON) && m_bClick == true) + { + m_bHover = false; + m_bClick = false; + m_bCurrent_Hover = false; + m_bMove = false; + m_iSpellType = -1; + } + + static_cast(m_pOwner)->Function_Callback(TEXT("Click"), &m_bClick); + + __super::Update(fTimeDelta); + +} + +void CSpell_Drag::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) { + if (m_bMove == true) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CSpell_Drag::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::SPELL_DRAG)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + + return S_OK; +} + +_vector CSpell_Drag::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CSpell_Drag::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom1->Bind_ShaderResource(m_pShaderCom, "g_Texture1", 0))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom2->Bind_ShaderResource(m_pShaderCom, "g_Texture2", 0))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom3->Bind_ShaderResource(m_pShaderCom, "g_Texture3", 0))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fTime", &m_fTime, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAngle", &m_fAngle, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fImageUV", &m_vUV, sizeof(_float4)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCurrent_Size", &m_vScale, sizeof(_float2)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CSpell_Drag::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_SpellType_Generic"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_SelectedPresetBorder"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_GoldLeaf"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_Atlas_Widget_Spell"), reinterpret_cast(&m_pDiffuse_TextureCom3), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +void CSpell_Drag::Compute_UI(_uint SpellID) +{ + _float2 fImage_Size = { 1024.f, 1792.f }; + + _uint iCountX = 4; + _uint iCountY = 7; + + _float iImageX = 256.f; + _float iImageY = 256.f; + + _uint iframeX = SpellID % iCountX; + _uint iframeY = SpellID / iCountX; + + _float2 UVStart; + UVStart.x = iframeX * iImageX / fImage_Size.x; + UVStart.y = iframeY * iImageY / fImage_Size.y; + + _float2 UVEnd; + UVEnd.x = UVStart.x + (iImageX / fImage_Size.x); + UVEnd.y = UVStart.y + (iImageY / fImage_Size.y); + + _float4 UV = _float4{ UVStart.x, UVStart.y, UVEnd.x, UVEnd.y }; + m_vUV = UV; +} + +void CSpell_Drag::Set_SpellType(_int SpellID) +{ + if (SpellID == -1 || SpellID >= 26) + { + m_iSkillType = -1; + m_bHover = false; + return; + } + m_iSpellType = SpellID; + m_bHover = true; + Compute_UI(m_pInfoInstance->Get_Spell_Info(m_iSpellType).iSkill_Type); +} + +_float2 CSpell_Drag::Get_MousePos() +{ + POINT m_pPt{}; + GetCursorPos(&m_pPt); + ScreenToClient(g_hWnd, &m_pPt); + _float2 fMouse{}; + fMouse.x = m_pPt.x - (g_iWinSizeX * 0.5f); + fMouse.y = m_pPt.y - (g_iWinSizeY * 0.5f); + + m_vMove_MousePos = XMVectorSet(fMouse.x, fMouse.y, 0.f, 1.f); + return fMouse; +} + +void CSpell_Drag::Set_Current_Slot(_uint Index) +{ + if (Index == -1) + { + m_iCurrent_Slot_Index = -1; + m_bCurrent_Hover = false; + return; + } + m_iCurrent_Slot_Index = Index; + m_bCurrent_Hover = true; + Compute_UI(m_pInfoInstance->Get_Spell_Info(m_iCurrent_Slot_Index).iSkill_Type); +} + +CSpell_Drag* CSpell_Drag::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Drag* pInstance = new CSpell_Drag(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Drag"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Drag::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Drag* pInstance = new CSpell_Drag(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Drag"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Drag::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pDiffuse_TextureCom1); + SAFE_RELEASE(m_pDiffuse_TextureCom2); + SAFE_RELEASE(m_pDiffuse_TextureCom3); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpell_Drag::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/Spell_Header.cpp b/Jusin154_Team3D/Client/Private/Spell_Header.cpp index 5625e7645..a7f4526f9 100644 --- a/Jusin154_Team3D/Client/Private/Spell_Header.cpp +++ b/Jusin154_Team3D/Client/Private/Spell_Header.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include "Spell_Header.h" #include "GameInstance.h" +#include "InfoInstance.h" CSpell_Header::CSpell_Header(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CElementObject(pDevice, pContext) @@ -8,7 +9,8 @@ CSpell_Header::CSpell_Header(ID3D11Device* pDevice, ID3D11DeviceContext* pContex } CSpell_Header::CSpell_Header(const CSpell_Header& rhs) - :CElementObject(rhs) + :CElementObject(rhs), + m_pInfoInstance(CInfoInstance::GetInstance()) { } @@ -46,7 +48,6 @@ HRESULT CSpell_Header::Initialize(void* pArg) static_cast(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SkillType(*reinterpret_cast<_int*>(p)); }); static_cast(m_pOwner)->Add_Function(TEXT("FadeIn"), [this](void* p) {this->Set_FadeIn(); }); static_cast(m_pOwner)->Add_Function(TEXT("FadeOut"), [this](void* p) {this->Set_FadeOut(); }); - m_bActive = true; return S_OK; } @@ -93,7 +94,7 @@ void CSpell_Header::Update(_float fTimeDelta) if (m_iSpellType != -1) { - m_iSkillType = static_cast(m_pOwner)->Get_Info(m_iSpellType).iSpell_Type; + m_iSkillType = m_pInfoInstance->Get_Spell_Info(m_iSpellType).iSpell_Type; } m_fTime += fTimeDelta * m_fTimeMult; diff --git a/Jusin154_Team3D/Client/Private/Spell_Header_Line.cpp b/Jusin154_Team3D/Client/Private/Spell_Header_Line.cpp index fc5d96073..1bd1c8aa5 100644 --- a/Jusin154_Team3D/Client/Private/Spell_Header_Line.cpp +++ b/Jusin154_Team3D/Client/Private/Spell_Header_Line.cpp @@ -41,7 +41,6 @@ HRESULT CSpell_Header_Line::Initialize(void* pArg) m_fAlphaTime = 5.f; static_cast(m_pOwner)->Add_Function(TEXT("FadeIn"), [this](void* p) {this->Set_FadeIn(); }); static_cast(m_pOwner)->Add_Function(TEXT("FadeOut"), [this](void* p) {this->Set_FadeOut(); }); - m_bActive = true; return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Spell_Hover.cpp b/Jusin154_Team3D/Client/Private/Spell_Hover.cpp index 3e018dd98..7c18a81e2 100644 --- a/Jusin154_Team3D/Client/Private/Spell_Hover.cpp +++ b/Jusin154_Team3D/Client/Private/Spell_Hover.cpp @@ -47,7 +47,6 @@ HRESULT CSpell_Hover::Initialize(void* pArg) m_pVIBufferCom->Set_Pos(-185.f, 375.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); static_cast(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SkillType(*reinterpret_cast<_int*>(p)); }); - m_bActive = true; return S_OK; } @@ -91,7 +90,10 @@ void CSpell_Hover::Update(_float fTimeDelta) } } - m_pVIBufferCom->Set_Hover_Index(m_iSpellType); + if (m_bClick == false) + { + m_pVIBufferCom->Set_Hover_Index(m_iSpellType); + } m_fTime += fTimeDelta * m_fTimeMult; __super::Update(fTimeDelta); @@ -156,6 +158,18 @@ void CSpell_Hover::SizeUpdate(_float fSizeX, _float fSizeY) m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); } +void CSpell_Hover::Click_Slot(_bool bClick) +{ + if (bClick == true) + { + m_bClick = true; + } + else + { + m_bClick = false; + } +} + HRESULT CSpell_Hover::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) diff --git a/Jusin154_Team3D/Client/Private/Spell_Hover_Effect.cpp b/Jusin154_Team3D/Client/Private/Spell_Hover_Effect.cpp index ab130ff64..0f99b618a 100644 --- a/Jusin154_Team3D/Client/Private/Spell_Hover_Effect.cpp +++ b/Jusin154_Team3D/Client/Private/Spell_Hover_Effect.cpp @@ -48,7 +48,6 @@ HRESULT CSpell_Hover_Effect::Initialize(void* pArg) m_pVIBufferCom->Set_Pos(-185.f, 375.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); static_cast(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SkillType(*reinterpret_cast<_int*>(p)); }); - m_bActive = true; return S_OK; } @@ -91,7 +90,10 @@ void CSpell_Hover_Effect::Update(_float fTimeDelta) m_fAlpha = 0.f; } } - m_pVIBufferCom->Set_Hover_Index(m_iSpellType); + if (m_bClick == false) + { + m_pVIBufferCom->Set_Hover_Index(m_iSpellType); + } m_fTime += fTimeDelta * m_fTimeMult; __super::Update(fTimeDelta); } @@ -155,6 +157,18 @@ void CSpell_Hover_Effect::SizeUpdate(_float fSizeX, _float fSizeY) m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); } +void CSpell_Hover_Effect::Click_Slot(_bool bClick) +{ + if (bClick == true) + { + m_bClick = true; + } + else + { + m_bClick = false; + } +} + HRESULT CSpell_Hover_Effect::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) diff --git a/Jusin154_Team3D/Client/Private/Spell_List.cpp b/Jusin154_Team3D/Client/Private/Spell_List.cpp index 7353cba51..24eaf5441 100644 --- a/Jusin154_Team3D/Client/Private/Spell_List.cpp +++ b/Jusin154_Team3D/Client/Private/Spell_List.cpp @@ -48,9 +48,11 @@ HRESULT CSpell_List::Initialize(void* pArg) m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); m_fDelayTime = 0.5f; m_iPerSpell_Slot = -1; + m_bClick = false; Color(); - m_bActive = true; + static_cast(m_pOwner)->Add_Function(TEXT("Click"), [this](void* p) {this->Click_Slot(*reinterpret_cast<_bool*>(p)); }); return S_OK; + } void CSpell_List::Priority_Update(_float fTimeDelta) @@ -93,7 +95,10 @@ void CSpell_List::Update(_float fTimeDelta) } } m_fTime += fTimeDelta * m_fTimeMult; - Hover(fTimeDelta); + if (m_bClick == false) + { + Hover(); + } __super::Update(fTimeDelta); } @@ -159,16 +164,16 @@ void CSpell_List::SizeUpdate(_float fSizeX, _float fSizeY) void CSpell_List::Color() { - m_pVIBufferCom->Set_Index_Renge_Color(0, 3, _float4(255.f / 255.f, 255.f / 255.f, 0.f / 255.f, 1.f)); - m_pVIBufferCom->Set_Index_Renge_Color(4, 7, _float4(150.f / 255.f, 120.f / 255.f, 240.f / 255.f, 1.f)); - m_pVIBufferCom->Set_Index_Renge_Color(8, 12, _float4(190.f / 255.f, 46.f / 255.f, 34.f / 255.f, 1.f)); - m_pVIBufferCom->Set_Index_Renge_Color(13, 16, _float4(24.f / 255.f, 190.f / 255.f, 255.f / 255.f, 1.f)); - m_pVIBufferCom->Set_Index_Renge_Color(17, 19, _float4(200.f / 255.f, 220.f / 255.f, 150.f / 255.f, 1.f)); - m_pVIBufferCom->Set_Index_Renge_Color(20, 22, _float4(50.f / 255.f, 150.f / 255.f, 110.f / 255.f, 1.f)); - m_pVIBufferCom->Set_Index_Renge_Color(23, 25, _float4(24.f / 255.f, 190.f / 255.f, 255.f / 255.f, 1.f)); + m_pVIBufferCom->Set_Index_Renge_Color(0, 3, 0.f); + m_pVIBufferCom->Set_Index_Renge_Color(4, 7, 1.f); + m_pVIBufferCom->Set_Index_Renge_Color(8, 12, 2.f); + m_pVIBufferCom->Set_Index_Renge_Color(13, 16, 3.f); + m_pVIBufferCom->Set_Index_Renge_Color(17, 19, 4.f); + m_pVIBufferCom->Set_Index_Renge_Color(20, 22, 5.f); + m_pVIBufferCom->Set_Index_Renge_Color(23, 25, 3.f); } -void CSpell_List::Hover(_float fTimeDelta) +void CSpell_List::Hover() { POINT ptMouse{}; GetCursorPos(&ptMouse); @@ -199,6 +204,18 @@ void CSpell_List::Hover(_float fTimeDelta) } +void CSpell_List::Click_Slot(_bool bClick) +{ + if (bClick == true) + { + m_bClick = true; + } + else + { + m_bClick = false; + } +} + HRESULT CSpell_List::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) diff --git a/Jusin154_Team3D/Client/Private/Spell_List_Image.cpp b/Jusin154_Team3D/Client/Private/Spell_List_Image.cpp index 26d8fa5a0..2d03173e0 100644 --- a/Jusin154_Team3D/Client/Private/Spell_List_Image.cpp +++ b/Jusin154_Team3D/Client/Private/Spell_List_Image.cpp @@ -48,7 +48,6 @@ HRESULT CSpell_List_Image::Initialize(void* pArg) m_pVIBufferCom->Set_Pos(-185.f, 375.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); m_pVIBufferCom->Set_ImageUV(pUVDesc); - m_bActive = true; return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp b/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp index d86062901..c054ee7e7 100644 --- a/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp +++ b/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include "Spell_Overlay.h" #include "GameInstance.h" +#include "InfoInstance.h" CSpell_Overlay::CSpell_Overlay(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CElementObject(pDevice, pContext) @@ -8,7 +9,8 @@ CSpell_Overlay::CSpell_Overlay(ID3D11Device* pDevice, ID3D11DeviceContext* pCont } CSpell_Overlay::CSpell_Overlay(const CSpell_Overlay& rhs) - :CElementObject(rhs) + :CElementObject(rhs), + m_pInfoInstance(CInfoInstance::GetInstance()) { } @@ -48,15 +50,16 @@ HRESULT CSpell_Overlay::Initialize(void* pArg) m_vUVScale.y = 1.f; m_fCoolTime = 5.f; m_fSortZ = 0.01f; - m_iSpellType = ENUM_CLASS(SPELLTYPE::CONTROL); - Compute_UI(5); - m_bActive = true; + m_iSlotCount = 4; + m_iCurrent_Slot = 0; + Array_Clear(-1); + Bool_Array_Clear(false); return S_OK; } -void CSpell_Overlay::Compute_UI(_uint SpellID) +_float4 CSpell_Overlay::Compute_UI(_uint SpellID) { - _float2 fImage_Size = { 1024.f, 1536.f}; + _float2 fImage_Size = { 1024.f, 1792.f }; _uint iCountX = 4; _uint iCountY = 6; @@ -75,8 +78,76 @@ void CSpell_Overlay::Compute_UI(_uint SpellID) UVEnd.x = UVStart.x + (iImageX / fImage_Size.x); UVEnd.y = UVStart.y + (iImageY / fImage_Size.y); - _float4 UV = _float4{UVStart.x, UVStart.y, UVEnd.x, UVEnd.y}; - m_vUV = UV; + _float4 UV = _float4{ UVStart.x, UVStart.y, UVEnd.x, UVEnd.y }; + return UV; +} + +void CSpell_Overlay::Array_Clear(_int Value) +{ + for (_int i = 0; i < m_iSlotCount; ++i) + { + m_Spells[i] = Value; + } + for (_int i = 0; i < m_iSlotCount; ++i) + { + m_iSpellType[i] = Value; + } + for (_int i = 0; i < m_iSlotCount; ++i) + { + m_vUV[i] = _float4(_float(Value), _float(Value), _float(Value), _float(Value)); + } +} + +void CSpell_Overlay::Bool_Array_Clear(_bool Bool) +{ + for (_int i = 0; i < m_iSlotCount; ++i) + { + m_bEquipped[i] = Bool; + } + for (_int i = 0; i < m_iSlotCount; ++i) + { + m_bSpellUsed[i] = Bool; + } +} + +void CSpell_Overlay::Spell_Setting(_int SlotIndex, _int SpellIndex) +{ + if (SlotIndex < 0 || SlotIndex > m_iSlotCount) + { + return; + } + + m_Spells[SlotIndex] = SpellIndex; + m_bEquipped[SlotIndex] = true; + m_bSpellUsed[SlotIndex] = m_pInfoInstance->Get_Spell_Info(SpellIndex).bUse_Skill; + m_vUV[SlotIndex] = Compute_UI(SpellIndex); + m_iSpellType[SlotIndex] = m_pInfoInstance->Get_Spell_Info(SpellIndex).iSpell_Type; +} + +void CSpell_Overlay::Use_Spell() +{ + if (m_bEquipped[m_iCurrent_Slot] == true && m_bSpellUsed[m_iCurrent_Slot] == true) + { + m_pInfoInstance->Update_Spell(m_Spells[m_iCurrent_Slot]); + m_pInfoInstance->Event_CallBack(TEXT("JAP"), &m_Spells[m_iCurrent_Slot]); + } +} + + +void CSpell_Overlay::Set_SpellSlot(_int Index) +{ + if (Index < 0) + { + m_iCurrent_Slot = m_iSlotCount - 1; + } + else if (Index >= m_iSlotCount) + { + m_iCurrent_Slot = 0; + } + else + { + m_iCurrent_Slot = Index; + } } void CSpell_Overlay::Priority_Update(_float fTimeDelta) @@ -119,18 +190,17 @@ void CSpell_Overlay::Update(_float fTimeDelta) } } - if (m_vUVScale.y >= 1.f) + for (_int i = 0; i < m_iSlotCount; ++i) { - if (m_pGameInstance->Key_Down(DIK_1)) + if (m_bEquipped[i] == true) { - m_vUVScale.y = 0.f; + m_bSpellUsed[i] = m_pInfoInstance->Get_Spell_Info(m_Spells[i]).bUse_Skill; + m_fCoolTime = m_pInfoInstance->Get_CoolTime(m_Spells[m_iCurrent_Slot]); } } - if (m_vUVScale.y <= 1) - { - m_vUVScale.y += fTimeDelta * (1.f / m_fCoolTime); - } + + m_vUVScale.y = m_fCoolTime; m_fTime += fTimeDelta * m_fTimeMult; __super::Update(fTimeDelta); @@ -144,7 +214,10 @@ void CSpell_Overlay::Late_Update(_float fTimeDelta) return; } if (m_bVisible) { + if (m_bEquipped[m_iCurrent_Slot] == true) + { m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } } __super::Late_Update(fTimeDelta); } @@ -226,7 +299,7 @@ HRESULT CSpell_Overlay::Bind_ShaderResources() { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_iSpellType", &m_iSpellType, sizeof(_int)))) + if (FAILED(m_pShaderCom->Bind_RawValue("g_iSpellType", &m_iSpellType[m_iCurrent_Slot], sizeof(_int)))) { return E_FAIL; } @@ -258,7 +331,7 @@ HRESULT CSpell_Overlay::Bind_ShaderResources() { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_fImageUV", &m_vUV, sizeof(_float4)))) + if (FAILED(m_pShaderCom->Bind_RawValue("g_fImageUV", &m_vUV[m_iCurrent_Slot], sizeof(_float4)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Private/Spell_Panel.cpp b/Jusin154_Team3D/Client/Private/Spell_Panel.cpp index 242fe64c9..c631ef00b 100644 --- a/Jusin154_Team3D/Client/Private/Spell_Panel.cpp +++ b/Jusin154_Team3D/Client/Private/Spell_Panel.cpp @@ -15,6 +15,7 @@ #include "Spell_Header.h" #include "Spell_Header_Line.h" #include "Spell_Anim.h" +#include "Spell_Drag.h" #include "InfoInstance.h" CSpell_Panel::CSpell_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -60,9 +61,11 @@ HRESULT CSpell_Panel::Initialize(void* pArg) m_iPendingSpell = -1; m_fDelayTime = 1.f; m_bActive = true; - Add_Function(TEXT("Hover"), [this](void* p) {this->Slot_Chack(p); }); - + Add_Function(TEXT("Click"), [this](void* p) {this->Click_Slot(*reinterpret_cast<_bool*>(p)); }); + Add_Function(TEXT("Current_Slot_Click"), [this](void* p) {this->Current_Slot_Chack(*reinterpret_cast<_int*>(p)); }); + Visible(true); + ElementAllVisible(true); return S_OK; } @@ -84,7 +87,7 @@ void CSpell_Panel::Update(_float fTimeDelta) if (m_iSpellType != -1) { - m_fHoverTimer += fTimeDelta; + m_fHoverTimer += fTimeDelta; } else { @@ -92,9 +95,9 @@ void CSpell_Panel::Update(_float fTimeDelta) Function_Callback(TEXT("FadeOut")); } - if (m_fHoverTimer >= m_fDelayTime && m_iPendingSpell != m_iSpellType) + if (m_fHoverTimer >= m_fDelayTime) { - m_iPendingSpell = m_iSpellType; + Function_Callback(TEXT("FadeIn")); } @@ -163,6 +166,23 @@ void CSpell_Panel::Slot_Chack(void* pArg) Function_Callback(TEXT("Slot_Hover"), &m_iSpellType); } +void CSpell_Panel::Click_Slot(_bool bClick) +{ + if (bClick == true) + { + m_bHover = true; + } + else + { + m_bHover = false; + } +} + +void CSpell_Panel::Current_Slot_Chack(_int Index) +{ + m_iCurrent_Slot_Index = Index; +} + HRESULT CSpell_Panel::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) @@ -304,6 +324,12 @@ HRESULT CSpell_Panel::Ready_Element(void* pArg) } Add_Element(TEXT("Spell_Anim"), m_pSpell_Anim); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Drag)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Drag"), m_pSpell_Drag); + //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, m_Info, nullptr, reinterpret_cast(&m_pSpell_Data)))) //{ // return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Spell_Preview.cpp b/Jusin154_Team3D/Client/Private/Spell_Preview.cpp index 4ab5944e2..662d64f78 100644 --- a/Jusin154_Team3D/Client/Private/Spell_Preview.cpp +++ b/Jusin154_Team3D/Client/Private/Spell_Preview.cpp @@ -49,7 +49,6 @@ HRESULT CSpell_Preview::Initialize(void* pArg) m_fSortZ = 0.02f; static_cast(m_pOwner)->Add_Function(TEXT("FadeIn"), [this](void* p) {this->Set_FadeIn(); }); static_cast(m_pOwner)->Add_Function(TEXT("FadeOut"), [this](void* p) {this->Set_FadeOut(); }); - m_bActive = true; return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Spell_Slot.cpp b/Jusin154_Team3D/Client/Private/Spell_Slot.cpp index 154832ff0..f020de280 100644 --- a/Jusin154_Team3D/Client/Private/Spell_Slot.cpp +++ b/Jusin154_Team3D/Client/Private/Spell_Slot.cpp @@ -47,7 +47,6 @@ HRESULT CSpell_Slot::Initialize(void* pArg) m_pVIBufferCom->Set_Cloned(true); m_pVIBufferCom->Set_Pos(380.f, -30.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); - m_bActive = true; return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Spell_State.cpp b/Jusin154_Team3D/Client/Private/Spell_State.cpp index 60391a3ed..bcfce9906 100644 --- a/Jusin154_Team3D/Client/Private/Spell_State.cpp +++ b/Jusin154_Team3D/Client/Private/Spell_State.cpp @@ -46,8 +46,7 @@ HRESULT CSpell_State::Initialize(void* pArg) m_pVIBufferCom->Set_Cloned(true); m_pVIBufferCom->Set_Pos(-185.f, 375.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); - m_bActive = true; - + static_cast(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SkillType(*reinterpret_cast<_int*>(p)); }); return S_OK; } @@ -90,8 +89,13 @@ void CSpell_State::Update(_float fTimeDelta) m_fAlpha = 0.f; } } + m_fTime += fTimeDelta * m_fTimeMult; - Hover(); + if (m_bClick == false) + { + m_pVIBufferCom->Set_Hover_Index(m_iSpellType); + } + __super::Update(fTimeDelta); } @@ -154,21 +158,16 @@ void CSpell_State::SizeUpdate(_float fSizeX, _float fSizeY) m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); } -void CSpell_State::Hover() +void CSpell_State::Click_Slot(_bool bClick) { - POINT ptMouse{}; - GetCursorPos(&ptMouse); - ScreenToClient(g_hWnd, &ptMouse); - _float2 fMouse; - fMouse.x = ptMouse.x - (g_iWinSizeX * 0.5f); - fMouse.y = -(ptMouse.y - (g_iWinSizeY * 0.5f)); - - // 엘리먼트의 월드 위치를 더해주면 엘리먼트 좌표계 기준이 됨 - fMouse.x -= m_pOwner->Get_WorldPostion().m128_f32[0]; - fMouse.y -= m_pOwner->Get_WorldPostion().m128_f32[1]; - - m_pVIBufferCom->Set_Mouse_Hover(fMouse); - + if (bClick == true) + { + m_bClick = true; + } + else + { + m_bClick = false; + } } HRESULT CSpell_State::Bind_ShaderResources() diff --git a/Jusin154_Team3D/Client/Private/Spell_UI.cpp b/Jusin154_Team3D/Client/Private/Spell_UI.cpp index 43c6c45ce..fecb52a8c 100644 --- a/Jusin154_Team3D/Client/Private/Spell_UI.cpp +++ b/Jusin154_Team3D/Client/Private/Spell_UI.cpp @@ -45,7 +45,6 @@ HRESULT CSpell_UI::Initialize(void* pArg) //m_vImageUV[2] = Image_UV(1); //m_vImageUV[3] = Alphabet_UV('T'); Set_ImagePos(); - m_bActive = true; return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Spell_Vidio_Border.cpp b/Jusin154_Team3D/Client/Private/Spell_Vidio_Border.cpp index 0f2cd9760..be702f1fb 100644 --- a/Jusin154_Team3D/Client/Private/Spell_Vidio_Border.cpp +++ b/Jusin154_Team3D/Client/Private/Spell_Vidio_Border.cpp @@ -1,7 +1,6 @@ #include "pch.h" #include "Spell_Vidio_Border.h" #include "GameInstance.h" -#include "Spell_Anim.h" CSpell_Vidio_Border::CSpell_Vidio_Border(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CElementObject(pDevice, pContext) @@ -48,8 +47,6 @@ HRESULT CSpell_Vidio_Border::Initialize(void* pArg) static_cast(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SkillType(*reinterpret_cast<_int*>(p)); }); static_cast(m_pOwner)->Add_Function(TEXT("FadeIn"), [this](void* p) {this->Set_FadeIn(); }); static_cast(m_pOwner)->Add_Function(TEXT("FadeOut"), [this](void* p) {this->Set_FadeOut(); }); - m_bActive = true; - return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/State_Blink.cpp b/Jusin154_Team3D/Client/Private/State_Blink.cpp new file mode 100644 index 000000000..a0e5e4522 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Blink.cpp @@ -0,0 +1,64 @@ +#include "pch.h" +#include "State_Blink.h" +#include "Unit.h" + + +CState_Blink::CState_Blink() + :CState_Root() +{ +} + +void CState_Blink::Enter() +{ + __super::Enter(); +} + +HRESULT CState_Blink::Update(_float fTimeDelta) +{ + if (nullptr != m_funcPriorityUpdate) { + m_funcPriorityUpdate(fTimeDelta); + } + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + if (nullptr != m_funcLateUpdate) { + m_funcLateUpdate(fTimeDelta); + } + return S_OK; +} + +void CState_Blink::Exit() +{ + __super::Exit(); +} + +HRESULT CState_Blink::Initialize(STATE_BLINK_DESC* pDesc) +{ + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_funcPriorityUpdate = pDesc->funcPriorityUpdate; + m_funcLateUpdate = pDesc->funcLateUpdate; + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + + return S_OK; +} + +CState_Blink* CState_Blink::Create(STATE_BLINK_DESC* pDesc) +{ + CState_Blink* pInstance = new CState_Blink; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CState_Blink::Free() +{ + __super::Free(); +} + +void CState_Blink::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Swing.cpp b/Jusin154_Team3D/Client/Private/State_Swing.cpp new file mode 100644 index 000000000..a3d45b12d --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Swing.cpp @@ -0,0 +1,64 @@ +#include "pch.h" +#include "State_Swing.h" +#include "Unit.h" + + +CState_Swing::CState_Swing() + :CState_Root() +{ +} + +void CState_Swing::Enter() +{ + __super::Enter(); +} + +HRESULT CState_Swing::Update(_float fTimeDelta) +{ + if (nullptr != m_funcPriorityUpdate) { + m_funcPriorityUpdate(fTimeDelta); + } + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + if (nullptr != m_funcLateUpdate) { + m_funcLateUpdate(fTimeDelta); + } + return S_OK; +} + +void CState_Swing::Exit() +{ + __super::Exit(); +} + +HRESULT CState_Swing::Initialize(STATE_SWING_DESC* pDesc) +{ + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_funcPriorityUpdate = pDesc->funcPriorityUpdate; + m_funcLateUpdate = pDesc->funcLateUpdate; + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + + return S_OK; +} + +CState_Swing* CState_Swing::Create(STATE_SWING_DESC* pDesc) +{ + CState_Swing* pInstance = new CState_Swing; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CState_Swing::Free() +{ + __super::Free(); +} + +void CState_Swing::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/Terrain.cpp b/Jusin154_Team3D/Client/Private/Terrain.cpp index 648f5723d..f4391d732 100644 --- a/Jusin154_Team3D/Client/Private/Terrain.cpp +++ b/Jusin154_Team3D/Client/Private/Terrain.cpp @@ -57,7 +57,11 @@ void CTerrain::Priority_Update(_float fTimeDelta) void CTerrain::Update(_float fTimeDelta) { +#ifdef _DEBUG Describe_Entity(); +#endif // _DEBUG + + } void CTerrain::Late_Update(_float fTimeDelta) diff --git a/Jusin154_Team3D/Client/Private/Troll.cpp b/Jusin154_Team3D/Client/Private/Troll.cpp index b41700ae4..e80fa33e2 100644 --- a/Jusin154_Team3D/Client/Private/Troll.cpp +++ b/Jusin154_Team3D/Client/Private/Troll.cpp @@ -4,6 +4,7 @@ #include "Troll_Weapon.h" #include "Troll_Rock.h" #include "GameInstance.h" +#include "Effect_Container.h" #pragma region STATE #include "State_Idle.h" @@ -122,6 +123,18 @@ void CTroll::Late_Update(_float fTimeDelta) } + _vector vDir = XMLoadFloat4(&m_vTargetPos) - Get_WorldPostion(); + vDir = XMVector4Normalize(vDir); + _vector vLook = XMVector3Normalize( + XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f)); + float dot = XMVectorGetX(XMVector3Dot(vLook, vDir)); + dot = max(-1.f, min(1.f, dot)); + + float angle = acosf(dot); + m_fDegree = XMConvertToDegrees(angle); + + m_fCross = XMVectorGetY(XMVector3Cross(vLook, vDir)); + m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); } @@ -183,8 +196,19 @@ void CTroll::OnCollision(CGameObject* pOther, void* pDesc) _vector vHitDir = {}; // 시도한 move 방향 _float fLength = {}; // 작용된 힘 - //m_pCharacter_Controller->ConvertToDO(*m_pRigidBody); - //m_pRigidBody->Add_Force(vHitDir * fLength * 100.f, PSX::PxForceMode::eIMPULSE); + _uint iSkillType = dynamic_cast(pOther)->Get_SkillType(); + switch (iSkillType) + { + case ENUM_CLASS(SKILL_TYPE::DESCENDO): + m_eHitSpell = STATEANIM::KNOCKDOWN_FWD; + break; + case ENUM_CLASS(SKILL_TYPE::FLIPENDO): + m_eHitSpell = STATEANIM::TUMBLE2; + break; + default: + m_eHitSpell = STATEANIM::KNOCKDOWN_FWD; + break; + } m_pFSM->Change_State(FSMSTATE::HIT); } diff --git a/Jusin154_Team3D/Client/Private/Troll_Rock.cpp b/Jusin154_Team3D/Client/Private/Troll_Rock.cpp index 8e7420d53..f7d2bc363 100644 --- a/Jusin154_Team3D/Client/Private/Troll_Rock.cpp +++ b/Jusin154_Team3D/Client/Private/Troll_Rock.cpp @@ -38,7 +38,6 @@ HRESULT CTroll_Rock::Initialize(void* pArg) void CTroll_Rock::Priority_Update(_float fTimeDelta) { - m_pModelCom->Combined_BoneMatrix(); if (m_bAttach) { @@ -58,6 +57,8 @@ void CTroll_Rock::Priority_Update(_float fTimeDelta) { _matrix world = XMLoadFloat4x4(m_pTransformCom->Get_WorldMatrixPtr()); m_pTransformCom->Set_WorldMatrix(world); + + m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::LOOK), fTimeDelta * 20.f); m_pTransformCom->Go_Straight(fTimeDelta); } diff --git a/Jusin154_Team3D/Client/Private/Troll_States.cpp b/Jusin154_Team3D/Client/Private/Troll_States.cpp index 1a58524ef..855689cd0 100644 --- a/Jusin154_Team3D/Client/Private/Troll_States.cpp +++ b/Jusin154_Team3D/Client/Private/Troll_States.cpp @@ -12,6 +12,7 @@ #include "State_Hit.h" #include "Troll_State_Rush.h" #include "State_Throw.h" +#include "State_Swing.h" #pragma endregion @@ -25,7 +26,7 @@ void CTroll::Behavior_IdleEnter() HRESULT CTroll::Behavior_IdleExitCheck() { - if (m_fTargetDistance <= 20.f) + if (m_fTargetDistance <= 25.f && m_fTargetDistance !=0) m_pFSM->Change_State(FSMSTATE::MOVE); return E_FAIL; @@ -50,7 +51,7 @@ void CTroll::Behavior_MoveEnter() m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } -HRESULT CTroll::Behavior_MoveExitCheck() +HRESULT CTroll::Behavior_MoveExitCheck(_float fTimeDelta) { pair<_uint, _bool> pairAnimInfo = {}; _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); @@ -63,7 +64,7 @@ HRESULT CTroll::Behavior_MoveExitCheck() } } - if (m_fTargetDistance <= 18.f && m_fTargetDistance !=0.f) + if (m_fTargetDistance <= 20.f && m_fTargetDistance !=0.f) m_pFSM->Change_State(FSMSTATE::COMBAT); return E_FAIL; @@ -82,21 +83,16 @@ void CTroll::Behavior_CombatEnter() m_bLookAt = true; if (m_fTargetDistance <= 12.f && m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SLAM)] <= 0.f) { - m_pFSM->Enable_State(FSMSTATE::SKILL); - pairAnimInfo = m_Animation[STATEANIM::SKILL]; - m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SLAM)] = m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SLAM)]; + m_pFSM->Enable_State(FSMSTATE::SLAM); } else if (m_fTargetDistance <= 12.f && m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::BACKHAND_SWING)] <= 0.f) { m_pFSM->Enable_State(FSMSTATE::BACKHAND_SWING); - pairAnimInfo = m_Animation[STATEANIM::BACKHAND_SWING_JOG]; - m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::BACKHAND_SWING)] = m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::BACKHAND_SWING)]; } else if (m_fTargetDistance <= 12.f && m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SWING)] <= 0.f) { - m_pFSM->Enable_State(FSMSTATE::SWING); - pairAnimInfo = m_Animation[STATEANIM::SWING_FWD]; - m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SWING)] = m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SWING)]; + m_pFSM->Change_State(FSMSTATE::SWING); + return; } else if (m_fTargetDistance <= 15.f && m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::THROWROCK)] <= 0.f) { @@ -127,9 +123,9 @@ void CTroll::Behavior_CombatEnter() pairAnimInfo = m_Animation[STATEANIM::IDLE_BREAK4]; break; } + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); } - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second,1.f,true); } HRESULT CTroll::Behavior_CombatExitCheck(_float fTimeDelta) @@ -137,39 +133,82 @@ HRESULT CTroll::Behavior_CombatExitCheck(_float fTimeDelta) pair<_uint, _bool> pairAnimInfo = {}; _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); - if (m_pFSM->IsEnable(FSMSTATE::SKILL)) + if (m_pFSM->IsEnable(FSMSTATE::SLAM)) { - m_pFSM->Disable_State(FSMSTATE::SKILL); - pairAnimInfo = m_Animation[STATEANIM::SKILL]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); - m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SLAM)] = m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SLAM)]; - Add_Event(pairAnimInfo.first, - [this]() {m_bLookAt = false; }, - 0.2f); + if (m_fTargetDistance > 5.f) + { + if (m_fDegree >= 90.f && iCurrAnimIndex != m_Animation[STATEANIM::JOG_FWD].first) + { + if (m_fCross > 0) { + pairAnimInfo = m_Animation[STATEANIM::JOG_LEFT_TURN]; + } + else { + pairAnimInfo = m_Animation[STATEANIM::JOG_RIGHT_TURN]; + } + } + else { + pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; + } + + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + } + else + { + pairAnimInfo = m_Animation[STATEANIM::SLAM]; + + if (iCurrAnimIndex != pairAnimInfo.first) + { + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SLAM)] =m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SLAM)]; + + Add_Event(pairAnimInfo.first, + [this]() { m_bLookAt = false;}, + 0.2f); + + m_pFSM->Disable_State(FSMSTATE::SLAM); + } + } + return S_OK; } - if (m_pFSM->IsEnable(FSMSTATE::SWING)) - { - m_pFSM->Disable_State(FSMSTATE::SWING); - pairAnimInfo = m_Animation[STATEANIM::SWING_FWD]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); - m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SWING)] = m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SWING)]; - Add_Event(pairAnimInfo.first, - [this]() {m_bLookAt = false; }, - 0.2f); - return S_OK; - } if (m_pFSM->IsEnable(FSMSTATE::BACKHAND_SWING)) { - m_pFSM->Disable_State(FSMSTATE::BACKHAND_SWING); - pairAnimInfo = m_Animation[STATEANIM::BACKHAND_SWING_JOG]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); - m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::BACKHAND_SWING)] = m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::BACKHAND_SWING)]; - Add_Event(pairAnimInfo.first, - [this]() {m_bLookAt = false; }, - 0.2f); + if (m_fTargetDistance > 5.f) + { + if (m_fDegree >= 90.f && iCurrAnimIndex != m_Animation[STATEANIM::JOG_FWD].first) + { + if (m_fCross > 0) { + pairAnimInfo = m_Animation[STATEANIM::JOG_LEFT_TURN]; + } + else { + pairAnimInfo = m_Animation[STATEANIM::JOG_RIGHT_TURN]; + } + } + else { + pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; + } + + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + } + else + { + pairAnimInfo = m_Animation[STATEANIM::BACKHAND_SWING_JOG]; + + if (iCurrAnimIndex != pairAnimInfo.first) + { + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::BACKHAND_SWING)] = m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::BACKHAND_SWING)]; + + Add_Event(pairAnimInfo.first, + [this]() { m_bLookAt = false; }, + 0.2f); + + m_pFSM->Disable_State(FSMSTATE::BACKHAND_SWING); + } + } + return S_OK; } @@ -185,7 +224,7 @@ HRESULT CTroll::Behavior_CombatExitCheck(_float fTimeDelta) void CTroll::Behavior_CombatExit() { - m_pFSM->Disable_State(FSMSTATE::COMBAT | FSMSTATE::SKILL | FSMSTATE::SKILL2 |FSMSTATE::SWING |FSMSTATE::BACKHAND_SWING); + m_pFSM->Disable_State(FSMSTATE::COMBAT | FSMSTATE::SLAM | FSMSTATE::BACKHAND_SWING); } void CTroll::Behavior_RushEnter() @@ -209,7 +248,8 @@ HRESULT CTroll::Behavior_RushExitCheck(_float fTimeDelta) { m_bLookAt = false; pairAnimInfo = m_Animation[STATEANIM::RUSH_LOOP]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second,1.f,true); + m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::RUSH)] = m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::RUSH)]; } } else { @@ -221,7 +261,6 @@ HRESULT CTroll::Behavior_RushExitCheck(_float fTimeDelta) m_pFSM->Disable_State(FSMSTATE::RUSH); pairAnimInfo = m_Animation[STATEANIM::RUSH_END]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); - m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::RUSH)] = m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::RUSH)]; } } return S_OK; @@ -282,8 +321,6 @@ HRESULT CTroll::Behavior_ThrowExitCheck(_float fTimeDelta) if (m_pModelCom->IsFinishedAnim()) { m_bLookAt = true; - Get_PartObject()->Set_Attach(true); - Get_PartObject()->Set_Visible(false); m_pFSM->Change_State(FSMSTATE::IDLE); } return E_FAIL; @@ -292,6 +329,34 @@ HRESULT CTroll::Behavior_ThrowExitCheck(_float fTimeDelta) void CTroll::Behavior_ThrowExit() { m_pFSM->Disable_State(FSMSTATE::THROW_ROCK); + Get_PartObject()->Set_Attach(true); + Get_PartObject()->Set_Visible(false); +} + +void CTroll::Behavior_SwingEnter() +{ + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::SWING); + pairAnimInfo = m_Animation[STATEANIM::SWING_FWD]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + Add_Event(pairAnimInfo.first, + [this]() {m_bLookAt = false; }, + 0.2f); +} + +HRESULT CTroll::Behavior_SwingExitCheck(_float fTimeDelta) +{ + if (m_pModelCom->IsFinishedAnim()) + { + m_bLookAt = true; + m_pFSM->Change_State(FSMSTATE::IDLE); + } + return E_FAIL; +} + +void CTroll::Behavior_SwingExit() +{ + m_pFSM->Disable_State(FSMSTATE::SWING); } void CTroll::Behavior_HitEnter() @@ -300,7 +365,8 @@ void CTroll::Behavior_HitEnter() _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); pair<_uint, _bool> pairAnimInfo; - if (iCurrAnimIndex == m_Animation[STATEANIM::SKILL].first) + m_bLookAt = true; + if (iCurrAnimIndex == m_Animation[STATEANIM::SLAM].first) { pairAnimInfo = m_Animation[STATEANIM::HIT_FACE]; } @@ -366,12 +432,9 @@ void CTroll::Add_FSM() CState_Move::STATE_MOVE_DESC Desc{}; Desc.pOwner = this; Desc.funcEnterEvent = [this]() { Behavior_MoveEnter(); }; - Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(fTimedelta); }; Desc.funcExitEvent = [this]() { Behavior_MoveExit(); }; - Desc.funcPriorityUpdate = [this](_float fTimeDelta) { - if (m_pGameInstance->Key_Pressing(DIK_A)) { m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); } - if (m_pGameInstance->Key_Pressing(DIK_D)) { m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); }; - }; + Desc.funcPriorityUpdate = nullptr; Desc.funcLateUpdate = nullptr; m_States.emplace(FSMSTATE::MOVE, CState_Move::Create(&Desc)); } @@ -409,6 +472,17 @@ void CTroll::Add_FSM() Desc.funcLateUpdate = nullptr; m_States.emplace(FSMSTATE::THROW_ROCK, CState_Throw::Create(&Desc)); } + + { + CState_Swing::STATE_SWING_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_SwingEnter(); }; + Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_SwingExitCheck(fTimeDelta); }; + Desc.funcExitEvent = [this]() { Behavior_SwingExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::SWING, CState_Swing::Create(&Desc)); + } #pragma endregion #pragma region Behavior_Hit @@ -439,13 +513,15 @@ void CTroll::Set_Anim() m_Animation[STATEANIM::WALK_FWD] = { 22,true }; m_Animation[STATEANIM::JOG_START] = { 104,false }; + m_Animation[STATEANIM::JOG_LEFT_TURN] = { 108,false }; + m_Animation[STATEANIM::JOG_RIGHT_TURN] = { 112,false }; m_Animation[STATEANIM::JOG_FWD] = { 103,true }; m_Animation[STATEANIM::DODGE_LEFT] = { 125, false }; m_Animation[STATEANIM::DODGE_RIGHT] = { 126, false }; m_Animation[STATEANIM::SPRINT] = { 90, true }; - m_Animation[STATEANIM::SKILL] = { 66,false }; // 도끼 찍기 + m_Animation[STATEANIM::SLAM] = { 66,false }; // 도끼 찍기 m_Animation[STATEANIM::SKILL2] = { 70,false }; m_Animation[STATEANIM::THROW_ROCK_START] = { 77,false }; @@ -472,4 +548,8 @@ void CTroll::Set_Anim() m_Animation[STATEANIM::KNOCKDOWN_BWD] = { 165, false }; // + //왼턴 108 + //오른턴 112 + + } diff --git a/Jusin154_Team3D/Client/Public/Action_Panel.h b/Jusin154_Team3D/Client/Public/Action_Panel.h index 60fff67e2..83f93ed83 100644 --- a/Jusin154_Team3D/Client/Public/Action_Panel.h +++ b/Jusin154_Team3D/Client/Public/Action_Panel.h @@ -11,6 +11,12 @@ NS_BEGIN(Client) class CAction_Panel final : public CPanelObject { + typedef struct Get_Skill_Info + { + _int iSlotIndexX{}; + _int iSlotIndexY{}; + _int iSpellIndex{}; + }GETSKILLINFO; private: CAction_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CAction_Panel(const CAction_Panel& rhs); @@ -27,6 +33,9 @@ class CAction_Panel final : public CPanelObject void Magic_Meter_Visible(_uint iIndex, _bool bVisible); void Magic_Meter_UV(); void Matic_Meter_Move(); + + void Use_Spell(_int Index); + void Spell_Setting(void* pArg); private: virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; @@ -35,6 +44,8 @@ class CAction_Panel final : public CPanelObject virtual HRESULT Initialize(void* pArg) override; private: + CInfoInstance* m_pInfoInstance = { nullptr }; + CTexture* m_pDiffuse_TextureCom = { nullptr }; CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; @@ -43,7 +54,10 @@ class CAction_Panel final : public CPanelObject _uint m_iMagic_Meter_Count{}; CGameObject* m_pSpell_Slot = { nullptr }; - CGameObject* m_pSpell_Overlay = { nullptr }; + CGameObject* m_pSpell_Overlay1 = { nullptr }; + CGameObject* m_pSpell_Overlay2 = { nullptr }; + CGameObject* m_pSpell_Overlay3 = { nullptr }; + CGameObject* m_pSpell_Overlay4 = { nullptr }; CGameObject* m_pSlot_Number = { nullptr }; CGameObject* m_pHpBarBG = { nullptr }; CGameObject* m_pMagic_Meter1 = { nullptr }; diff --git a/Jusin154_Team3D/Client/Public/Bombard.h b/Jusin154_Team3D/Client/Public/Bombard.h index 6eb00c959..972a1e5ac 100644 --- a/Jusin154_Team3D/Client/Public/Bombard.h +++ b/Jusin154_Team3D/Client/Public/Bombard.h @@ -21,7 +21,7 @@ class CBombard final : public CEffect_Container virtual void Late_Update(_float fTimeDelta) override; public: - virtual HRESULT Pre_Setting(CGameObject* pObject) override; + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; private: virtual HRESULT Initialize_Prototype() override; diff --git a/Jusin154_Team3D/Client/Public/BombardSide.h b/Jusin154_Team3D/Client/Public/BombardSide.h index 7a6d1eae7..5268488f5 100644 --- a/Jusin154_Team3D/Client/Public/BombardSide.h +++ b/Jusin154_Team3D/Client/Public/BombardSide.h @@ -21,7 +21,7 @@ class CBombardSide final : public CEffect_Container virtual void Late_Update(_float fTimeDelta) override; public: - virtual HRESULT Pre_Setting(CGameObject* pObject) override; + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; private: virtual HRESULT Initialize_Prototype() override; @@ -33,6 +33,10 @@ class CBombardSide final : public CEffect_Container private: _wstring m_wstrEffectName = {}; + _bool m_isParticleEnd = {}; + _bool m_isTrailEnd = {}; + _float4x4 m_TrailStopMat = {}; + class CEffectParts* m_pWandLight = { nullptr }; class CTrailObject* m_pWandTrail = { nullptr }; class CEffectParts* m_pWandParticle = { nullptr }; diff --git a/Jusin154_Team3D/Client/Public/Client_Enum.h b/Jusin154_Team3D/Client/Public/Client_Enum.h index e44d69abe..1b7e7cd38 100644 --- a/Jusin154_Team3D/Client/Public/Client_Enum.h +++ b/Jusin154_Team3D/Client/Public/Client_Enum.h @@ -12,28 +12,31 @@ namespace Client enum class SHADER_PASS_PARTICLE { EXPLOSION, END }; enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, TRAIL_BLEND, TRAILWB_FOR_BLEND, TRAIL_BLUR, TRAIL_BLOOM, END }; enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, NON_WORLD_BLUR, BLEND, BLEND_NOWORLD, BLOOM, BLOOM_NOWORLD, BLUR_NO_EMMISVE, BLUR_NO_WORLD_NO_EMISSIVE, WEIGHTBLEND_FOR_BLEND, END }; - enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, TYPE, HPBAR, MAGIC_METER, MAGIC_ICON, REMOVEUV, REVELIO, POTION, MAGIC_ITEM, SPELL_PREVIEW, SPELL_HEADER, SPELL_HEADER_LINE, END }; - enum class SHADER_PASS_UIINTANCE { DEFAULT, ALPHABLEND, MAGIC_METER, SPELL_LIST, EESSENTIAL_SPELL_SOLT, EESSENTIAL_SPELL, COLOR, SPELL_HOVER, SPELL_SLOT_EFFECT, END }; + enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, TYPE, HPBAR, MAGIC_METER, MAGIC_ICON, REMOVEUV, REVELIO, POTION, MAGIC_ITEM, SPELL_PREVIEW, SPELL_HEADER, SPELL_HEADER_LINE, SPELL_DRAG, END }; + enum class SHADER_PASS_UIINTANCE { DEFAULT, ALPHABLEND, UVALPHABLEND, MAGIC_METER, SPELL_LIST, EESSENTIAL_SPELL_SOLT, EESSENTIAL_SPELL, COLOR, SPELL_HOVER, SPELL_SLOT_EFFECT, SPELL_SLOT, END }; enum class EFFECT_TYPE { EFFECT, TRAIL, END }; - enum class SKILL_TYPE { - ARESTO_MOMENTUM, GLACIUS, LEVIOSO, TRANSFORM, ASSIO, - DEPULSO, DESCENDO, FLIPENDO, CONFRINGO, DIFFINDO, EXPELLIARMUS, - BOMBARDA, INCENDIO, DISILLUSIONMENT, LUMOS, REPARO, WINGARDIUM_LEVIOSA, - CONJURING_SPELL, ALTERING_SPELL, EVANESCO, AVADA_KEDAVRA, CRUCIO, IMPERIO, - BEAST_PETTING_BRUSH, BEAST_FEED, NAB_SACK, JAP, REVELIO, PROTEGO, STUPEFY, + enum class SKILL_TYPE { + ARRESTO_MOMENTUM, GLACIUS, LEVIOSO, TRANSFORM, // 노란색 + ACCIO, DEPULSO, DESCENDO, FLIPENDO, // 보라색 + CONFRINGO, DIFFINDO, EXPELLIARMUS, BOMBARDA, INCENDIO, // 빨간색 + DISILLUSIONMENT, LUMOS, REPARO, WINGARDIUM_LEVIOSA, // 하늘색 + CONJURING_SPELL, ALTERING_SPELL, EVANESCO, // 연녹색 + AVADA_KEDAVRA, CRUCIO, IMPERIO, // 진녹색 + BEAST_PETTING_BRUSH, BEAST_FEED, NAB_SACK, // 하늘색 + JAP, REVELIO, PROTEGO, STUPEFY, // 검은색 ANCIENT_MAGIC_THROW, ANCIENT_MAGIC, ALOHOMORA, PETRIFICUS_TOTALUS, - JAP_SIDE, BOMBARDA_SIDE , DESCENDO_SIDE , LEVIOSO_SIDE - ,END + JAP_SIDE, BOMBARDA_SIDE, DESCENDO_SIDE, LEVIOSO_SIDE, END }; + enum class BLOOM_TYPE { NONE, BASIC, MULTIPLY, END }; enum class KEYINPUT { - INPUT_1, INPUT_2, INPUT_3, INPUT_4, - INPUT_T, + INPUT_1 = 1, INPUT_2, INPUT_3, INPUT_4, + INPUT_T, INPUT_G, INPUT_TAB, END }; diff --git a/Jusin154_Team3D/Client/Public/Client_Struct.h b/Jusin154_Team3D/Client/Public/Client_Struct.h index f865b6be1..3c87189db 100644 --- a/Jusin154_Team3D/Client/Public/Client_Struct.h +++ b/Jusin154_Team3D/Client/Public/Client_Struct.h @@ -29,5 +29,6 @@ namespace Client _wstring pSpellInfo; _bool bSpell_Lock = false; _bool bEquip_Spell = false; + _bool bUse_Skill = false; }SPELL_INFO; }; diff --git a/Jusin154_Team3D/Client/Public/Current_Spell_Slot.h b/Jusin154_Team3D/Client/Public/Current_Spell_Slot.h index 91305afe5..2c563d0e0 100644 --- a/Jusin154_Team3D/Client/Public/Current_Spell_Slot.h +++ b/Jusin154_Team3D/Client/Public/Current_Spell_Slot.h @@ -13,6 +13,12 @@ NS_BEGIN(Client) class CCurrent_Spell_Slot final : public CElementObject { + typedef struct Get_Skill_Info + { + _int iSlotIndexX{}; + _int iSlotIndexY{}; + _int iSpellIndex{}; + }GETSKILLINFO; private: CCurrent_Spell_Slot(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CCurrent_Spell_Slot(const CCurrent_Spell_Slot& rhs); @@ -29,6 +35,14 @@ class CCurrent_Spell_Slot final : public CElementObject virtual void SizeUpY(_float fSizeY) override; virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; +private: + void Hover(); + void Click_Slot(_bool bClick); + void Get_Skill(_int SpellIndex, _int SlotIndex); + _int Chack_Slot(_int Index) const; + void Clear(_int iValue); + + _float4 UV(_int SpellID); private: virtual HRESULT Bind_ShaderResources() override; @@ -37,14 +51,27 @@ class CCurrent_Spell_Slot final : public CElementObject virtual HRESULT Initialize(void* pArg) override; private: + CInfoInstance* m_pInfoInstance = { nullptr }; + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CTexture* m_pDiffuse_TextureCom2 = { nullptr }; CShader* m_pShaderCom = { nullptr }; CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; - _float m_fOffSetX{}; - _float m_fOffSetY{}; - _uint m_iCols{}; + class CUI_Manager* m_pManager = { nullptr }; + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + + _bool m_bChangeSlot = { false }; + + _int m_iSlot_Index{}; + _int m_iSkill_Index{}; + _int m_iSpell[4][4]{}; + CVIBuffer_UI_Instance::UI_ATLAS_DESC m_vUV{}; + GETSKILLINFO m_GetSkillInfo = {}; public: static CCurrent_Spell_Slot* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Client/Public/Decendo.h b/Jusin154_Team3D/Client/Public/Decendo.h index e1bc2863a..a29e34db9 100644 --- a/Jusin154_Team3D/Client/Public/Decendo.h +++ b/Jusin154_Team3D/Client/Public/Decendo.h @@ -21,7 +21,7 @@ class CDecendo final : public CEffect_Container virtual void Late_Update(_float fTimeDelta) override; public: - virtual HRESULT Pre_Setting(CGameObject* pObject) override; + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; private: virtual HRESULT Initialize_Prototype() override; @@ -32,15 +32,23 @@ class CDecendo final : public CEffect_Container virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; private: _wstring m_wstrEffectName = {}; + class CInfoInstance* m_pInfoInstance = { nullptr }; class CPartObject* m_pProjectile = {}; class CPartObject* m_pProjectile_Blur = {}; - _vector m_vRotateUp = {}; - _float m_fAccTime = {}; + _float4 m_vStartPos = { 0.f, 0.f, 0.f, 1.f }; // 현재 발사 된 위치 + _float4 m_vTargetPos = { 0.f, 0.f, 10.f, 1.f }; // 현재 타게팅 된 위치 + _float m_fLinearSpeed = 22.f; + _float3 m_vCameraLook = {}; + + _float3 m_vRotateUp = {}; + _float m_fRotateAccTime = {}; _float m_fLerpAmount = {}; _float m_fTurnValue = {}; - _vector m_vCameraLook = {}; + + _float m_fAngularSpeed = {}; + _float m_fTimeRate = {}; public: static CDecendo* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual void Free() override; diff --git a/Jusin154_Team3D/Client/Public/DecendoSide.h b/Jusin154_Team3D/Client/Public/DecendoSide.h index 70bd7106e..8901151b6 100644 --- a/Jusin154_Team3D/Client/Public/DecendoSide.h +++ b/Jusin154_Team3D/Client/Public/DecendoSide.h @@ -21,7 +21,7 @@ class CDecendoSide final : public CEffect_Container virtual void Late_Update(_float fTimeDelta) override; public: - virtual HRESULT Pre_Setting(CGameObject* pObject) override; + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; private: virtual HRESULT Initialize_Prototype() override; @@ -33,6 +33,9 @@ class CDecendoSide final : public CEffect_Container private: _wstring m_wstrEffectName = {}; + _bool m_isTrailEnd = {}; + _float4x4 m_TrailStopMat = {}; + class CEffectParts* m_pWandLight = { nullptr }; class CTrailObject* m_pWandTrail = { nullptr }; diff --git a/Jusin154_Team3D/Client/Public/Eessential_Spell_Slot.h b/Jusin154_Team3D/Client/Public/Eessential_Spell_Slot.h index 1cc98a0fc..c2f8e83c2 100644 --- a/Jusin154_Team3D/Client/Public/Eessential_Spell_Slot.h +++ b/Jusin154_Team3D/Client/Public/Eessential_Spell_Slot.h @@ -31,7 +31,7 @@ class CEessential_Spell_Slot final : public CElementObject private: - void Hover(_float fTimeDelta); + void Hover(); private: virtual HRESULT Bind_ShaderResources() override; diff --git a/Jusin154_Team3D/Client/Public/EffectObject.h b/Jusin154_Team3D/Client/Public/EffectObject.h index f30eee9e8..ab0df0822 100644 --- a/Jusin154_Team3D/Client/Public/EffectObject.h +++ b/Jusin154_Team3D/Client/Public/EffectObject.h @@ -104,6 +104,8 @@ class CEffectObject abstract : public CPartObject _float2 vDissolveUVGainAmount = {}; _bool isDissolveMove = {}; + + _float3 vDissolveValue = {}; @@ -114,7 +116,6 @@ class CEffectObject abstract : public CPartObject _bool isPadding0 = {}; _bool isPadding1 = {}; - }EFFECT_INFO; diff --git a/Jusin154_Team3D/Client/Public/EffectPool.h b/Jusin154_Team3D/Client/Public/EffectPool.h index 686a4e161..f3cc94e01 100644 --- a/Jusin154_Team3D/Client/Public/EffectPool.h +++ b/Jusin154_Team3D/Client/Public/EffectPool.h @@ -26,7 +26,7 @@ class CEffectPool final : public CGameObject virtual HRESULT Render() override; public: HRESULT Create_Effect(SKILL_TYPE eType, _uint iNumEffect, _uint iPrototypeLevel, _uint iCloneLevel , function AddPrototypeEvent); - HRESULT Use_Skill(SKILL_TYPE eType , CGameObject* pOwner); + HRESULT Use_Skill(SKILL_TYPE eType , CGameObject* pOwner, void* pArg = nullptr); private: list m_EffectList[ENUM_CLASS(SKILL_TYPE::END)] = {}; list m_ActiveEffectList = {}; diff --git a/Jusin154_Team3D/Client/Public/Effect_Container.h b/Jusin154_Team3D/Client/Public/Effect_Container.h index b2201d6f6..066c5c625 100644 --- a/Jusin154_Team3D/Client/Public/Effect_Container.h +++ b/Jusin154_Team3D/Client/Public/Effect_Container.h @@ -22,9 +22,9 @@ class CEffect_Container abstract : public CContainerObject virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; public: HRESULT Load_Directory(const _char* pPath); - virtual HRESULT Pre_Setting(CGameObject* pObject); + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr); HRESULT Load_Package(const _char* pPath); - + _uint Get_SkillType() const { return m_iSkillType; } public: protected: @@ -36,10 +36,12 @@ class CEffect_Container abstract : public CContainerObject void Update_Event(_float fTimeDelta); HRESULT Reset_EffectParts(); + _int CollisionCheck(); + protected: - _float4 m_vStartPos = {}; - _float4 m_vEndPos = {}; - PSX::PxSweepBuffer hitBuffer = {}; + _float4 m_vStartPos = {}; + _float4 m_vEndPos = {}; + PSX::PxSweepBufferN<12> m_Hitbuffer = {}; protected: _wstring m_wstrEffectName = {}; @@ -53,6 +55,8 @@ class CEffect_Container abstract : public CContainerObject _bool m_isCollisionEnter = { false }; map<_float, function> m_Events = {}; + _uint m_iSkillType = ENUM_CLASS(SKILL_TYPE::END); + _bool m_bHasDamage = { false }; public: virtual void Free() override; diff --git a/Jusin154_Team3D/Client/Public/Goblin.h b/Jusin154_Team3D/Client/Public/Goblin.h index a93d3b666..72f615848 100644 --- a/Jusin154_Team3D/Client/Public/Goblin.h +++ b/Jusin154_Team3D/Client/Public/Goblin.h @@ -9,6 +9,13 @@ NS_BEGIN(Client) class CGoblin final : public CMonster { + enum class GOBLIN_SKILL + { + SWING, + THROW, + TP, + END + }; private: CGoblin(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CGoblin(const CGoblin& Prototype); @@ -36,6 +43,7 @@ class CGoblin final : public CMonster virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; HRESULT Ready_Components(); + HRESULT Ready_Parts(); HRESULT Bind_ShaderResources(); public: @@ -51,6 +59,12 @@ class CGoblin final : public CMonster virtual void Add_FSM(); virtual void Set_Anim(); + _float m_fSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::END)] = {}; + _float m_fMaxSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::END)] = { 5.f,2.f,15.f }; + + _bool m_bStep = { false }; + _float m_fTpTime = {}; + void Behavior_IdleEnter(); HRESULT Behavior_IdleExitCheck(); @@ -61,9 +75,25 @@ class CGoblin final : public CMonster void Behavior_MoveExit(); void Behavior_CombatEnter(); - HRESULT Behavior_CombatExitCheck(); + HRESULT Behavior_CombatExitCheck(_float fTimeDelta); void Behavior_CombatExit(); + + void Behavior_SwingEnter(); + HRESULT Behavior_SwingExitCheck(_float fTimeDelta); + void Behavior_SwingExit(); + + void Behavior_ThrowEnter(); + HRESULT Behavior_ThrowExitCheck(_float fTimeDelta); + void Behavior_ThrowExit(); + + void Behavior_BlinkEnter(); + HRESULT Behavior_BlinkExitCheck(_float fTimeDelta); + void Behavior_BlinkExit(); + + void Behavior_HitEnter(); + HRESULT Behavior_HitExitCheck(_float fTimeDelta); + void Behavior_HitExit(); }; NS_END diff --git a/Jusin154_Team3D/Client/Public/InfoInstance.h b/Jusin154_Team3D/Client/Public/InfoInstance.h index 2274dd466..908273dff 100644 --- a/Jusin154_Team3D/Client/Public/InfoInstance.h +++ b/Jusin154_Team3D/Client/Public/InfoInstance.h @@ -45,8 +45,13 @@ DECLARE_SINGLETON(CInfoInstance) #pragma region Spell_INFO HRESULT Load_SpellInfo(const _char* pFilePath); SPELL_INFO Get_Spell_Info(_int Spell_Info); + _int Update_Spell(_int SpellIndex); + _float Get_CoolTime(_int SpellID); void Change_Canvas(); - void Key_Input(_uint Input); + void Key_Input(_uint Input); // 플레이어 키 입력 + + void Add_Event(_wstring EventName, function Event); + void Event_CallBack(_wstring EventName, void* pArg = nullptr); #pragma endregion private: CGameInstance* m_pGameInstance = { nullptr }; @@ -58,7 +63,10 @@ DECLARE_SINGLETON(CInfoInstance) class CMapInfo* m_pMapInfo = { nullptr }; class CSkill_Data* m_pSkillInfo= { nullptr }; _uint m_eInput = ENUM_CLASS(KEYINPUT::END); + _int m_eSpell = ENUM_CLASS(SKILL_TYPE::END); + // 임시로 이벤트 1개 만들어 둠 + multimap<_wstring, function> UI_Event; #ifdef _DEBUG _string m_strLog = {}; #endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Public/Levioso.h b/Jusin154_Team3D/Client/Public/Levioso.h index e2f1daddd..a0275c221 100644 --- a/Jusin154_Team3D/Client/Public/Levioso.h +++ b/Jusin154_Team3D/Client/Public/Levioso.h @@ -21,7 +21,7 @@ class CLevioso final : public CEffect_Container virtual void Late_Update(_float fTimeDelta) override; public: - virtual HRESULT Pre_Setting(CGameObject* pObject) override; + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; private: virtual HRESULT Initialize_Prototype() override; diff --git a/Jusin154_Team3D/Client/Public/LeviosoSide.h b/Jusin154_Team3D/Client/Public/LeviosoSide.h index 2a136a3ea..f4f93e3fc 100644 --- a/Jusin154_Team3D/Client/Public/LeviosoSide.h +++ b/Jusin154_Team3D/Client/Public/LeviosoSide.h @@ -21,7 +21,7 @@ class CLeviosoSide final : public CEffect_Container virtual void Late_Update(_float fTimeDelta) override; public: - virtual HRESULT Pre_Setting(CGameObject* pObject) override; + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; private: virtual HRESULT Initialize_Prototype() override; diff --git a/Jusin154_Team3D/Client/Public/Lumos.h b/Jusin154_Team3D/Client/Public/Lumos.h index 0d4cd61f7..03f0c20b3 100644 --- a/Jusin154_Team3D/Client/Public/Lumos.h +++ b/Jusin154_Team3D/Client/Public/Lumos.h @@ -21,7 +21,7 @@ class CLumos final : public CEffect_Container virtual void Late_Update(_float fTimeDelta) override; public: - virtual HRESULT Pre_Setting(CGameObject* pObject) override; + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; private: virtual HRESULT Initialize_Prototype() override; diff --git a/Jusin154_Team3D/Client/Public/MiniMap_Panel.h b/Jusin154_Team3D/Client/Public/MiniMap_Panel.h index 79381c49c..ee3cc6a2b 100644 --- a/Jusin154_Team3D/Client/Public/MiniMap_Panel.h +++ b/Jusin154_Team3D/Client/Public/MiniMap_Panel.h @@ -31,8 +31,6 @@ class CMiniMap_Panel final : public CPanelObject virtual HRESULT Initialize(void* pArg) override; private: - CTexture* m_pDiffuse_TextureCom = { nullptr }; - CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; CGameObject* m_pMiniMap_TrimBorder = { nullptr }; CGameObject* m_pNoMountIcon = { nullptr }; diff --git a/Jusin154_Team3D/Client/Public/Monster.h b/Jusin154_Team3D/Client/Public/Monster.h index 1a81e029e..0a73f3783 100644 --- a/Jusin154_Team3D/Client/Public/Monster.h +++ b/Jusin154_Team3D/Client/Public/Monster.h @@ -27,6 +27,7 @@ class CMonster abstract : public CUnit _float3 m_vToTargetDir = { }; _float m_fTargetDistance = { FLT_MAX }; _bool m_bDrawOutLine = { false }; + _bool m_bLookAt = { true }; protected: virtual HRESULT Initialize_Prototype() override; diff --git a/Jusin154_Team3D/Client/Public/NomalJap.h b/Jusin154_Team3D/Client/Public/NomalJap.h index a1857a2bd..10ae59cb8 100644 --- a/Jusin154_Team3D/Client/Public/NomalJap.h +++ b/Jusin154_Team3D/Client/Public/NomalJap.h @@ -22,7 +22,7 @@ class CNomalJap final : public CEffect_Container public: - virtual HRESULT Pre_Setting(CGameObject* pObject) override; + virtual HRESULT Pre_Setting(CGameObject* pObject , void* pArg = nullptr) override; private: virtual HRESULT Initialize_Prototype() override; @@ -32,25 +32,38 @@ class CNomalJap final : public CEffect_Container HRESULT Bind_ShaderResources() override; virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; private: - CInfoInstance* m_pInfoInstance = { nullptr }; - _wstring m_wstrEffectName = {}; + class CInfoInstance* m_pInfoInstance = { nullptr }; + _wstring m_wstrEffectName = {}; - class CPartObject* m_pProjectile = {}; - class CPartObject* m_pProjectile_Side = {}; + _float4 m_vJapData[4] = { _float4(65.f , 330.f , 35.f , 20.f) + , _float4(55.f , 100.f , 55.f , 200.f) + , _float4(55.f , 0.f , 0.f , 0.f) + , _float4(65.f , 250.f , 35.f , 60.f) }; - _float3 m_vRotateUp = {}; - _float m_fAccMoveTime = {}; - _float m_fLerpAmount = {}; - _float m_fTurnValue = {}; + class CPartObject* m_pProjectile = {}; + class CPartObject* m_pProjectile_Side = {}; - CUnit* m_pTargetUnit = { nullptr }; // 발사될 당시 대상 - _float3 m_vDirection = { 0.f, 0.f, 1.f }; - _float4 m_vStartPos = { 0.f, 0.f, 0.f, 1.f }; // 현재 발사 된 위치 - _float4 m_vTargetPos = { 0.f, 0.f, 10.f, 1.f }; // 현재 타게팅 된 위치 - _float m_fAngularSpeed = XM_2PI / 0.3f; - _float m_fLinearSpeed = 1.f; - _bool m_bTrailPulseEnded = false; - _float4 m_vSrcPos = {}; + _float3 m_vRotateUp = {}; + _float m_fAccMoveTime = {}; + _float m_fAccRotateTime = {}; + _float m_fRotateAmount = { 0.2f }; + _float m_fTurnValue = {}; + _float m_fAngle = { XMConvertToRadians(285.f) }; + _float3 m_vCameraLook = {}; + + _float3 m_vDirection = { 0.f, 0.f, 1.f }; + _float4 m_vStartPos = { 0.f, 0.f, 0.f, 1.f }; // 현재 발사 된 위치 + _float4 m_vTargetPos = { 0.f, 0.f, 10.f, 1.f }; // 현재 타게팅 된 위치 + _float m_fAngularSpeed = {}; + _float m_fLinearSpeed = 35.f; + _float m_fTimeRate = {}; + + /*좌우 무빙 관련 변수들*/ + _float3 m_vRotateRight = {}; + _float m_fZigZagAngle = { XMConvertToRadians(60.f) }; + _float m_fAccZigZagTime = {}; + _float m_fZigZagSpeed = { 25.f }; + _float m_fZigZagAmount = { 0.1f }; public: static CNomalJap* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual void Free() override; diff --git a/Jusin154_Team3D/Client/Public/NomalJapSide.h b/Jusin154_Team3D/Client/Public/NomalJapSide.h index a664f2be1..dcb24ad6a 100644 --- a/Jusin154_Team3D/Client/Public/NomalJapSide.h +++ b/Jusin154_Team3D/Client/Public/NomalJapSide.h @@ -21,7 +21,7 @@ class CNomalJapSide final : public CEffect_Container virtual void Late_Update(_float fTimeDelta) override; public: - virtual HRESULT Pre_Setting(CGameObject* pObject) override; + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; private: virtual HRESULT Initialize_Prototype() override; @@ -33,6 +33,10 @@ class CNomalJapSide final : public CEffect_Container private: _wstring m_wstrEffectName = {}; + _bool m_isParticleEnd = {}; + _bool m_isTrailEnd = {}; + _float4x4 m_TrailStopMat = {}; + class CEffectParts* m_pWandLight = { nullptr }; class CTrailObject* m_pWandTrail = { nullptr }; class CEffectParts* m_pWandParticle = { nullptr }; diff --git a/Jusin154_Team3D/Client/Public/Player.h b/Jusin154_Team3D/Client/Public/Player.h index 7d85ef896..21a1eecbe 100644 --- a/Jusin154_Team3D/Client/Public/Player.h +++ b/Jusin154_Team3D/Client/Public/Player.h @@ -82,7 +82,9 @@ class CPlayer final : public CUnit private: - void TestKeyInput(_float fTimeDelta); + // UI 연동 추가 + void Get_Spell(_int SkillIndex); + virtual void Add_FSM(); virtual void Set_Anim(); diff --git a/Jusin154_Team3D/Client/Public/Protego.h b/Jusin154_Team3D/Client/Public/Protego.h index 1d6c6ed2b..8f07d8c01 100644 --- a/Jusin154_Team3D/Client/Public/Protego.h +++ b/Jusin154_Team3D/Client/Public/Protego.h @@ -21,7 +21,7 @@ class CProtego final : public CEffect_Container virtual void Late_Update(_float fTimeDelta) override; public: - virtual HRESULT Pre_Setting(CGameObject* pObject) override; + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; private: virtual HRESULT Initialize_Prototype() override; diff --git a/Jusin154_Team3D/Client/Public/Revelio.h b/Jusin154_Team3D/Client/Public/Revelio.h index d8f8f2707..32f224ab0 100644 --- a/Jusin154_Team3D/Client/Public/Revelio.h +++ b/Jusin154_Team3D/Client/Public/Revelio.h @@ -21,7 +21,7 @@ class CRevelio final : public CEffect_Container virtual void Late_Update(_float fTimeDelta) override; public: - virtual HRESULT Pre_Setting(CGameObject* pObject) override; + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; private: virtual HRESULT Initialize_Prototype() override; diff --git a/Jusin154_Team3D/Client/Public/Skill_Data.h b/Jusin154_Team3D/Client/Public/Skill_Data.h index 00b539a71..487764fed 100644 --- a/Jusin154_Team3D/Client/Public/Skill_Data.h +++ b/Jusin154_Team3D/Client/Public/Skill_Data.h @@ -21,16 +21,19 @@ class CSkill_Data final : public CBase public: void Update(_float fTimeDelta); void Change_Level(); - + _float Get_CoolTime(_int SpellID); public: HRESULT Load_SpellInfo(const _char* pFilePath); public: const SPELL_INFO& Get_Info(_uint SpellID) const; + _int Update_Spell(_int SpellID); private: - SPELL_INFO SpellInfo[34] = {}; + _int m_iSpell_Count{}; + SPELL_INFO SpellInfo[34] = {}; + _float m_iSpell_CoolTime[34] = {}; private: HRESULT Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); diff --git a/Jusin154_Team3D/Client/Public/Spell_Drag.h b/Jusin154_Team3D/Client/Public/Spell_Drag.h new file mode 100644 index 000000000..4b0858b9c --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Spell_Drag.h @@ -0,0 +1,68 @@ +#pragma once + +#include "Client_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +class CSpell_Drag final : public CElementObject +{ +private: + CSpell_Drag(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Drag(const CSpell_Drag& rhs); + virtual ~CSpell_Drag() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +private: + void Compute_UI(_uint SpellID); + virtual void Set_SpellType(_int SpellID) override; + _float2 Get_MousePos(); + void Set_Current_Slot(_uint Index); + +private: + CInfoInstance* m_pInfoInstance = { nullptr }; + + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CTexture* m_pDiffuse_TextureCom2 = { nullptr }; + CTexture* m_pDiffuse_TextureCom3 = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + _vector m_vStart_MousePos{}; + _vector m_vMove_MousePos{}; + _float4 m_vUV{}; + + _int m_iCurrent_Slot_Index{}; + + _bool m_bCurrent_Hover = { false }; + _bool m_bMove = { false }; + _bool m_bClick = { false }; + _bool m_bFalse = { false }; +public: + static CSpell_Drag* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Spell_Header.h b/Jusin154_Team3D/Client/Public/Spell_Header.h index cb7f1956d..d65b41934 100644 --- a/Jusin154_Team3D/Client/Public/Spell_Header.h +++ b/Jusin154_Team3D/Client/Public/Spell_Header.h @@ -32,6 +32,8 @@ class CSpell_Header final : public CElementObject virtual HRESULT Initialize(void* pArg) override; private: + CInfoInstance* m_pInfoInstance = { nullptr }; + CTexture* m_pDiffuse_TextureCom = { nullptr }; CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; diff --git a/Jusin154_Team3D/Client/Public/Spell_Hover.h b/Jusin154_Team3D/Client/Public/Spell_Hover.h index bd223cb21..316b57221 100644 --- a/Jusin154_Team3D/Client/Public/Spell_Hover.h +++ b/Jusin154_Team3D/Client/Public/Spell_Hover.h @@ -30,7 +30,7 @@ class CSpell_Hover final : public CElementObject virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; private: - void Hover(); + void Click_Slot(_bool bClick); private: virtual HRESULT Bind_ShaderResources() override; diff --git a/Jusin154_Team3D/Client/Public/Spell_Hover_Effect.h b/Jusin154_Team3D/Client/Public/Spell_Hover_Effect.h index c416c180a..5911f58c6 100644 --- a/Jusin154_Team3D/Client/Public/Spell_Hover_Effect.h +++ b/Jusin154_Team3D/Client/Public/Spell_Hover_Effect.h @@ -29,6 +29,9 @@ class CSpell_Hover_Effect final : public CElementObject virtual void SizeUpY(_float fSizeY) override; virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; +private: + void Click_Slot(_bool bClick); + private: virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; diff --git a/Jusin154_Team3D/Client/Public/Spell_List.h b/Jusin154_Team3D/Client/Public/Spell_List.h index 2be2758cf..b1733544d 100644 --- a/Jusin154_Team3D/Client/Public/Spell_List.h +++ b/Jusin154_Team3D/Client/Public/Spell_List.h @@ -31,7 +31,8 @@ class CSpell_List final : public CElementObject private: void Color(); - void Hover(_float fTimeDelta); + void Hover(); + void Click_Slot(_bool bClick); private: virtual HRESULT Bind_ShaderResources() override; diff --git a/Jusin154_Team3D/Client/Public/Spell_Overlay.h b/Jusin154_Team3D/Client/Public/Spell_Overlay.h index 2b889685c..9230c5b49 100644 --- a/Jusin154_Team3D/Client/Public/Spell_Overlay.h +++ b/Jusin154_Team3D/Client/Public/Spell_Overlay.h @@ -25,7 +25,6 @@ class CSpell_Overlay final : public CElementObject virtual HRESULT Render() override; virtual _vector Get_WorldPostion() override; - private: virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; @@ -33,9 +32,18 @@ class CSpell_Overlay final : public CElementObject virtual HRESULT Initialize(void* pArg) override; private: - void Compute_UI(_uint SpellID); + _float4 Compute_UI(_uint SpellID); + void Array_Clear(_int Value); + void Bool_Array_Clear(_bool Bool); + +public: + void Spell_Setting(_int SlotIndex, _int SpellIndex); + void Set_SpellSlot(_int Index); + void Use_Spell(); private: + CInfoInstance* m_pInfoInstance = { nullptr }; + CTexture* m_pDiffuse_TextureCom = { nullptr }; CTexture* m_pDiffuse_TextureCom1 = { nullptr }; CTexture* m_pDiffuse_TextureCom2 = { nullptr }; @@ -46,7 +54,15 @@ class CSpell_Overlay final : public CElementObject _int m_iImageFrameX{}; _int m_iImageFrameY{}; _float m_fFrame{}; - _float4 m_vUV{}; + _float4 m_vUV[4] = {}; + + _int m_iSlotCount{}; + _int m_Spells[4] = { 0 }; + _int m_iSpellType[4] = { 0 }; + _int m_iCurrent_Slot{}; + + _bool m_bEquipped[4] = { false }; + _bool m_bSpellUsed[4] = { false }; public: static CSpell_Overlay* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Client/Public/Spell_Panel.h b/Jusin154_Team3D/Client/Public/Spell_Panel.h index daab8a2ca..f4769dd97 100644 --- a/Jusin154_Team3D/Client/Public/Spell_Panel.h +++ b/Jusin154_Team3D/Client/Public/Spell_Panel.h @@ -31,6 +31,8 @@ class CSpell_Panel final : public CPanelObject private: void Slot_Chack(void* pArg); + void Click_Slot(_bool Click); + void Current_Slot_Chack(_int Index); private: @@ -62,13 +64,19 @@ class CSpell_Panel final : public CPanelObject CGameObject* m_pSpell_Header = { nullptr }; CGameObject* m_pSpell_Header_Line = { nullptr }; CGameObject* m_pSpell_Anim = { nullptr }; + CGameObject* m_pSpell_Drag = { nullptr }; _int m_iHoverSlot[2] = { -1,-1 }; + SPELLINFO m_Info[34] = {}; CUIObject::HOVER_INFO m_Hover; - _int m_iPendingSpell = -1; - _float m_fHoverTimer = 0.f; + _int m_iPendingSpell = -1; + _float m_fHoverTimer = 0.f; + + _int m_iCurrent_Slot_Index{}; + _bool m_bCurrentSlot_Hover = { false }; + public: static CSpell_Panel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Client/Public/Spell_State.h b/Jusin154_Team3D/Client/Public/Spell_State.h index 9e958722e..c16df540f 100644 --- a/Jusin154_Team3D/Client/Public/Spell_State.h +++ b/Jusin154_Team3D/Client/Public/Spell_State.h @@ -30,7 +30,7 @@ class CSpell_State final : public CElementObject virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; private: - void Hover(); + void Click_Slot(_bool bClick); private: virtual HRESULT Bind_ShaderResources() override; diff --git a/Jusin154_Team3D/Client/Public/Spell_Vidio_Border.h b/Jusin154_Team3D/Client/Public/Spell_Vidio_Border.h index eb4c32fd6..de678b1f4 100644 --- a/Jusin154_Team3D/Client/Public/Spell_Vidio_Border.h +++ b/Jusin154_Team3D/Client/Public/Spell_Vidio_Border.h @@ -25,12 +25,6 @@ class CSpell_Vidio_Border final : public CElementObject virtual HRESULT Render() override; virtual _vector Get_WorldPostion() override; -//public: -// virtual const SPELLINFO Get_Info(_int Index) override; -// -//public: -// virtual void Set_SkillType(_int eType); - private: virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; diff --git a/Jusin154_Team3D/Client/Public/State_Blink.h b/Jusin154_Team3D/Client/Public/State_Blink.h new file mode 100644 index 000000000..9eeb8f85d --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Blink.h @@ -0,0 +1,36 @@ +#pragma once +#include "Client_Define.h" +#include "State_Root.h" + +NS_BEGIN(Client) + +class CState_Blink final : public CState_Root +{ +public: + typedef struct tagBlink : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }STATE_BLINK_DESC; +private: + CState_Blink(); + virtual ~CState_Blink() = default; + +public: + virtual void Enter(); + virtual HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +private: + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + +private: + HRESULT Initialize(STATE_BLINK_DESC* pDesc); + +public: + static CState_Blink* Create(STATE_BLINK_DESC* pDesc); + virtual void Free() override; + virtual void Describe_Entity(); +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/State_Swing.h b/Jusin154_Team3D/Client/Public/State_Swing.h new file mode 100644 index 000000000..9954a912f --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Swing.h @@ -0,0 +1,36 @@ +#pragma once +#include "Client_Define.h" +#include "State_Root.h" + +NS_BEGIN(Client) + +class CState_Swing final : public CState_Root +{ +public: + typedef struct tagSwing : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }STATE_SWING_DESC; +private: + CState_Swing(); + virtual ~CState_Swing() = default; + +public: + virtual void Enter(); + virtual HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +private: + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + +private: + HRESULT Initialize(STATE_SWING_DESC* pDesc); + +public: + static CState_Swing* Create(STATE_SWING_DESC* pDesc); + virtual void Free() override; + virtual void Describe_Entity(); +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Troll.h b/Jusin154_Team3D/Client/Public/Troll.h index 2314ae19b..07be171a7 100644 --- a/Jusin154_Team3D/Client/Public/Troll.h +++ b/Jusin154_Team3D/Client/Public/Troll.h @@ -42,8 +42,6 @@ class CTroll final : public CMonster _float2 m_vStunTimer = { 0.f, 4.f }; _uint iIndex; - _bool m_bLookAt = { true }; - private: virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; @@ -65,10 +63,14 @@ class CTroll final : public CMonster virtual void Set_Anim(); _float m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::END)] = {}; - _float m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::END)] = { 20.f,15.f, 10.f, 5.f ,10.f}; + _float m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::END)] = { 20.f,15.f, 10.f, 15.f ,15.f}; _float m_fRushTime = {}; + _float m_fAttackDelay = {}; + + _float m_fDegree = {}; + _float m_fCross = {}; void Behavior_IdleEnter(); @@ -76,7 +78,7 @@ class CTroll final : public CMonster void Behavior_IdleExit(); void Behavior_MoveEnter(); - HRESULT Behavior_MoveExitCheck(); + HRESULT Behavior_MoveExitCheck(_float fTimeDelta); void Behavior_MoveExit(); void Behavior_CombatEnter(); @@ -91,6 +93,10 @@ class CTroll final : public CMonster HRESULT Behavior_ThrowExitCheck(_float fTimeDelta); void Behavior_ThrowExit(); + void Behavior_SwingEnter(); + HRESULT Behavior_SwingExitCheck(_float fTimeDelta); + void Behavior_SwingExit(); + void Behavior_HitEnter(); HRESULT Behavior_HitExitCheck(); void Behavior_HitExit(); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BombardaSide/Bombard_Trail.trail b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BombardaSide/Bombard_Trail.trail index f412c79fe..a973309be 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BombardaSide/Bombard_Trail.trail and b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/BombardaSide/Bombard_Trail.trail differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Circle_S.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Circle_S.bin index 7cd5f49e9..5870fe8e6 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Circle_S.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Circle_S.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7a4bf86427df3ec13dc4bcb71f00c3ce4f0898187c7b813340a6b8257f7b624c +oid sha256:89a1a4370aa456bf9aac89cdcc574476416552b8435e0fce7d95f57dd3b76534 size 897 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_PT0.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_PT0.bin index 2cb05e324..cc813724c 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_PT0.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_PT0.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8e2a236bcf8cae35368ed01fcccb6873a2210f75aa5e8c6e54b5756ef7fa09fa +oid sha256:53e8fbee4763ad56483bdb08946831685f9074de65a323e5dad77268aac01e60 size 890 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Ring.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Ring.bin index 6e73608eb..b486265dc 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Ring.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Ring.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:47f2de238af5adc3832891ac4b3dc3ee5b3d92ee4bc383dca6f76fa0d8a2ad48 +oid sha256:23722d536422fdf289e890409e0458d3cf406f09180a281926f91f9ff40d3b5c size 844 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Wand_Light.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Wand_Light.bin index e11e7ef35..2e1154439 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Wand_Light.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Wand_Light.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e1961e10bf9395bbbbc5d3bce84d09b070749fdccdd6cd73334ea62418a45a07 +oid sha256:df644319a74c442c891041eefeb5e8a8a957bb44668416cf7498988ea9b30db9 size 987 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Proj_Trail.trail b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Proj_Trail.trail index 7351c6b10..91ae91941 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Proj_Trail.trail and b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Proj_Trail.trail differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/DecendoSide/Trail_R.trail b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/DecendoSide/Trail_R.trail index 78363b13a..91892cc7f 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/DecendoSide/Trail_R.trail and b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/DecendoSide/Trail_R.trail differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapTrail.trail b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapTrail.trail index 8b558499e..7317469cb 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapTrail.trail and b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapTrail.trail differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Levioso_Wand_Light.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Levioso_Wand_Light.bin new file mode 100644 index 000000000..0a3c60810 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Levioso_Wand_Light.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:950176215bdac99585a8c8ac27513896f917f39d0cce8b1c4910dc611e2a1f51 +size 1022 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Levioso.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Levioso.bin index 517803a84..24957383b 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Levioso.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Levioso.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4c16921bcfa5621c02d9762a53857a4436d9ea28704102476e46045763478be9 -size 644 +oid sha256:e7392a101f23639921ab9f6c35f1dfdd767d491f94df486b9f07af294447e880 +size 712 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Spell/SpellInfo.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Spell/SpellInfo.xml index e95b0bb5d..8d0130895 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Spell/SpellInfo.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Spell/SpellInfo.xml @@ -1,36 +1,36 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin/Goblin.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin/Goblin.bin index ce32db235..6e34567fa 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin/Goblin.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin/Goblin.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8f213297e0bdeb327bd5e32ffb67f75593bcdce1d84bc3bbbefb57bcb5a12ad7 -size 1456150 +oid sha256:be254ecb748748080b015fa8e293d12445b835a341075bb79113d41ef788d426 +size 1457699 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin/Goblin.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin/Goblin.fbx index 7234bc3dc..227b0eeaa 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin/Goblin.fbx +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin/Goblin.fbx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:42791e191e881258436e7bcc34c342c22b5d14dde01f2a065a0603826bbfc553 -size 520028 +oid sha256:c6590bf308dd22da41e048d111dd2de7425d111647d5d8aa24701f67ec52d912 +size 529804 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Goblin_Dagger/Dagger.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Goblin_Dagger/Goblin_Dagger.bin similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Goblin_Dagger/Dagger.bin rename to Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Goblin_Dagger/Goblin_Dagger.bin diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Goblin_Dagger/Dagger.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Goblin_Dagger/Goblin_Dagger.fbx similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Goblin_Dagger/Dagger.fbx rename to Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Goblin_Dagger/Goblin_Dagger.fbx diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Buffers.hlsli b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Buffers.hlsli new file mode 100644 index 000000000..95aac70f8 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Buffers.hlsli @@ -0,0 +1,9 @@ +#ifndef ENGINE_SHADER_BUFFERS_HLSLI +#define ENGINE_SHADER_BUFFERS_HLSLI + +cbuffer GLOBAL_SSAO_DATA : register(b10) +{ + float4 SamplePos[64]; +}; + +#endif // ENGINE_SHADER_BUFFERS_HLSLI diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Defines.hlsli b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Defines.hlsli index 3ce9b7364..1e037ba16 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Defines.hlsli +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Defines.hlsli @@ -6,6 +6,7 @@ #include "Engine_Shader_Samplers.hlsli" #include "Engine_Shader_States.hlsli" #include "Engine_Shader_Functions.hlsli" +#include "Engine_Shader_Buffers.hlsli" #endif // ENGINE_SHADER_DEFINES_HLSLI diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli index eed99c58c..342f13cdc 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli @@ -30,7 +30,7 @@ float ShadowVisibility_hwPCF(Texture2D ShadowMap, float4 vLightClip, float2 vSha for (int u = -1; u <= 1; ++u) { float2 vOffset = float2(u, v) * vTexel; - float fDepth = ShadowMap.Sample(BorderOneSampler, uv + vOffset); + float fDepth = ShadowMap.Sample(BorderOneSampler, uv + vOffset).x; fVisibility += (fDepthCenter - bias > fDepth) ? 0.f : 1.f; } } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Samplers.hlsli b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Samplers.hlsli index 2e950e2c6..099c9e610 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Samplers.hlsli +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Samplers.hlsli @@ -50,6 +50,13 @@ sampler BorderOneSampler = sampler_state BorderColor = float4(1.f, 1.f, 1.f, 1.f); }; +sampler SsaoDataSampler = sampler_state +{ + Filter = MIN_MAG_MIP_POINT; + AddressU = wrap; + AddressV = wrap; +}; + sampler PointSampler = sampler_state { Filter = MIN_MAG_MIP_POINT; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index b59cd1543..30762c3ba 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -18,8 +18,15 @@ float g_fFocusDistance; float g_fFarBlurStart; float g_fFarBlurEnd; float g_fDOFBlurMultiplier; +float g_fSSAO_BIAS; +bool g_bSSAO_INVERT; -Texture2D g_Texture; +Texture2D g_Texture; +Texture2D g_SSAONoiseTexture; +Texture2D g_SSAOInputTexture; +uint g_iKernelSize; +float g_fSSAORadius; +float2 g_vSSAOTextureSize; float g_fLightRange; float g_fSpotInnerAngle; @@ -134,9 +141,10 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) float2 uv = In.vTexcoord; - float3 vAlbedo = g_DiffuseTexture.Sample(DefaultSampler, uv).rgb; - float3 vNormal = normalize(g_NormalTexture.Sample(DefaultSampler, uv).xyz * 2.f - 1.f); - float4 vDepth = g_DepthTexture.Sample(DefaultSampler, uv); + float3 vAlbedo = g_DiffuseTexture.Sample(DefaultSampler, uv).rgb; + float3 vNormal = normalize(g_NormalTexture.Sample(DefaultSampler, uv).xyz * 2.f - 1.f); + float4 vDepth = g_DepthTexture.Sample(DefaultSampler, uv); + float fAmbientOcclusion = g_SSAOInputTexture.Sample(DefaultSampler, uv).r; float fViewZ = vDepth.y * g_fFar; @@ -182,11 +190,12 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) } else // basic Lighting(phong blinn) // if you were here, you miss some assets. { - Out.vShade = g_vLightDiffuse * saturate(max(dot(normalize(g_vLightDir.xyz) * -1.f, vNormal), 0.f) + (g_vLightAmbient * g_vMtrlAmbient)); + Out.vShade = g_vLightDiffuse * saturate(max(dot(normalize(g_vLightDir.xyz) * -1.f, vNormal), 0.f) + (fAmbientOcclusion * g_vLightAmbient * g_vMtrlAmbient)); Out.vSpecular = (g_vLightSpecular * g_vMtrlSpecular) * pow(max(dot(vToView * -1.f, vToLight), 0.f), 50.f); return Out; } + float fTotalOcclusion = saturate(fOcclusion * fAmbientOcclusion); { // 수치조정 // 디렉셔널 float fMinRoughness = 0.05f; @@ -197,9 +206,9 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); - PBR_Out.vShade *= fOcclusion; + PBR_Out.vShade *= fTotalOcclusion; - float3 vAmbient = g_vLightAmbient.rgb * fOcclusion * fAttenuation; + float3 vAmbient = g_vLightAmbient.rgb * fTotalOcclusion * fAttenuation; float3 vFinalDiffuse = PBR_Out.vShade + vAmbient; float3 vFinalSpecular = PBR_Out.vSpecular * g_vLightSpecular.rgb; @@ -246,6 +255,7 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In) float fLightDistance = length(vFinalLightPosition - vWorldPosition.xyz); float3 vToView = normalize(g_vCamPosition.xyz - vWorldPosition.xyz); // 픽셀에서 카메라로 float3 vToLight = normalize(vFinalLightPosition - vWorldPosition.xyz); // 픽셀에서 라이트로 + float fAmbientOcclusion = g_SSAOInputTexture.Sample(DefaultSampler, uv).r; if (g_bUsePowerLightAttenuation) { @@ -284,12 +294,14 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In) } else // basic Lighting(phong blinn) // if you were here, you miss some assets. { - Out.vShade = fAttenuation * (g_vLightDiffuse * saturate(max(dot(vToLight * -1.f, vNormal), 0.f) + (g_vLightAmbient * g_vMtrlAmbient))); + Out.vShade = fAttenuation * (g_vLightDiffuse * saturate(max(dot(vToLight * -1.f, vNormal), 0.f) + (fAmbientOcclusion * g_vLightAmbient * g_vMtrlAmbient))); Out.vSpecular = fAttenuation * ((g_vLightSpecular * g_vMtrlSpecular) * pow(max(dot(vToView * -1.f, vToLight), 0.f), 50.f)); return Out; } + float fTotalOcclusion = saturate(fOcclusion * fAmbientOcclusion); + { // 수치조정 // 점광원 float fMinRoughness = 0.05f; fRoughness = max(fRoughness, fMinRoughness); // 러프니스 최소값 보장 @@ -299,9 +311,9 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In) PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); - PBR_Out.vShade *= fOcclusion; + PBR_Out.vShade *= fTotalOcclusion; - float3 vAmbient = g_vLightAmbient.rgb * fOcclusion * fAttenuation; + float3 vAmbient = g_vLightAmbient.rgb * fTotalOcclusion * fAttenuation; float3 vFinalDiffuse = PBR_Out.vShade + vAmbient; float3 vFinalSpecular = PBR_Out.vSpecular * g_vLightSpecular.rgb; @@ -322,6 +334,7 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In) float3 vAlbedo = g_DiffuseTexture.Sample(DefaultSampler, uv).rgb; float3 vNormal = normalize(g_NormalTexture.Sample(DefaultSampler, uv).xyz * 2.f - 1.f); float4 vDepth = g_DepthTexture.Sample(DefaultSampler, uv); + float fAmbientOcclusion = g_SSAOInputTexture.Sample(DefaultSampler, uv).r; float fViewZ = vDepth.y * g_fFar; @@ -401,11 +414,12 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In) } else // basic Lighting(phong blinn) // if you were here, you miss some assets. { - Out.vShade = fAttenuation * (g_vLightDiffuse * saturate(max(dot(vToLight * -1.f, vNormal), 0.f) + (g_vLightAmbient * g_vMtrlAmbient))); + Out.vShade = fAttenuation * (g_vLightDiffuse * saturate(max(dot(vToLight * -1.f, vNormal), 0.f) + (fAmbientOcclusion * g_vLightAmbient * g_vMtrlAmbient))); Out.vSpecular = fAttenuation * ((g_vLightSpecular * g_vMtrlSpecular) * pow(max(dot(vToView * -1.f, vToLight), 0.f), 50.f)); return Out; } + float fTotalOcclusion = saturate(fOcclusion * fAmbientOcclusion); { // 수치조정 // 점광원 float fMinRoughness = 0.05f; @@ -416,9 +430,9 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In) PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); - PBR_Out.vShade *= fOcclusion; + PBR_Out.vShade *= fTotalOcclusion; - float3 vAmbient = g_vLightAmbient.rgb * fOcclusion * fAttenuation; + float3 vAmbient = g_vLightAmbient.rgb * fTotalOcclusion * fAttenuation; float3 vFinalDiffuse = PBR_Out.vShade + vAmbient; float3 vFinalSpecular = PBR_Out.vSpecular * g_vLightSpecular.rgb; @@ -464,10 +478,7 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) vector vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); - if (0.f == vDiffuse.a) - { - discard; - } + if (0.f == vDiffuse.a) { discard; } vector vShade = g_ShadeTexture.Sample(DefaultSampler, In.vTexcoord); @@ -560,22 +571,22 @@ PS_OUT_FLT4_SINGLE PS_MAIN_EMBOSS(PS_IN In) { case 0: /* None */ - vColor = float3(0.f, 0.f, 0.f); + vColor = (0.f, 0.f, 0.f); break; case 1: /* Basic_Apply */ break; case 2: /* Multiply */ - vColor *= 3; + vColor *= 3.f; break; case 3: break; } - float fIntensity = dot(vColor, float3(0.2126f, 0.7152f, 0.0722f)); // 대략적인 밝기 ( 인간적인 ) + float fIntensity = dot(vColor, float3(0.2126f, 0.7152f, 0.0722f)); // 대략적인 밝기 - if (fIntensity <= 1e-4f) + if (fIntensity <= FLT_EPSILON5) { Out.vSingleTarget = 0; return Out; @@ -631,7 +642,7 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_X(PS_IN In) vTexcoord.x = In.vTexcoord.x + (float) i / g_vResolution.x; vTexcoord.y = In.vTexcoord.y; - vColor += g_fWeights_128[i + 63] * g_BlurTexture.Sample(BorderZeroSampler, vTexcoord); + vColor += g_fWeights_128[i + 63] * g_BlurTexture.Sample(ClampSampler, vTexcoord); } Out.vBlurX = vColor; @@ -818,7 +829,7 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_Y(PS_IN In) vTexcoord.x = In.vTexcoord.x; vTexcoord.y = In.vTexcoord.y + (float) i / g_vResolution.y; - vColor += g_fWeights_128[i + 63] * g_BlurTexture.Sample(BorderZeroSampler, vTexcoord); + vColor += g_fWeights_128[i + 63] * g_BlurTexture.Sample(ClampSampler, vTexcoord); } Out.vBlurX = vColor; @@ -875,6 +886,8 @@ PS_OUT_BACKBUFFER PS_TONE_MAPPING(PS_IN In) vColor = pow(vColor, 2.2f); switch (g_iToneMappingType) { case 0: + vColor = pow(vColor, 1.f/2.2f); + vColor /= g_fToneMappingExposure; break; case 1: vColor = float4(ReinHard_ToneMapper(vColor.xyz), 1.f); @@ -891,6 +904,96 @@ PS_OUT_BACKBUFFER PS_TONE_MAPPING(PS_IN In) return Out; } +struct PS_OUT_SSAO_AMBIENT_OCCLUSION +{ + float fOcclusion : SV_TARGET0; +}; + +PS_OUT_SSAO_AMBIENT_OCCLUSION PS_SSAO_AMBIENT_OCCLUSION(PS_IN In) +{ + PS_OUT_SSAO_AMBIENT_OCCLUSION Out; + float2 uv = In.vTexcoord; + + float4 vDepthDesc = g_DepthTexture.Sample(PointSampler, uv); + float fCenterViewSpaceZ = vDepthDesc.y * g_fFar; // n ~ f + + float4 vCenterViewPosition; + { + vCenterViewPosition.x = uv.x * 2.f - 1.f; + vCenterViewPosition.y = uv.y * -2.f + 1.f; + vCenterViewPosition.z = vDepthDesc.x; + vCenterViewPosition.w = 1.f; + vCenterViewPosition *= fCenterViewSpaceZ; + vCenterViewPosition = mul(vCenterViewPosition, g_invmatProj); + vCenterViewPosition /= vCenterViewPosition.w; + } + float3 vNormal = normalize(g_NormalTexture.Sample(PointSampler, uv).xyz * 2.f - 1.f); + float3 vCenterViewNormal = mul(vNormal, (float3x3)g_ViewMatrix); + + float2 vNoiseScale = g_vResolution / 4.f; + float3 vNoise = g_SSAONoiseTexture.Sample(SsaoDataSampler, uv * vNoiseScale).xyz; + + float3 vTangent = normalize(vNoise - vCenterViewNormal * dot(vNoise, vCenterViewNormal)); + float3 vBiNormal = cross(vCenterViewNormal, vTangent); + float3x3 toViewTBNMatrix = float3x3(vTangent, vBiNormal, vCenterViewNormal); + + float fOcclusion = 0.f; + for (uint i = 0; i < g_iKernelSize; ++i) + { + float3 vViewSamplePosVec = mul(SamplePos[i].xyz, toViewTBNMatrix); // TANSPACE -> VIEW + float4 vViewSamplePos = vCenterViewPosition + float4(vViewSamplePosVec * g_fSSAORadius, 0.f); + float4 vNDCSampleOffset = mul(vViewSamplePos, g_ProjMatrix); + vNDCSampleOffset /= vNDCSampleOffset.w; + + float2 sampleUV; + sampleUV.x = vNDCSampleOffset.x * 0.5f + 0.5f; + sampleUV.y = vNDCSampleOffset.y * -0.5f + 0.5f; + + if (sampleUV.x < 0 || sampleUV.x > 1 + || sampleUV.y < 0 || sampleUV.y > 1) { + continue; + } + + float fRecordedSampleViewPosDepth = g_DepthTexture.Sample(PointSampler, sampleUV).y * g_fFar; + float fIsOccluded = (fRecordedSampleViewPosDepth < vViewSamplePos.z - g_fSSAO_BIAS) ? 1.0f : 0.0f; + + float fRangeCheck = smoothstep(0.f, 1.f, g_fSSAORadius / abs(vViewSamplePos.z - fRecordedSampleViewPosDepth)); + fIsOccluded *= fRangeCheck; + fOcclusion += fIsOccluded; + } + fOcclusion = (1.f - (fOcclusion / g_iKernelSize)); + Out.fOcclusion = fOcclusion; + + return Out; +} + +struct PS_OUT_SSAO_BLUR +{ + float fBlur : SV_TARGET0; +}; + +PS_OUT_SSAO_BLUR PS_SSAO_BLUR(PS_IN In) +{ + PS_OUT_SSAO_BLUR Out; + + float2 vTexelSize = 1.0f / g_vResolution; + + float fResult = 0.0f; + for (int x = -2; x < 2; ++x) + { + for (int y = -2; y < 2; ++y) + { + float2 vOffset = float2((float) x, (float) y) * vTexelSize; + fResult += g_SSAOInputTexture.Sample(DefaultSampler, In.vTexcoord + vOffset).r; + } + } + + fResult /= 16.f; // 16개 샘플 평균 + + Out.fBlur = fResult; + return Out; +} + technique11 DefaultTechnique { pass DebugPass // 0 @@ -1050,4 +1153,24 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_TONE_MAPPING(); } + + pass SSAO_AmbientOcclusion // 16 + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_None, 0); + SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_CAPTURE(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_SSAO_AMBIENT_OCCLUSION(); + } + + pass SSAO_Blur_X // 17 + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_None, 0); + SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_CAPTURE(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_SSAO_BLUR(); + } } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index e0f824a57..aef919e5d 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -1167,24 +1167,20 @@ PS_OUT PS_Spell_Drag(PS_IN In) float4 Color = float4(1.f, 1.f, 1.f, 1.f); float4 tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord); - float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord); - float4 tex2Color = g_Texture3.Sample(DefaultSampler, In.vTexcoord); + float tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord).r; + float4 tex2Color = g_Texture2.Sample(DefaultSampler, In.vTexcoord); - Color = tex1; - tex2.rgb = tex2Color; + tex2Color.a = tex2; + Color = lerp(tex1, tex2Color, tex2Color.a); - Color = lerp(Color, tex2, tex2.a); - - float2 Imagetexpos1 = g_fImageUV.xy / g_fCurrent_Size; - float2 Imagetexsize1 = g_fImageUV.zw / g_fCurrent_Size; - float2 Imagelocal = (In.vTexcoord - Imagetexpos1) / Imagetexsize1; - bool inside1 = all(Imagelocal >= 0.0f && Imagelocal <= 1.0f); - float4 tex3 = g_Texture2.Sample(DefaultSampler, In.vTexcoord); + float2 atlasUV = g_fImageUV.xy + In.vTexcoord * (g_fImageUV.zw - g_fImageUV.xy); + //float2 center = (g_fImageUV.xy + g_fImageUV.zw) * 0.5f; + //float2 uv = atlasUV - center; + //uv *= 0.7f; + //uv += center; + float4 tex3 = g_Texture3.Sample(ClampSampler, atlasUV); - if (inside1) - { - Color = lerp(Color, tex3, tex3.a); - } + Color = lerp(Color, tex3, tex3.a); Color.a *= Alpha; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl index 593c4b16a..88deb62b4 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl @@ -17,6 +17,8 @@ float g_fAngle; float g_fFar; float g_fTime; +float4 g_UV; + struct VS_IN { float3 vPosition : POSITION; @@ -25,16 +27,19 @@ struct VS_IN float2 vSize : TEXCOORD1; float2 vPos : TEXCOORD2; float4 vUV : TEXCOORD3; - float4 vColor : TEXCOORD4; + float vBaseColor : TEXCOORD4; float bHover : TEXCOORD5; + float bSpell : TEXCOORD6; }; struct VS_OUT { float4 vPosition : SV_POSITION; float2 vTexcoord : TEXCOORD0; - float4 vColor : TEXCOORD1; - float bHover : TEXCOORD2; + float2 vUV : TEXCOORD1; + float vBaseColor : TEXCOORD2; + float bHover : TEXCOORD3; + float bSpell : TEXCOORD4; }; VS_OUT VS_MAIN(VS_IN In) @@ -55,9 +60,11 @@ VS_OUT VS_MAIN(VS_IN In) float3 vFinalWorldPos = vLocalPos + vParentPos; Out.vPosition = mul(float4(vFinalWorldPos, 1.f), matVP); - Out.vTexcoord = UV.xy + In.vTexcoord * (UV.zw - UV.xy); - Out.vColor = In.vColor; + Out.vUV = UV.xy + In.vTexcoord * (UV.zw - UV.xy); + Out.vTexcoord = In.vTexcoord; + Out.vBaseColor = In.vBaseColor; Out.bHover = In.bHover; + Out.bSpell = In.bSpell; return Out; } @@ -65,8 +72,10 @@ struct PS_IN { float4 vPosition : SV_POSITION; float2 vTexcoord : TEXCOORD0; - float4 vColor : TEXCOORD1; - float bHover : TEXCOORD2; + float2 vUV : TEXCOORD1; + float vBaseColor : TEXCOORD2; + float bHover : TEXCOORD3; + float bSpell : TEXCOORD4; }; struct PS_OUT @@ -113,6 +122,23 @@ PS_OUT PS_Alpha_Blend(PS_IN In) return Out; } +PS_OUT PS_UVAlpha_Blend(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + + float4 color = g_Texture.Sample(ClampSampler, In.vUV); + + if (color.a <= 0.4f) + discard; + + color.a *= Alpha; + + Out.vColor = color; + + return Out; +} + PS_OUT PS_Megic_Meter(PS_IN In) { PS_OUT Out; @@ -191,7 +217,7 @@ PS_OUT PS_Eessential_Spell(PS_IN In) float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; float4 color = float4(1.f, 1.f, 1.f, 1.f); - float4 tex1 = g_Texture.Sample(ClampSampler, In.vTexcoord); + float4 tex1 = g_Texture.Sample(ClampSampler, In.vUV); color = tex1; @@ -208,10 +234,35 @@ PS_OUT PS_Color_Image(PS_IN In) float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; float4 color = float4(1.f, 1.f, 1.f, 1.f); + + float3 BGColor = float3(1.f, 1.f, 1.f); + switch (In.vBaseColor) + { + case 0: + BGColor = float3(255.f, 255.f, 0.f) / 255.f; + break; + case 1: + BGColor = float3(150.f, 120.f, 240.f) / 255.f; + break; + case 2: + BGColor = float3(190.f, 46., 34.f) / 255.f; + break; + case 3: + BGColor = float3(24.f, 190.f, 255.f) / 255.f; + break; + case 4: + BGColor = float3(200.f, 220.f, 150.f) / 255.f; + break; + case 5: + BGColor = float3(50.f, 150.f, 110.f) / 255.f; + break; + } + float4 tex1 = g_Texture.Sample(ClampSampler, In.vTexcoord); + color = tex1; - color *= In.vColor; + color.rgb *= BGColor; color.a *= Alpha; @@ -247,10 +298,7 @@ PS_OUT PS_Spell_Hover(PS_IN In) color.rgb = HoverOff; color.a *= 0.5f; } - - - color *= In.vColor; - + color.a *= Alpha; Out.vColor = color; @@ -281,7 +329,7 @@ PS_OUT PS_Spell_Effect(PS_IN In) //float2 maskUV = In.vTexcoord; - //maskUV.x += g_fTime * float2(0.05, 0.02); // 속도 조절 가능 + //maskUV.x += g_fTime * float2(0.05, 0.02); // ?띾룄 議곗젅 媛€?? //float2 center = float2(0.5, 0.0); //float2 uv = In.vTexcoord - center; @@ -297,14 +345,73 @@ PS_OUT PS_Spell_Effect(PS_IN In) color.a *= tex1; color.a *= mask; color.a *= Alpha; - - color *= In.vColor; Out.vColor = color; return Out; } +PS_OUT PS_Spell_Slot(PS_IN In) +{ + PS_OUT Out; + + float2 center = float2(0.5f, 0.5f); + float2 uv = In.vTexcoord - center; + uv *= sqrt(2.0f); + 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 += center; + + float4 Color = float4(1.f, 1.f, 1.f, 1.f); + + if (In.bSpell != 0) + { + float3 BGColor = float3(1.f, 1.f, 1.f); + switch (In.vBaseColor) + { + case 0: + BGColor = float3(255.f, 255.f, 0.f) / 255.f; + break; + case 1: + BGColor = float3(150.f, 120.f, 240.f) / 255.f; + break; + case 2: + BGColor = float3(190.f, 46., 34.f) / 255.f; + break; + case 3: + BGColor = float3(24.f, 190.f, 255.f) / 255.f; + break; + case 4: + BGColor = float3(200.f, 220.f, 150.f) / 255.f; + break; + case 5: + BGColor = float3(50.f, 150.f, 110.f) / 255.f; + break; + + } + float4 tex1 = g_Texture.Sample(ClampSampler, Rotation); + tex1.rgb *= BGColor; + Color = tex1; + + float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vUV); + Color = lerp(Color, tex2, tex2.a); + + float4 tex3 = g_Texture2.Sample(ClampSampler, Rotation); + Color = lerp(Color, tex3, tex3.a); + } + + else + { + float4 tex3 = g_Texture2.Sample(ClampSampler, Rotation); + Color = tex3; + } + + Out.vColor = Color; + + return Out; +} + technique11 PosTexTechnique11 { pass Default @@ -329,6 +436,17 @@ technique11 PosTexTechnique11 PixelShader = compile ps_5_0 PS_Alpha_Blend(); } + pass UVAlphaBlend + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_UVAlpha_Blend(); + } + pass Megic_Meter { SetRasterizerState(RS_Default); @@ -405,4 +523,15 @@ technique11 PosTexTechnique11 GeometryShader = NULL; PixelShader = compile ps_5_0 PS_Spell_Effect(); } + + pass Spell_Slot + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + + VertexShader = compile vs_5_0 VS_MAIN(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_Spell_Slot(); + } } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl index e80f2f915..b65b093b0 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl @@ -82,13 +82,13 @@ VS_OUT VS_MAIN(VS_IN In) matWV = mul(g_WorldMatrix, g_ViewMatrix); matWVP = mul(matWV, g_ProjMatrix); - Out.vPosition = mul(vPosition, matWVP); - Out.vNormal = normalize(mul(vNormal, g_WorldMatrix)).xyz; - Out.vBinormal = normalize(mul(vBinormal, g_WorldMatrix)).xyz; - Out.vTangent = normalize(mul(vTangent, g_WorldMatrix)).xyz; - Out.vTexcoord = In.vTexcoord; - Out.vWorldPos = mul(vPosition, g_WorldMatrix); - Out.vProjPos = Out.vPosition; + Out.vPosition = mul(vPosition, matWVP); + Out.vNormal = normalize(mul(vNormal, g_WorldMatrix)).xyz; + Out.vBinormal = normalize(mul(vBinormal, g_WorldMatrix)).xyz; + Out.vTangent = normalize(mul(vTangent, g_WorldMatrix)).xyz; + Out.vTexcoord = In.vTexcoord; + Out.vWorldPos = mul(vPosition, g_WorldMatrix); + Out.vProjPos = Out.vPosition; return Out; } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl index c8efd9d04..094a0fcab 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl @@ -510,7 +510,7 @@ float4 DrawEffect(PS_IN In) // discard; - fTimeRatio = 1 - pow(1 - fTimeRatio, 3); + //fTimeRatio = 1 - pow(1 - fTimeRatio, 3); float fFade = smoothstep(fTimeRatio - 0.1f, fTimeRatio + 0.1f, vMtrlDissolve.r); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/Transparency.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/Transparency.png new file mode 100644 index 000000000..d350d3d8b Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Action/Transparency.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/Atlas_Spell.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/Atlas_Spell.dds index dd494f042..094852933 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/Atlas_Spell.dds and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/SpellMeters/Atlas_Spell.dds differ diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index 4604806a0..0173d98f1 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -322,6 +322,7 @@ + @@ -491,6 +492,7 @@ Create + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index 11bd374af..f9e14d913 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -475,6 +475,9 @@ {6b288e75-d33a-4a9d-9cb0-139d3671ad13} + + {fe7d5909-159c-4130-ae5e-e08e648b193c} + @@ -927,6 +930,9 @@ 04.InfoInstance\02.MapInfo + + 50.UI\UI_Manager + @@ -1378,6 +1384,9 @@ 04.InfoInstance\02.MapInfo + + 50.UI\UI_Manager + diff --git a/Jusin154_Team3D/Editor/Private/Action_Panel.cpp b/Jusin154_Team3D/Editor/Private/Action_Panel.cpp index ea6164263..c899530b0 100644 --- a/Jusin154_Team3D/Editor/Private/Action_Panel.cpp +++ b/Jusin154_Team3D/Editor/Private/Action_Panel.cpp @@ -54,6 +54,8 @@ HRESULT CAction_Panel::Initialize(void* pArg) Magic_Meter_UV(); Magic_Meter_Visible(1, true); Magic_Meter_Visible(5, true); + Visible(true); + ElementAllVisible(true); return S_OK; } @@ -86,7 +88,7 @@ void CAction_Panel::Late_Update(_float fTimeDelta) } if (m_bVisible) { - //m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } __super::Late_Update(fTimeDelta); @@ -208,7 +210,7 @@ HRESULT CAction_Panel::Ready_Element(void* pArg) { return E_FAIL; } - Add_Element(TEXT("Spell_Overlay"), m_pSpell_Overlay); + Add_Element(TEXT("Spell_Overlay1"), m_pSpell_Overlay); if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSlot_Number)))) { return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Private/Bombard.cpp b/Jusin154_Team3D/Editor/Private/Bombard.cpp index 042976d1f..f15f953ea 100644 --- a/Jusin154_Team3D/Editor/Private/Bombard.cpp +++ b/Jusin154_Team3D/Editor/Private/Bombard.cpp @@ -67,13 +67,14 @@ void CBombard::Update(_float fTimeDelta) pPJTransform->Translation(m_vCameraLook * 2.f); - - if (true == m_pGameInstance->SphereCast(0.125f, XMLoadFloat4(&m_vStartPos), m_vCameraLook, XMVectorGetX(XMVector3Length(m_vCameraLook * 2.f)) - , PSX::PxHitFlag::ePOSITION | PSX::PxHitFlag::eNORMAL, PSX::PxQueryFlag::eSTATIC, hitBuffer)) + if (true == m_pGameInstance->SphereCast(0.5f, XMLoadFloat4(&m_vStartPos), m_vCameraLook, XMVectorGetX(XMVector3Length(m_vCameraLook * 2.f)) + , PSX::PxHitFlag::ePOSITION | PSX::PxHitFlag::eNORMAL, PSX::PxQueryFlag::eDYNAMIC | PSX::PxQueryFlag::eSTATIC, m_Hitbuffer)) { OnCollision(); } + + } void CBombard::Late_Update(_float fTimeDelta) @@ -87,9 +88,9 @@ void CBombard::Late_Update(_float fTimeDelta) } -HRESULT CBombard::Pre_Setting(CGameObject* pObject) +HRESULT CBombard::Pre_Setting(CGameObject* pObject, void* pArg) { - if (FAILED(__super::Pre_Setting(pObject))) + if (FAILED(__super::Pre_Setting(pObject, nullptr))) return E_FAIL; CWand* pWand = static_cast(m_pOwner)->Get_PartObject(); @@ -113,6 +114,8 @@ HRESULT CBombard::Pre_Setting(CGameObject* pObject) m_pLight_Projectile->Set_Visible(true); + // 건드린 친구들 순서대로 다 가져옴 ( 정렬은 안되어있음 ) + return S_OK; } @@ -160,12 +163,17 @@ CGameObject* CBombard::Clone(void* pArg, CGameObject* pOwner) void CBombard::OnCollision(CGameObject* pOther, void* pDesc) { + _int iIndex = CollisionCheck(); + + if (iIndex < 0) + return; + if (m_isCollisionEnter == true) return; m_isCollisionEnter = true; - _vector vPos = XMVectorSet(hitBuffer.block.position.x, hitBuffer.block.position.y, hitBuffer.block.position.z, 1.f); + _vector vPos = XMVectorSet(m_Hitbuffer.touches[iIndex].position.x, m_Hitbuffer.touches[iIndex].position.y, m_Hitbuffer.touches[iIndex].position.z, 1.f); for (auto& pPair : m_PartObjects) diff --git a/Jusin154_Team3D/Editor/Private/BombardSide.cpp b/Jusin154_Team3D/Editor/Private/BombardSide.cpp index 6261f5e74..06d6475be 100644 --- a/Jusin154_Team3D/Editor/Private/BombardSide.cpp +++ b/Jusin154_Team3D/Editor/Private/BombardSide.cpp @@ -48,7 +48,7 @@ HRESULT CBombardSide::Initialize(void* pArg) SAFE_ADDREF(m_pWandTrail); SAFE_ADDREF(m_pWandParticle); - m_fDuration = 2.f; + m_fDuration = 2.5f; m_Events.emplace(0.6f, [&](){ m_isParticleEnd = true; @@ -111,9 +111,9 @@ void CBombardSide::Late_Update(_float fTimeDelta) } -HRESULT CBombardSide::Pre_Setting(CGameObject* pObject) +HRESULT CBombardSide::Pre_Setting(CGameObject* pObject, void* pArg) { - if (FAILED(__super::Pre_Setting(pObject))) + if (FAILED(__super::Pre_Setting(pObject, nullptr))) return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Private/Current_Slot_Number.cpp b/Jusin154_Team3D/Editor/Private/Current_Slot_Number.cpp index f7bb015e0..ba3100acc 100644 --- a/Jusin154_Team3D/Editor/Private/Current_Slot_Number.cpp +++ b/Jusin154_Team3D/Editor/Private/Current_Slot_Number.cpp @@ -112,7 +112,7 @@ HRESULT CCurrent_Slot_Number::Render() { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ALPHABLEND)))) + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::UVALPHABLEND)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp b/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp index ceee66aaa..088ae08ab 100644 --- a/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp +++ b/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp @@ -1,20 +1,21 @@ #include "pch.h" #include "Current_Spell_Slot.h" #include "GameInstance.h" +#include "UI_Manager.h" CCurrent_Spell_Slot::CCurrent_Spell_Slot(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) - :CElementObject(pDevice, pContext) + :CElementObject(pDevice, pContext) { } CCurrent_Spell_Slot::CCurrent_Spell_Slot(const CCurrent_Spell_Slot& rhs) - :CElementObject(rhs) + :CElementObject(rhs) { } HRESULT CCurrent_Spell_Slot::Initialize_Prototype() { - return S_OK; + return S_OK; } HRESULT CCurrent_Spell_Slot::Initialize(void* pArg) @@ -47,6 +48,11 @@ HRESULT CCurrent_Spell_Slot::Initialize(void* pArg) m_pVIBufferCom->Set_Cloned(true); m_pVIBufferCom->Set_Pos(-780.f, 340.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + m_bChangeSlot = false; + m_iSpellType = -1; + m_iSkill_Index = -1; + Clear(-1); + static_cast(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SkillType(*reinterpret_cast<_int*>(p)); }); return S_OK; } @@ -90,6 +96,45 @@ void CCurrent_Spell_Slot::Update(_float fTimeDelta) } } m_fTime += fTimeDelta * m_fTimeMult; + + Hover(); + + + if (m_bHover == true) + { + if (m_pGameInstance->Mouse_Down(DIM_LBUTTON) && m_bClick == false) + { + m_bClick = true; + m_iSkill_Index = Chack_Slot(m_iSlot_Index); + static_cast(m_pOwner)->Function_Callback(TEXT("Current_Hover"), &m_iSkill_Index); + } + } + + if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) + { + if (m_bHover == true) + { + if (m_iSpellType != -1) + { + Get_Skill(m_iSpellType, m_iSlot_Index); + } + + if (m_iSkill_Index != -1) + { + Get_Skill(m_iSkill_Index, m_iSlot_Index); + m_iSkill_Index = -1; + } + m_bHover = false; + m_bClick = false; + m_iSkill_Index = -1; + } + else + { + m_iSkill_Index = -1; + static_cast(m_pOwner)->Function_Callback(TEXT("Current_Hover"), &m_iSkill_Index); + } + } + __super::Update(fTimeDelta); } @@ -112,7 +157,7 @@ HRESULT CCurrent_Spell_Slot::Render() { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::DEFAULT)))) + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::SPELL_SLOT)))) { return E_FAIL; } @@ -152,6 +197,110 @@ void CCurrent_Spell_Slot::SizeUpdate(_float fSizeX, _float fSizeY) m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); } +void CCurrent_Spell_Slot::Hover() +{ + POINT ptMouse{}; + GetCursorPos(&ptMouse); + ScreenToClient(g_hWnd, &ptMouse); + _float2 fMouse; + fMouse.x = ptMouse.x - (g_iWinSizeX * 0.5f); + fMouse.y = -(ptMouse.y - (g_iWinSizeY * 0.5f)); + + // 엘리먼트의 월드 위치를 더해주면 엘리먼트 좌표계 기준이 됨 + fMouse.x -= m_pOwner->Get_WorldPostion().m128_f32[0]; + fMouse.y -= m_pOwner->Get_WorldPostion().m128_f32[1]; + + m_iSlot_Index = m_pVIBufferCom->Set_Mouse_Hover(fMouse); + if (m_iSlot_Index != -1) + { + m_bHover = true; + } + else + { + m_bHover = false; + m_bClick = false; + } +} + +void CCurrent_Spell_Slot::Click_Slot(_bool bClick) +{ + if (bClick == true) + { + m_bClick = true; + } + else + { + m_bClick = false; + } +} + +void CCurrent_Spell_Slot::Get_Skill(_int SpellIndex, _int SlotIndex) +{ + if (SlotIndex == -1) + return; + + if (SpellIndex == -1) + return; + + _int iSlotx = 4; + + _int x = SlotIndex % iSlotx; + _int y = SlotIndex / iSlotx; + + m_iSpell[y][x] = SpellIndex; + m_pVIBufferCom->Set_Equip_Index(SlotIndex); + m_vUV.fUV = UV(SpellIndex); + m_pVIBufferCom->Set_Index_Color(SlotIndex, static_cast<_float>(static_cast(m_pOwner)->Get_Info(SpellIndex).iSpell_Type)); + m_pVIBufferCom->Set_Index_ImageUV(SlotIndex, m_vUV); + //m_pManager->Event_Callback(TEXT("Skill_Change")); +} + +_int CCurrent_Spell_Slot::Chack_Slot(_int Index) const +{ + _int iSlotx = 4; + + _int x = Index % iSlotx; + _int y = Index / iSlotx; + + return m_iSpell[y][x]; +} + +void CCurrent_Spell_Slot::Clear(_int iValue) +{ + for (_int i = 0; i < 4; ++i) + { + for (_int j = 0; j < 4; ++j) + { + m_iSpell[i][j] = iValue; + } + } +} + +_float4 CCurrent_Spell_Slot::UV(_int SpellID) +{ + _float2 fImage_Size = { 1024.f, 1792.f }; + + _uint iCountX = 4; + _uint iCountY = 7; + + _float iImageX = 256.f; + _float iImageY = 256.f; + + _uint iframeX = SpellID % iCountX; + _uint iframeY = SpellID / iCountX; + + _float2 UVStart; + UVStart.x = iframeX * iImageX / fImage_Size.x; + UVStart.y = iframeY * iImageY / fImage_Size.y; + + _float2 UVEnd; + UVEnd.x = UVStart.x + (iImageX / fImage_Size.x); + UVEnd.y = UVStart.y + (iImageY / fImage_Size.y); + + _float4 UV = _float4{ UVStart.x, UVStart.y, UVEnd.x, UVEnd.y }; + return UV; +} + HRESULT CCurrent_Spell_Slot::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) @@ -170,6 +319,14 @@ HRESULT CCurrent_Spell_Slot::Bind_ShaderResources() { return E_FAIL; } + if (FAILED(m_pDiffuse_TextureCom1->Bind_ShaderResource(m_pShaderCom, "g_Texture1", 0))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom2->Bind_ShaderResource(m_pShaderCom, "g_Texture2", 0))) + { + return E_FAIL; + } if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { return E_FAIL; @@ -200,7 +357,15 @@ HRESULT CCurrent_Spell_Slot::Ready_Components(void* pArg) { return E_FAIL; } - if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_ActionItemGoldleaf_4K"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_SpellType_Generic"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_Atlas_Spell"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_ActionItemGoldleaf_4K"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) { return E_FAIL; } @@ -208,7 +373,6 @@ HRESULT CCurrent_Spell_Slot::Ready_Components(void* pArg) { return E_FAIL; } - return S_OK; } @@ -243,6 +407,8 @@ void CCurrent_Spell_Slot::Free() __super::Free(); SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pDiffuse_TextureCom1); + SAFE_RELEASE(m_pDiffuse_TextureCom2); SAFE_RELEASE(m_pShaderCom); SAFE_RELEASE(m_pVIBufferCom); } diff --git a/Jusin154_Team3D/Editor/Private/Decendo.cpp b/Jusin154_Team3D/Editor/Private/Decendo.cpp index fca79c71d..2bc18e59e 100644 --- a/Jusin154_Team3D/Editor/Private/Decendo.cpp +++ b/Jusin154_Team3D/Editor/Private/Decendo.cpp @@ -7,15 +7,18 @@ #include "Wand.h" #include "Player.h" +#include "InfoInstance.h" CDecendo::CDecendo(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CEffect_Container{ pDevice, pContext } + { } CDecendo::CDecendo(const CDecendo& rhs) - : CEffect_Container(rhs) + : CEffect_Container(rhs), + m_pInfoInstance(CInfoInstance::GetInstance()) { } @@ -46,7 +49,7 @@ HRESULT CDecendo::Initialize(void* pArg) SAFE_ADDREF(m_pProjectile_Blur); SAFE_ADDREF(m_pProjectile); - m_fDuration = 2.5f; + m_fDuration = 3.5f; return S_OK; } @@ -67,26 +70,23 @@ void CDecendo::Update(_float fTimeDelta) Update_Event(fTimeDelta); - m_pProjectile_Blur->Get_Component()->Translation(m_vCameraLook * 0.5f); - m_pProjectile->Get_Component()->Translation(m_vCameraLook * 0.5f); + _vector vDirection = XMLoadFloat3(&m_vCameraLook); + // 선속도 + m_pProjectile_Blur->Get_Component()->Translation(vDirection * m_fLinearSpeed * fTimeDelta); + m_pProjectile->Get_Component()->Translation(vDirection * m_fLinearSpeed * fTimeDelta); - if (m_fAccTime > XM_2PI) + //Up벡터 방향으로 파이만큼 이동 + + if (m_fRotateAccTime > XM_2PI) return; - m_fAccTime += fTimeDelta * 7.5f; + m_fRotateAccTime += fTimeDelta * m_fAngularSpeed; - m_pProjectile_Blur->Get_Component()->Translation(m_vRotateUp * 0.2f * sinf(m_fAccTime)); - m_pProjectile->Get_Component()->Translation(m_vRotateUp * 0.2f * sinf(m_fAccTime)); + m_pProjectile_Blur->Get_Component()->Translation(XMLoadFloat3(&m_vRotateUp) * sinf(m_fRotateAccTime) * 0.1f); + m_pProjectile->Get_Component()->Translation(XMLoadFloat3(&m_vRotateUp) * sinf(m_fRotateAccTime) * 0.1f); - //TODO : 다시 위치 잡기 - if (true == m_pGameInstance->SphereCast(0.125f, XMLoadFloat4(&m_vStartPos), m_vCameraLook, XMVectorGetX(XMVector3Length(m_vCameraLook * 0.5f)) - , PSX::PxHitFlag::ePOSITION | PSX::PxHitFlag::eNORMAL, PSX::PxQueryFlag::eSTATIC, hitBuffer)) - { - OnCollision(); - } - } void CDecendo::Late_Update(_float fTimeDelta) @@ -98,58 +98,103 @@ void CDecendo::Late_Update(_float fTimeDelta) XMStoreFloat4(&m_vEndPos, m_pProjectile->Get_WorldPostion()); + _vector vDir = XMLoadFloat4(&m_vEndPos) - XMLoadFloat4(&m_vStartPos); + + if (true == m_pGameInstance->SphereCast(0.125, XMLoadFloat4(&m_vStartPos), XMVector3Normalize(vDir), XMVectorGetX(XMVector3Length(vDir)) + , PSX::PxHitFlag::ePOSITION | PSX::PxHitFlag::eNORMAL, PSX::PxQueryFlag::eDYNAMIC | PSX::PxQueryFlag::eSTATIC, m_Hitbuffer)) + { + OnCollision(); + } + __super::Late_Update(fTimeDelta); } -HRESULT CDecendo::Pre_Setting(CGameObject* pObject) +HRESULT CDecendo::Pre_Setting(CGameObject* pObject, void* pArg) { - if (FAILED(__super::Pre_Setting(pObject))) + if (FAILED(__super::Pre_Setting(pObject, nullptr))) return E_FAIL; - CWand* pWand = static_cast(m_pOwner)->Get_PartObject(); + CWand* pWand = static_cast(m_pOwner); if (pWand == nullptr) return E_FAIL; - CPartObject* pCircle0 = Get_PartObject(); - CPartObject* pWandLight = Get_PartObject("Decendo_Wand_Light"); - - - /* 초기 객체 위치 초기화 */ pCircle0->Get_Component()->Set_State(STATE::POSITION, pWand->Get_WorldPostion()); pWandLight->Get_Component()->Set_State(STATE::POSITION, pWand->Get_WorldPostion()); - m_pProjectile->Get_Component()->Set_State(STATE::POSITION, pWand->Get_WorldPostion()); - m_pProjectile_Blur->Get_Component()->Set_State(STATE::POSITION, pWand->Get_WorldPostion()); + + + /* 초기 위치 저장 */ + _vector vStartPos = m_pOwner->Get_WorldPostion(); + XMStoreFloat4(&m_vStartPos, vStartPos); + + /* 초기 객체 위치 초기화 */ + + m_pProjectile->Get_Component()->Set_State(STATE::POSITION, vStartPos); + m_pProjectile_Blur->Get_Component()->Set_State(STATE::POSITION, vStartPos); /* 초기 객체 비지블 */ - pCircle0->Set_Visible(true); - pWandLight->Set_Visible(true); - m_pProjectile->Set_Visible(true); m_pProjectile_Blur->Set_Visible(true); - /*트레일 초기화 */ Get_PartObject()->Set_Visible(true); Get_PartObject()->Get_Component()->Reset_Trail(); - //나아가는 벡터와 한점을 가져와 수직인 평면상에 하나의 점으로 DIR 을 만듬 - m_vCameraLook = XMVector3Normalize(m_pOwner->Get_Component()->Get_State(STATE::LOOK)); + _vector vDirection = m_pOwner->Get_Owner()->Get_Component()->Get_State(STATE::LOOK); + + XMStoreFloat3(&m_vCameraLook, vDirection); + + { /* 대상 위치 지정 */ + + CUnit* pTargetUnit = m_pInfoInstance->Get_LockOnUnit(); + if (nullptr != pTargetUnit) { + + XMStoreFloat4(&m_vTargetPos, pTargetUnit->Get_WorldPostion()); + + XMStoreFloat3(&m_vCameraLook, XMVector3Normalize(XMLoadFloat4(&m_vTargetPos) - XMLoadFloat4(&m_vStartPos))); + } + else { + // 타겟이 없다면 현재위치 -> 카메라 룩벡터 * duration간 예상 이동거리 를 대상으로 지정 + XMStoreFloat4(&m_vTargetPos, vStartPos + vDirection * m_fLinearSpeed * 0.5f); + } + } + + + /* 대상 거리 계산 */ + + m_fRotateAccTime = 0.f; + _vector vUp = XMVectorSet(0.f, 1.f, 0.f, 0.f); + _vector vRight = XMVectorSet(1.f, 0.f, 0.f, 0.f); - _vector vQuaternion = XMQuaternionRotationAxis(m_vCameraLook, m_pGameInstance->Random_Float(0.f, XM_PIDIV2)); + _vector vQuaternion = XMQuaternionRotationAxis(XMLoadFloat3(&m_vCameraLook), XMConvertToRadians(m_pGameInstance->Random_Float(0 , 360.f))); - m_vRotateUp = XMVector3Rotate(vUp, vQuaternion); - m_vRotateUp = XMVector3Normalize(m_vRotateUp); + XMStoreFloat3(&m_vRotateUp, XMVector3Normalize(XMVector3Rotate(vUp, vQuaternion))); + /* 내속도를 알고 잇음*/ + + /* 거리 / 속도 = 시간 */ + + _float fDistance = XMVectorGetX(XMVector3Length(XMLoadFloat4(&m_vTargetPos) - XMLoadFloat4(&m_vStartPos))); + + m_fTimeRate = fDistance / m_fLinearSpeed; + + //내가 적에게까지 갈때까지 걸리는 시간을 암 + + //그러므로 내가 0 ~ 파이 까지 러프하는 과정이 그 시간동안 이루어져야 함 + + //그 속도가 파이 / 시간 이므로 이걸 프레임마다 누적함 + + m_fAngularSpeed = XM_2PI / m_fTimeRate; // 프레임마다 누적할 시간 + return S_OK; } @@ -197,12 +242,17 @@ CGameObject* CDecendo::Clone(void* pArg, CGameObject* pOwner) void CDecendo::OnCollision(CGameObject* pOther, void* pDesc) { + _int iIndex = CollisionCheck(); + + if (iIndex < 0) + return; + if (m_isCollisionEnter == true) return; m_isCollisionEnter = true; - _vector vPos = XMVectorSet(hitBuffer.block.position.x, hitBuffer.block.position.y, hitBuffer.block.position.z, 1.f); + _vector vPos = XMVectorSet(m_Hitbuffer.touches[iIndex].position.x, m_Hitbuffer.touches[iIndex].position.y, m_Hitbuffer.touches[iIndex].position.z, 1.f); for (auto& pPair : m_PartObjects) @@ -217,7 +267,7 @@ void CDecendo::OnCollision(CGameObject* pOther, void* pDesc) m_pProjectile->Set_Visible(false); - CWand* pWand = static_cast(m_pOwner)->Get_PartObject(); + CWand* pWand = static_cast(m_pOwner); if (pWand == nullptr) return; @@ -254,6 +304,20 @@ void CDecendo::Free() #ifdef _DEBUG void CDecendo::Describe_Entity() { + GUI::Begin("DECENDO"); + + GUI::InputFloat("Speed", &m_fLinearSpeed); + + _float fDistance = XMVectorGetX(XMVector3Length(XMLoadFloat4(&m_vTargetPos) - XMLoadFloat4(&m_vStartPos))); + + GUI::InputFloat("DISTANCE", &fDistance); + GUI::InputFloat("AngularSpeed", &m_fAngularSpeed); + GUI::InputFloat("TimeRate", &m_fTimeRate); + + + GUI::InputFloat3("TargetPos", (_float*)&m_vTargetPos); + + GUI::End(); } #endif diff --git a/Jusin154_Team3D/Editor/Private/DecendoSide.cpp b/Jusin154_Team3D/Editor/Private/DecendoSide.cpp index f7a179cad..790d32939 100644 --- a/Jusin154_Team3D/Editor/Private/DecendoSide.cpp +++ b/Jusin154_Team3D/Editor/Private/DecendoSide.cpp @@ -99,9 +99,9 @@ void CDecendoSide::Late_Update(_float fTimeDelta) } -HRESULT CDecendoSide::Pre_Setting(CGameObject* pObject) +HRESULT CDecendoSide::Pre_Setting(CGameObject* pObject, void* pArg) { - if (FAILED(__super::Pre_Setting(pObject))) + if (FAILED(__super::Pre_Setting(pObject, nullptr))) return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Private/EditEffect.cpp b/Jusin154_Team3D/Editor/Private/EditEffect.cpp index 396ddff81..7fa642c7c 100644 --- a/Jusin154_Team3D/Editor/Private/EditEffect.cpp +++ b/Jusin154_Team3D/Editor/Private/EditEffect.cpp @@ -110,6 +110,11 @@ void CEditEffect::Late_Update(_float fTimeDelta) } +_vector CEditEffect::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + void CEditEffect::Reference_Mat_For_EditEffect() { @@ -417,8 +422,9 @@ void CEditEffect::Describe_Entity() { //여기서 모델, 텍스쳐, 선택할 수 있도록 함 + const char* pLerp[] = { "Linear" , "EaseInQuad", "EaseOutQuad", "EaseInCubic" , "EaseOutCubic" , "EaseInOutSin" , "EaseInBack" , "Expo" , "Circle" }; - const char* pRenderNames[] = { "PRIORITY" , "SHADOW", "NONBLEND", "DECAL", "BLUR" , "NONLIGHT" ,"EFFECT", "BLEND" ,"BLOOM" , "UI", "OCCLUSION"}; + const char* pRenderNames[] = { "PRIORITY" , "SHADOW", "NONBLEND", "DECAL", "BLUR" , "NONLIGHT" ,"EFFECT", "BLEND" ,"BLOOM" , "UI", "OCCLUSION" , "PRESHADOW"}; const char* pEffectType[] = { "EFFECT" , "TRAIL" }; const char* pShaderPass[] = { "DEFAULT" , "NON_NOMALMAP" , "BLUR" , "WEIGHTBLEND" , "NON_WORLD" , "NON_WORLD_BLUR", "BLEND", "BLEND_NOWORLD", "BLOOM" ,"BLOOM_NOWORLD" ,"BLUR_NO_EMMISVE", "BLUR_NO_WORLD_NO_EMISSIVE","WEIGHTBLEND_FOR_BLEND"}; const char* pBloomType[] = { "NONE" , "BASIC" , "MUILTY"}; diff --git a/Jusin154_Team3D/Editor/Private/Eessential_Spell_Slot.cpp b/Jusin154_Team3D/Editor/Private/Eessential_Spell_Slot.cpp index b8fc818c2..6c1923954 100644 --- a/Jusin154_Team3D/Editor/Private/Eessential_Spell_Slot.cpp +++ b/Jusin154_Team3D/Editor/Private/Eessential_Spell_Slot.cpp @@ -91,7 +91,7 @@ void CEessential_Spell_Slot::Update(_float fTimeDelta) } } - Hover(fTimeDelta); + Hover(); m_fTime += fTimeDelta * m_fTimeMult; __super::Update(fTimeDelta); @@ -156,7 +156,7 @@ void CEessential_Spell_Slot::SizeUpdate(_float fSizeX, _float fSizeY) m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); } -void CEessential_Spell_Slot::Hover(_float fTimeDelta) +void CEessential_Spell_Slot::Hover() { POINT ptMouse{}; GetCursorPos(&ptMouse); diff --git a/Jusin154_Team3D/Editor/Private/EffectPool.cpp b/Jusin154_Team3D/Editor/Private/EffectPool.cpp index dd03e1dae..c3a39568c 100644 --- a/Jusin154_Team3D/Editor/Private/EffectPool.cpp +++ b/Jusin154_Team3D/Editor/Private/EffectPool.cpp @@ -62,6 +62,8 @@ void CEffectPool::Priority_Update(_float fTimeDelta) } } + (*m_EffectList[ENUM_CLASS(SKILL_TYPE::DESCENDO)].begin())->Describe_Entity(); + } void CEffectPool::Update(_float fTimeDelta) @@ -215,7 +217,7 @@ HRESULT CEffectPool::Ready_Effect() return S_OK; } -HRESULT CEffectPool::Use_Skill(SKILL_TYPE eType, CGameObject* pOwner) +HRESULT CEffectPool::Use_Skill(SKILL_TYPE eType, CGameObject* pOwner, void* pArg) { if (pOwner == nullptr) return S_OK; @@ -225,7 +227,7 @@ HRESULT CEffectPool::Use_Skill(SKILL_TYPE eType, CGameObject* pOwner) if (pSkill->Get_Visible() == true) continue; - pSkill->Pre_Setting(pOwner); + pSkill->Pre_Setting(pOwner, pArg); m_ActiveEffectList.push_back(pSkill); Safe_AddRef(pSkill); diff --git a/Jusin154_Team3D/Editor/Private/Effect_Container.cpp b/Jusin154_Team3D/Editor/Private/Effect_Container.cpp index e9e58c49a..db3f7ce43 100644 --- a/Jusin154_Team3D/Editor/Private/Effect_Container.cpp +++ b/Jusin154_Team3D/Editor/Private/Effect_Container.cpp @@ -306,7 +306,7 @@ HRESULT CEffect_Container::Load_Package(const _char* pPath) return S_OK; } -HRESULT CEffect_Container::Pre_Setting(CGameObject* pObject) +HRESULT CEffect_Container::Pre_Setting(CGameObject* pObject, void* pArg) { if (pObject == nullptr) return E_FAIL; @@ -418,3 +418,61 @@ void CEffect_Container::Update_Event(_float fTimeDelta) } + +_int CEffect_Container::CollisionCheck() +{ + _bool bIsCollide = { false }; + + // 건드린 친구들 순서대로 다 가져옴 ( 정렬은 안되어있음 ) + for (PSX::PxU32 i = 0; i < m_Hitbuffer.nbTouches; ++i) + { + const PSX::PxSweepHit& Hit = m_Hitbuffer.touches[i]; + /* 기타 로직 */ + + PSX::PxRigidActor* pActor = Hit.actor; + PSX::PxShape* pShape = Hit.shape; + + if (nullptr != pActor && nullptr != pActor->userData) { + + PhsXUserData* pUserData = static_cast(pActor->userData); + + if (pUserData->iSubKind >= UINT_MAX - 1) { + continue; + } + + switch (PXOBJECT(pUserData->eKind)) + { + case PXOBJECT::PLAYER: + continue; + case PXOBJECT::MONSTER: + case PXOBJECT::GOBLIN_WARRIOR: + case PXOBJECT::TROLL: + case PXOBJECT::WALL: + + { + return i; + } + break; + default: + break; + } + + switch (pUserData->eKind) + { + case PHYSX_KIND::BODY_STATIC: + case PHYSX_KIND::BODY_DYNAMIC: + { + return i; + } + break; + case PHYSX_KIND::CCTActor: + break; + default: + break; + } + } + } + + return -1; + +} diff --git a/Jusin154_Team3D/Editor/Private/GamePlay_Canvas.cpp b/Jusin154_Team3D/Editor/Private/GamePlay_Canvas.cpp index 92bceea98..077702144 100644 --- a/Jusin154_Team3D/Editor/Private/GamePlay_Canvas.cpp +++ b/Jusin154_Team3D/Editor/Private/GamePlay_Canvas.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include "GamePlay_Canvas.h" #include "GameInstance.h" +#include "UI_Manager.h" #include "Mission_Panel.h" #include "MiniMap_Panel.h" #include "Loading_Panel.h" @@ -44,11 +45,13 @@ HRESULT CGamePlay_Canvas::Initialize(void* pArg) { return E_FAIL; } + Visible(true); return S_OK; } void CGamePlay_Canvas::Priority_Update(_float fTimeDelta) { + __super::Priority_Update(fTimeDelta); } diff --git a/Jusin154_Team3D/Editor/Private/Goblin.cpp b/Jusin154_Team3D/Editor/Private/Goblin.cpp index e8c7401fc..e3cba447f 100644 --- a/Jusin154_Team3D/Editor/Private/Goblin.cpp +++ b/Jusin154_Team3D/Editor/Private/Goblin.cpp @@ -10,6 +10,7 @@ #include "State_Land.h" #include "State_Move.h" #include "State_Combat.h" +#include "InfoInstance.h" #pragma endregion CGoblin::CGoblin(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -53,6 +54,8 @@ HRESULT CGoblin::Initialize(void* pArg) m_pCharacter_Controller->Set_Position(XMVectorSet(-10.f, 0.f, -10.f, 1.f)); + CInfoInstance::GetInstance()->Regist_ActiveMonster(this); + return S_OK; } @@ -67,7 +70,7 @@ void CGoblin::Update(_float fTimeDelta) m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); - m_pCharacter_Controller->Move(fTimeDelta); + //m_pCharacter_Controller->Move(fTimeDelta); } @@ -76,7 +79,7 @@ void CGoblin::Late_Update(_float fTimeDelta) __super::Late_Update(fTimeDelta); m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position()); - m_pTransformCom->LookAt(m_pPlayerTransform->Get_State(STATE::POSITION)); + //m_pTransformCom->LookAt(m_pPlayerTransform->Get_State(STATE::POSITION)); m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this); } diff --git a/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp b/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp index e25650f18..c5ddcdc85 100644 --- a/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp +++ b/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp @@ -1,8 +1,8 @@ #include "pch.h" #include "IMGUIUI.h" #include "UIObject.h" -#include "GamePlay_Canvas.h" -#include "Spell_Canvas.h" +#include "UI_Manager.h" +#include "CanvasObject.h" #include "PanelObject.h" #include "ElementObject.h" #include "Mouse_Cursor.h" @@ -32,6 +32,38 @@ HRESULT CIMGUIUI::Initialize(void* pArg) return S_OK; } +void CIMGUIUI::CanvaswstringTostring(vector& panelNames) +{ + m_iCanvasNamestring.clear(); + m_iCanvaslName.clear(); + m_iCanvasNamewstring.clear(); + + m_iCanvasNamewstring = panelNames; + + for (auto& wname : panelNames) + { + // wstring -> UTF-8 string 변환 + int size = WideCharToMultiByte(CP_UTF8, 0, + wname.c_str(), (int)wname.size(), + nullptr, 0, nullptr, nullptr); + + std::string result(size, 0); + + WideCharToMultiByte(CP_UTF8, 0, + wname.c_str(), (int)wname.size(), + &result[0], size, nullptr, nullptr); + + // 변환된 string 저장 + m_iCanvasNamestring.push_back(std::move(result)); + } + + // vector 업데이트 + for (auto& str : m_iCanvasNamestring) + m_iCanvaslName.push_back(str.c_str()); + + m_iCanvasCount = 999; +} + void CIMGUIUI::PanelwstringTostring(vector& panelNames) { m_iPanelNamestring.clear(); @@ -104,7 +136,6 @@ void CIMGUIUI::Update(_float fTimeDelta) { static const char* SpellTypeNames[] = { "CONTROL","POWER", "DAMAGE","UTILITY", "TRANSFORM", "CURSE", "ESSENTIAL" }; int itemCount = sizeof(SpellTypeNames) / sizeof(const char*); - static const char* CanvasNames[] = { "GamePlay Canvas", "Spell Canvas" }; static int iCanvasIndex = 0; if (m_pCurrent_Canvas != nullptr) { @@ -154,17 +185,20 @@ void CIMGUIUI::Update(_float fTimeDelta) m_fMoveSpeed = static_cast(m_pElementObject)->Get_Speed(); m_fAngle = static_cast(m_pElementObject)->Get_Angle(); m_iSpellType = static_cast(m_pElementObject)->Get_SkillType(); + m_iSkillType = static_cast(m_pElementObject)->Get_SpellType(); m_fCoolTime = static_cast(m_pElementObject)->Get_CoolTime(); } - GUI::Begin("Current_PanelObject_Info"); - if (m_pCurrent_Canvas != nullptr) + GUI::Begin("Current_CanvasObject_Info"); + if (m_pUI_Manager != nullptr) { - if (GUI::Combo("Canvas", &iCanvasIndex, CanvasNames, 2)) + auto CanvasName = static_cast(m_pUI_Manager)->Canvas_Name(); + if (CanvasName != m_iCanvasNamewstring) { - if (iCanvasIndex == 0) - m_pCurrent_Canvas = m_pGamePlay_Canvas; - else - m_pCurrent_Canvas = m_pSpell_Canvas; + CanvaswstringTostring(CanvasName); + } + if (GUI::Combo("Canvas", &m_iCanvasCount, m_iCanvaslName.data(), static_cast<_int>(m_iCanvaslName.size()))) + { + m_pCurrent_Canvas = static_cast(m_pUI_Manager)->Get_Canvas(m_iCanvasNamewstring[m_iCanvasCount]); } } if (m_pCurrent_Canvas != nullptr) @@ -436,6 +470,7 @@ void CIMGUIUI::Update(_float fTimeDelta) static_cast(m_pElementObject)->Set_Angle(m_fAngle); } + GUI::Text("SpellType %d", m_iSkillType); GUI::Text("SkillType %d", m_iSpellType); if (GUI::Combo("SkillType", &m_iSpellType, SpellTypeNames, itemCount)) { @@ -467,15 +502,12 @@ HRESULT CIMGUIUI::Bind_ShaderResources() HRESULT CIMGUIUI::Ready_Components(void* pArg) { - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pGamePlay_Canvas)))) + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pUI_Manager)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Canvas)))) - { - return E_FAIL; - } return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp index deb2afb09..ef6720fd5 100644 --- a/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp @@ -16,6 +16,7 @@ #include "Player.h" #include "EffectPool.h" #include "InfoInstance.h" +#include "Goblin.h" CLevel_EffectViewer::CLevel_EffectViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } @@ -43,6 +44,9 @@ HRESULT CLevel_EffectViewer::Initialize() return E_FAIL; } + + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_EffectPool")))) //플레이어보다 먼저 생성해야함! { return E_FAIL; @@ -61,10 +65,16 @@ HRESULT CLevel_EffectViewer::Initialize() return E_FAIL; } + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Monster")))) + return E_FAIL; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Sky")))){ return E_FAIL; } + ZeroMemory(&m_PlaneData, sizeof(m_PlaneData)); + m_PlaneData.eKind = PHYSX_KIND::BODY_STATIC; + m_PlaneData.iSubKind = ENUM_CLASS(PXOBJECT::TERRAIN); m_pGameInstance->Add_Editor_Plane(m_PlaneData); return S_OK; @@ -138,7 +148,7 @@ HRESULT CLevel_EffectViewer::Ready_Layer_PhysX(const _wstring& strLayerTag) CDummy_PhysXBox::PHYSXDUMMY_DESC Desc{}; Desc.vPos = { m_pGameInstance->Random_Float(0.f, 30.f), m_pGameInstance->Random_Float(3.f, 33.f), m_pGameInstance->Random_Float(0.f, 30.f) }; Desc.vRotRPY = { m_pGameInstance->Random_Float(0.f, XM_2PI), m_pGameInstance->Random_Float(0.f, XM_2PI), m_pGameInstance->Random_Float(0.f, XM_2PI) }; - Desc.iSubKind = 0; + Desc.iSubKind = ENUM_CLASS(PXOBJECT::BOX); if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) { return E_FAIL; @@ -149,7 +159,7 @@ HRESULT CLevel_EffectViewer::Ready_Layer_PhysX(const _wstring& strLayerTag) CDummy_PhysXWall::PHYSXDUMMY_DESC Desc{}; Desc.vPos = { -15.f, 3.f, 15.f }; Desc.vRotRPY = { 0.f, m_pGameInstance->Random_Float(0.f, XM_2PI), 0.f }; - Desc.iSubKind = 23; + Desc.iSubKind = ENUM_CLASS(PXOBJECT::WALL); if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) { return E_FAIL; @@ -160,7 +170,7 @@ HRESULT CLevel_EffectViewer::Ready_Layer_PhysX(const _wstring& strLayerTag) CDummy_PhysXMonster::PHYSXDUMMY_DESC Desc{}; Desc.vPos = { 0.f, 150.f, 5.f }; Desc.vRotRPY = { 12.f, 0.f, 0.f }; - Desc.iSubKind = 10; + Desc.iSubKind = ENUM_CLASS(PXOBJECT::GOBLIN_WARRIOR); if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER, &Desc))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp index fffb1faef..0bb6faa46 100644 --- a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp @@ -327,8 +327,6 @@ void CLevel_ObjectViewer::Show_AnimList() if (GUI::Button(pModel->Get_AnimList(i))) { pModel->Set_AnimationIndex(i); - pModel->Set_CurrentTrackPosition(0.f); - pModel->Play_Animation(0.f); } } } @@ -661,8 +659,6 @@ void CLevel_ObjectViewer::Find_Anim() if (GUI::Button(pModel->Get_AnimList(m_iAnimIndex))) { pModel->Set_AnimationIndex(m_iAnimIndex); - pModel->Set_CurrentTrackPosition(0.f); - pModel->Play_Animation(0.f); } } @@ -677,8 +673,6 @@ void CLevel_ObjectViewer::Find_Anim() if (GUI::Button(pModel->Get_AnimList(i))) { pModel->Set_AnimationIndex(i); - pModel->Set_CurrentTrackPosition(0.f); - pModel->Play_Animation(0.f); } } } diff --git a/Jusin154_Team3D/Editor/Private/Levioso.cpp b/Jusin154_Team3D/Editor/Private/Levioso.cpp index 2a79e53bd..0a7a72f9c 100644 --- a/Jusin154_Team3D/Editor/Private/Levioso.cpp +++ b/Jusin154_Team3D/Editor/Private/Levioso.cpp @@ -80,7 +80,7 @@ void CLevioso::Update(_float fTimeDelta) m_pTrail_PT_0->Get_Component()->Translation(m_vOwnerLook * 0.25f); if (true == m_pGameInstance->SphereCast(0.0f, XMLoadFloat4(&m_vStartPos), m_vOwnerLook, XMVectorGetX(XMVector3Length(m_vOwnerLook * 1.f)) - , PSX::PxHitFlag::ePOSITION | PSX::PxHitFlag::eNORMAL, PSX::PxQueryFlag::eSTATIC, hitBuffer)) + , PSX::PxHitFlag::ePOSITION | PSX::PxHitFlag::eNORMAL, PSX::PxQueryFlag::eSTATIC, m_Hitbuffer)) { OnCollision(); } @@ -112,10 +112,10 @@ void CLevioso::Late_Update(_float fTimeDelta) } -HRESULT CLevioso::Pre_Setting(CGameObject* pObject) +HRESULT CLevioso::Pre_Setting(CGameObject* pObject, void* pArg) { - if (FAILED(__super::Pre_Setting(pObject))) + if (FAILED(__super::Pre_Setting(pObject, nullptr))) return E_FAIL; CPlayer* pPlayer = static_cast(m_pOwner); @@ -126,6 +126,8 @@ HRESULT CLevioso::Pre_Setting(CGameObject* pObject) _vector WandPos = pPlayer->Get_WandPos().r[3]; CEditEffect* pWandSmoke = Get_PartObject("Levioso_Wand0"); + CEditEffect* pWandLight= Get_PartObject("Levioso_Wand_Light"); + m_pLeviosoPJ_0->Get_Component()->Set_WorldMatrix(m_pOwner->Get_Component()->Get_XMWorldMatrix()); m_pTrail_PT_0->Get_Component()->Set_WorldMatrix(m_pOwner->Get_Component()->Get_XMWorldMatrix()); @@ -134,10 +136,12 @@ HRESULT CLevioso::Pre_Setting(CGameObject* pObject) m_pLeviosoPJ_0->Get_Component()->Set_State(STATE::POSITION, WandPos); m_pTrail_PT_0->Get_Component()->Set_State(STATE::POSITION, WandPos); pWandSmoke->Get_Component()->Set_State(STATE::POSITION, pPlayer->Get_PartObject()->Get_WorldPostion()); + pWandLight->Get_Component()->Set_State(STATE::POSITION, pPlayer->Get_PartObject()->Get_WorldPostion()); m_pLeviosoPJ_0->Set_Visible(true); m_pTrail_PT_0->Set_Visible(true); pWandSmoke->Set_Visible(true); + pWandLight->Set_Visible(true); m_pLeviosoTrail->Set_Visible(true); m_pLeviosoTrail->Get_Component()->Reset_Trail(); @@ -196,7 +200,7 @@ void CLevioso::OnCollision(CGameObject* pOther, void* pDesc) m_isCollisionEnter = true; - _vector vPos = XMVectorSet(hitBuffer.block.position.x, hitBuffer.block.position.y, hitBuffer.block.position.z, 1.f); + _vector vPos = XMVectorSet(m_Hitbuffer.block.position.x, m_Hitbuffer.block.position.y, m_Hitbuffer.block.position.z, 1.f); for (auto& pPair : m_PartObjects) @@ -208,6 +212,15 @@ void CLevioso::OnCollision(CGameObject* pOther, void* pDesc) m_fAccTime = 0.f; m_fDuration = 3.f; //적중하면 지속시간 3초 + CPlayer* pPlayer = static_cast(m_pOwner); + + if (pPlayer == nullptr) + return; + + _vector WandPos = pPlayer->Get_WandPos().r[3]; + + CEditEffect* pWandLight = Get_PartObject("Levioso_Wand_Light"); + pWandLight->Get_Component()->Set_State(STATE::POSITION, pPlayer->Get_PartObject()->Get_WorldPostion()); //CEditEffect* pLevioso_Hit = Get_PartObject("Levioso_Hit"); //CEditEffect* pLevioso_Bottom_Wind = Get_PartObject("Levioso_Bottom_Wind"); //CEditEffect* pLevioso_Rotate0 = Get_PartObject("Levioso_Rotate0"); diff --git a/Jusin154_Team3D/Editor/Private/LeviosoSide.cpp b/Jusin154_Team3D/Editor/Private/LeviosoSide.cpp index a99a9a4fa..aa618c7d4 100644 --- a/Jusin154_Team3D/Editor/Private/LeviosoSide.cpp +++ b/Jusin154_Team3D/Editor/Private/LeviosoSide.cpp @@ -88,9 +88,9 @@ void CLeviosoSide::Late_Update(_float fTimeDelta) } -HRESULT CLeviosoSide::Pre_Setting(CGameObject* pObject) +HRESULT CLeviosoSide::Pre_Setting(CGameObject* pObject, void* pArg) { - if (FAILED(__super::Pre_Setting(pObject))) + if (FAILED(__super::Pre_Setting(pObject, nullptr))) return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 245cc0ba2..57b727dec 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -37,6 +37,7 @@ #pragma region UI #include "Spell_Data.h" +#include "UI_Manager.h" #include "GamePlay_Canvas.h" @@ -81,6 +82,7 @@ #include "Spell_Vidio_Border.h" #include "Spell_Anim.h" #include "Current_Slot_Number.h" +#include "Spell_Drag.h" #include "IMGUIUI.h" @@ -710,6 +712,11 @@ HRESULT CLoader::Loading_For_UI() return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), TEXT("Wingardium_Leviosa"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Wingardium_Leviosa\\Wingardium_Leviosa%d.png"), 273)))) + { + return E_FAIL; + } if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), TEXT("Wingardium_Leviosa"), CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Wingardium_Leviosa\\Wingardium_Leviosa%d.png"), 273)))) { @@ -827,6 +834,11 @@ HRESULT CLoader::Loading_For_UI() return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CUI_Manager::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CGamePlay_Canvas::Create(m_pDevice, m_pContext)))) { return E_FAIL; @@ -986,6 +998,10 @@ HRESULT CLoader::Loading_For_UI() { return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Drag::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CIMGUIUI::Create(m_pDevice, m_pContext)))) { @@ -1187,6 +1203,12 @@ HRESULT CLoader::Loading_For_Effect() vector*>> futures = {}; + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Monster/Goblin/Goblin.bin", XMMatrixRotationY(XMConvertToRadians(180.f))* XMMatrixIdentity(), + TEXT("Prototype_Component_Goblin_Model") + + )); + futures.emplace_back(Deferred_ModelLoad( MODEL::NONANIM, "../Bin/Resources/Models/SkyBox/SkyBox.fbx", XMMatrixIdentity(), TEXT("Prototype_Component_SkyboxModel") @@ -1267,6 +1289,8 @@ HRESULT CLoader::Loading_For_Effect() if (FAILED(m_pGameInstance->Add_Prototype(ENUM_CLASS(LEVEL::EFFECT), CNomalJap::Create(m_pDevice, m_pContext)))) return E_FAIL; + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CGoblin::Create(m_pDevice, m_pContext)))) + return E_FAIL; /* For.Prototype_GameObject_DummySkyBox */ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummySkyBox::Create(m_pDevice, m_pContext)))) return E_FAIL; @@ -1859,6 +1883,11 @@ HRESULT CLoader::Loading_For_ObjectViewer() m_strMessage = TEXT("Model Loading.."); + /*if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_NPC"), + CModel::Create(m_pDevice, m_pContext, MODEL::ENVIROMENT, "C:/MeshTable\\Game\\RiggedObjects\\Characters\\Human\\Body\\Generic_M\\SK_GenericDarkWizard_14.fbx", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity())))) { + return E_FAIL; + }*/ + // Heavy Wall CRigidBody_Dynamic::RIGIDBODY_PROTOTYPE_DYNAMIC_DESC Desc{}; { @@ -1966,6 +1995,7 @@ HRESULT CLoader::Loading_For_ObjectViewer() MODEL::ANIM, "../Bin/Resources/Models/Monster/Goblin/Goblin.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity(), TEXT("Prototype_Component_Goblin_Model") )); + futures.emplace_back(Deferred_ModelLoad( MODEL::ANIM, "../Bin/Resources/Models/Monster/TombProtector/TombProtector.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), TEXT("Prototype_Component_TombProtector_Model") @@ -1997,14 +2027,20 @@ HRESULT CLoader::Loading_For_ObjectViewer() )); futures.emplace_back(Deferred_ModelLoad( - MODEL::NONANIM, "../Bin/Resources/Models/Object/Goblin_Dagger/Dagger.fbx", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f)* XMMatrixIdentity(), + MODEL::NONANIM, "../Bin/Resources/Models/Object/Goblin_Dagger/Goblin_Dagger.fbx", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f)* XMMatrixIdentity(), TEXT("Prototype_Component_Dagger_Model") )); + /*futures.emplace_back(Deferred_ModelLoad( + MODEL::ENVIROMENT, "C:\\Users\\Bin\\Desktop\\Hogwart\\Game\\RiggedObjects\\Characters\\Human\\Body\\Generic_M\\SK_GenericDarkWizard_14.fbx", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity(), + TEXT("Prototype_Component_Npc_Model") + ));*/ + futures.emplace_back(Deferred_ModelLoad( - MODEL::ANIM, "../Bin/Resources/Models/Human/Npc/Npc.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity(), + MODEL::ANIM, "../Bin/Resources/Models/Human/Npc/Npc.bin", XMMatrixRotationY(XMConvertToRadians(180.f))* XMMatrixIdentity(), TEXT("Prototype_Component_Npc_Model") )); + futures.emplace_back(Deferred_ModelLoad( MODEL::ANIM, "../Bin/Resources/Models/Object/Wand/Wand.bin",XMMatrixIdentity(), TEXT("Prototype_Component_Wand_Model") @@ -2022,6 +2058,7 @@ HRESULT CLoader::Loading_For_ObjectViewer() TEXT("Desc_Box") )); + for (auto& job : futures) { pair<_wstring, CModel*>* pResult = job.get(); if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pResult->first, pResult->second))) { diff --git a/Jusin154_Team3D/Editor/Private/Magic_Meter.cpp b/Jusin154_Team3D/Editor/Private/Magic_Meter.cpp index bb03f3089..e3d6a650d 100644 --- a/Jusin154_Team3D/Editor/Private/Magic_Meter.cpp +++ b/Jusin154_Team3D/Editor/Private/Magic_Meter.cpp @@ -43,7 +43,6 @@ HRESULT CMagic_Meter::Initialize(void* pArg) m_fAlphaTime = 1.f; m_fMaxGauge = 20.f; m_fCurrentGauge = 10.f; - Visible(false); return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/MiniMap_Panel.cpp b/Jusin154_Team3D/Editor/Private/MiniMap_Panel.cpp index e2a9a1ef2..ccde5e3ca 100644 --- a/Jusin154_Team3D/Editor/Private/MiniMap_Panel.cpp +++ b/Jusin154_Team3D/Editor/Private/MiniMap_Panel.cpp @@ -40,6 +40,8 @@ HRESULT CMiniMap_Panel::Initialize(void* pArg) { return E_FAIL; } + Visible(true); + ElementAllVisible(true); return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Monster.cpp b/Jusin154_Team3D/Editor/Private/Monster.cpp index 704992d98..0c427ed3f 100644 --- a/Jusin154_Team3D/Editor/Private/Monster.cpp +++ b/Jusin154_Team3D/Editor/Private/Monster.cpp @@ -24,8 +24,8 @@ HRESULT CMonster::Initialize(void* pArg) if (FAILED(__super::Initialize(pArg))) return E_FAIL; - m_pPlayerTransform = static_cast(pArg)->Get_Component(); - SAFE_ADDREF(m_pPlayerTransform); + //m_pPlayerTransform = static_cast(pArg)->Get_Component(); + //SAFE_ADDREF(m_pPlayerTransform); return S_OK; } @@ -42,7 +42,7 @@ void CMonster::Update(_float fTimeDelta) void CMonster::Late_Update(_float fTimeDelta) { - m_fTargetDistance = m_pTransformCom->TargetDis(m_pPlayerTransform->Get_State(STATE::POSITION)); + //m_fTargetDistance = m_pTransformCom->TargetDis(m_pPlayerTransform->Get_State(STATE::POSITION)); } HRESULT CMonster::Render() diff --git a/Jusin154_Team3D/Editor/Private/NomalJap.cpp b/Jusin154_Team3D/Editor/Private/NomalJap.cpp index ad1d780ed..2ec79a720 100644 --- a/Jusin154_Team3D/Editor/Private/NomalJap.cpp +++ b/Jusin154_Team3D/Editor/Private/NomalJap.cpp @@ -58,6 +58,9 @@ void CNomalJap::Priority_Update(_float fTimeDelta) { __super::Priority_Update(fTimeDelta); + + XMStoreFloat4(&m_vStartPos, m_pProjectile->Get_WorldPostion()); + } void CNomalJap::Update(_float fTimeDelta) @@ -69,57 +72,37 @@ void CNomalJap::Update(_float fTimeDelta) __super::Update(fTimeDelta); Update_Event(fTimeDelta); - if (m_fAccMoveTime > m_fDuration) { - SAFE_RELEASE(m_pTargetUnit); - } - _vector vDirection = XMLoadFloat3(&m_vDirection); - //_vector vStartPos = Get_WorldPostion(); - //_float3 vfStartPos = {}; - //XMStoreFloat3(&vfStartPos, Get_WorldPostion()); + _vector vDirection = XMLoadFloat3(&m_vCameraLook); + // 선속도 m_pProjectile_Side->Get_Component()->Translation(vDirection * m_fLinearSpeed * fTimeDelta); m_pProjectile->Get_Component()->Translation(vDirection * m_fLinearSpeed * fTimeDelta); - //_vector vEndPos = Get_WorldPostion(); - - //_float3 vfEndPos = {}; - //XMStoreFloat3(&vfEndPos, Get_WorldPostion()); - - //_float3 vDir = {}; - //XMStoreFloat3(&vDir, vEndPos - vStartPos); - - //m_pGameInstance->SphereCast(0.125f, vfStartPos, vDir, XMVectorGetX(XMVector3Length(vEndPos - vStartPos)), ) - - - if (false == m_bTrailPulseEnded && m_fAccMoveTime > m_fDuration * 0.3f) { - m_bTrailPulseEnded = true; - - if (nullptr != m_pTargetUnit && false == m_pTargetUnit->isDead()) { - _vector vCurrentPos = m_pProjectile->Get_WorldPostion(); - _vector vTargetPos = m_pTargetUnit->Get_WorldPostion(); - XMStoreFloat4(&m_vTargetPos, vTargetPos); - XMStoreFloat3(&m_vDirection, XMVector4Normalize(vTargetPos - vCurrentPos)); - - _float fDistance = XMVectorGetX(XMVector3Length(vTargetPos - vCurrentPos)); - m_fLinearSpeed = fDistance / (m_fDuration - m_fAccMoveTime) * 10 / 3; - SAFE_RELEASE(m_pTargetUnit); - } + //Up벡터 방향으로 파이만큼 이동 + if (m_fAccRotateTime > XM_2PI) return; - } - if (true == m_bTrailPulseEnded) { - return; - } - _vector vRotateUp = XMLoadFloat3(&m_vRotateUp); - m_fAccMoveTime += fTimeDelta; + m_fAccRotateTime += fTimeDelta * m_fAngularSpeed; + + m_pProjectile_Side->Get_Component()->Translation(XMLoadFloat3(&m_vRotateUp) * sinf(m_fAccRotateTime) * m_fRotateAmount); + m_pProjectile->Get_Component()->Translation(XMLoadFloat3(&m_vRotateUp) * sinf(m_fAccRotateTime) * m_fRotateAmount); + + // 내 라이트 방향으로 좌우무빙 하도록 해보자 + + + if (m_fAccZigZagTime > XM_2PI) + m_fAccZigZagTime = 0.f; + + m_fAccZigZagTime += fTimeDelta * m_fZigZagSpeed; + + m_pProjectile_Side->Get_Component()->Translation(XMLoadFloat3(&m_vRotateRight) * sinf(m_fAccZigZagTime) * m_fZigZagAmount); + m_pProjectile->Get_Component()->Translation(XMLoadFloat3(&m_vRotateRight) * sinf(m_fAccZigZagTime) * m_fZigZagAmount); + - // 각속도 - m_pProjectile_Side->Get_Component()->Translation(vRotateUp * 0.6f * sinf(m_fAngularSpeed * m_fAccMoveTime)); - m_pProjectile->Get_Component()->Translation(vRotateUp * 0.6f * sinf(m_fAngularSpeed * m_fAccMoveTime)); } @@ -131,20 +114,34 @@ void CNomalJap::Late_Update(_float fTimeDelta) Get_PartObject()->Trail_Update(m_pProjectile->Get_Component()->Get_XMWorldMatrix(), fTimeDelta); + + XMStoreFloat4(&m_vEndPos, m_pProjectile->Get_WorldPostion()); + + _vector vDir = XMLoadFloat4(&m_vEndPos) - XMLoadFloat4(&m_vStartPos); + + if (true == m_pGameInstance->SphereCast(0.125, XMLoadFloat4(&m_vStartPos), XMVector3Normalize(vDir), XMVectorGetX(XMVector3Length(vDir)) + , PSX::PxHitFlag::ePOSITION | PSX::PxHitFlag::eNORMAL, PSX::PxQueryFlag::eDYNAMIC | PSX::PxQueryFlag::eSTATIC, m_Hitbuffer)) + { + OnCollision(); + } + __super::Late_Update(fTimeDelta); } -HRESULT CNomalJap::Pre_Setting(CGameObject* pObject) +HRESULT CNomalJap::Pre_Setting(CGameObject* pObject, void* pArg) { - if(FAILED(__super::Pre_Setting(pObject))) + if (FAILED(__super::Pre_Setting(pObject, nullptr))) return E_FAIL; - m_bTrailPulseEnded = false; m_fAccMoveTime = 0.f; + m_fAccRotateTime = 0.f; - /* 초기 객체 위치 초기화 */ + /* 초기 위치 저장 */ _vector vStartPos = m_pOwner->Get_WorldPostion(); XMStoreFloat4(&m_vStartPos, vStartPos); + + /* 초기 객체 위치 초기화 */ + m_pProjectile->Get_Component()->Set_State(STATE::POSITION, vStartPos); m_pProjectile_Side->Get_Component()->Set_State(STATE::POSITION, vStartPos); @@ -156,40 +153,68 @@ HRESULT CNomalJap::Pre_Setting(CGameObject* pObject) Get_PartObject()->Set_Visible(true); Get_PartObject()->Get_Component()->Reset_Trail(); - //나아가는 벡터와 한점을 가져와 수직인 평면상에 하나의 점으로 DIR 을 만듬 - pair<_float3, _float3> pairCameraLook = m_pInfoInstance->Get_CameraCoordinateSystem(); - _vector vDirection = XMVector3Normalize(XMLoadFloat3(&pairCameraLook.first)); - _vector vUp = XMVectorSet(0.f, 1.f, 0.f, 0.f); - XMStoreFloat3(&m_vDirection, vDirection); + _uint iIndex = *static_cast<_uint*>(pArg); + - //Get_PartObject("Circle_Particle_Red")->Set_Visible(true); - //Get_PartObject("Circle_Particle_Red")->Get_Component()->Set_WorldMatrix(m_pOwner->Get_Component()->Get_XMWorldMatrix()); + m_fLinearSpeed = m_vJapData[iIndex].x; + m_fAngle = XMConvertToRadians(m_vJapData[iIndex].y); + m_fZigZagSpeed = m_vJapData[iIndex].z; + m_fZigZagAngle = XMConvertToRadians(m_vJapData[iIndex].w); + - _vector vQuaternion = XMQuaternionRotationAxis(vDirection, m_pGameInstance->Random_Float(0.f, XM_PIDIV2)); + _vector vDirection = m_pOwner->Get_Owner()->Get_Component()->Get_State(STATE::LOOK); + + XMStoreFloat3(&m_vCameraLook, vDirection); { /* 대상 위치 지정 */ - SAFE_RELEASE(m_pTargetUnit); - m_pTargetUnit = m_pInfoInstance->Get_LockOnUnit(); - if (nullptr != m_pTargetUnit) { - SAFE_ADDREF(m_pTargetUnit); // 타겟이 있다면 타겟 위치로 지정 - XMStoreFloat4(&m_vTargetPos, m_pTargetUnit->Get_WorldPostion()); + + CUnit* pTargetUnit = m_pInfoInstance->Get_LockOnUnit(); + if (nullptr != pTargetUnit) { + + XMStoreFloat4(&m_vTargetPos, pTargetUnit->Get_WorldPostion()); + + XMStoreFloat3(&m_vCameraLook, XMVector3Normalize(XMLoadFloat4(&m_vTargetPos) - XMLoadFloat4(&m_vStartPos))); } else { // 타겟이 없다면 현재위치 -> 카메라 룩벡터 * duration간 예상 이동거리 를 대상으로 지정 - XMStoreFloat4(&m_vTargetPos, vStartPos + vDirection * m_pTransformCom->Get_Speed() * m_fDuration); + XMStoreFloat4(&m_vTargetPos, vStartPos + vDirection * m_fLinearSpeed * 0.5f); } } - { /* 대상 거리 계산 */ - _float fDistance = XMVectorGetX(XMVector3Length(XMLoadFloat4(&m_vTargetPos) - XMLoadFloat4(&m_vStartPos))); - m_fLinearSpeed = fDistance / m_fDuration; - // 전체 duration 의 0.3 지점에서 2π 회전하도록 각속도 설정 - _float fTargetRatio = 0.3f; - m_fAngularSpeed = m_pGameInstance->Random_Float(2.f, 2.8f) * XM_2PI / (m_fDuration * fTargetRatio); - } + + /* 대상 거리 계산 */ + + _vector vUp = XMVectorSet(0.f, 1.f, 0.f, 0.f); + _vector vRight = XMVectorSet(1.f, 0.f, 0.f, 0.f); + + + _vector vQuaternion = XMQuaternionRotationAxis(XMLoadFloat3(&m_vCameraLook), m_fAngle); XMStoreFloat3(&m_vRotateUp, XMVector3Normalize(XMVector3Rotate(vUp, vQuaternion))); + vQuaternion = XMQuaternionRotationAxis(XMLoadFloat3(&m_vRotateUp), m_fAngle); + + XMStoreFloat3(&m_vRotateRight, XMVector3Normalize(XMVector3Rotate(vRight, vQuaternion))); + + + /* 내속도를 알고 잇음*/ + + /* 거리 / 속도 = 시간 */ + + _float fDistance = XMVectorGetX(XMVector3Length(XMLoadFloat4(&m_vTargetPos) - XMLoadFloat4(&m_vStartPos))); + + m_fTimeRate = fDistance / m_fLinearSpeed; + + //내가 적에게까지 갈때까지 걸리는 시간을 암 + + //그러므로 내가 0 ~ 파이 까지 러프하는 과정이 그 시간동안 이루어져야 함 + + //그 속도가 파이 / 시간 이므로 이걸 프레임마다 누적함 + + m_fAngularSpeed = XM_2PI / m_fTimeRate; // 프레임마다 누적할 시간 + + m_fAccZigZagTime = 0.f; + return S_OK; } @@ -237,23 +262,28 @@ CGameObject* CNomalJap::Clone(void* pArg, CGameObject* pOwner) void CNomalJap::OnCollision(CGameObject* pOther, void* pDesc) { + int iIndex = CollisionCheck(); + + if (iIndex < 0) + return; + if (m_isCollisionEnter == true) return; m_isCollisionEnter = true; - ON_COLLISION_INFO* CollisionDesc = static_cast(pDesc); + _vector vPos = XMVectorSet(m_Hitbuffer.touches[iIndex].position.x, m_Hitbuffer.touches[iIndex].position.y, m_Hitbuffer.touches[iIndex].position.z, 1.f); + for (auto& pPair : m_PartObjects) { pPair.second->Set_Visible(true); - pPair.second->Get_Component()->Set_State(STATE::POSITION, CollisionDesc->vWorldPos); + pPair.second->Get_Component()->Set_State(STATE::POSITION, vPos); } Get_PartObject("JapPT0")->Get_Component()->LookAt(m_pOwner->Get_WorldPostion()); - SAFE_RELEASE(m_pTargetUnit); m_pProjectile_Side->Set_Visible(false); m_pProjectile->Set_Visible(false); Get_PartObject("Circle_Particle_Red")->Set_Visible(false); @@ -267,7 +297,6 @@ void CNomalJap::Free() { __super::Free(); - SAFE_RELEASE(m_pTargetUnit); Safe_Release(m_pProjectile); Safe_Release(m_pProjectile_Side); @@ -276,7 +305,25 @@ void CNomalJap::Free() void CNomalJap::Describe_Entity() { + GUI::Begin("Jap"); + GUI::InputFloat("Speed", &m_fLinearSpeed); + + if (GUI::InputFloat("Angle", &m_fAngle)) + m_fAngle = XMConvertToRadians(m_fAngle); + + + GUI::InputFloat("ZigTime", &m_fAccZigZagTime); + + GUI::InputFloat("ZigSpeed", &m_fZigZagSpeed); + + GUI::InputFloat("ZigAmount", &m_fZigZagAmount); + + if (GUI::InputFloat("ZigZagAngle", &m_fZigZagAngle)) + m_fZigZagAngle = XMConvertToRadians(m_fZigZagAngle); + + + GUI::End(); } #endif // _DEBUG diff --git a/Jusin154_Team3D/Editor/Private/NomalJapSide.cpp b/Jusin154_Team3D/Editor/Private/NomalJapSide.cpp index 103cc63c5..7d4879264 100644 --- a/Jusin154_Team3D/Editor/Private/NomalJapSide.cpp +++ b/Jusin154_Team3D/Editor/Private/NomalJapSide.cpp @@ -115,9 +115,9 @@ void CNomalJapSide::Late_Update(_float fTimeDelta) } -HRESULT CNomalJapSide::Pre_Setting(CGameObject* pObject) +HRESULT CNomalJapSide::Pre_Setting(CGameObject* pObject, void* pArg) { - if (FAILED(__super::Pre_Setting(pObject))) + if (FAILED(__super::Pre_Setting(pObject, nullptr))) return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Private/Player.cpp b/Jusin154_Team3D/Editor/Private/Player.cpp index 2fa65ac0f..48dbcbb67 100644 --- a/Jusin154_Team3D/Editor/Private/Player.cpp +++ b/Jusin154_Team3D/Editor/Private/Player.cpp @@ -74,8 +74,8 @@ HRESULT CPlayer::Initialize(void* pArg) m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody); m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody); - //m_pEffectPool = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_EffectPool"))->Get_Object(); - //SAFE_ADDREF(m_pEffectPool); + m_pEffectPool = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_EffectPool"))->Get_Object(); + SAFE_ADDREF(m_pEffectPool); return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Player_States.cpp b/Jusin154_Team3D/Editor/Private/Player_States.cpp index be851101b..3cf37a8be 100644 --- a/Jusin154_Team3D/Editor/Private/Player_States.cpp +++ b/Jusin154_Team3D/Editor/Private/Player_States.cpp @@ -187,7 +187,7 @@ HRESULT CPlayer::Behavior_IdleExitCheck(_float fTimeDelta) m_pFSM->Change_State(FSMSTATE::COMBAT); } else if (m_pGameInstance->Key_Down(DIK_B)) { - m_pFSM->Change_State(FSMSTATE::BROOM_RIDE); + //m_pFSM->Change_State(FSMSTATE::BROOM_RIDE); } return E_FAIL; } @@ -743,7 +743,7 @@ void CPlayer::Behavior_CombatEnter() m_pFSM->Enable_State(FSMSTATE::LIGHT_ATTACK); pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK]; - Add_Event(pairAnimInfo.first, [this]() { m_pEffectPool->Use_Skill(SKILL_TYPE::JAP, Get_PartObject()); }, 0.1f); + Add_Event(pairAnimInfo.first, [this]() {_uint iIndex = 0; m_pEffectPool->Use_Skill(SKILL_TYPE::JAP, Get_PartObject() , &iIndex); }, 0.1f); Add_Event(pairAnimInfo.first, [this]() { m_pEffectPool->Use_Skill(SKILL_TYPE::JAP_SIDE, Get_PartObject()); }, 0.0f); } @@ -915,8 +915,11 @@ HRESULT CPlayer::Behavior_CombatExitCheck() pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK]; pairAnimInfo.first = iIndex + 1; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + Add_Event(pairAnimInfo.first, - [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::JAP, this); }, + [this]() { + _uint iIndex = m_pModelCom->Get_AnimIndex() - m_Animation[STATEANIM::LIGHT_ATTACK].first; + m_pEffectPool->Use_Skill(SKILL_TYPE::JAP, Get_PartObject() , &iIndex);}, 0.1f); } } @@ -995,7 +998,7 @@ HRESULT CPlayer::Behavior_CombatExitCheck() { pairAnimInfo = m_Animation[STATEANIM::DESCENDO]; Add_Event(pairAnimInfo.first, - [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::DESCENDO, this); }, + [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::DESCENDO, Get_PartObject()); }, 0.1f); m_eSpell = STATEANIM::END; diff --git a/Jusin154_Team3D/Editor/Private/Protego.cpp b/Jusin154_Team3D/Editor/Private/Protego.cpp index 960e08267..5b189510c 100644 --- a/Jusin154_Team3D/Editor/Private/Protego.cpp +++ b/Jusin154_Team3D/Editor/Private/Protego.cpp @@ -97,9 +97,9 @@ void CProtego::Late_Update(_float fTimeDelta) } -HRESULT CProtego::Pre_Setting(CGameObject* pObject) +HRESULT CProtego::Pre_Setting(CGameObject* pObject, void* pArg) { - if (FAILED(__super::Pre_Setting(pObject))) + if (FAILED(__super::Pre_Setting(pObject, nullptr))) return E_FAIL; m_pSphere->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); diff --git a/Jusin154_Team3D/Editor/Private/Revelio.cpp b/Jusin154_Team3D/Editor/Private/Revelio.cpp index b1fa1b1b1..fa6f534e9 100644 --- a/Jusin154_Team3D/Editor/Private/Revelio.cpp +++ b/Jusin154_Team3D/Editor/Private/Revelio.cpp @@ -92,9 +92,9 @@ void CRevelio::Late_Update(_float fTimeDelta) } -HRESULT CRevelio::Pre_Setting(CGameObject* pObject) +HRESULT CRevelio::Pre_Setting(CGameObject* pObject, void* pArg) { - if (FAILED(__super::Pre_Setting(pObject))) + if (FAILED(__super::Pre_Setting(pObject, nullptr))) return E_FAIL; CPlayer* pPlayer = static_cast(m_pOwner); diff --git a/Jusin154_Team3D/Editor/Private/Slot_Number.cpp b/Jusin154_Team3D/Editor/Private/Slot_Number.cpp index 11ddde33b..26299a05e 100644 --- a/Jusin154_Team3D/Editor/Private/Slot_Number.cpp +++ b/Jusin154_Team3D/Editor/Private/Slot_Number.cpp @@ -112,7 +112,7 @@ HRESULT CSlot_Number::Render() { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ALPHABLEND)))) + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::UVALPHABLEND)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Anim.cpp b/Jusin154_Team3D/Editor/Private/Spell_Anim.cpp index 333921bdf..b283adec6 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Anim.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Anim.cpp @@ -41,7 +41,7 @@ HRESULT CSpell_Anim::Initialize(void* pArg) m_fAlpha = 0.f; m_fAlphaTime = 9.f; m_fSortZ = 0.01f; - m_iTotalFrames = 120; + m_iTotalFrames = 151; m_fFrameTime = 0.1f; m_iCurrentFrame = 0; m_bAnim_Start = false; @@ -158,7 +158,7 @@ void CSpell_Anim::Set_FadeIn() m_bAnim_Start = true; } -void CSpell_Anim::Change_Image(_int SpellID) +HRESULT CSpell_Anim::Change_Image(_int SpellID) { _wstring pImageName = static_cast(m_pOwner)->Get_Info(SpellID).pImage_Name; m_iTotalFrames = static_cast(m_pOwner)->Get_Info(SpellID).iAnimNum; @@ -168,7 +168,9 @@ void CSpell_Anim::Change_Image(_int SpellID) SAFE_RELEASE(m_pDiffuse_TextureCom); } if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(LEVEL::UI), pImageName, reinterpret_cast(&m_pDiffuse_TextureCom)))) - return; + return E_FAIL; + + return S_OK; } void CSpell_Anim::Set_SkillType(_int eType) @@ -179,6 +181,8 @@ void CSpell_Anim::Set_SkillType(_int eType) m_iCurrentFrame = 0; Change_Image(eType); } + else if (eType == -1) + m_iPerSpell = eType; } HRESULT CSpell_Anim::Bind_ShaderResources() @@ -224,7 +228,7 @@ HRESULT CSpell_Anim::Ready_Components(void* pArg) { return E_FAIL; } - if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Arresto_Momentum"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Accio"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Canvas.cpp b/Jusin154_Team3D/Editor/Private/Spell_Canvas.cpp index e711775e1..b15c58a94 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Canvas.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Canvas.cpp @@ -1,4 +1,5 @@ #include "pch.h" +#include "UI_Manager.h" #include "Spell_Canvas.h" #include "GameInstance.h" #include "Spell_Panel.h" @@ -39,6 +40,7 @@ HRESULT CSpell_Canvas::Initialize(void* pArg) { return E_FAIL; } + Visible(false); return S_OK; } @@ -49,6 +51,7 @@ void CSpell_Canvas::Priority_Update(_float fTimeDelta) void CSpell_Canvas::Update(_float fTimeDelta) { + __super::Update(fTimeDelta); } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Drag.cpp b/Jusin154_Team3D/Editor/Private/Spell_Drag.cpp index a1e01be9e..5884d5967 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Drag.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Drag.cpp @@ -21,8 +21,8 @@ HRESULT CSpell_Drag::Initialize(void* pArg) { CUIObject::UIOBJECT_DESC Desc{}; - Desc.fX = 380.f; - Desc.fY = 30.f; + Desc.fX = 0.f; + Desc.fY = 0.f; Desc.fSizeX = 105.f; Desc.fSizeY = 105.f; @@ -40,9 +40,16 @@ HRESULT CSpell_Drag::Initialize(void* pArg) m_fTimeMult = 3.f; m_fAlpha = 1.f; m_fAlphaTime = 1.f; + m_fDelayTime = 0.2f; + m_fSortZ = 0.f; m_iSkillType = ENUM_CLASS(SKILL_TYPE::ARRESTO_MOMENTUM); Compute_UI(m_iSkillType); + m_bMove = false; + m_bClick = false; + m_iSpellType = -1; + m_iCurrent_Slot_Index = -1; static_cast(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SpellType(*reinterpret_cast<_int*>(p)); }); + static_cast(m_pOwner)->Add_Function(TEXT("Current_Hover"), [this](void* p) {this->Set_Current_Slot(*reinterpret_cast<_int*>(p)); }); return S_OK; } @@ -85,8 +92,76 @@ void CSpell_Drag::Update(_float fTimeDelta) m_fAlpha = 0.f; } } - m_fTime += fTimeDelta * m_fTimeMult; + + if (m_pGameInstance->Mouse_Down(DIM_LBUTTON)) + { + if (m_iSpellType == -1 && m_iCurrent_Slot_Index == -1) + { + m_bFalse = true; + return; + } + + m_vStart_MousePos = XMVectorSet(0.f, 0.f, 0.f, 0.f); + + POINT m_pPt{}; + GetCursorPos(&m_pPt); + ScreenToClient(g_hWnd, &m_pPt); + _float2 fMouse{}; + fMouse.x = m_pPt.x - (g_iWinSizeX * 0.5f); + fMouse.y = m_pPt.y - (g_iWinSizeY * 0.5f); + + m_vStart_MousePos = XMVectorSet(fMouse.x, fMouse.y, 0.f, 1.f); + m_bFalse = false; + } + + if (m_bFalse == false && (m_bHover == true || m_bCurrent_Hover == true)) + { + if (m_pGameInstance->Mouse_Pressing(DIM_LBUTTON)) + { + POINT pt{}; + GetCursorPos(&pt); + ScreenToClient(g_hWnd, &pt); + + float moveX = pt.x - (g_iWinSizeX * 0.5f); + float moveY = pt.y - (g_iWinSizeY * 0.5f); + + m_vMove_MousePos = XMVectorSet(moveX, moveY, 0.f, 1.f); + + _vector Dir = m_vMove_MousePos - m_vStart_MousePos; + _float fLength2 = XMVectorGetX(XMVector2Dot(Dir, Dir)); + + if (fLength2 >= 50.f) + { + m_bMove = true; + } + m_bClick = true; + + } + } + else + { + m_iSpellType = -1; + } + + if (m_bMove == true) + { + MoveX(Get_MousePos().x); + MoveY(Get_MousePos().y); + } + + + if (m_pGameInstance->Mouse_Up(DIM_LBUTTON) && m_bClick == true) + { + m_bHover = false; + m_bClick = false; + m_bCurrent_Hover = false; + m_bMove = false; + m_iSpellType = -1; + } + + static_cast(m_pOwner)->Function_Callback(TEXT("Click"), &m_bClick); + __super::Update(fTimeDelta); } @@ -98,7 +173,10 @@ void CSpell_Drag::Late_Update(_float fTimeDelta) return; } if (m_bVisible) { - m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + if (m_bMove == true) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } } __super::Late_Update(fTimeDelta); } @@ -188,7 +266,7 @@ HRESULT CSpell_Drag::Bind_ShaderResources() { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_fCurrent_Size", &m_vScale, sizeof(_float4)))) + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCurrent_Size", &m_vScale, sizeof(_float2)))) { return E_FAIL; } @@ -213,7 +291,7 @@ HRESULT CSpell_Drag::Ready_Components(void* pArg) { return E_FAIL; } - if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_Atlas_Spell"), reinterpret_cast(&m_pDiffuse_TextureCom3), nullptr))) + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_Atlas_Widget_Spell"), reinterpret_cast(&m_pDiffuse_TextureCom3), nullptr))) { return E_FAIL; } @@ -227,10 +305,10 @@ HRESULT CSpell_Drag::Ready_Components(void* pArg) void CSpell_Drag::Compute_UI(_uint SpellID) { - _float2 fImage_Size = { 1024.f, 1536.f }; + _float2 fImage_Size = { 1024.f, 1792.f }; _uint iCountX = 4; - _uint iCountY = 6; + _uint iCountY = 7; _float iImageX = 256.f; _float iImageY = 256.f; @@ -252,12 +330,41 @@ void CSpell_Drag::Compute_UI(_uint SpellID) void CSpell_Drag::Set_SpellType(_int SpellID) { - m_iSkillType = SpellID; - if (m_iSkillType != -1) + if (SpellID == -1 || SpellID >= 26) { - m_iSkillType = static_cast(m_pOwner)->Get_Info(SpellID).iSkill_Type; - Compute_UI(m_iSkillType); + m_iSkillType = -1; + m_bHover = false; + return; } + m_iSpellType = SpellID; + m_bHover = true; + Compute_UI(static_cast(m_pOwner)->Get_Info(m_iSpellType).iSkill_Type); +} + +_float2 CSpell_Drag::Get_MousePos() +{ + POINT m_pPt{}; + GetCursorPos(&m_pPt); + ScreenToClient(g_hWnd, &m_pPt); + _float2 fMouse{}; + fMouse.x = m_pPt.x - (g_iWinSizeX * 0.5f); + fMouse.y = m_pPt.y - (g_iWinSizeY * 0.5f); + + m_vMove_MousePos = XMVectorSet(fMouse.x, fMouse.y, 0.f, 1.f); + return fMouse; +} + +void CSpell_Drag::Set_Current_Slot(_uint Index) +{ + if (Index == -1) + { + m_iCurrent_Slot_Index = -1; + m_bCurrent_Hover = false; + return; + } + m_iCurrent_Slot_Index = Index; + m_bCurrent_Hover = true; + Compute_UI(static_cast(m_pOwner)->Get_Info(m_iCurrent_Slot_Index).iSkill_Type); } CSpell_Drag* CSpell_Drag::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) diff --git a/Jusin154_Team3D/Editor/Private/Spell_Hover.cpp b/Jusin154_Team3D/Editor/Private/Spell_Hover.cpp index 9604d77e7..153a96e8b 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Hover.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Hover.cpp @@ -90,7 +90,11 @@ void CSpell_Hover::Update(_float fTimeDelta) } } - m_pVIBufferCom->Set_Hover_Index(m_iSpellType); + if (m_bClick == false) + { + m_pVIBufferCom->Set_Hover_Index(m_iSpellType); + } + m_fTime += fTimeDelta * m_fTimeMult; __super::Update(fTimeDelta); @@ -155,6 +159,18 @@ void CSpell_Hover::SizeUpdate(_float fSizeX, _float fSizeY) m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); } +void CSpell_Hover::Click_Slot(_bool bClick) +{ + if (bClick == true) + { + m_bClick = true; + } + else + { + m_bClick = false; + } +} + HRESULT CSpell_Hover::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) diff --git a/Jusin154_Team3D/Editor/Private/Spell_Hover_Effect.cpp b/Jusin154_Team3D/Editor/Private/Spell_Hover_Effect.cpp index d323d9f12..9c6ad5484 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Hover_Effect.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Hover_Effect.cpp @@ -90,7 +90,11 @@ void CSpell_Hover_Effect::Update(_float fTimeDelta) m_fAlpha = 0.f; } } - m_pVIBufferCom->Set_Hover_Index(m_iSpellType); + if (m_bClick == false) + { + m_pVIBufferCom->Set_Hover_Index(m_iSpellType); + } + m_fTime += fTimeDelta * m_fTimeMult; __super::Update(fTimeDelta); } @@ -154,6 +158,18 @@ void CSpell_Hover_Effect::SizeUpdate(_float fSizeX, _float fSizeY) m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); } +void CSpell_Hover_Effect::Click_Slot(_bool bClick) +{ + if (bClick == true) + { + m_bClick = true; + } + else + { + m_bClick = false; + } +} + HRESULT CSpell_Hover_Effect::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) diff --git a/Jusin154_Team3D/Editor/Private/Spell_List.cpp b/Jusin154_Team3D/Editor/Private/Spell_List.cpp index 2285e0425..3afd78cd1 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_List.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_List.cpp @@ -48,7 +48,9 @@ HRESULT CSpell_List::Initialize(void* pArg) m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); m_fDelayTime = 0.5f; m_iPerSpell_Slot = -1; + m_bClick = false; Color(); + static_cast(m_pOwner)->Add_Function(TEXT("Click"), [this](void* p) {this->Click_Slot(*reinterpret_cast<_bool*>(p)); }); return S_OK; } @@ -92,7 +94,11 @@ void CSpell_List::Update(_float fTimeDelta) } } m_fTime += fTimeDelta * m_fTimeMult; - Hover(fTimeDelta); + if (m_bClick == false) + { + Hover(); + } + __super::Update(fTimeDelta); } @@ -158,16 +164,16 @@ void CSpell_List::SizeUpdate(_float fSizeX, _float fSizeY) void CSpell_List::Color() { - m_pVIBufferCom->Set_Index_Renge_Color(0, 3, _float4(255.f / 255.f, 255.f / 255.f, 0.f / 255.f, 1.f)); - m_pVIBufferCom->Set_Index_Renge_Color(4, 7, _float4(150.f / 255.f, 120.f / 255.f, 240.f / 255.f, 1.f)); - m_pVIBufferCom->Set_Index_Renge_Color(8, 12, _float4(190.f / 255.f, 46.f / 255.f, 34.f / 255.f, 1.f)); - m_pVIBufferCom->Set_Index_Renge_Color(13, 16, _float4(24.f / 255.f, 190.f / 255.f, 255.f / 255.f, 1.f)); - m_pVIBufferCom->Set_Index_Renge_Color(17, 19, _float4(200.f / 255.f, 220.f / 255.f, 150.f / 255.f, 1.f)); - m_pVIBufferCom->Set_Index_Renge_Color(20, 22, _float4(50.f / 255.f, 150.f / 255.f, 110.f / 255.f, 1.f)); - m_pVIBufferCom->Set_Index_Renge_Color(23, 25, _float4(24.f / 255.f, 190.f / 255.f, 255.f / 255.f, 1.f)); + m_pVIBufferCom->Set_Index_Renge_Color(0, 3, 0.f); + m_pVIBufferCom->Set_Index_Renge_Color(4, 7, 1.f); + m_pVIBufferCom->Set_Index_Renge_Color(8, 12, 2.f); + m_pVIBufferCom->Set_Index_Renge_Color(13, 16, 3.f); + m_pVIBufferCom->Set_Index_Renge_Color(17, 19, 4.f); + m_pVIBufferCom->Set_Index_Renge_Color(20, 22, 5.f); + m_pVIBufferCom->Set_Index_Renge_Color(23, 25, 3.f); } -void CSpell_List::Hover(_float fTimeDelta) +void CSpell_List::Hover() { POINT ptMouse{}; GetCursorPos(&ptMouse); @@ -198,6 +204,18 @@ void CSpell_List::Hover(_float fTimeDelta) } +void CSpell_List::Click_Slot(_bool bClick) +{ + if (bClick == true) + { + m_bClick = true; + } + else + { + m_bClick = false; + } +} + HRESULT CSpell_List::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) diff --git a/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp b/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp index 54cece9c3..06ed9660b 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp @@ -55,7 +55,7 @@ HRESULT CSpell_Overlay::Initialize(void* pArg) void CSpell_Overlay::Compute_UI(_uint SpellID) { - _float2 fImage_Size = { 1024.f, 1536.f }; + _float2 fImage_Size = { 1024.f, 1792.f }; _uint iCountX = 4; _uint iCountY = 6; diff --git a/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp b/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp index 7f60a1c46..5565bd390 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp @@ -16,6 +16,7 @@ #include "Spell_Header_Line.h" #include "Spell_Data.h" #include "Spell_Anim.h" +#include "Spell_Drag.h" CSpell_Panel::CSpell_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CPanelObject(pDevice, pContext) @@ -54,11 +55,16 @@ HRESULT CSpell_Panel::Initialize(void* pArg) return E_FAIL; } m_fCanvasAlpha = 1.f; - m_fSortZ = 0.04f; + m_fSortZ = 0.05f; m_iSpellType = -1; m_iPendingSpell = -1; m_fDelayTime = 1.f; + m_bCurrentSlot_Hover = false; Add_Function(TEXT("Hover"), [this](void* p) {this->Slot_Chack(p); }); + Add_Function(TEXT("Click"), [this](void* p) {this->Click_Slot(*reinterpret_cast<_bool*>(p)); }); + Add_Function(TEXT("Current_Slot_Click"), [this](void* p) {this->Current_Slot_Chack(*reinterpret_cast<_int*>(p)); }); + Visible(true); + ElementAllVisible(true); return S_OK; } @@ -88,9 +94,9 @@ void CSpell_Panel::Update(_float fTimeDelta) Function_Callback(TEXT("FadeOut")); } - if (m_fHoverTimer >= m_fDelayTime && m_iPendingSpell != m_iSpellType) + if (m_fHoverTimer >= m_fDelayTime) { - m_iPendingSpell = m_iSpellType; + Function_Callback(TEXT("FadeIn")); } @@ -155,7 +161,27 @@ void CSpell_Panel::Slot_Chack(void* pArg) } m_iSpellType = finalHover; - Function_Callback(TEXT("Slot_Hover"), &m_iSpellType); + if (m_bHover == false) + { + Function_Callback(TEXT("Slot_Hover"), &m_iSpellType); + } +} + +void CSpell_Panel::Click_Slot(_bool bClick) +{ + if (bClick == true) + { + m_bHover = true; + } + else + { + m_bHover = false; + } +} + +void CSpell_Panel::Current_Slot_Chack(_int Index) +{ + m_iCurrent_Slot_Index = Index; } HRESULT CSpell_Panel::Bind_ShaderResources() @@ -299,6 +325,12 @@ HRESULT CSpell_Panel::Ready_Element(void* pArg) } Add_Element(TEXT("Spell_Anim"), m_pSpell_Anim); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pCSpell_Drag)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Drag"), m_pCSpell_Drag); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, m_Info, nullptr, reinterpret_cast(&m_pSpell_Data)))) { return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Private/Spell_State.cpp b/Jusin154_Team3D/Editor/Private/Spell_State.cpp index 44fdf495c..a41babab4 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_State.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_State.cpp @@ -46,6 +46,7 @@ HRESULT CSpell_State::Initialize(void* pArg) m_pVIBufferCom->Set_Cloned(true); m_pVIBufferCom->Set_Pos(-185.f, 375.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + static_cast(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SkillType(*reinterpret_cast<_int*>(p)); }); return S_OK; } @@ -88,8 +89,13 @@ void CSpell_State::Update(_float fTimeDelta) m_fAlpha = 0.f; } } + m_fTime += fTimeDelta * m_fTimeMult; - Hover(); + if (m_bClick == false) + { + m_pVIBufferCom->Set_Hover_Index(m_iSpellType); + } + __super::Update(fTimeDelta); } @@ -152,21 +158,16 @@ void CSpell_State::SizeUpdate(_float fSizeX, _float fSizeY) m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); } -void CSpell_State::Hover() +void CSpell_State::Click_Slot(_bool bClick) { - POINT ptMouse{}; - GetCursorPos(&ptMouse); - ScreenToClient(g_hWnd, &ptMouse); - _float2 fMouse; - fMouse.x = ptMouse.x - (g_iWinSizeX * 0.5f); - fMouse.y = -(ptMouse.y - (g_iWinSizeY * 0.5f)); - - // 엘리먼트의 월드 위치를 더해주면 엘리먼트 좌표계 기준이 됨 - fMouse.x -= m_pOwner->Get_WorldPostion().m128_f32[0]; - fMouse.y -= m_pOwner->Get_WorldPostion().m128_f32[1]; - - m_pVIBufferCom->Set_Mouse_Hover(fMouse); - + if (bClick == true) + { + m_bClick = true; + } + else + { + m_bClick = false; + } } HRESULT CSpell_State::Bind_ShaderResources() diff --git a/Jusin154_Team3D/Editor/Private/Spell_Vidio_Border.cpp b/Jusin154_Team3D/Editor/Private/Spell_Vidio_Border.cpp index 1324ee4b8..826bec3a4 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Vidio_Border.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Vidio_Border.cpp @@ -1,7 +1,6 @@ #include "pch.h" #include "Spell_Vidio_Border.h" #include "GameInstance.h" -#include "Spell_Anim.h" CSpell_Vidio_Border::CSpell_Vidio_Border(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CElementObject(pDevice, pContext) diff --git a/Jusin154_Team3D/Editor/Private/TrailObject.cpp b/Jusin154_Team3D/Editor/Private/TrailObject.cpp index 6b7288990..12fbd1dcf 100644 --- a/Jusin154_Team3D/Editor/Private/TrailObject.cpp +++ b/Jusin154_Team3D/Editor/Private/TrailObject.cpp @@ -484,7 +484,7 @@ void CTrailObject::Free() void CTrailObject::Describe_Entity() { - const char* pRenderNames[] = { "PRIORITY" , "SHADOW", "NONBLEND", "DECAL", "BLUR" , "NONLIGHT" ,"EFFECT", "BLEND" ,"BLOOM" , "UI", "OCCLUSION" }; + const char* pRenderNames[] = { "PRIORITY" , "SHADOW", "NONBLEND", "DECAL", "BLUR" , "NONLIGHT" ,"EFFECT", "BLEND" ,"BLOOM" , "UI", "OCCLUSION" , "PRESHADOW" }; const char* pEffectType[] = { "EFFECT" , "TRAIL" }; const char* pShaderPass[] = { "DEFAULT" , "SCISSOR" , "UI" , "UVMOVE" , "TRAIL" , "TRAIL_BLEND" , "TRAILWB_FOR_BLEND" , "TRAIL_BLUR", "TRAIL_BLOOM" }; const char* pBloomType[] = { "NONE" , "BASIC" , "MUILTY" }; @@ -509,10 +509,15 @@ void CTrailObject::Describe_Entity() m_pTrailCom->Describe_Entity(); m_pShaderCom->Describe_Entity(); - if(GUI::InputInt("NumVertex", &m_TrailInfo.iNumVertex)) + if (GUI::InputInt("NumVertex", &m_TrailInfo.iNumVertex)) + { + + } + + if(GUI::Button("Reset Trail")) { - m_pTrailCom->Reset_Trail(); m_pTrailCom->ReStructVB(m_TrailInfo.iNumVertex); + m_pTrailCom->Reset_Trail(); } GUI::Checkbox("Diffuse", &m_TrailInfo.isDiffuse); diff --git a/Jusin154_Team3D/Editor/Private/UI_Manager.cpp b/Jusin154_Team3D/Editor/Private/UI_Manager.cpp new file mode 100644 index 000000000..888e842d2 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/UI_Manager.cpp @@ -0,0 +1,204 @@ +#include "pch.h" +#include "UI_Manager.h" +#include "GameInstance.h" +#include "GamePlay_Canvas.h" +#include "Spell_Canvas.h" + +CUI_Manager::CUI_Manager(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CUIObject(pDevice, pContext) +{ +} + +CUI_Manager::CUI_Manager(const CUI_Manager& rhs) + :CUIObject(rhs) +{ +} + +HRESULT CUI_Manager::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CUI_Manager::Initialize(void* pArg) +{ + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + m_bCanvas_Change = false; + m_eType = Canvases::GAMEPLAYER_CANVAS; + return S_OK; +} + +void CUI_Manager::Canvas_Change(Canvases eType) +{ + m_eType = eType; + + switch (eType) + { + case Canvases::GAMEPLAYER_CANVAS: + static_cast(m_pGamePlay_Canves)->Visible(true); + static_cast(m_pSpell_Canvas)->Visible(false); + + break; + case Canvases::SPELL_CANVAS: + static_cast(m_pSpell_Canvas)->Visible(true); + static_cast(m_pGamePlay_Canves)->Visible(false); + + break; + default: + return; + } +} + +void CUI_Manager::Clear_Canvas() +{ +} + +CGameObject* CUI_Manager::Get_Canvas(const wstring& Name) +{ + return Find_Canvas(Name); +} + +_int CUI_Manager::Canvas_Count() +{ + return m_iCanvas_Count; +} + +const vector CUI_Manager::Canvas_Name() +{ + return m_CanvasNames; +} + +void CUI_Manager::Add_Manager_Event(_wstring Name, function Event) +{ + m_Event_map.emplace(Name, Event); +} + +void CUI_Manager::Event_Callback(_wstring Name, void* pArg) +{ + auto range = m_Event_map.equal_range(Name); + for (auto it = range.first; it != range.second; ++it) + { + it->second(pArg); + } +} + +void CUI_Manager::Priority_Update(_float fTimeDelta) +{ +} + +void CUI_Manager::Update(_float fTimeDelta) +{ + if (m_pGameInstance->Key_Down(DIK_T)) + { + if (m_eType == Canvases::GAMEPLAYER_CANVAS) + Canvas_Change(Canvases::SPELL_CANVAS); + else + Canvas_Change(Canvases::GAMEPLAYER_CANVAS); + } + +} + +void CUI_Manager::Late_Update(_float fTimeDelta) +{ +} + +HRESULT CUI_Manager::Render() +{ + return S_OK; +} + +_vector CUI_Manager::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CUI_Manager::Bind_ShaderResources() +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CUI_Manager::Ready_Components(void* pArg) +{ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, g_iStaticLevel, LAYER_UI, nullptr, this, reinterpret_cast(&m_pGamePlay_Canves)))) { + return E_FAIL; + } + Add_Canvas(TEXT("GamePlay_Canvas"), m_pGamePlay_Canves); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, g_iStaticLevel, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Canvas)))) { + return E_FAIL; + } + Add_Canvas(TEXT("Spell_Canvas"), m_pSpell_Canvas); + + return S_OK; +} + +void CUI_Manager::Add_Canvas(_wstring Name, CGameObject* pCanvas) +{ + if (pCanvas == nullptr) + { + return; + } + + if (Find_Canvas(Name) != nullptr) + { + return; + } + m_Canvases.push_back(pCanvas); + m_CanvasNames.push_back(Name); + m_Canvas_map.emplace(Name, pCanvas); + m_iCanvas_Count++; +} + +CGameObject* CUI_Manager::Find_Canvas(const _wstring& Name) +{ + auto iter = m_Canvas_map.find(Name); + + if (iter == m_Canvas_map.end()) + return nullptr; + + return iter->second; +} + +CUI_Manager* CUI_Manager::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CUI_Manager* pInstance = new CUI_Manager(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CUI_Manager"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CUI_Manager::Clone(void* pArg, CGameObject* pOwner) +{ + CUI_Manager* pInstance = new CUI_Manager(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CUI_Manager"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CUI_Manager::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pVIBufferCom); +} + +void CUI_Manager::Describe_Entity() +{ +} + diff --git a/Jusin154_Team3D/Editor/Public/Bombard.h b/Jusin154_Team3D/Editor/Public/Bombard.h index 7ac78a4ca..cbc7c5f33 100644 --- a/Jusin154_Team3D/Editor/Public/Bombard.h +++ b/Jusin154_Team3D/Editor/Public/Bombard.h @@ -21,7 +21,7 @@ class CBombard final : public CEffect_Container virtual void Late_Update(_float fTimeDelta) override; public: - virtual HRESULT Pre_Setting(CGameObject* pObject) override; + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; private: virtual HRESULT Initialize_Prototype() override; diff --git a/Jusin154_Team3D/Editor/Public/BombardSide.h b/Jusin154_Team3D/Editor/Public/BombardSide.h index a324fc9df..67033b073 100644 --- a/Jusin154_Team3D/Editor/Public/BombardSide.h +++ b/Jusin154_Team3D/Editor/Public/BombardSide.h @@ -21,7 +21,7 @@ class CBombardSide final : public CEffect_Container virtual void Late_Update(_float fTimeDelta) override; public: - virtual HRESULT Pre_Setting(CGameObject* pObject) override; + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; private: virtual HRESULT Initialize_Prototype() override; diff --git a/Jusin154_Team3D/Editor/Public/Current_Spell_Slot.h b/Jusin154_Team3D/Editor/Public/Current_Spell_Slot.h index 4bba09fc0..4472b06b8 100644 --- a/Jusin154_Team3D/Editor/Public/Current_Spell_Slot.h +++ b/Jusin154_Team3D/Editor/Public/Current_Spell_Slot.h @@ -23,6 +23,14 @@ class CCurrent_Spell_Slot final : public CElementObject virtual void SizeUpY(_float fSizeY) override; virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; +private: + void Hover(); + void Click_Slot(_bool bClick); + void Get_Skill(_int SpellIndex, _int SlotIndex); + _int Chack_Slot(_int Index) const; + void Clear(_int iValue); + + _float4 UV(_int SpellID); private: virtual HRESULT Bind_ShaderResources() override; @@ -31,13 +39,24 @@ class CCurrent_Spell_Slot final : public CElementObject virtual HRESULT Initialize(void* pArg) override; private: - CTexture* m_pDiffuse_TextureCom = { nullptr }; - CShader* m_pShaderCom = { nullptr }; - CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CTexture* m_pDiffuse_TextureCom2 = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; - _float m_fOffSetX{}; - _float m_fOffSetY{}; - _uint m_iCols{}; + class CUI_Manager* m_pManager = { nullptr }; + + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + + _bool m_bChangeSlot = { false }; + + _int m_iSlot_Index{}; + _int m_iSkill_Index{}; + _int m_iSpell[4][4]{}; + CVIBuffer_UI_Instance::UI_ATLAS_DESC m_vUV{}; public: static CCurrent_Spell_Slot* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Editor/Public/Decendo.h b/Jusin154_Team3D/Editor/Public/Decendo.h index ca1f684a5..f7873b3dd 100644 --- a/Jusin154_Team3D/Editor/Public/Decendo.h +++ b/Jusin154_Team3D/Editor/Public/Decendo.h @@ -21,7 +21,7 @@ class CDecendo final : public CEffect_Container virtual void Late_Update(_float fTimeDelta) override; public: - virtual HRESULT Pre_Setting(CGameObject* pObject) override; + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; private: virtual HRESULT Initialize_Prototype() override; @@ -32,15 +32,24 @@ class CDecendo final : public CEffect_Container virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; private: _wstring m_wstrEffectName = {}; + class CInfoInstance* m_pInfoInstance = { nullptr }; class CPartObject* m_pProjectile = {}; class CPartObject* m_pProjectile_Blur = {}; - _vector m_vRotateUp = {}; - _float m_fAccTime = {}; + + _float4 m_vStartPos = { 0.f, 0.f, 0.f, 1.f }; // 현재 발사 된 위치 + _float4 m_vTargetPos = { 0.f, 0.f, 10.f, 1.f }; // 현재 타게팅 된 위치 + _float m_fLinearSpeed = 22.f; + _float3 m_vCameraLook = {}; + + _float3 m_vRotateUp = {}; + _float m_fRotateAccTime = {}; _float m_fLerpAmount = {}; _float m_fTurnValue = {}; - _vector m_vCameraLook = {}; + + _float m_fAngularSpeed = {}; + _float m_fTimeRate = {}; public: diff --git a/Jusin154_Team3D/Editor/Public/DecendoSide.h b/Jusin154_Team3D/Editor/Public/DecendoSide.h index 1e36f255f..a02c85be4 100644 --- a/Jusin154_Team3D/Editor/Public/DecendoSide.h +++ b/Jusin154_Team3D/Editor/Public/DecendoSide.h @@ -21,7 +21,7 @@ class CDecendoSide final : public CEffect_Container virtual void Late_Update(_float fTimeDelta) override; public: - virtual HRESULT Pre_Setting(CGameObject* pObject) override; + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; private: virtual HRESULT Initialize_Prototype() override; diff --git a/Jusin154_Team3D/Editor/Public/EditEffect.h b/Jusin154_Team3D/Editor/Public/EditEffect.h index aacd47acf..07b57d1a0 100644 --- a/Jusin154_Team3D/Editor/Public/EditEffect.h +++ b/Jusin154_Team3D/Editor/Public/EditEffect.h @@ -21,7 +21,8 @@ class CEditEffect final : public CEffectObject public: virtual void Priority_Update(_float fTimeDelta) override; virtual void Update(_float fTimeDelta) override; - virtual void Late_Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual _vector Get_WorldPostion() override; public: void Reference_Mat_For_EditEffect(); diff --git a/Jusin154_Team3D/Editor/Public/Editor_Define.h b/Jusin154_Team3D/Editor/Public/Editor_Define.h index eec9fa11c..6e637b091 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Define.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Define.h @@ -27,7 +27,7 @@ namespace Editor enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, TRAIL_BLEND , TRAILWB_FOR_BLEND , TRAIL_BLUR , TRAIL_BLOOM, END }; enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, NON_WORLD_BLUR, BLEND, BLEND_NOWORLD, BLOOM, BLOOM_NOWORLD, BLUR_NO_EMMISVE, BLUR_NO_WORLD_NO_EMISSIVE, WEIGHTBLEND_FOR_BLEND,END }; enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, TYPE, HPBAR, MAGIC_METER, MAGIC_ICON, REMOVEUV, REVELIO, POTION, MAGIC_ITEM, SPELL_PREVIEW, SPELL_HEADER, SPELL_HEADER_LINE, SPELL_DRAG, END }; - enum class SHADER_PASS_UIINTANCE { DEFAULT, ALPHABLEND, MAGIC_METER, SPELL_LIST, EESSENTIAL_SPELL_SOLT, EESSENTIAL_SPELL, COLOR, SPELL_HOVER, SPELL_SLOT_EFFECT, END }; + enum class SHADER_PASS_UIINTANCE { DEFAULT, ALPHABLEND, UVALPHABLEND, MAGIC_METER, SPELL_LIST, EESSENTIAL_SPELL_SOLT, EESSENTIAL_SPELL, COLOR, SPELL_HOVER, SPELL_SLOT_EFFECT, SPELL_SLOT, END }; @@ -40,12 +40,8 @@ namespace Editor AVADA_KEDAVRA, CRUCIO, IMPERIO, // 진녹색 BEAST_PETTING_BRUSH, BEAST_FEED, NAB_SACK, // 하늘색 JAP , REVELIO, PROTEGO, STUPEFY, // 검은색 - - ANCIENT_MAGIC_THROW, ANCIENT_MAGIC, ALOHOMORA, PETRIFICUS_TOTALUS, - JAP_SIDE, BOMBARDA_SIDE, DESCENDO_SIDE, LEVIOSO_SIDE, - - END + JAP_SIDE, BOMBARDA_SIDE, DESCENDO_SIDE, LEVIOSO_SIDE,END }; enum class BLOOM_TYPE { NONE , BASIC , MULTIPLY , END}; diff --git a/Jusin154_Team3D/Editor/Public/Eessential_Spell_Slot.h b/Jusin154_Team3D/Editor/Public/Eessential_Spell_Slot.h index 5ce4f508f..a99fea74a 100644 --- a/Jusin154_Team3D/Editor/Public/Eessential_Spell_Slot.h +++ b/Jusin154_Team3D/Editor/Public/Eessential_Spell_Slot.h @@ -25,7 +25,7 @@ class CEessential_Spell_Slot final : public CElementObject private: - void Hover(_float fTimeDelta); + void Hover(); private: virtual HRESULT Bind_ShaderResources() override; diff --git a/Jusin154_Team3D/Editor/Public/EffectObject.h b/Jusin154_Team3D/Editor/Public/EffectObject.h index 49c1e3a68..428999c9e 100644 --- a/Jusin154_Team3D/Editor/Public/EffectObject.h +++ b/Jusin154_Team3D/Editor/Public/EffectObject.h @@ -219,10 +219,6 @@ class CEffectObject abstract : public CPartObject public: HRESULT Load(const _char* pFilePath, LEVEL eLevel); HRESULT Load(); - void Set_Dissolve(_bool isDissolve) - { - m_EffectInfo.isDissolve = isDissolve; - } public: #ifdef _DEBUG HRESULT LoadPre(const _char* pFilePath, LEVEL eLevel); diff --git a/Jusin154_Team3D/Editor/Public/EffectPool.h b/Jusin154_Team3D/Editor/Public/EffectPool.h index 0a555cb30..1540f8bed 100644 --- a/Jusin154_Team3D/Editor/Public/EffectPool.h +++ b/Jusin154_Team3D/Editor/Public/EffectPool.h @@ -26,7 +26,7 @@ class CEffectPool final : public CGameObject virtual HRESULT Render() override; public: HRESULT Create_Effect(SKILL_TYPE eType, _uint iNumEffect, _uint iPrototypeLevel, _uint iCloneLevel , function AddPrototypeEvent); - HRESULT Use_Skill(SKILL_TYPE eType , CGameObject* pOwner); + HRESULT Use_Skill(SKILL_TYPE eType , CGameObject* pOwner, void* pArg = nullptr); public: #ifdef _DEBUG HRESULT Reset_Pool(); diff --git a/Jusin154_Team3D/Editor/Public/Effect_Container.h b/Jusin154_Team3D/Editor/Public/Effect_Container.h index ec57ab97d..7e54b32e4 100644 --- a/Jusin154_Team3D/Editor/Public/Effect_Container.h +++ b/Jusin154_Team3D/Editor/Public/Effect_Container.h @@ -23,7 +23,7 @@ class CEffect_Container abstract : public CContainerObject public: HRESULT Load_Directory(const _char* pPath); HRESULT Load_Package(const _char* pPath); - virtual HRESULT Pre_Setting(CGameObject* pObject); + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr); protected: virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; @@ -33,11 +33,12 @@ class CEffect_Container abstract : public CContainerObject HRESULT Reset_EditEffect(); void Update_Event(_float fTimeDelta); + _int CollisionCheck(); protected: _float4 m_vStartPos = {}; _float4 m_vEndPos = {}; - PSX::PxSweepBuffer hitBuffer = {}; + PSX::PxSweepBufferN<12> m_Hitbuffer = {}; protected: _wstring m_wstrEffectName = {}; diff --git a/Jusin154_Team3D/Editor/Public/IMGUIUI.h b/Jusin154_Team3D/Editor/Public/IMGUIUI.h index 77f8ef5fe..de548593b 100644 --- a/Jusin154_Team3D/Editor/Public/IMGUIUI.h +++ b/Jusin154_Team3D/Editor/Public/IMGUIUI.h @@ -30,12 +30,13 @@ class CIMGUIUI final : public CGameObject virtual HRESULT Initialize(void* pArg) override; private: + void CanvaswstringTostring(vector& panelNames); void PanelwstringTostring(vector& panelNames); void ElementwstringTostring(vector& panelNames); private: + CGameObject* m_pUI_Manager = { nullptr }; CGameObject* m_pGamePlay_Canvas = { nullptr }; - CGameObject* m_pSpell_Canvas = { nullptr }; CGameObject* m_pCurrent_Canvas = { nullptr }; CGameObject* m_pPanelObject = { nullptr }; CGameObject* m_pElementObject = { nullptr }; @@ -49,6 +50,7 @@ class CIMGUIUI final : public CGameObject _float2 m_UV{}; _int m_iSpellType{}; + _int m_iSkillType{}; _vector m_vLerpPosition{}; _float m_fLerpX{}; @@ -85,6 +87,11 @@ class CIMGUIUI final : public CGameObject vector m_iPanelNamestring; vector m_iPanelName; + _int m_iCanvasCount{}; + vector m_iCanvasNamewstring; + vector m_iCanvasNamestring; + vector m_iCanvaslName; + _bool m_bCanvasVisible = { false }; _bool m_bPanelVisible = { false }; _bool m_bElementAllVisible = { false }; diff --git a/Jusin154_Team3D/Editor/Public/Levioso.h b/Jusin154_Team3D/Editor/Public/Levioso.h index 304035c69..6577efc8b 100644 --- a/Jusin154_Team3D/Editor/Public/Levioso.h +++ b/Jusin154_Team3D/Editor/Public/Levioso.h @@ -21,7 +21,7 @@ class CLevioso final : public CEffect_Container virtual void Late_Update(_float fTimeDelta) override; public: - virtual HRESULT Pre_Setting(CGameObject* pObject) override; + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; private: virtual HRESULT Initialize_Prototype() override; diff --git a/Jusin154_Team3D/Editor/Public/LeviosoSide.h b/Jusin154_Team3D/Editor/Public/LeviosoSide.h index c630042b3..8a0860127 100644 --- a/Jusin154_Team3D/Editor/Public/LeviosoSide.h +++ b/Jusin154_Team3D/Editor/Public/LeviosoSide.h @@ -21,7 +21,7 @@ class CLeviosoSide final : public CEffect_Container virtual void Late_Update(_float fTimeDelta) override; public: - virtual HRESULT Pre_Setting(CGameObject* pObject) override; + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; private: virtual HRESULT Initialize_Prototype() override; diff --git a/Jusin154_Team3D/Editor/Public/NomalJap.h b/Jusin154_Team3D/Editor/Public/NomalJap.h index 51fd250f3..9500cb71f 100644 --- a/Jusin154_Team3D/Editor/Public/NomalJap.h +++ b/Jusin154_Team3D/Editor/Public/NomalJap.h @@ -22,7 +22,7 @@ class CNomalJap final : public CEffect_Container public: - virtual HRESULT Pre_Setting(CGameObject* pObject) override; + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; private: virtual HRESULT Initialize_Prototype() override; @@ -35,21 +35,35 @@ class CNomalJap final : public CEffect_Container class CInfoInstance* m_pInfoInstance = { nullptr }; _wstring m_wstrEffectName = {}; + _float4 m_vJapData[4] = { _float4(45.f , 330.f , 35.f , 20.f) + , _float4(35.f , 100.f , 55.f , 200.f) + , _float4(35.f , 0.f , 0.f , 0.f) + , _float4(45.f , 250.f , 35.f , 60.f) }; + class CPartObject* m_pProjectile = {}; class CPartObject* m_pProjectile_Side = {}; _float3 m_vRotateUp = {}; _float m_fAccMoveTime = {}; - _float m_fLerpAmount = {}; + _float m_fAccRotateTime = {}; + _float m_fRotateAmount = { 0.2f }; _float m_fTurnValue = {}; + _float m_fAngle = { XMConvertToRadians(285.f) }; + _float3 m_vCameraLook = {}; - CUnit* m_pTargetUnit = { nullptr }; // 발사될 당시 대상 _float3 m_vDirection = { 0.f, 0.f, 1.f }; _float4 m_vStartPos = { 0.f, 0.f, 0.f, 1.f }; // 현재 발사 된 위치 _float4 m_vTargetPos = { 0.f, 0.f, 10.f, 1.f }; // 현재 타게팅 된 위치 - _float m_fAngularSpeed = XM_2PI / 0.3f; - _float m_fLinearSpeed = 1.f; - _bool m_bTrailPulseEnded = false; + _float m_fAngularSpeed = {}; + _float m_fLinearSpeed = 35.f; + _float m_fTimeRate = {}; + + /*좌우 무빙 관련 변수들*/ + _float3 m_vRotateRight = {}; + _float m_fZigZagAngle = { XMConvertToRadians(60.f) }; + _float m_fAccZigZagTime = {}; + _float m_fZigZagSpeed = { 25.f }; + _float m_fZigZagAmount = { 0.1f }; public: static CNomalJap* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual void Free() override; diff --git a/Jusin154_Team3D/Editor/Public/NomalJapSide.h b/Jusin154_Team3D/Editor/Public/NomalJapSide.h index 3a4022984..1185a2ba5 100644 --- a/Jusin154_Team3D/Editor/Public/NomalJapSide.h +++ b/Jusin154_Team3D/Editor/Public/NomalJapSide.h @@ -21,7 +21,7 @@ class CNomalJapSide final : public CEffect_Container virtual void Late_Update(_float fTimeDelta) override; public: - virtual HRESULT Pre_Setting(CGameObject* pObject) override; + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; private: virtual HRESULT Initialize_Prototype() override; diff --git a/Jusin154_Team3D/Editor/Public/Protego.h b/Jusin154_Team3D/Editor/Public/Protego.h index cfae68ca6..85aae6220 100644 --- a/Jusin154_Team3D/Editor/Public/Protego.h +++ b/Jusin154_Team3D/Editor/Public/Protego.h @@ -21,7 +21,7 @@ class CProtego final : public CEffect_Container virtual void Late_Update(_float fTimeDelta) override; public: - virtual HRESULT Pre_Setting(CGameObject* pObject) override; + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; private: virtual HRESULT Initialize_Prototype() override; diff --git a/Jusin154_Team3D/Editor/Public/Revelio.h b/Jusin154_Team3D/Editor/Public/Revelio.h index e3b334bf6..1a9f47ee2 100644 --- a/Jusin154_Team3D/Editor/Public/Revelio.h +++ b/Jusin154_Team3D/Editor/Public/Revelio.h @@ -21,7 +21,7 @@ class CRevelio final : public CEffect_Container virtual void Late_Update(_float fTimeDelta) override; public: - virtual HRESULT Pre_Setting(CGameObject* pObject) override; + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; private: virtual HRESULT Initialize_Prototype() override; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Anim.h b/Jusin154_Team3D/Editor/Public/Spell_Anim.h index 4845e6212..314066ef4 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Anim.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Anim.h @@ -23,7 +23,7 @@ class CSpell_Anim final : public CElementObject virtual void Set_FadeIn() override; private: - void Change_Image(_int SpellID); + HRESULT Change_Image(_int SpellID); virtual void Set_SkillType(_int eType) override; private: diff --git a/Jusin154_Team3D/Editor/Public/Spell_Drag.h b/Jusin154_Team3D/Editor/Public/Spell_Drag.h index b65a92d24..6918f1ab2 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Drag.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Drag.h @@ -29,6 +29,8 @@ class CSpell_Drag final : public CElementObject private: void Compute_UI(_uint SpellID); virtual void Set_SpellType(_int SpellID) override; + _float2 Get_MousePos(); + void Set_Current_Slot(_uint Index); private: CTexture* m_pDiffuse_TextureCom = { nullptr }; @@ -38,8 +40,16 @@ class CSpell_Drag final : public CElementObject CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + _vector m_vStart_MousePos{}; + _vector m_vMove_MousePos{}; _float4 m_vUV{}; + _int m_iCurrent_Slot_Index{}; + + _bool m_bCurrent_Hover = { false }; + _bool m_bMove = { false }; + _bool m_bClick = { false }; + _bool m_bFalse = { false }; public: static CSpell_Drag* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Hover.h b/Jusin154_Team3D/Editor/Public/Spell_Hover.h index 7aeeca08a..b6ceb64fb 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Hover.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Hover.h @@ -28,7 +28,7 @@ class CSpell_Hover final : public CElementObject virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; private: - void Hover(); + void Click_Slot(_bool bClick); private: virtual HRESULT Bind_ShaderResources() override; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Hover_Effect.h b/Jusin154_Team3D/Editor/Public/Spell_Hover_Effect.h index 2216e07f9..64dd364f2 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Hover_Effect.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Hover_Effect.h @@ -27,6 +27,9 @@ class CSpell_Hover_Effect final : public CElementObject virtual void SizeUpY(_float fSizeY) override; virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; +private: + void Click_Slot(_bool bClick); + private: virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; diff --git a/Jusin154_Team3D/Editor/Public/Spell_List.h b/Jusin154_Team3D/Editor/Public/Spell_List.h index a74245592..35f9f082a 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_List.h +++ b/Jusin154_Team3D/Editor/Public/Spell_List.h @@ -29,7 +29,8 @@ class CSpell_List final : public CElementObject private: void Color(); - void Hover(_float fTimeDelta); + void Hover(); + void Click_Slot(_bool bClick); private: virtual HRESULT Bind_ShaderResources() override; @@ -49,6 +50,7 @@ class CSpell_List final : public CElementObject _int m_iPerSpell_Slot{}; _float m_fHoverTime{}; + public: static CSpell_List* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Panel.h b/Jusin154_Team3D/Editor/Public/Spell_Panel.h index af602b37e..2110d8974 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Panel.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Panel.h @@ -29,7 +29,8 @@ class CSpell_Panel final : public CPanelObject private: void Slot_Chack(void* pArg); - + void Click_Slot(_bool Click); + void Current_Slot_Chack(_int Index); private: virtual HRESULT Bind_ShaderResources() override; @@ -58,6 +59,7 @@ class CSpell_Panel final : public CPanelObject CGameObject* m_pSpell_Header = { nullptr }; CGameObject* m_pSpell_Header_Line = { nullptr }; CGameObject* m_pSpell_Anim = { nullptr }; + CGameObject* m_pCSpell_Drag = { nullptr }; _int m_iHoverSlot[2] = { -1,-1 }; @@ -66,6 +68,10 @@ class CSpell_Panel final : public CPanelObject _int m_iPendingSpell = -1; _float m_fHoverTimer = 0.f; + + _int m_iCurrent_Slot_Index{}; + _bool m_bCurrentSlot_Hover = { false }; + public: static CSpell_Panel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Editor/Public/Spell_State.h b/Jusin154_Team3D/Editor/Public/Spell_State.h index ae6d7a509..09f34bacf 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_State.h +++ b/Jusin154_Team3D/Editor/Public/Spell_State.h @@ -28,7 +28,7 @@ class CSpell_State final : public CElementObject virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; private: - void Hover(); + void Click_Slot(_bool bClick); private: virtual HRESULT Bind_ShaderResources() override; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Vidio_Border.h b/Jusin154_Team3D/Editor/Public/Spell_Vidio_Border.h index bb306b7bb..515064bc2 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Vidio_Border.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Vidio_Border.h @@ -19,12 +19,6 @@ class CSpell_Vidio_Border final : public CElementObject virtual HRESULT Render() override; virtual _vector Get_WorldPostion() override; -//public: -// virtual const SPELLINFO Get_Info(_int Index) override; -// -//public: -// virtual void Set_SkillType(_int eType); - private: virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; diff --git a/Jusin154_Team3D/Editor/Public/TrailObject.h b/Jusin154_Team3D/Editor/Public/TrailObject.h index 737b1f29c..03d6277f2 100644 --- a/Jusin154_Team3D/Editor/Public/TrailObject.h +++ b/Jusin154_Team3D/Editor/Public/TrailObject.h @@ -68,7 +68,7 @@ class CTrailObject final : public CPartObject BLOOM_TYPE eBloomType = {}; _float2 vBloomTime = {}; - _int iNumVertex = {}; + _int iNumVertex = { 256 }; RENDER eRenderOrder = { RENDER::EFFECT }; diff --git a/Jusin154_Team3D/Editor/Public/UI_Manager.h b/Jusin154_Team3D/Editor/Public/UI_Manager.h new file mode 100644 index 000000000..b42b75c79 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/UI_Manager.h @@ -0,0 +1,74 @@ +#pragma once + +#include "Editor_Define.h" +#include "UIObject.h" + +NS_BEGIN(Engine) + +NS_END + +NS_BEGIN(Editor) + +class CUI_Manager final : public CUIObject +{ +public: + enum class Canvases {GAMEPLAYER_CANVAS, SPELL_CANVAS}; + +private: + CUI_Manager(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CUI_Manager(const CUI_Manager& rhs); + virtual ~CUI_Manager() = default; + +public: + virtual void Priority_Update(_float fTimeDelta); + virtual void Update(_float fTimeDelta); + virtual void Late_Update(_float fTimeDelta); + virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + //virtual HRESULT Ready_Panel(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +public: + void Canvas_Change(Canvases m_eType); + void Clear_Canvas(); + virtual class CGameObject* Get_Canvas(const wstring& Name); + virtual _int Canvas_Count(); + virtual const vector Canvas_Name(); + + void Add_Manager_Event(_wstring Name, function Event); + void Event_Callback(_wstring Name, void* pArg = nullptr); +private: + void Add_Canvas(_wstring Name, class CGameObject* pCanvas); + CGameObject* Find_Canvas(const _wstring& Name); + +private: + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + CGameObject* m_pGamePlay_Canves = { nullptr }; + CGameObject* m_pSpell_Canvas = { nullptr }; + _bool m_bCanvas_Change = { false }; + + Canvases m_eType{}; + + vector m_Canvases; // 캔버스가 패널들을 관리 하기 위해서 필요함 + vector m_CanvasNames; // 패널들의 이름을 전해주기 위해서 + map m_Canvas_map; // 캔버스에서 내가 원하는 패널을 찾기 위해서 + _int m_iCanvas_Count{}; // 전체 패널의 갯수 + + multimap> m_Event_map; + + +public: + static CUI_Manager* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; + +}; + +NS_END; diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Buffers.hlsli b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Buffers.hlsli new file mode 100644 index 000000000..95aac70f8 --- /dev/null +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Buffers.hlsli @@ -0,0 +1,9 @@ +#ifndef ENGINE_SHADER_BUFFERS_HLSLI +#define ENGINE_SHADER_BUFFERS_HLSLI + +cbuffer GLOBAL_SSAO_DATA : register(b10) +{ + float4 SamplePos[64]; +}; + +#endif // ENGINE_SHADER_BUFFERS_HLSLI diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Defines.hlsli b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Defines.hlsli index 3ce9b7364..1e037ba16 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Defines.hlsli +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Defines.hlsli @@ -6,6 +6,7 @@ #include "Engine_Shader_Samplers.hlsli" #include "Engine_Shader_States.hlsli" #include "Engine_Shader_Functions.hlsli" +#include "Engine_Shader_Buffers.hlsli" #endif // ENGINE_SHADER_DEFINES_HLSLI diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli index eed99c58c..342f13cdc 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli @@ -30,7 +30,7 @@ float ShadowVisibility_hwPCF(Texture2D ShadowMap, float4 vLightClip, float2 vSha for (int u = -1; u <= 1; ++u) { float2 vOffset = float2(u, v) * vTexel; - float fDepth = ShadowMap.Sample(BorderOneSampler, uv + vOffset); + float fDepth = ShadowMap.Sample(BorderOneSampler, uv + vOffset).x; fVisibility += (fDepthCenter - bias > fDepth) ? 0.f : 1.f; } } diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Samplers.hlsli b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Samplers.hlsli index 2e950e2c6..099c9e610 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Samplers.hlsli +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Samplers.hlsli @@ -50,6 +50,13 @@ sampler BorderOneSampler = sampler_state BorderColor = float4(1.f, 1.f, 1.f, 1.f); }; +sampler SsaoDataSampler = sampler_state +{ + Filter = MIN_MAG_MIP_POINT; + AddressU = wrap; + AddressV = wrap; +}; + sampler PointSampler = sampler_state { Filter = MIN_MAG_MIP_POINT; diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index b59cd1543..30762c3ba 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -18,8 +18,15 @@ float g_fFocusDistance; float g_fFarBlurStart; float g_fFarBlurEnd; float g_fDOFBlurMultiplier; +float g_fSSAO_BIAS; +bool g_bSSAO_INVERT; -Texture2D g_Texture; +Texture2D g_Texture; +Texture2D g_SSAONoiseTexture; +Texture2D g_SSAOInputTexture; +uint g_iKernelSize; +float g_fSSAORadius; +float2 g_vSSAOTextureSize; float g_fLightRange; float g_fSpotInnerAngle; @@ -134,9 +141,10 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) float2 uv = In.vTexcoord; - float3 vAlbedo = g_DiffuseTexture.Sample(DefaultSampler, uv).rgb; - float3 vNormal = normalize(g_NormalTexture.Sample(DefaultSampler, uv).xyz * 2.f - 1.f); - float4 vDepth = g_DepthTexture.Sample(DefaultSampler, uv); + float3 vAlbedo = g_DiffuseTexture.Sample(DefaultSampler, uv).rgb; + float3 vNormal = normalize(g_NormalTexture.Sample(DefaultSampler, uv).xyz * 2.f - 1.f); + float4 vDepth = g_DepthTexture.Sample(DefaultSampler, uv); + float fAmbientOcclusion = g_SSAOInputTexture.Sample(DefaultSampler, uv).r; float fViewZ = vDepth.y * g_fFar; @@ -182,11 +190,12 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) } else // basic Lighting(phong blinn) // if you were here, you miss some assets. { - Out.vShade = g_vLightDiffuse * saturate(max(dot(normalize(g_vLightDir.xyz) * -1.f, vNormal), 0.f) + (g_vLightAmbient * g_vMtrlAmbient)); + Out.vShade = g_vLightDiffuse * saturate(max(dot(normalize(g_vLightDir.xyz) * -1.f, vNormal), 0.f) + (fAmbientOcclusion * g_vLightAmbient * g_vMtrlAmbient)); Out.vSpecular = (g_vLightSpecular * g_vMtrlSpecular) * pow(max(dot(vToView * -1.f, vToLight), 0.f), 50.f); return Out; } + float fTotalOcclusion = saturate(fOcclusion * fAmbientOcclusion); { // 수치조정 // 디렉셔널 float fMinRoughness = 0.05f; @@ -197,9 +206,9 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); - PBR_Out.vShade *= fOcclusion; + PBR_Out.vShade *= fTotalOcclusion; - float3 vAmbient = g_vLightAmbient.rgb * fOcclusion * fAttenuation; + float3 vAmbient = g_vLightAmbient.rgb * fTotalOcclusion * fAttenuation; float3 vFinalDiffuse = PBR_Out.vShade + vAmbient; float3 vFinalSpecular = PBR_Out.vSpecular * g_vLightSpecular.rgb; @@ -246,6 +255,7 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In) float fLightDistance = length(vFinalLightPosition - vWorldPosition.xyz); float3 vToView = normalize(g_vCamPosition.xyz - vWorldPosition.xyz); // 픽셀에서 카메라로 float3 vToLight = normalize(vFinalLightPosition - vWorldPosition.xyz); // 픽셀에서 라이트로 + float fAmbientOcclusion = g_SSAOInputTexture.Sample(DefaultSampler, uv).r; if (g_bUsePowerLightAttenuation) { @@ -284,12 +294,14 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In) } else // basic Lighting(phong blinn) // if you were here, you miss some assets. { - Out.vShade = fAttenuation * (g_vLightDiffuse * saturate(max(dot(vToLight * -1.f, vNormal), 0.f) + (g_vLightAmbient * g_vMtrlAmbient))); + Out.vShade = fAttenuation * (g_vLightDiffuse * saturate(max(dot(vToLight * -1.f, vNormal), 0.f) + (fAmbientOcclusion * g_vLightAmbient * g_vMtrlAmbient))); Out.vSpecular = fAttenuation * ((g_vLightSpecular * g_vMtrlSpecular) * pow(max(dot(vToView * -1.f, vToLight), 0.f), 50.f)); return Out; } + float fTotalOcclusion = saturate(fOcclusion * fAmbientOcclusion); + { // 수치조정 // 점광원 float fMinRoughness = 0.05f; fRoughness = max(fRoughness, fMinRoughness); // 러프니스 최소값 보장 @@ -299,9 +311,9 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In) PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); - PBR_Out.vShade *= fOcclusion; + PBR_Out.vShade *= fTotalOcclusion; - float3 vAmbient = g_vLightAmbient.rgb * fOcclusion * fAttenuation; + float3 vAmbient = g_vLightAmbient.rgb * fTotalOcclusion * fAttenuation; float3 vFinalDiffuse = PBR_Out.vShade + vAmbient; float3 vFinalSpecular = PBR_Out.vSpecular * g_vLightSpecular.rgb; @@ -322,6 +334,7 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In) float3 vAlbedo = g_DiffuseTexture.Sample(DefaultSampler, uv).rgb; float3 vNormal = normalize(g_NormalTexture.Sample(DefaultSampler, uv).xyz * 2.f - 1.f); float4 vDepth = g_DepthTexture.Sample(DefaultSampler, uv); + float fAmbientOcclusion = g_SSAOInputTexture.Sample(DefaultSampler, uv).r; float fViewZ = vDepth.y * g_fFar; @@ -401,11 +414,12 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In) } else // basic Lighting(phong blinn) // if you were here, you miss some assets. { - Out.vShade = fAttenuation * (g_vLightDiffuse * saturate(max(dot(vToLight * -1.f, vNormal), 0.f) + (g_vLightAmbient * g_vMtrlAmbient))); + Out.vShade = fAttenuation * (g_vLightDiffuse * saturate(max(dot(vToLight * -1.f, vNormal), 0.f) + (fAmbientOcclusion * g_vLightAmbient * g_vMtrlAmbient))); Out.vSpecular = fAttenuation * ((g_vLightSpecular * g_vMtrlSpecular) * pow(max(dot(vToView * -1.f, vToLight), 0.f), 50.f)); return Out; } + float fTotalOcclusion = saturate(fOcclusion * fAmbientOcclusion); { // 수치조정 // 점광원 float fMinRoughness = 0.05f; @@ -416,9 +430,9 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In) PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); - PBR_Out.vShade *= fOcclusion; + PBR_Out.vShade *= fTotalOcclusion; - float3 vAmbient = g_vLightAmbient.rgb * fOcclusion * fAttenuation; + float3 vAmbient = g_vLightAmbient.rgb * fTotalOcclusion * fAttenuation; float3 vFinalDiffuse = PBR_Out.vShade + vAmbient; float3 vFinalSpecular = PBR_Out.vSpecular * g_vLightSpecular.rgb; @@ -464,10 +478,7 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) vector vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); - if (0.f == vDiffuse.a) - { - discard; - } + if (0.f == vDiffuse.a) { discard; } vector vShade = g_ShadeTexture.Sample(DefaultSampler, In.vTexcoord); @@ -560,22 +571,22 @@ PS_OUT_FLT4_SINGLE PS_MAIN_EMBOSS(PS_IN In) { case 0: /* None */ - vColor = float3(0.f, 0.f, 0.f); + vColor = (0.f, 0.f, 0.f); break; case 1: /* Basic_Apply */ break; case 2: /* Multiply */ - vColor *= 3; + vColor *= 3.f; break; case 3: break; } - float fIntensity = dot(vColor, float3(0.2126f, 0.7152f, 0.0722f)); // 대략적인 밝기 ( 인간적인 ) + float fIntensity = dot(vColor, float3(0.2126f, 0.7152f, 0.0722f)); // 대략적인 밝기 - if (fIntensity <= 1e-4f) + if (fIntensity <= FLT_EPSILON5) { Out.vSingleTarget = 0; return Out; @@ -631,7 +642,7 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_X(PS_IN In) vTexcoord.x = In.vTexcoord.x + (float) i / g_vResolution.x; vTexcoord.y = In.vTexcoord.y; - vColor += g_fWeights_128[i + 63] * g_BlurTexture.Sample(BorderZeroSampler, vTexcoord); + vColor += g_fWeights_128[i + 63] * g_BlurTexture.Sample(ClampSampler, vTexcoord); } Out.vBlurX = vColor; @@ -818,7 +829,7 @@ PS_OUT_BLUR_X PS_MAIN_BLUR_Y(PS_IN In) vTexcoord.x = In.vTexcoord.x; vTexcoord.y = In.vTexcoord.y + (float) i / g_vResolution.y; - vColor += g_fWeights_128[i + 63] * g_BlurTexture.Sample(BorderZeroSampler, vTexcoord); + vColor += g_fWeights_128[i + 63] * g_BlurTexture.Sample(ClampSampler, vTexcoord); } Out.vBlurX = vColor; @@ -875,6 +886,8 @@ PS_OUT_BACKBUFFER PS_TONE_MAPPING(PS_IN In) vColor = pow(vColor, 2.2f); switch (g_iToneMappingType) { case 0: + vColor = pow(vColor, 1.f/2.2f); + vColor /= g_fToneMappingExposure; break; case 1: vColor = float4(ReinHard_ToneMapper(vColor.xyz), 1.f); @@ -891,6 +904,96 @@ PS_OUT_BACKBUFFER PS_TONE_MAPPING(PS_IN In) return Out; } +struct PS_OUT_SSAO_AMBIENT_OCCLUSION +{ + float fOcclusion : SV_TARGET0; +}; + +PS_OUT_SSAO_AMBIENT_OCCLUSION PS_SSAO_AMBIENT_OCCLUSION(PS_IN In) +{ + PS_OUT_SSAO_AMBIENT_OCCLUSION Out; + float2 uv = In.vTexcoord; + + float4 vDepthDesc = g_DepthTexture.Sample(PointSampler, uv); + float fCenterViewSpaceZ = vDepthDesc.y * g_fFar; // n ~ f + + float4 vCenterViewPosition; + { + vCenterViewPosition.x = uv.x * 2.f - 1.f; + vCenterViewPosition.y = uv.y * -2.f + 1.f; + vCenterViewPosition.z = vDepthDesc.x; + vCenterViewPosition.w = 1.f; + vCenterViewPosition *= fCenterViewSpaceZ; + vCenterViewPosition = mul(vCenterViewPosition, g_invmatProj); + vCenterViewPosition /= vCenterViewPosition.w; + } + float3 vNormal = normalize(g_NormalTexture.Sample(PointSampler, uv).xyz * 2.f - 1.f); + float3 vCenterViewNormal = mul(vNormal, (float3x3)g_ViewMatrix); + + float2 vNoiseScale = g_vResolution / 4.f; + float3 vNoise = g_SSAONoiseTexture.Sample(SsaoDataSampler, uv * vNoiseScale).xyz; + + float3 vTangent = normalize(vNoise - vCenterViewNormal * dot(vNoise, vCenterViewNormal)); + float3 vBiNormal = cross(vCenterViewNormal, vTangent); + float3x3 toViewTBNMatrix = float3x3(vTangent, vBiNormal, vCenterViewNormal); + + float fOcclusion = 0.f; + for (uint i = 0; i < g_iKernelSize; ++i) + { + float3 vViewSamplePosVec = mul(SamplePos[i].xyz, toViewTBNMatrix); // TANSPACE -> VIEW + float4 vViewSamplePos = vCenterViewPosition + float4(vViewSamplePosVec * g_fSSAORadius, 0.f); + float4 vNDCSampleOffset = mul(vViewSamplePos, g_ProjMatrix); + vNDCSampleOffset /= vNDCSampleOffset.w; + + float2 sampleUV; + sampleUV.x = vNDCSampleOffset.x * 0.5f + 0.5f; + sampleUV.y = vNDCSampleOffset.y * -0.5f + 0.5f; + + if (sampleUV.x < 0 || sampleUV.x > 1 + || sampleUV.y < 0 || sampleUV.y > 1) { + continue; + } + + float fRecordedSampleViewPosDepth = g_DepthTexture.Sample(PointSampler, sampleUV).y * g_fFar; + float fIsOccluded = (fRecordedSampleViewPosDepth < vViewSamplePos.z - g_fSSAO_BIAS) ? 1.0f : 0.0f; + + float fRangeCheck = smoothstep(0.f, 1.f, g_fSSAORadius / abs(vViewSamplePos.z - fRecordedSampleViewPosDepth)); + fIsOccluded *= fRangeCheck; + fOcclusion += fIsOccluded; + } + fOcclusion = (1.f - (fOcclusion / g_iKernelSize)); + Out.fOcclusion = fOcclusion; + + return Out; +} + +struct PS_OUT_SSAO_BLUR +{ + float fBlur : SV_TARGET0; +}; + +PS_OUT_SSAO_BLUR PS_SSAO_BLUR(PS_IN In) +{ + PS_OUT_SSAO_BLUR Out; + + float2 vTexelSize = 1.0f / g_vResolution; + + float fResult = 0.0f; + for (int x = -2; x < 2; ++x) + { + for (int y = -2; y < 2; ++y) + { + float2 vOffset = float2((float) x, (float) y) * vTexelSize; + fResult += g_SSAOInputTexture.Sample(DefaultSampler, In.vTexcoord + vOffset).r; + } + } + + fResult /= 16.f; // 16개 샘플 평균 + + Out.fBlur = fResult; + return Out; +} + technique11 DefaultTechnique { pass DebugPass // 0 @@ -1050,4 +1153,24 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_TONE_MAPPING(); } + + pass SSAO_AmbientOcclusion // 16 + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_None, 0); + SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_CAPTURE(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_SSAO_AMBIENT_OCCLUSION(); + } + + pass SSAO_Blur_X // 17 + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_None, 0); + SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_CAPTURE(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_SSAO_BLUR(); + } } diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj b/Jusin154_Team3D/Engine/Default/Engine.vcxproj index b87aad2df..0ef236f71 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj @@ -616,6 +616,7 @@ call Update_Lib.bat Effect 5.0 + diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters index 0f0ec0991..96ee85b7b 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters @@ -1246,6 +1246,9 @@ 99.Define\99.THIRDPARTY\FMOD + + 99.Define\01.SHADER\Inc + diff --git a/Jusin154_Team3D/Engine/Private/CanvasObject.cpp b/Jusin154_Team3D/Engine/Private/CanvasObject.cpp index cd210787b..c1ceaa795 100644 --- a/Jusin154_Team3D/Engine/Private/CanvasObject.cpp +++ b/Jusin154_Team3D/Engine/Private/CanvasObject.cpp @@ -68,6 +68,7 @@ void CCanvasObject::Update(_float fTimeDelta) m_fAlpha = 0.f; } } + __super::Update(fTimeDelta); } void CCanvasObject::Late_Update(_float fTimeDelta) diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index aaf34c9e3..4f0f2accf 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -50,8 +50,13 @@ HRESULT CGameInstance::Initialize_Engine(const ENGINE_DESC& EngineDesc, ID3D11De } } } +#ifdef 기무리 + m_pThreadHolder = CThreadHolder::Create(12); +#endif // 기무리 +#ifndef 기무리 + m_pThreadHolder = CThreadHolder::Create(6); +#endif // !기무리 - m_pThreadHolder = CThreadHolder::Create( 6 ); if (nullptr == m_pThreadHolder) { return E_FAIL; diff --git a/Jusin154_Team3D/Engine/Private/Material.cpp b/Jusin154_Team3D/Engine/Private/Material.cpp index aca39b20c..205ec83cb 100644 --- a/Jusin154_Team3D/Engine/Private/Material.cpp +++ b/Jusin154_Team3D/Engine/Private/Material.cpp @@ -307,6 +307,9 @@ HRESULT CMaterial::Add_Texture(const _char* pTextureFolderPath, string& FileType else if (!strcmp(FileType.c_str(), "E")){ eTexture = aiTextureType::aiTextureType_EMISSIVE; } + else if (!strcmp(FileType.c_str(), "SRXO")) { + eTexture = aiTextureType::aiTextureType_SPECULAR; + } else { #ifndef 기무리 diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index 37e3501c0..f20f2cdac 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -180,7 +180,7 @@ _bool CModel::Play_Anim(_float fTimeDelta, CTransform* pTransform) } else { - Update_RootBone(); + Update_RootBone(m_fAmount); } if (m_bIsFinishedAnim) @@ -275,7 +275,7 @@ _bool CModel::Play_Dual_Anim(_float fTimeDelta, CTransform* pTransform) } else { - Update_RootBone(); + Update_RootBone(m_fAmount); } if (m_bIsFinishedAnim) diff --git a/Jusin154_Team3D/Engine/Private/PanelObject.cpp b/Jusin154_Team3D/Engine/Private/PanelObject.cpp index 73c36b4f2..d41593c87 100644 --- a/Jusin154_Team3D/Engine/Private/PanelObject.cpp +++ b/Jusin154_Team3D/Engine/Private/PanelObject.cpp @@ -45,7 +45,7 @@ void CPanelObject::Update(_float fTimeDelta) m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet( m_fX + m_pOwner->Get_WorldPostion().m128_f32[0], -m_fY + m_pOwner->Get_WorldPostion().m128_f32[1], - 0.f, 1.f)); + m_fSortZ, 1.f)); m_fCurrent_Position = XMVectorSet(m_fX, m_fY, 0.f, 1.f); diff --git a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp index e8649f278..51fb0212e 100644 --- a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp @@ -461,7 +461,7 @@ PSX::PxController* CPhysX_Manager::Add_BoxController(PSX::PxBoxControllerDesc& D PSX::PxController* pController = { nullptr }; pController = m_pCCTManager->createController(Desc); - + return pController; } @@ -500,12 +500,10 @@ HRESULT CPhysX_Manager::Initialize() return E_FAIL; } #ifdef _DEBUG - if (FAILED(Connect_DebugServer())) { //ASSERT_NURI(false); //ASSERT_JINWOO(false); } - #endif // _DEBUG { // 씬 세팅 @@ -584,7 +582,7 @@ m_pPhysics = PxCreatePhysics(PX_PHYSICS_VERSION, *m_pFoundation, m_ToleranceScal m_pMaterials.push_back(m_pPhysics->createMaterial(0.5f, 0.5f, 0.6f)); PlaneData.eKind = PHYSX_KIND::BODY_STATIC; - PlaneData.iSubKind = UINT_MAX; + PlaneData.iSubKind = ENUM_CLASS(PXOBJECT::TERRAIN); PlaneData.pOwner = nullptr; PlaneData.pBody = nullptr; diff --git a/Jusin154_Team3D/Engine/Private/PipeLine.cpp b/Jusin154_Team3D/Engine/Private/PipeLine.cpp index e7a755785..5f8e56edc 100644 --- a/Jusin154_Team3D/Engine/Private/PipeLine.cpp +++ b/Jusin154_Team3D/Engine/Private/PipeLine.cpp @@ -1,6 +1,5 @@ #include "pch.h" #include "PipeLine.h" - CPipeLine::CPipeLine() { } diff --git a/Jusin154_Team3D/Engine/Private/Renderer.cpp b/Jusin154_Team3D/Engine/Private/Renderer.cpp index 66c43767f..0ad5df157 100644 --- a/Jusin154_Team3D/Engine/Private/Renderer.cpp +++ b/Jusin154_Team3D/Engine/Private/Renderer.cpp @@ -17,6 +17,8 @@ void CRenderer::Render() Render_Priority(); Render_Shadow(); Render_NonBlend(); + Render_SSAO(); + Render_SSAO_BLUR(); Render_LightAcc(); Render_Blur(); Render_Combined(); @@ -35,10 +37,20 @@ void CRenderer::Render() #ifdef _DEBUG Describe_Entitiy(); m_pGameInstance->RenderTarget_Debuger(); + static _bool m_bToggleDebug = false; if (m_pGameInstance->Key_Pressing(DIK_F10)) { Render_Debug(); } + else { + GUI::Begin("RenderTarget Debuger"); + GUI::Checkbox("DebugToggle", &m_bToggleDebug); + if (m_bToggleDebug) { + Render_Debug(); + } + GUI::End(); + } + #endif } @@ -227,7 +239,9 @@ void CRenderer::Render_LightAcc() if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Surface"), m_pShader, "g_SurfaceTexture"))) { return; } - + if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_SSAO_BLUR"), m_pShader, "g_SSAOInputTexture"))) { + return; + } m_pVIBuffer->Bind_Resources(); @@ -518,12 +532,149 @@ void CRenderer::Render_Blur() } void CRenderer::Render_SSAO() { +#ifdef _DEBUG + static _bool bSSAO = { true }; + static _uint iKernelSize = SSAO_SAMPLE_NUMBER; + static _float fSSAORadius = 0.8f; + static _float fSSAO_BIAS = 0.1f * fSSAORadius; + static _bool bInverted = { false }; + GUI::Begin("Renderer"); + GUI::Checkbox("bSSAO ", &bSSAO); + if (true == bSSAO) { + GUI::SameLine(); + if (GUI::CollapsingHeader("SSAO")) { + GUI::DragFloat("fSSAORadius ", &fSSAORadius, 0.0001f, -3.f, 3.f, "%.5f"); + GUI::DragFloat("fSSAO_BIAS", &fSSAO_BIAS, 0.0001f, -2.f, 2.f, "%.5f"); + GUI::Checkbox("Inverted", &bInverted); + } + } + else { + GUI::End(); + return; + } + GUI::End(); +#endif // _DEBUG + if (FAILED(m_pGameInstance->Begin_MRT(TEXT("MRT_SSAO_OCCLUSION")))) { + return; + } + { + _uint iNumViewPort = { 1 }; + D3D11_VIEWPORT vp = {}; + m_pContext->RSGetViewports(&iNumViewPort, &vp); + _float2 vResolution = { vp.Width, vp.Height }; + if (FAILED(m_pShader->Bind_RawValue("g_vResolution", &vResolution, sizeof(_float2)))) { + assert(false); + } + + // Bind_Resorces + if (FAILED(m_pShader->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))){ + assert(false); + return ; + } + if (FAILED(m_pShader->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))){ + assert(false); + return ; + } + if (FAILED(m_pShader->Bind_Matrix("g_invMatView", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW_INV) ))){ + assert(false); + return ; + } + if (FAILED(m_pShader->Bind_Matrix("g_invmatProj", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ_INV)))){ + assert(false); + return ; + } + if (FAILED(m_pShader->Bind_RawValue("g_vCamPosition", m_pGameInstance->Get_CamPosition(), sizeof(_float4)))){ + assert(false); + return ; + } + if (FAILED(m_pShader->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))){ + assert(false); + return ; + } + + if (FAILED(m_pShader->Bind_RawValue("g_iKernelSize", &iKernelSize, sizeof(_uint)))){ + assert(false); + return ; + } + if (FAILED(m_pShader->Bind_RawValue("g_fSSAORadius", &fSSAORadius, sizeof(_float)))){ + assert(false); + return ; + } + + if (FAILED(m_pShader->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { + assert(false); + return; + } + + if (FAILED(m_pShader->Bind_RawValue("g_fSSAO_BIAS", &fSSAO_BIAS, sizeof(_float)))) { + assert(false); + return; + } + + if (FAILED(m_pShader->Bind_RawValue("g_bSSAO_INVERT", &bInverted, sizeof(_bool)))) { + assert(false); + return; + } + m_pContext->VSSetConstantBuffers(10, 1, &m_pGlobalStaticCB); + m_pContext->PSSetConstantBuffers(10, 1, &m_pGlobalStaticCB); + } + { + // Bind_Targets + if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Depth"), m_pShader, "g_DepthTexture"))) { + assert(false); + return; + } + if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Normal"), m_pShader, "g_NormalTexture"))) { + assert(false); + return; + } + if (FAILED(m_pShader->Bind_SRV("g_SSAONoiseTexture", m_pSSAO_NoiseSRV))) { + assert(false); + return; + } + } + + if (FAILED(m_pShader->Begin(ENUM_CLASS(SHADER_PASS_DEFERRED::SSAO_OCCLUSION)))){ + assert(false); + return ; + } + if (FAILED(m_pVIBuffer->Bind_Resources())){ + assert(false); + return ; + } + if (FAILED(m_pVIBuffer->Render())){ + assert(false); + return ; + } + if (FAILED(m_pGameInstance->End_MRT())) { + return; + } } void CRenderer::Render_SSAO_BLUR() { -} -void CRenderer::Render_SSAO_Lighting() -{ + if (FAILED(m_pGameInstance->Begin_MRT(TEXT("MRT_SSAO_BLUR")))) { + return; + } + { + // Bind_Resorces + m_pShader->Bind_Matrix("g_WorldMatrix", &m_WorldMatrix); + m_pShader->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix); + m_pShader->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix); + if (FAILED(m_pShader->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { + return; + } + // Bind_Targets + if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_SSAO_AmbientOcclusion"), m_pShader, "g_SSAOInputTexture"))) { + return; + } + } + m_pShader->Begin(ENUM_CLASS(SHADER_PASS_DEFERRED::SSAO_BLUR)); + + m_pVIBuffer->Bind_Resources(); + m_pVIBuffer->Render(); + if (FAILED(m_pGameInstance->End_MRT())) { + return; + } } void CRenderer::Render_Blend() { @@ -575,7 +726,7 @@ void CRenderer::Render_Bloom() return; } - m_pShader->Bind_RawValue("m_fBloomThresholdy", &m_fBloomThreshold, sizeof(_float)); + m_pShader->Bind_RawValue("g_fBloomThreshold", &m_fBloomThreshold, sizeof(_float)); m_pShader->Bind_RawValue("g_iBloomEmbossingPass", &m_iBloomEmbossingPass, sizeof(_int)); m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_Input"), TEXT("Target_Bloom_2x2"), SHADER_PASS_DEFERRED::EMBOSSING); // 2 diff --git a/Jusin154_Team3D/Engine/Private/Renderer_Declare.cpp b/Jusin154_Team3D/Engine/Private/Renderer_Declare.cpp index 43a0c225f..230578c31 100644 --- a/Jusin154_Team3D/Engine/Private/Renderer_Declare.cpp +++ b/Jusin154_Team3D/Engine/Private/Renderer_Declare.cpp @@ -74,6 +74,80 @@ HRESULT CRenderer::Ready_ShadowDepthStencilView(_uint iSizeX, _uint iSizeY) return S_OK; } +void CRenderer::Fill_Geometry(_uint iNumSample) +{ + uniform_real_distribution<_float> rand_Normal(0.f, 1.f); + uniform_real_distribution<_float> rand_Minus(-1.f, 1.f); + mt19937 m_Rng{ random_device{}() }; + + _float fScale; + _vector vPos; + for (_uint iIndexSample = 0; iIndexSample < iNumSample; ++iIndexSample) { + vPos = { + rand_Minus(m_Rng), + rand_Minus(m_Rng), + rand_Normal(m_Rng) + }; + vPos = XMVector3Normalize(vPos) * rand_Normal(m_Rng); + fScale = ((_float)iIndexSample / (_float)iNumSample); + fScale = CMyTools::Lerp_f1D(0.f, 1.f, fScale * fScale); + vPos *= fScale; + XMStoreFloat3(&m_tagSSAOGeometry.SamplePos[iIndexSample].vPos, vPos); + } + + for (_uint iIndexDir = 0; iIndexDir < 16; ++iIndexDir) { + m_tagSSAOGeometryDirections.vDir[iIndexDir] = { + rand_Minus(m_Rng), + rand_Minus(m_Rng), + 0.f, + 0.f + }; + } + D3D11_TEXTURE2D_DESC texDesc = {}; + texDesc.Width = 4; + texDesc.Height = 4; + texDesc.MipLevels = 1; + texDesc.ArraySize = 1; + texDesc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT; + texDesc.SampleDesc.Count = 1; + texDesc.SampleDesc.Quality = 0; + texDesc.Usage = D3D11_USAGE_IMMUTABLE; + texDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE; + + D3D11_SUBRESOURCE_DATA initData = {}; + initData.pSysMem = &m_tagSSAOGeometryDirections; + initData.SysMemPitch = sizeof(_float4) * texDesc.Width; // 16 * 4 = 64 + + if (FAILED(m_pDevice->CreateTexture2D(&texDesc, &initData, &m_pSSAO_NoiseTexture))) { + assert(false); + return; + } + + D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc = {}; + srvDesc.Format = texDesc.Format; + srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D; + srvDesc.Texture2D.MostDetailedMip = 0; + srvDesc.Texture2D.MipLevels = 1; + + m_pDevice->CreateShaderResourceView(m_pSSAO_NoiseTexture, &srvDesc, &m_pSSAO_NoiseSRV); + + { + D3D11_BUFFER_DESC desc = {}; + desc.ByteWidth = sizeof(SSAO_GEOMETRY_HEMISPHERE); + desc.Usage = D3D11_USAGE_IMMUTABLE; + desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; + desc.CPUAccessFlags = 0; + + D3D11_SUBRESOURCE_DATA initData = {}; + initData.pSysMem = &m_tagSSAOGeometry; + initData.SysMemPitch = 0; + + HRESULT hr = m_pDevice->CreateBuffer(&desc, &initData, &m_pGlobalStaticCB); + + m_pContext->VSSetConstantBuffers(10, 1, &m_pGlobalStaticCB); + m_pContext->PSSetConstantBuffers(10, 1, &m_pGlobalStaticCB); + } +} HRESULT CRenderer::Initialize() { _uint iNumViewports = { 1 }; @@ -152,19 +226,14 @@ HRESULT CRenderer::Initialize() return E_FAIL; } - /* Target_SSAO */ - if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_SSAO"), (_uint)Viewport.Width, (_uint)Viewport.Height, - DXGI_FORMAT_R16G16B16A16_FLOAT, _float4(0.0f, 0.f, 0.0f, 0.0f)))) { + /* Target_SSAO_AmbientOcclusion */ + if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_SSAO_AmbientOcclusion"), (_uint)Viewport.Width, (_uint)Viewport.Height, + DXGI_FORMAT_R32_FLOAT, _float4(1.f, 1.f, 1.f, 1.f)))) { return E_FAIL; } - /* Target_SSAO_BLUR_X */ - if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_SSAO_BLUR_X"), (_uint)Viewport.Width, (_uint)Viewport.Height, - DXGI_FORMAT_R16G16B16A16_FLOAT, _float4(0.0f, 0.f, 0.0f, 0.0f)))) { - return E_FAIL; - } - /* Target_SSAO_LIGHTING */ - if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_SSAO_LIGHTING"), (_uint)Viewport.Width, (_uint)Viewport.Height, - DXGI_FORMAT_R16G16B16A16_FLOAT, _float4(0.0f, 0.f, 0.0f, 0.0f)))) { + /* Target_SSAO_BLUR */ + if (FAILED(m_pGameInstance->Add_RenderTarget(TEXT("Target_SSAO_BLUR"), (_uint)Viewport.Width, (_uint)Viewport.Height, + DXGI_FORMAT_R32_FLOAT, _float4(1.f, 1.f, 1.f, 1.f)))) { return E_FAIL; } @@ -256,18 +325,13 @@ HRESULT CRenderer::Initialize() return E_FAIL; } /* MRT_SSAO */ - if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_SSAO"), TEXT("Target_SSAO")))) { + if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_SSAO_OCCLUSION"), TEXT("Target_SSAO_AmbientOcclusion")))) { return E_FAIL; } /* MRT_SSAO_BLUR */ - if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_SSAO_BLUR"), TEXT("Target_SSAO_BLUR_X")))) { + if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_SSAO_BLUR"), TEXT("Target_SSAO_BLUR")))) { return E_FAIL; } - /* MRT_SSAO_LIGHTING */ - if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_SSAO_LIGHTING"), TEXT("Target_SSAO_LIGHTING")))) { - return E_FAIL; - } - /* MRT_Combined */ if (FAILED(m_pGameInstance->Add_MRT(TEXT("MRT_Combined"), TEXT("Target_Fog")))) { return E_FAIL; @@ -344,7 +408,6 @@ HRESULT CRenderer::Initialize() return E_FAIL; } - m_pLastColorShader = (CShader*)m_pGameInstance->Clone_Asset_Prototype(g_iStaticLevel, FX_LASTCOLOR, nullptr, nullptr); if (nullptr == m_pLastColorShader) { @@ -366,6 +429,8 @@ HRESULT CRenderer::Initialize() XMStoreFloat4x4(&m_ViewMatrix, XMMatrixIdentity()); XMStoreFloat4x4(&m_ProjMatrix, XMMatrixOrthographicLH(Viewport.Width, Viewport.Height, 0.f, 1.f)); + Fill_Geometry(SSAO_SAMPLE_NUMBER); + return S_OK; } CRenderer* CRenderer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -401,6 +466,9 @@ void CRenderer::Free() RenderObjects.clear(); } + SAFE_RELEASE(m_pGlobalStaticCB); + SAFE_RELEASE(m_pSSAO_NoiseTexture); + SAFE_RELEASE(m_pSSAO_NoiseSRV); SAFE_RELEASE(m_pPreShadowDSV); SAFE_RELEASE(m_pShadowDSV); SAFE_RELEASE(m_pShader); diff --git a/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic.cpp b/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic.cpp index ecd0a4a35..8c3d19d67 100644 --- a/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic.cpp +++ b/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic.cpp @@ -143,6 +143,35 @@ HRESULT CRigidBody_Dynamic::ConvertToCCT(CCharacter_Controller& CCTOriginal) return E_FAIL; } +_float3 CRigidBody_Dynamic::Get_FootPosition() +{ + PSX::PxTransform pxTransform = m_pRigidBody->getGlobalPose(); + switch (m_eActorType) + { + case Engine::ACTOR::BOX: + pxTransform.p.y -= m_vhalfGeometryInfo.y; + break; + case Engine::ACTOR::CAPSULE: + pxTransform.p.y -= m_vhalfGeometryInfo.y * 0.5f + m_vhalfGeometryInfo.x; + break; + case Engine::ACTOR::SPHERE: + pxTransform.p.y -= m_vhalfGeometryInfo.x; + break; + default: + break; + } + _float3 vOut = { pxTransform.p.x , pxTransform.p.y , pxTransform.p.z }; + return vOut; +} + +PSX::PxTransform CRigidBody_Dynamic::Get_FootPositionPxTransform() +{ + PSX::PxTransform pxTransform = m_pRigidBody->getGlobalPose(); + _float3 vFootPos = Get_FootPosition(); + pxTransform.p = { vFootPos.x, vFootPos.y, vFootPos.z }; + return pxTransform; +} + HRESULT CRigidBody_Dynamic::Initialize_Prototype(RIGIDBODY_PROTOTYPE_DYNAMIC_DESC& Desc) { m_eActorType = Desc.eType; diff --git a/Jusin154_Team3D/Engine/Private/Trail.cpp b/Jusin154_Team3D/Engine/Private/Trail.cpp index 0563c246c..a0c9f988d 100644 --- a/Jusin154_Team3D/Engine/Private/Trail.cpp +++ b/Jusin154_Team3D/Engine/Private/Trail.cpp @@ -40,9 +40,46 @@ HRESULT CTrail::Initialize(void* pArg) if (FAILED(Create_VB())) return E_FAIL; -#pragma endregion + if (FAILED(Create_IB())) + return E_FAIL; + + return S_OK; +} -#pragma region IDX_BUFFER +HRESULT CTrail::Create_VB() +{ + + if (m_pVB != nullptr) + SAFE_RELEASE(m_pVB); + + D3D11_BUFFER_DESC VBDesc{}; + VBDesc.ByteWidth = m_iVertexStride * m_iNumVertices; + VBDesc.Usage = D3D11_USAGE_DYNAMIC; + VBDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; + VBDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; + VBDesc.MiscFlags = 0; + VBDesc.StructureByteStride = m_iVertexStride; + + VTXPOSTEX* pVertices = new VTXPOSTEX[m_iNumVertices]{}; + + D3D11_SUBRESOURCE_DATA InitialVBDate{}; + InitialVBDate.pSysMem = pVertices; + + if (FAILED(m_pDevice->CreateBuffer(&VBDesc, &InitialVBDate, &m_pVB))) { + return E_FAIL; + } + + Safe_Delete_Array(pVertices); + + return S_OK; +} + +HRESULT CTrail::Create_IB() +{ + if (m_pIB != nullptr) + SAFE_RELEASE(m_pIB); + + m_iNumIndices = (m_iNumVertices / 2 - 1) * 6; D3D11_BUFFER_DESC IBDesc{}; IBDesc.ByteWidth = m_iIndexStride * m_iNumIndices; @@ -85,35 +122,6 @@ HRESULT CTrail::Initialize(void* pArg) } Safe_Delete_Array(pIndices); -#pragma endregion - - return S_OK; -} - -HRESULT CTrail::Create_VB() -{ - - if (m_pVB != nullptr) - SAFE_RELEASE(m_pVB); - -#pragma region VTX_BUFFER - D3D11_BUFFER_DESC VBDesc{}; - VBDesc.ByteWidth = m_iVertexStride * m_iNumVertices; - VBDesc.Usage = D3D11_USAGE_DYNAMIC; - VBDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; - VBDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; - VBDesc.MiscFlags = 0; - VBDesc.StructureByteStride = m_iVertexStride; - - VTXPOSTEX* pVertices = new VTXPOSTEX[m_iNumVertices]{}; - - D3D11_SUBRESOURCE_DATA InitialVBDate{}; - InitialVBDate.pSysMem = pVertices; - - if (FAILED(m_pDevice->CreateBuffer(&VBDesc, &InitialVBDate, &m_pVB))) { - return E_FAIL; - } - Safe_Delete_Array(pVertices); return S_OK; } @@ -134,13 +142,17 @@ void CTrail::Trail_Update(_float fDeltaTime, _fmatrix WorldMatrix) //한칸씩 밀기 - memmove(m_PreLow, m_PreLow + 1, sizeof(VTXPOSTEX)); - memmove(m_PreHigh, m_PreHigh + 1, sizeof(VTXPOSTEX)); + for (_uint i = 0; i < 3; i++) + { + m_PreLow[i] = m_PreLow[i + 1]; + m_PreHigh[i] = m_PreHigh[i + 1]; + } - m_PreLow[1] = vLow; - m_PreHigh[1] = vHigh; - if (m_iNumCount < 4) + XMStoreFloat3(&m_PreLow[3], vLow); + XMStoreFloat3(&m_PreHigh[3], vHigh); + + if (m_iNumCount < 12) { XMStoreFloat3(&m_pVertices[m_iNumCount++].vPosition, vLow); XMStoreFloat3(&m_pVertices[m_iNumCount++].vPosition, vHigh); @@ -151,11 +163,15 @@ void CTrail::Trail_Update(_float fDeltaTime, _fmatrix WorldMatrix) //시작점 끝점 내점 두개를 이용하여 보간할 것임 - for (size_t i = 0; i < 4; i++) + _vector m_PreLowVector[4] = { XMLoadFloat3(&m_PreLow[0]) , XMLoadFloat3(&m_PreLow[1]) , XMLoadFloat3(&m_PreLow[2]), XMLoadFloat3(&m_PreLow[3]) }; + _vector m_PreHighVector[4] = { XMLoadFloat3(&m_PreHigh[0]) , XMLoadFloat3(&m_PreHigh[1]),XMLoadFloat3(&m_PreHigh[2]) , XMLoadFloat3(&m_PreHigh[3]) }; + + for (size_t i = 0; i < 9; i++) { - _float iRatio = (_float)i / 3; - _vector vLerpLow = XMVectorCatmullRom(XMLoadFloat3(&m_pVertices[m_iNumCount - 2].vPosition), m_PreLow[0], m_PreLow[1], m_PreLow[1] + (m_PreLow[1] - m_PreLow[0]), iRatio); // LoW - _vector vLerpHigh = XMVectorCatmullRom(XMLoadFloat3(&m_pVertices[m_iNumCount - 1].vPosition), m_PreHigh[0], m_PreHigh[1], m_PreHigh[1] + (m_PreHigh[1] - m_PreHigh[0]), iRatio); + + _float iRatio = (_float)i / 8; + _vector vLerpLow = XMVectorCatmullRom(m_PreLowVector[0], m_PreLowVector[1], m_PreLowVector[2], m_PreLowVector[3], iRatio); // LoW + _vector vLerpHigh = XMVectorCatmullRom(m_PreHighVector[0], m_PreHighVector[1], m_PreHighVector[2], m_PreHighVector[3], iRatio); XMStoreFloat3(&m_pVertices[m_iNumCount++].vPosition, vLerpLow); XMStoreFloat3(&m_pVertices[m_iNumCount++].vPosition, vLerpHigh); @@ -233,6 +249,13 @@ HRESULT CTrail::ReStructVB(_uint iNumVertices) if (FAILED(Create_VB())) return E_FAIL; + if (FAILED(Create_IB())) + return E_FAIL; + + Safe_Delete_Array(m_pVertices); + + m_pVertices = new VTXPOSTEX[m_iNumVertices]{}; + return S_OK; } diff --git a/Jusin154_Team3D/Engine/Private/UIObject.cpp b/Jusin154_Team3D/Engine/Private/UIObject.cpp index a7f122609..2d578317d 100644 --- a/Jusin154_Team3D/Engine/Private/UIObject.cpp +++ b/Jusin154_Team3D/Engine/Private/UIObject.cpp @@ -93,12 +93,12 @@ void CUIObject::Priority_Update(_float fTimeDelta) void CUIObject::Update(_float fTimeDelta) { - m_vScale = _float3(m_fSizeX, m_fSizeY, 1.f); - m_pTransformCom->Set_Scale(m_vScale); + //m_vScale = _float3(m_fSizeX, m_fSizeY, 1.f); + //m_pTransformCom->Set_Scale(m_vScale); - m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(m_fX - m_fWinSizeX * 0.5f, -m_fY + m_fWinSizeY * 0.5f, 0.f, 1.f)); + //m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(m_fX - m_fWinSizeX * 0.5f, -m_fY + m_fWinSizeY * 0.5f, 0.f, 1.f)); - m_fCurrent_Position = XMVectorSet(m_fX, m_fY, m_fSortZ, 1.f); + //m_fCurrent_Position = XMVectorSet(m_fX, m_fY, m_fSortZ, 1.f); } @@ -293,6 +293,10 @@ _float2 CUIObject::Get_UV() return m_vUVScale; } +void CUIObject::Add_Canvas(wstring Name, CGameObject* pCanvas) +{ +} + void CUIObject::Nine_Slice_Left(_float X) { m_vNine_Slice.x = X; diff --git a/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp b/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp index 57426e437..b99dbdb0d 100644 --- a/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp +++ b/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp @@ -119,8 +119,9 @@ HRESULT CVIBuffer_UI_Instance::Initialize_Prototype(const INSTANCE_DESC* pInstan m_pInstanceVertices[i].fSize = _float2(1.f, 1.f); // 기본 크기 m_pInstanceVertices[i].fPos = _float2(0.f, 0.f); // 기본 위치 m_pInstanceVertices[i].fUV = _float4(0.f, 0.f, 1.f, 1.f); // 전체 텍스처 영역 - m_pInstanceVertices[i].vColor = _float4(1.f, 1.f, 1.f, 1.f); // 기본 흰색 + m_pInstanceVertices[i].vColor = 0; // 기본 흰색 m_pInstanceVertices[i].bHover = 0; + m_pInstanceVertices[i].bSpell = 0; } m_InstanceInitialDesc.pSysMem = m_pInstanceVertices; @@ -249,7 +250,20 @@ void CVIBuffer_UI_Instance::Set_ImageUV(UI_ATLAS_DESC* AtlasUV) m_pContext->Unmap(m_pVBInstance, 0); } -void CVIBuffer_UI_Instance::Set_Index_Renge_Color(_uint StartIndex, _uint EndIndex, _float4 vColor) +void CVIBuffer_UI_Instance::Set_Index_ImageUV(_int Index, UI_ATLAS_DESC AtlasUV) +{ + D3D11_MAPPED_SUBRESOURCE SubResource{}; + + m_pContext->Map(m_pVBInstance, 0, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &SubResource); + + VTX_INSTANCE_UI* pVertices = static_cast(SubResource.pData); + + pVertices[Index].fUV = AtlasUV.fUV; + + m_pContext->Unmap(m_pVBInstance, 0); +} + +void CVIBuffer_UI_Instance::Set_Index_Renge_Color(_uint StartIndex, _uint EndIndex, _float Color) { D3D11_MAPPED_SUBRESOURCE SubResource{}; @@ -259,12 +273,25 @@ void CVIBuffer_UI_Instance::Set_Index_Renge_Color(_uint StartIndex, _uint EndInd for (size_t i = StartIndex; i <= EndIndex; i++) { - pVertices[i].vColor = vColor; + pVertices[i].vColor = Color; } m_pContext->Unmap(m_pVBInstance, 0); } +void CVIBuffer_UI_Instance::Set_Index_Color(_int Index, _float vColor) +{ + D3D11_MAPPED_SUBRESOURCE SubResource{}; + + m_pContext->Map(m_pVBInstance, 0, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &SubResource); + + VTX_INSTANCE_UI* pVertices = static_cast(SubResource.pData); + + pVertices[Index].vColor = vColor; + + m_pContext->Unmap(m_pVBInstance, 0); +} + _int CVIBuffer_UI_Instance::Set_Mouse_Hover(_float2 fMousePos) { D3D11_MAPPED_SUBRESOURCE SubResource{}; @@ -330,6 +357,19 @@ void CVIBuffer_UI_Instance::Set_Hover_Index(_uint iIndex) m_pContext->Unmap(m_pVBInstance, 0); } +void CVIBuffer_UI_Instance::Set_Equip_Index(_uint iIndex) +{ + D3D11_MAPPED_SUBRESOURCE SubResource{}; + + m_pContext->Map(m_pVBInstance, 0, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &SubResource); + + VTX_INSTANCE_UI* pVertices = static_cast(SubResource.pData); + + pVertices[iIndex].bSpell = 1.f; + + m_pContext->Unmap(m_pVBInstance, 0); +} + CVIBuffer_UI_Instance* CVIBuffer_UI_Instance::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const INSTANCE_DESC* pInstanceDesc) { CVIBuffer_UI_Instance* pInstance = new CVIBuffer_UI_Instance(pDevice, pContext); diff --git a/Jusin154_Team3D/Engine/Public/Engine_Enum.h b/Jusin154_Team3D/Engine/Public/Engine_Enum.h index 002f888cc..13eabbb94 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Enum.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Enum.h @@ -37,7 +37,7 @@ enum class SHADER_PASS_CELL { DEBUG, END }; enum class SHADER_PASS_DEFERRED { DEBUG, DIRECTIONAL, POINT, COMBINED, BLUR, SPOT, REFIT, EMBOSSING, BLOOM_BLURX, BLOOM_BLURY, BLOOM_ACCUM, BLOOM_FINISH, BLURX_ENVIRONMENT, - POSTCOMBINED, FOG, TONE_MAPPING, + POSTCOMBINED, FOG, TONE_MAPPING, SSAO_OCCLUSION, SSAO_BLUR, END }; enum class QUESTYPE {MAIN, SUB, END}; @@ -101,7 +101,7 @@ enum class PXOBJECT : _uint { #pragma endregion #pragma region MONSTER MONSTER = 30, - GOBLIN_WARRIOR, // 031 + GOBLIN_WARRIOR, // 31 GOBLIN_MAGICIAN, GOBLIN_THEIF, TROLL, diff --git a/Jusin154_Team3D/Engine/Public/Engine_Macro.h b/Jusin154_Team3D/Engine/Public/Engine_Macro.h index 630a9baf6..17aefec0f 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Macro.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Macro.h @@ -88,6 +88,9 @@ // GRAVITY 음수 박으면 피직스 로드 실패함 #define GRAVITY 9.81f + +#define SSAO_SAMPLE_NUMBER 64 + constexpr unsigned int g_iMaxShadowWidth = 16384; constexpr unsigned int g_iMaxShadowHeight = 9216; diff --git a/Jusin154_Team3D/Engine/Public/Engine_Struct.h b/Jusin154_Team3D/Engine/Public/Engine_Struct.h index cae318eb1..4c6517b67 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Struct.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Struct.h @@ -201,8 +201,9 @@ typedef struct tagVertexInstance_UI _float2 fSize = {}; _float2 fPos = {}; _float4 fUV = _float4(0.f, 0.f, 1.f, 1.f); - _float4 vColor = _float4(1.f, 1.f, 1.f, 1.f); + _float vColor = 0; _float bHover = 0; + _float bSpell = 0; }VTX_INSTANCE_UI; typedef struct tagVertexBlock @@ -362,7 +363,7 @@ typedef struct tagVertexModelInstanceModelDesc typedef struct tagVertexInstance_UIDesc { - static constexpr unsigned int iNumElements = { 7 }; + static constexpr unsigned int iNumElements = { 8 }; static constexpr D3D11_INPUT_ELEMENT_DESC Elements[] = { { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0}, { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0}, @@ -370,8 +371,9 @@ typedef struct tagVertexInstance_UIDesc { "TEXCOORD", 1, DXGI_FORMAT_R32G32_FLOAT, 1, 0, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, { "TEXCOORD", 2, DXGI_FORMAT_R32G32_FLOAT, 1, 8, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, { "TEXCOORD", 3, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, 16, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, - { "TEXCOORD", 4, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, 32, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, - { "TEXCOORD", 5, DXGI_FORMAT_R32_FLOAT, 1, 48, D3D11_INPUT_PER_INSTANCE_DATA, 1 } + { "TEXCOORD", 4, DXGI_FORMAT_R32_FLOAT, 1, 32, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, + { "TEXCOORD", 5, DXGI_FORMAT_R32_FLOAT, 1, 36, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, + { "TEXCOORD", 6, DXGI_FORMAT_R32_FLOAT, 1, 40, D3D11_INPUT_PER_INSTANCE_DATA, 1 } }; }VTX_POSTEX_INSTANCE_UI; @@ -438,5 +440,17 @@ typedef struct tagBoneDesc _float4x4 Combined; }BONE_DESC; +typedef struct tagSSAO_SamplePos { + _float3 vPos = { }; // xy(-1, 1) z(0, 1) + _float fPad = {}; +}SSAO_SAMPLE; + +typedef struct tagSSAO_Geometry_Hemisphere { + SSAO_SAMPLE SamplePos[SSAO_SAMPLE_NUMBER]; +}SSAO_GEOMETRY_HEMISPHERE; + +typedef struct tagSSAO_GeometryDirections_RANDOM_REAL { + _float4 vDir[16]; +}SSAO_GEOMETRYDIRECTIONS_RANDOM_REAL; NS_END diff --git a/Jusin154_Team3D/Engine/Public/FSM.h b/Jusin154_Team3D/Engine/Public/FSM.h index 65826020e..9b8b2c9f7 100644 --- a/Jusin154_Team3D/Engine/Public/FSM.h +++ b/Jusin154_Team3D/Engine/Public/FSM.h @@ -30,6 +30,8 @@ enum ESTATE : _u64Flag THROW_ROCK = 1ULL << 23, BACKHAND_SWING = 1ULL << 24, SWING = 1ULL << 25, + SLAM = 1ULL << 26, + BLINK = 1ULL << 27, END }; NS_END diff --git a/Jusin154_Team3D/Engine/Public/GameInstance.h b/Jusin154_Team3D/Engine/Public/GameInstance.h index 92e3a963a..21b640eb4 100644 --- a/Jusin154_Team3D/Engine/Public/GameInstance.h +++ b/Jusin154_Team3D/Engine/Public/GameInstance.h @@ -278,11 +278,11 @@ class ENGINE_DLL CGameInstance final : public CBase class CThreadHolder* m_pThreadHolder = { nullptr }; class CFog* m_pFog = { nullptr }; class CResource_Manager* m_pResource_Manager = { nullptr }; - + mt19937 m_Rng{ random_device{}() }; #ifdef _DEBUG private: - mt19937 m_Rng{ random_device{}() }; + _float m_fTimer_PriorityUpdate = { 0.f }; _float m_fTimer_Update = { 0.f }; _float m_fTimer_LateUpdate = { 0.f }; diff --git a/Jusin154_Team3D/Engine/Public/PhysX/PxShape.h b/Jusin154_Team3D/Engine/Public/PhysX/PxShape.h index 657c907f3..f15fff9ff 100644 --- a/Jusin154_Team3D/Engine/Public/PhysX/PxShape.h +++ b/Jusin154_Team3D/Engine/Public/PhysX/PxShape.h @@ -1,4 +1,4 @@ -// Redistribution and use in source and binary forms, with or without +// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright diff --git a/Jusin154_Team3D/Engine/Public/PhysX/foundation/PxTransform.h b/Jusin154_Team3D/Engine/Public/PhysX/foundation/PxTransform.h index 3abc05ed3..f8988f3b4 100644 --- a/Jusin154_Team3D/Engine/Public/PhysX/foundation/PxTransform.h +++ b/Jusin154_Team3D/Engine/Public/PhysX/foundation/PxTransform.h @@ -1,4 +1,4 @@ -// Redistribution and use in source and binary forms, with or without +// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright diff --git a/Jusin154_Team3D/Engine/Public/Renderer.h b/Jusin154_Team3D/Engine/Public/Renderer.h index 014b3e2f9..bb1a27ae1 100644 --- a/Jusin154_Team3D/Engine/Public/Renderer.h +++ b/Jusin154_Team3D/Engine/Public/Renderer.h @@ -40,12 +40,14 @@ class CRenderer final : public CBase _float4x4 m_ViewMatrix = {}; _float4x4 m_ProjMatrix = {}; - ID3D11DepthStencilView* m_pShadowDSV = { nullptr }; - ID3D11DepthStencilView* m_pPreShadowDSV = { nullptr }; - - SHADOW_LIGHT_DESC m_PreShadowDesc = {}; - _float4x4 m_PreShadowMatrices[ENUM_CLASS(D3DTS::END)] = {}; + ID3D11DepthStencilView* m_pShadowDSV = { nullptr }; + ID3D11DepthStencilView* m_pPreShadowDSV = { nullptr }; + ID3D11ShaderResourceView* m_pSSAO_NoiseSRV = { nullptr }; + ID3D11Texture2D* m_pSSAO_NoiseTexture = { nullptr }; + ID3D11Buffer* m_pGlobalStaticCB = { nullptr }; + SHADOW_LIGHT_DESC m_PreShadowDesc = {}; + _float4x4 m_PreShadowMatrices[ENUM_CLASS(D3DTS::END)] = {}; /* TunningParam */ _int m_iToneMappingType = { 2 }; @@ -60,16 +62,17 @@ class CRenderer final : public CBase _float m_fDOF_ENV_MaxEnd = { 360.f }; _float m_fDOF_ENV_AmountRadius = { 1.f }; + SSAO_GEOMETRY_HEMISPHERE m_tagSSAOGeometry = {}; + SSAO_GEOMETRYDIRECTIONS_RANDOM_REAL m_tagSSAOGeometryDirections = {}; private: void Render_Occlusion(); void Render_Priority(); void Render_Shadow(); void Render_NonBlend(); - void Render_LightAcc(); void Render_Blur(); void Render_SSAO(); void Render_SSAO_BLUR(); - void Render_SSAO_Lighting(); + void Render_LightAcc(); void Render_Combined(); void Render_EnvironmentPostProcess(); void Render_Fog(); @@ -89,6 +92,7 @@ class CRenderer final : public CBase #endif private: + void Fill_Geometry(_uint iNumSample); HRESULT Ready_ShadowDepthStencilView(_uint iSizeX, _uint iSizeY); private: diff --git a/Jusin154_Team3D/Engine/Public/RigidBody_Dynamic.h b/Jusin154_Team3D/Engine/Public/RigidBody_Dynamic.h index a0107d097..b66fbf9e9 100644 --- a/Jusin154_Team3D/Engine/Public/RigidBody_Dynamic.h +++ b/Jusin154_Team3D/Engine/Public/RigidBody_Dynamic.h @@ -46,6 +46,8 @@ class ENGINE_DLL CRigidBody_Dynamic : public CRigidBody _bool IsActive() const { return m_bActive; } void SetActive(_bool bCondition) { m_bActive = bCondition; } + _float3 Get_FootPosition(); + PSX::PxTransform Get_FootPositionPxTransform(); private: PSX::PxRigidDynamic* m_pRigidBody = { nullptr }; // 실제 시뮬레이션을 도는 본체 PSX::PxRigidDynamicLockFlags m_eLockFlag = { }; diff --git a/Jusin154_Team3D/Engine/Public/State.h b/Jusin154_Team3D/Engine/Public/State.h index 4148c7342..82307f3cd 100644 --- a/Jusin154_Team3D/Engine/Public/State.h +++ b/Jusin154_Team3D/Engine/Public/State.h @@ -6,8 +6,8 @@ enum ESTATE { IDLE,IDLE_AIM, IDLE_TURN_L, IDLE_TURN_R, IDLE_TURN_BWD, IDLE_COMBAT_TURN_BWD,IDLE_BREAK1,IDLE_BREAK2,IDLE_BREAK3,IDLE_BREAK4, MOVE, - WALK, WALK_FWD,WALK_RIGHT,WALK_LEFT, WALK_BWD,WALK_STOP, - JOG,JOG_START, JOG_FWD, JOG_RIGHT, JOG_LEFT, JOG_BWD, JOG_STOP, JOG_AIM_LEFT, JOG_AIM_RIGHT, JOG_AIM_BWD, JOG_AIM_STOP_L, JOG_AIM_STOP_R, JOG_AIM_STOP_BWD, + WALK, WALK_FWD,WALK_RIGHT,WALK_LEFT, WALK_BWD,WALK_START,WALK_STOP, + JOG,JOG_START, JOG_FWD, JOG_RIGHT, JOG_LEFT, JOG_BWD, JOG_STOP, JOG_AIM_LEFT, JOG_AIM_RIGHT, JOG_AIM_BWD, JOG_AIM_STOP_L, JOG_AIM_STOP_R, JOG_AIM_STOP_BWD,JOG_LEFT_TURN,JOG_RIGHT_TURN, SPRINT, JUMP,JUMP_JOG,JUMP_SPRINT, LAND, @@ -15,11 +15,13 @@ enum ESTATE COMBAT, LIGHT_ATTACK, SPELL, SKILL, SKILL2, MAPHELP,POTION, ACCIO,DESCENDO,DIFFINDO,DEPULSO,LUMOS,LUMOS_STOP,DISILLUSION_ENTER,DISILLUSION_EXIT, ANCIENT_THROW, + SPELL_FAIL, BROOM_IDLE,BROOM_FWD,BROOM_LEFT,BROOM_RIGHT,BROOM_DOWN,BROOM_UP, BROOM_HOVER_IDLE, BROOM_HOVER_FWD, BROOM_HOVER_LEFT, BROOM_HOVER_RIGHT, BROOM_HOVER_START,BROOM_MOUNT, BROOM_MOUNT_END,BROOM_DISMOUNT, RUSH_START,RUSH_LOOP,RUSH_END, THROW_ROCK_START,THROW_ROCK, - BACKHAND_SWING_JOG,SWING_FWD, - HIT, HIT_FWD, HIT_BWD, HIT_BWD2, HIT_BWD3, HIT_BWD4, HIT_L, HIT_R,HIT_FACE,HIT_FACE_END, + BACKHAND_SWING_JOG,SWING_FWD,SLAM, + BLINK, + HIT, HIT_FWD, HIT_BWD, HIT_BWD2, HIT_BWD3, HIT_BWD4, HIT_L, HIT_R,HIT_FACE,HIT_FACE_END,HIT_LEVIOSO, KNOCKDOWN, KNOCKDOWN_FWD, KNOCKDOWN_FWD_SPLT, KNOCKDOWN_FWD_SPLT_HOLD, KNOCKDOWN_BWD, KNOCKDOWN_BWD_SPLT, KNOCKDOWN_BWD_SPLT_HOLD, GETUP, GETUP_BWD, GETUP_FWD, GETUP_L, GETUP_L_FD, GETUP_L_FU, GETUP_R, GETUP_R_FD, GETUP_R_FU, GETUP_SLOUCH, DEAD, DEAD_FWD, DEAD_FWD2, DEAD_BWD, DEAD_BWD2, DEAD_L, DEAD_L2, DEAD_R, DEAD_R2, diff --git a/Jusin154_Team3D/Engine/Public/Texture.h b/Jusin154_Team3D/Engine/Public/Texture.h index 6b94232cd..07a5d1569 100644 --- a/Jusin154_Team3D/Engine/Public/Texture.h +++ b/Jusin154_Team3D/Engine/Public/Texture.h @@ -33,9 +33,9 @@ class ENGINE_DLL CTexture final : private: vector m_SRVs = {}; - -#ifdef EDITOR_PROJECT _wstring m_wstrPrototypeName = {}; +#ifdef EDITOR_PROJECT + #endif // public: diff --git a/Jusin154_Team3D/Engine/Public/Trail.h b/Jusin154_Team3D/Engine/Public/Trail.h index 1f50da839..6fba6782e 100644 --- a/Jusin154_Team3D/Engine/Public/Trail.h +++ b/Jusin154_Team3D/Engine/Public/Trail.h @@ -29,11 +29,11 @@ class ENGINE_DLL CTrail final : public: void Fixed_Trail(_fmatrix WorldMatrix); - private: virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; HRESULT Create_VB(); + HRESULT Create_IB(); public: static CTrail* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); @@ -48,8 +48,8 @@ class ENGINE_DLL CTrail final : _uint m_iNumCount = {}; - _vector m_PreHigh[2] = {}; - _vector m_PreLow[2] = {}; + _float3 m_PreHigh[4] = {}; + _float3 m_PreLow[4] = {}; _vector m_PreFixedHigh[3] = {}; _vector m_PreFixedLow[3] = {}; diff --git a/Jusin154_Team3D/Engine/Public/UIObject.h b/Jusin154_Team3D/Engine/Public/UIObject.h index 4c73bf661..76b3ac1dc 100644 --- a/Jusin154_Team3D/Engine/Public/UIObject.h +++ b/Jusin154_Team3D/Engine/Public/UIObject.h @@ -85,6 +85,7 @@ typedef struct SlotHover virtual void Set_V(_float V); virtual _float2 Get_UV(); + virtual void Add_Canvas(wstring Name, class CGameObject* pCanvas); virtual void Nine_Slice_Left(_float X); virtual void Nine_Slice_Right(_float Y); @@ -184,7 +185,7 @@ typedef struct SlotHover _float4 m_vNine_Slice{}; _float m_fTopY{}; - + _bool m_bClick = { false }; protected: virtual HRESULT Initialize_Prototype(); virtual HRESULT Initialize(void* pArg); diff --git a/Jusin154_Team3D/Engine/Public/Unit.h b/Jusin154_Team3D/Engine/Public/Unit.h index f08ce1987..4f3b7afd0 100644 --- a/Jusin154_Team3D/Engine/Public/Unit.h +++ b/Jusin154_Team3D/Engine/Public/Unit.h @@ -69,7 +69,8 @@ class ENGINE_DLL CUnit abstract : public CContainerObject unordered_map m_States = { }; size_t m_iStateMask = { 0 }; - STATEANIM::ESTATE m_eSpell = { STATEANIM::END }; + _int m_eSpell = { }; + _int m_eHitSpell = {}; vector m_PendingEvents; diff --git a/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h b/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h index c20a19ae6..257759566 100644 --- a/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h +++ b/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h @@ -32,9 +32,12 @@ class ENGINE_DLL CVIBuffer_UI_Instance final : public CVIBuffer_Instance void Set_SizeY(_float fSizeY); void Set_Cloned(_bool isCloned) { m_isCloned = isCloned; } void Set_ImageUV(UI_ATLAS_DESC* AtlasUV); - void Set_Index_Renge_Color(_uint StartIndex, _uint EndIndex, _float4 vColor); + void Set_Index_ImageUV(_int Index, UI_ATLAS_DESC AtlasUV); + void Set_Index_Renge_Color(_uint StartIndex, _uint EndIndex, _float vColor); + void Set_Index_Color(_int Index, _float vColor); _int Set_Mouse_Hover(_float2 fMousePos); void Set_Hover_Index(_uint iIndex); + void Set_Equip_Index(_uint iIndex); private: VTX_INSTANCE_UI* m_pInstanceVertices = { nullptr };