From d1fa9bc4444e4b7da11da1a5179a3154aae415da Mon Sep 17 00:00:00 2001 From: kimnuri Date: Tue, 23 Dec 2025 01:18:25 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[add]=20=EB=8B=A4=EC=9D=8C=EB=A0=88?= =?UTF-8?q?=EB=B2=A8=20=ED=99=9C=EC=84=B1=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Client/Private/CamPosition_Shoulder.cpp | 4 +- Jusin154_Team3D/Client/Private/EffectPool.cpp | 66 +++++++++--------- .../Client/Private/Level_Field.cpp | 33 ++++++++- .../Client/Private/Level_GamePlay.cpp | 15 ++-- Jusin154_Team3D/Client/Private/Loader.cpp | 68 +++++++++---------- .../Client/Private/MapElement_Chest.cpp | 6 +- .../Client/Private/MapElement_Door.cpp | 2 +- .../Private/MapElement_Interactable.cpp | 2 +- .../Client/Private/MapElement_Static.cpp | 2 +- .../Client/Private/NPC_Ollivander.cpp | 66 +++++++++++------- Jusin154_Team3D/Client/Private/Player.cpp | 12 ++-- Jusin154_Team3D/Client/Public/Level_Field.h | 2 + .../Client/Public/NPC_Ollivander.h | 1 + Jusin154_Team3D/Client/Public/Player.h | 5 ++ .../GerboldOllivander/GerboldOlivander.bin | 4 +- .../GerboldOllivander/GerboldOlivander.fbx | 4 +- .../GerboldOlivander_Anim.bin | 3 - .../GerboldOlivander_Anim.fbx | 3 - .../Editor/Private/Dummy_PhysXBox.cpp | 2 +- .../Editor/Private/Dummy_PhysXWall.cpp | 2 +- .../Editor/Private/MapElement_Chest.cpp | 2 +- .../Editor/Private/MapElement_Door.cpp | 2 +- .../Private/MapElement_Interactable.cpp | 2 +- .../Engine/Private/GameInstance.cpp | 4 +- .../Engine/Private/PhysX_Manager.cpp | 27 +++++--- .../Engine/Private/VIBuffer_Terrain.cpp | 11 ++- Jusin154_Team3D/Engine/Public/Engine_Enum.h | 1 + Jusin154_Team3D/Engine/Public/GameInstance.h | 2 +- Jusin154_Team3D/Engine/Public/PhysX_Manager.h | 2 +- 29 files changed, 208 insertions(+), 147 deletions(-) delete mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/GerboldOllivander/GerboldOlivander_Anim.bin delete mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/GerboldOllivander/GerboldOlivander_Anim.fbx diff --git a/Jusin154_Team3D/Client/Private/CamPosition_Shoulder.cpp b/Jusin154_Team3D/Client/Private/CamPosition_Shoulder.cpp index 31e9814d5..0b100f941 100644 --- a/Jusin154_Team3D/Client/Private/CamPosition_Shoulder.cpp +++ b/Jusin154_Team3D/Client/Private/CamPosition_Shoulder.cpp @@ -358,8 +358,8 @@ HRESULT CCamPosition_Shoulder::Ready_SubParts() return E_FAIL; } - m_pGameInstance->Add_Camera(g_iStaticLevel, m_pBinded_Camera, CAMERA_SHOULDER); - if (FAILED(m_pGameInstance->Bind_Camera(g_iStaticLevel, CAMERA_SHOULDER, true))) { + m_pGameInstance->Add_Camera(NEXT_LEVEL, m_pBinded_Camera, CAMERA_SHOULDER); + if (FAILED(m_pGameInstance->Bind_Camera(NEXT_LEVEL, CAMERA_SHOULDER, true))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Private/EffectPool.cpp b/Jusin154_Team3D/Client/Private/EffectPool.cpp index 39e3b7ffd..a8a992bdc 100644 --- a/Jusin154_Team3D/Client/Private/EffectPool.cpp +++ b/Jusin154_Team3D/Client/Private/EffectPool.cpp @@ -214,7 +214,7 @@ HRESULT CEffectPool::Bind_ShaderResources() HRESULT CEffectPool::Ready_Effect() { - if (FAILED(Create_Effect(SKILL_TYPE::JAP, 10, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::JAP, 10, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CNomalJap* pEffect = nullptr; pEffect = m_pGameInstance->Clone_Prototype(iPrototypeLevel, nullptr); @@ -223,7 +223,7 @@ HRESULT CEffectPool::Ready_Effect() ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::BOMBARDA, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel)-> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::BOMBARDA, 5, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel)-> CEffect_Container* { CBombard* pEffect = nullptr; @@ -232,7 +232,7 @@ HRESULT CEffectPool::Ready_Effect() return pEffect; } ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::DESCENDO, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel)-> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::DESCENDO, 5, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel)-> CEffect_Container* { CDecendo* pEffect = nullptr; @@ -241,7 +241,7 @@ HRESULT CEffectPool::Ready_Effect() return pEffect; } ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::PROTEGO, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel)-> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::PROTEGO, 5, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel)-> CEffect_Container* { CProtego* pEffect = nullptr; @@ -250,7 +250,7 @@ HRESULT CEffectPool::Ready_Effect() return pEffect; } ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::REVELIO, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel)-> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::REVELIO, 5, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel)-> CEffect_Container* { CRevelio* pEffect = nullptr; @@ -259,7 +259,7 @@ HRESULT CEffectPool::Ready_Effect() return pEffect; } ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::JAP_SIDE, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel)-> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::JAP_SIDE, 5, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel)-> CEffect_Container* { CNomalJapSide* pEffect = nullptr; @@ -268,7 +268,7 @@ HRESULT CEffectPool::Ready_Effect() return pEffect; } ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::LEVIOSO, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::LEVIOSO, 5, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CLevioso* pEffect = nullptr; @@ -278,7 +278,7 @@ HRESULT CEffectPool::Ready_Effect() ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::LUMOS, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::LUMOS, 5, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CLumos* pEffect = nullptr; @@ -288,7 +288,7 @@ HRESULT CEffectPool::Ready_Effect() ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::ACCIO, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::ACCIO, 5, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CAccio* pEffect = nullptr; @@ -298,7 +298,7 @@ HRESULT CEffectPool::Ready_Effect() ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::BOMBARDA_SIDE, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::BOMBARDA_SIDE, 5, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CBombardSide* pEffect = nullptr; @@ -307,7 +307,7 @@ HRESULT CEffectPool::Ready_Effect() return pEffect; } ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::LEVIOSO_SIDE, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::LEVIOSO_SIDE, 5, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CLeviosoSide* pEffect = nullptr; @@ -317,7 +317,7 @@ HRESULT CEffectPool::Ready_Effect() ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::DESCENDO_SIDE, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::DESCENDO_SIDE, 5, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CDecendoSide* pEffect = nullptr; @@ -327,7 +327,7 @@ HRESULT CEffectPool::Ready_Effect() ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::WAND_END, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::WAND_END, 5, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CWandEnd* pEffect = nullptr; @@ -337,7 +337,7 @@ HRESULT CEffectPool::Ready_Effect() ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::BOX_SPLESH, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::BOX_SPLESH, 5, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CBox_Splesh* pEffect = nullptr; @@ -347,7 +347,7 @@ HRESULT CEffectPool::Ready_Effect() ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::CHAIL_SPLESH, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::CHAIL_SPLESH, 5, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CChair_Splesh* pEffect = nullptr; @@ -357,7 +357,7 @@ HRESULT CEffectPool::Ready_Effect() ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::BARRAL_SPLASH, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::BARRAL_SPLASH, 5, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CBarral_Splesh* pEffect = nullptr; @@ -367,7 +367,7 @@ HRESULT CEffectPool::Ready_Effect() ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::SCREEN_WIND, 3, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::SCREEN_WIND, 3, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CScreen_Wind* pEffect = nullptr; @@ -377,7 +377,7 @@ HRESULT CEffectPool::Ready_Effect() ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::STUPEFY, 3, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::STUPEFY, 3, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CStupefy* pEffect = nullptr; @@ -386,7 +386,7 @@ HRESULT CEffectPool::Ready_Effect() return pEffect; } ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::LIGHTNING, 3, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::LIGHTNING, 3, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CLightning* pEffect = nullptr; @@ -395,7 +395,7 @@ HRESULT CEffectPool::Ready_Effect() return pEffect; } ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::LIGHTNING_SIDE, 3, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::LIGHTNING_SIDE, 3, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CLightningSide* pEffect = nullptr; @@ -405,7 +405,7 @@ HRESULT CEffectPool::Ready_Effect() ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::BLINK, 3, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::BLINK, 3, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CBlink* pEffect = nullptr; @@ -414,7 +414,7 @@ HRESULT CEffectPool::Ready_Effect() return pEffect; } ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::TRANSFORMATION, 3, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::TRANSFORMATION, 3, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CTransformation* pEffect = nullptr; @@ -423,7 +423,7 @@ HRESULT CEffectPool::Ready_Effect() return pEffect; } ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::TRANSFORMATION_SIDE, 3, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::TRANSFORMATION_SIDE, 3, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CTransformationSide* pEffect = nullptr; @@ -440,7 +440,7 @@ HRESULT CEffectPool::Ready_MonsterEffect() { - if (FAILED(Create_Effect(SKILL_TYPE::TROLL_ATTACK, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::TROLL_ATTACK, 5, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CTrollSwing* pEffect = nullptr; @@ -449,7 +449,7 @@ HRESULT CEffectPool::Ready_MonsterEffect() return pEffect; } ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::TROLL_NOMAL_SMOKE, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::TROLL_NOMAL_SMOKE, 5, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CTroll_Nomal_Smoke* pEffect = nullptr; @@ -458,7 +458,7 @@ HRESULT CEffectPool::Ready_MonsterEffect() return pEffect; } ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::TROLL_RUSH_HIT, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::TROLL_RUSH_HIT, 5, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CTroll_Rush_Hit* pEffect = nullptr; @@ -468,7 +468,7 @@ HRESULT CEffectPool::Ready_MonsterEffect() ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::GOBLIN_PROTEGO, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::GOBLIN_PROTEGO, 5, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CGoblin_Protego* pEffect = nullptr; @@ -477,7 +477,7 @@ HRESULT CEffectPool::Ready_MonsterEffect() return pEffect; } ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::GOBLIN_ATTACK, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::GOBLIN_ATTACK, 5, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CGoblin_Attack* pEffect = nullptr; @@ -487,7 +487,7 @@ HRESULT CEffectPool::Ready_MonsterEffect() ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::GOBLIN_MAGE_ATTACK, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::GOBLIN_MAGE_ATTACK, 5, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CMage_Nomal_Attack* pEffect = nullptr; @@ -497,7 +497,7 @@ HRESULT CEffectPool::Ready_MonsterEffect() ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::GOBLIN_MAGE_DOWN, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::GOBLIN_MAGE_DOWN, 5, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CMage_Down_Attack* pEffect = nullptr; @@ -508,7 +508,7 @@ HRESULT CEffectPool::Ready_MonsterEffect() ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::GOBLIN_MAGE_SIDE, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::GOBLIN_MAGE_SIDE, 5, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CMageSide* pEffect = nullptr; @@ -519,7 +519,7 @@ HRESULT CEffectPool::Ready_MonsterEffect() ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::STUN, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::STUN, 5, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CStunEffect* pEffect = nullptr; @@ -529,7 +529,7 @@ HRESULT CEffectPool::Ready_MonsterEffect() ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::GOBILN_TELEPORT, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + if (FAILED(Create_Effect(SKILL_TYPE::GOBILN_TELEPORT, 5, g_iStaticLevel, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CGoblin_Teleport* pEffect = nullptr; diff --git a/Jusin154_Team3D/Client/Private/Level_Field.cpp b/Jusin154_Team3D/Client/Private/Level_Field.cpp index 20f3c0f6f..536cb8a7d 100644 --- a/Jusin154_Team3D/Client/Private/Level_Field.cpp +++ b/Jusin154_Team3D/Client/Private/Level_Field.cpp @@ -3,6 +3,8 @@ #include "GameInstance.h" #include "Level_Loading.h" #include "InfoInstance.h" +#include "Player.h" +#include "EffectPool.h" #include "Light_Main.h" #include "Layer.h" #include "Camera_Debug.h" @@ -33,6 +35,13 @@ HRESULT CLevel_Field::Initialize(void* pArg) return E_FAIL; } + if (FAILED(Reday_Layer_EffectPool())) { + return E_FAIL; + } + + if (FAILED(Ready_Layer_Player(LAYER_PLAYER))) { + return E_FAIL; + } if (FAILED(Ready_Markers())) { return E_FAIL; } @@ -157,11 +166,11 @@ HRESULT CLevel_Field::Ready_Camera() return E_FAIL; } - m_pGameInstance->Add_Camera(g_iStaticLevel, pCamera, CAMERA_DEBUG); + m_pGameInstance->Add_Camera(NEXT_LEVEL, pCamera, CAMERA_DEBUG); #endif // _DEBUG - if (FAILED(m_pGameInstance->Bind_Camera(g_iStaticLevel, CAMERA_DEBUG, true))) { + if (FAILED(m_pGameInstance->Bind_Camera(NEXT_LEVEL, CAMERA_DEBUG, true))) { return E_FAIL; } return S_OK; @@ -208,6 +217,18 @@ HRESULT CLevel_Field::Ready_Markers() return S_OK; } +HRESULT CLevel_Field::Ready_Layer_Player(const _wstring& strLayerTag) +{ + CPlayer::PLAYERDESC playerDesc = {}; + playerDesc.vPos = _float4(-17.96f, 18.74f, 9.11f, 1.f); + playerDesc.vRotQ = _float4(0.f, 0.f, 0.f, 1.f); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &playerDesc))) { + return E_FAIL; + } + + return S_OK; +} + HRESULT CLevel_Field::Ready_Layer_Effect(const _wstring& strLayerTag) { return S_OK; @@ -222,6 +243,14 @@ HRESULT CLevel_Field::Ready_Layer_Monster() return S_OK; } +HRESULT CLevel_Field::Reday_Layer_EffectPool() +{ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_EFFECTPOOL))) { + return E_FAIL; + } + return S_OK; +} + pair> CLevel_Field::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID, void* pArg) { CLevel_Field* pInstance = new CLevel_Field(pDevice, pContext, eLevelID); diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index 5c3aed936..b26fcaa24 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -549,11 +549,11 @@ HRESULT CLevel_GamePlay::Ready_Layer_Camera() return E_FAIL; } - m_pGameInstance->Add_Camera(g_iStaticLevel, pCamera, CAMERA_DEBUG); + m_pGameInstance->Add_Camera(NEXT_LEVEL, pCamera, CAMERA_DEBUG); #endif // _DEBUG - if (FAILED(m_pGameInstance->Bind_Camera(g_iStaticLevel, CAMERA_SHOULDER, true))) { + if (FAILED(m_pGameInstance->Bind_Camera(NEXT_LEVEL, CAMERA_SHOULDER, true))) { return E_FAIL; } @@ -573,15 +573,16 @@ 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))) { + CPlayer::PLAYERDESC playerDesc = {}; + playerDesc.vPos = _float4(-21.f, 0.f, -14.f, 1.f); + playerDesc.vRotQ = _float4(0.f, 0.f, 0.f, 1.f); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &playerDesc))) { return E_FAIL; } - for (_uint i = 0; i < 1; ++i) { - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag))) { - return E_FAIL; - } + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag))) { + return E_FAIL; } return S_OK; diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index bf7b52469..982067cb1 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -1870,7 +1870,7 @@ HRESULT CLoader::Loading_For_GamePlay() return E_FAIL; if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_GerboldOlivander_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Human/Npc/GerboldOllivander/GerboldOlivander.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))){ + CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Human/Npc/GerboldOllivander/GerboldOlivander.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixRotationZ(XMConvertToRadians(180.f)) * XMMatrixIdentity())))){ return E_FAIL; } @@ -1943,131 +1943,131 @@ HRESULT CLoader::Loading_For_GamePlay() return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CBombard::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CBombard::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CDecendo::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDecendo::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CNomalJap::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CNomalJap::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CProtego::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CProtego::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CRevelio::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CRevelio::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CNomalJapSide::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CNomalJapSide::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CLevioso::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CLevioso::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CLumos::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CLumos::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CAccio::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CAccio::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CLeviosoSide::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CLeviosoSide::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CBombardSide::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CBombardSide::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CDecendoSide::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDecendoSide::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CTransformationSide::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CTransformationSide::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CTrollSwing::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CTrollSwing::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CTroll_Nomal_Smoke::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CTroll_Nomal_Smoke::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CTroll_Rush_Hit::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CTroll_Rush_Hit::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CGoblin_Protego::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CGoblin_Protego::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CGoblin_Attack::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CGoblin_Attack::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CMage_Down_Attack::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CMage_Down_Attack::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CMage_Nomal_Attack::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CMage_Nomal_Attack::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CMageSide::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CMageSide::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CStunEffect::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CStunEffect::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CBox_Splesh::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CBox_Splesh::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CBarral_Splesh::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CBarral_Splesh::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CChair_Splesh::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CChair_Splesh::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CWandEnd::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CWandEnd::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CStupefy::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CStupefy::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CLightning::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CLightning::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CLightningSide::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CLightningSide::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CBlink::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CBlink::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CTransformation::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CTransformation::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CGoblin_Teleport::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CGoblin_Teleport::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CScreen_Wind::Create(m_pDevice, m_pContext)))) { + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CScreen_Wind::Create(m_pDevice, m_pContext)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Private/MapElement_Chest.cpp b/Jusin154_Team3D/Client/Private/MapElement_Chest.cpp index 6cd26482f..e88df1c57 100644 --- a/Jusin154_Team3D/Client/Private/MapElement_Chest.cpp +++ b/Jusin154_Team3D/Client/Private/MapElement_Chest.cpp @@ -315,9 +315,9 @@ CGameObject* CMapElement_Chest::Clone(void* pArg, CGameObject* pOwner) void CMapElement_Chest::Free() { - if (nullptr != m_pRigidBody) { - m_pGameInstance->Release_Actor(*m_pRigidBody->Get_Actor(), m_pGameInstance->Get_CurrentLevelID()); - } + //if (nullptr != m_pRigidBody) { + // m_pGameInstance->Release_Actor(*m_pRigidBody->Get_Actor(), m_pGameInstance->Get_CurrentLevelID()); + //} __super::Free(); if (m_bCloned) diff --git a/Jusin154_Team3D/Client/Private/MapElement_Door.cpp b/Jusin154_Team3D/Client/Private/MapElement_Door.cpp index d38f2a2d6..3252956d8 100644 --- a/Jusin154_Team3D/Client/Private/MapElement_Door.cpp +++ b/Jusin154_Team3D/Client/Private/MapElement_Door.cpp @@ -299,7 +299,7 @@ CGameObject* CMapElement_Door::Clone(void* pArg, CGameObject* pOwner) void CMapElement_Door::Free() { if (nullptr != m_pRigidBody) { - m_pGameInstance->Release_Actor(*m_pRigidBody->Get_Actor(), m_pGameInstance->Get_CurrentLevelID()); + m_pGameInstance->Release_Actor(*m_pRigidBody->Get_Actor()); } __super::Free(); diff --git a/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp b/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp index 2755d98d4..8a4b63b17 100644 --- a/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp +++ b/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp @@ -483,7 +483,7 @@ CGameObject* CMapElement_Interactable::Clone(void* pArg, CGameObject* pOwner) void CMapElement_Interactable::Free() { if (nullptr != m_pRigidBody) { - m_pGameInstance->Release_Actor(*m_pRigidBody->Get_Actor(), m_pGameInstance->Get_CurrentLevelID()); + m_pGameInstance->Release_Actor(*m_pRigidBody->Get_Actor()); } __super::Free(); diff --git a/Jusin154_Team3D/Client/Private/MapElement_Static.cpp b/Jusin154_Team3D/Client/Private/MapElement_Static.cpp index 56f903606..f74831165 100644 --- a/Jusin154_Team3D/Client/Private/MapElement_Static.cpp +++ b/Jusin154_Team3D/Client/Private/MapElement_Static.cpp @@ -154,7 +154,7 @@ void CMapElement_Static::ReadyForPhysX() { CModel* pModel = m_pModelComs[iIndexLOD]; - if (FAILED(pModel->Ready_PhysXMeshes(m_pTransformCom->Get_XMWorldMatrix(), iLevel))) { + if (FAILED(pModel->Ready_PhysXMeshes(XMMatrixIdentity(), iLevel))) { assert(false); } } diff --git a/Jusin154_Team3D/Client/Private/NPC_Ollivander.cpp b/Jusin154_Team3D/Client/Private/NPC_Ollivander.cpp index 34d760c7c..64f579d26 100644 --- a/Jusin154_Team3D/Client/Private/NPC_Ollivander.cpp +++ b/Jusin154_Team3D/Client/Private/NPC_Ollivander.cpp @@ -25,15 +25,15 @@ void CNPC_Ollivander::Priority_Update(_float fTimeDelta) void CNPC_Ollivander::Update(_float fTimeDelta) { m_pFSM->Update_State(fTimeDelta); - if (m_pModelCom->IsFinishedAnim()) { - m_pModelCom->Set_AnimationIndex(m_pGameInstance->Random_Int(0, 19), false); - } m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); __super::Update(fTimeDelta); #ifdef _DEBUG Describe_Entity(); #endif // _DEBUG + { // 세트 + m_pCharacter_Controller->Move(fTimeDelta); + } } void CNPC_Ollivander::Late_Update(_float fTimeDelta) @@ -42,6 +42,8 @@ void CNPC_Ollivander::Late_Update(_float fTimeDelta) m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); + Set_Shadow(m_pGameInstance->IsIn_ShadowViewFrustum(m_pTransformCom->Get_State(STATE::POSITION), m_pTransformCom->Get_Radius())); + __super::Late_Update(fTimeDelta); } @@ -72,6 +74,7 @@ HRESULT CNPC_Ollivander::Render() } m_pModelCom->Bind_OutPut_SRV_VS(26, 0); + m_pModelCom->Bind_OutPut_SRV_VS_Prev(27, 0); if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; @@ -159,13 +162,19 @@ HRESULT CNPC_Ollivander::Initialize(void* pArg) return E_FAIL; } m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(40.f, 4.f, 68.9f, 1.f)); - m_pModelCom->Set_AnimationIndex(m_pGameInstance->Random_Int(0, 19), false); + m_pModelCom->Set_AnimationIndex(0, true); return S_OK; } HRESULT CNPC_Ollivander::Ready_Components(void* pArg) { - if (FAILED(__super::Ready_Components(pArg))) { + CTransform::TRANSFORM_DESC Desc = {}; + + Desc.fSpeedPerSec = 10.f; + Desc.fRotationPerSec = XMConvertToRadians(180.0f); + Desc.fRadius = 10.f; + + if (FAILED(__super::Ready_Components(&Desc))) { return E_FAIL; } @@ -179,6 +188,28 @@ HRESULT CNPC_Ollivander::Ready_Components(void* pArg) return E_FAIL; } + { // CCT + CCharacter_Controller::Character_Controller_DESC Desc{}; + + Desc.iSubKind = ENUM_CLASS(PXOBJECT::OLLIVANDER); + Desc.pTransform = m_pTransformCom; + Desc.eBodyType = ACTOR::CAPSULE; + Desc.fContactOffset = 0.0001f; + Desc.fMaterial = { 1.2f, 1.0f, 0.0f }; + Desc.bAutoStepping = { false }; + Desc.fStepOffset = { 0.02f }; + Desc.fRadius = 0.5f; + Desc.fHeight = 0.6f; + Desc.pCallback_HitReport = nullptr; + Desc.pCallback_Behavior = nullptr; + Desc.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY; + Desc.fWalkableSlope = 45.f; + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), (CComponent**)&m_pCharacter_Controller, &Desc))) { + return E_FAIL; + } + m_pCharacter_Controller->SetGravity(true); + } + return S_OK; } @@ -209,30 +240,17 @@ CGameObject* CNPC_Ollivander::Clone(void* pArg, CGameObject* pOwner) void CNPC_Ollivander::Free() { __super::Free(); + + SAFE_RELEASE(m_pCharacter_Controller); + if (nullptr != m_pInfoInstance) { + CInfoInstance* pInfo = m_pInfoInstance; + m_pInfoInstance = nullptr; + } } #ifdef _DEBUG void CNPC_Ollivander::Describe_Entity() { - GUI::Begin("UNIT", 0, IMGUI_GLOBAL_BEGIN_FLAG); - if (GUI::CollapsingHeader("Ollivander")) { - m_pModelCom->Describe_Entity(); - if (ImGui::TreeNode("ANIM STATE")) { - - for (auto& pState : m_States) - { - if (ImGui::Button(to_string(pState.first).c_str())) - { - m_pFSM->Change_State(pState.first); - } - } - - GUI::Text(to_string(m_pModelCom->Get_CurrentTrackProgressRatio()).c_str()); - - ImGui::TreePop(); - } - } - GUI::End(); } #endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index 511f2fd97..1aa8cf79d 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -95,10 +95,14 @@ HRESULT CPlayer::Initialize(void* pArg) m_pInfoInstance->Regist_PlayerAlly(this); m_pInfoInstance->Set_Damage(m_pStat->Get_Stat().fDamage); - - m_pCharacter_Controller->Set_Position(XMVectorSet(-21.f, 0.f, -14.f, 1.f)); - m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(-21.f, 0.f, -14.f, 1.f)); - + { + PLAYERDESC* pDesc = static_cast(pArg); + _vector vPos = XMLoadFloat4(&pDesc->vPos); + _vector vRotQ = XMLoadFloat4(&pDesc->vRotQ); + m_pCharacter_Controller->Set_Position(vPos); + m_pTransformCom->Set_State(STATE::POSITION, vPos); + m_pTransformCom->Rotation(vRotQ); + } #ifdef _DEBUG m_BasicEffect = make_unique(m_pDevice); diff --git a/Jusin154_Team3D/Client/Public/Level_Field.h b/Jusin154_Team3D/Client/Public/Level_Field.h index 4e131b6b6..880a29d7d 100644 --- a/Jusin154_Team3D/Client/Public/Level_Field.h +++ b/Jusin154_Team3D/Client/Public/Level_Field.h @@ -26,11 +26,13 @@ class CLevel_Field final : public CLevel HRESULT Ready_Layer_SkyBox(); HRESULT Ready_Background(); HRESULT Ready_Markers(); + HRESULT Ready_Layer_Player(const _wstring& strLayerTag); HRESULT Ready_Layer_UI(const _wstring& strLayerTag); HRESULT Ready_Layer_Camera(); HRESULT Ready_Layer_Sound(); HRESULT Ready_Layer_Effect(const _wstring& strLayerTag); HRESULT Ready_Layer_Monster(); + HRESULT Reday_Layer_EffectPool(); public: static pair> Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID, void* pArg); diff --git a/Jusin154_Team3D/Client/Public/NPC_Ollivander.h b/Jusin154_Team3D/Client/Public/NPC_Ollivander.h index 16a511bc8..5c69772c2 100644 --- a/Jusin154_Team3D/Client/Public/NPC_Ollivander.h +++ b/Jusin154_Team3D/Client/Public/NPC_Ollivander.h @@ -20,6 +20,7 @@ class CNPC_Ollivander final : public CUnit virtual HRESULT Render_Shadow(SHADOW eType) override; protected: CInfoInstance* m_pInfoInstance = { nullptr }; + CCharacter_Controller* m_pCharacter_Controller = { nullptr }; protected: virtual HRESULT Initialize_Prototype() override; diff --git a/Jusin154_Team3D/Client/Public/Player.h b/Jusin154_Team3D/Client/Public/Player.h index e7d27c801..3b298842c 100644 --- a/Jusin154_Team3D/Client/Public/Player.h +++ b/Jusin154_Team3D/Client/Public/Player.h @@ -7,6 +7,11 @@ NS_BEGIN(Client) class CPlayer final : public CUnit { +public: + typedef struct tagPlayerInitDesc { + _float4 vPos; + _float4 vRotQ; + }PLAYERDESC; private: CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CPlayer(const CPlayer& Prototype); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/GerboldOllivander/GerboldOlivander.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/GerboldOllivander/GerboldOlivander.bin index 459598ade..704035228 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/GerboldOllivander/GerboldOlivander.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/GerboldOllivander/GerboldOlivander.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:45edbad61d9d6f8891b2009ec64951195a58e0fa50134a9d3b3dd0c5e34bee30 -size 6393892 +oid sha256:93816fc5a683892c7619312ac2ea43b255efd70cbf30141fa615eb5480f3397e +size 6556632 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/GerboldOllivander/GerboldOlivander.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/GerboldOllivander/GerboldOlivander.fbx index 838440947..d43881cfc 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/GerboldOllivander/GerboldOlivander.fbx +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/GerboldOllivander/GerboldOlivander.fbx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7fd7b3d203725b7044f2a72e4c7fda5981befcc2c607bfca596b0b6c0797c417 -size 3160204 +oid sha256:0102d6f855f46901fc5f1b291a29f46af1d4cac3baceafeed3a495d1dbbbc5f8 +size 3901724 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/GerboldOllivander/GerboldOlivander_Anim.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/GerboldOllivander/GerboldOlivander_Anim.bin deleted file mode 100644 index 16e04855b..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/GerboldOllivander/GerboldOlivander_Anim.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4c3d337a05c5621c027dec7cfd5345c13b8c46b243a072d4c8cf5c11d0d34039 -size 12951064 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/GerboldOllivander/GerboldOlivander_Anim.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/GerboldOllivander/GerboldOlivander_Anim.fbx deleted file mode 100644 index 0aa5ad418..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/GerboldOllivander/GerboldOlivander_Anim.fbx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:436a9c2d497061156640f0f2011616d41e0eacb3763eb86d18442bf4e2b4a193 -size 19497756 diff --git a/Jusin154_Team3D/Editor/Private/Dummy_PhysXBox.cpp b/Jusin154_Team3D/Editor/Private/Dummy_PhysXBox.cpp index 40902a74e..a25c08546 100644 --- a/Jusin154_Team3D/Editor/Private/Dummy_PhysXBox.cpp +++ b/Jusin154_Team3D/Editor/Private/Dummy_PhysXBox.cpp @@ -164,7 +164,7 @@ CGameObject* CDummy_PhysXBox::Clone(void* pArg, CGameObject* pOwner) void CDummy_PhysXBox::Free() { if (nullptr != m_pRigidBody) { - m_pGameInstance->Release_Actor(*m_pRigidBody->Get_Actor(), m_pGameInstance->Get_CurrentLevelID()); + m_pGameInstance->Release_Actor(*m_pRigidBody->Get_Actor()); } __super::Free(); diff --git a/Jusin154_Team3D/Editor/Private/Dummy_PhysXWall.cpp b/Jusin154_Team3D/Editor/Private/Dummy_PhysXWall.cpp index 7935ae394..a0b89ec34 100644 --- a/Jusin154_Team3D/Editor/Private/Dummy_PhysXWall.cpp +++ b/Jusin154_Team3D/Editor/Private/Dummy_PhysXWall.cpp @@ -154,7 +154,7 @@ CGameObject* CDummy_PhysXWall::Clone(void* pArg, CGameObject* pOwner) void CDummy_PhysXWall::Free() { if (nullptr != m_pRigidBody) { - m_pGameInstance->Release_Actor(*m_pRigidBody->Get_Actor(), m_pGameInstance->Get_CurrentLevelID()); + m_pGameInstance->Release_Actor(*m_pRigidBody->Get_Actor()); } __super::Free(); diff --git a/Jusin154_Team3D/Editor/Private/MapElement_Chest.cpp b/Jusin154_Team3D/Editor/Private/MapElement_Chest.cpp index 4ab6ed7d5..f738d0e23 100644 --- a/Jusin154_Team3D/Editor/Private/MapElement_Chest.cpp +++ b/Jusin154_Team3D/Editor/Private/MapElement_Chest.cpp @@ -329,7 +329,7 @@ CGameObject* CMapElement_Chest::Clone(void* pArg, CGameObject* pOwner) void CMapElement_Chest::Free() { if (nullptr != m_pRigidBody) { - m_pGameInstance->Release_Actor(*m_pRigidBody->Get_Actor(), m_pGameInstance->Get_CurrentLevelID()); + m_pGameInstance->Release_Actor(*m_pRigidBody->Get_Actor()); } __super::Free(); diff --git a/Jusin154_Team3D/Editor/Private/MapElement_Door.cpp b/Jusin154_Team3D/Editor/Private/MapElement_Door.cpp index 374b2e7a3..f76e1a9e3 100644 --- a/Jusin154_Team3D/Editor/Private/MapElement_Door.cpp +++ b/Jusin154_Team3D/Editor/Private/MapElement_Door.cpp @@ -214,7 +214,7 @@ CGameObject* CMapElement_Door::Clone(void* pArg, CGameObject* pOwner) void CMapElement_Door::Free() { if (nullptr != m_pRigidBody) { - m_pGameInstance->Release_Actor(*m_pRigidBody->Get_Actor(), m_pGameInstance->Get_CurrentLevelID()); + m_pGameInstance->Release_Actor(*m_pRigidBody->Get_Actor()); } __super::Free(); diff --git a/Jusin154_Team3D/Editor/Private/MapElement_Interactable.cpp b/Jusin154_Team3D/Editor/Private/MapElement_Interactable.cpp index e249f9b7e..89277aade 100644 --- a/Jusin154_Team3D/Editor/Private/MapElement_Interactable.cpp +++ b/Jusin154_Team3D/Editor/Private/MapElement_Interactable.cpp @@ -209,7 +209,7 @@ CGameObject* CMapElement_Interactable::Clone(void* pArg, CGameObject* pOwner) void CMapElement_Interactable::Free() { if (nullptr != m_pRigidBody) { - m_pGameInstance->Release_Actor(*m_pRigidBody->Get_Actor(), m_pGameInstance->Get_CurrentLevelID()); + m_pGameInstance->Release_Actor(*m_pRigidBody->Get_Actor()); } __super::Free(); diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index 436b86087..718d6a0e5 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -1044,9 +1044,9 @@ void CGameInstance::Detach_Actor(PSX::PxActor& Actor, _uint iLevel) { m_pPhysX_Manager->Detach_Actor(Actor, iLevel); } -void CGameInstance::Release_Actor(PSX::PxActor& Actor, _uint iLevel) +void CGameInstance::Release_Actor(PSX::PxActor& Actor) { - m_pPhysX_Manager->Detach_Actor(Actor, iLevel); + m_pPhysX_Manager->Release_Actor(Actor); } HRESULT CGameInstance::ConvertToTriMeshes(vector& Meshes, vector& pxTriMeshes, _fmatrix WorldMatrix) { diff --git a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp index 700a137c2..37cc85f7d 100644 --- a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp @@ -67,7 +67,8 @@ PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody_Dynamic& RigidB PSX::PxRigidStatic* CPhysX_Manager::Add_StaticActor(CRigidBody_Static& RigidBody, _uint iLevel) { _matrix WorldMatrix = RigidBody.Get_TransformPtr()->Get_XMWorldMatrix(); - PSX::PxTransform pxWorldMatrix = XMWorldToPx_NoScale(WorldMatrix); + PSX::PxTransform pxWorldMatrix = XMWorldToPx_NoScale(WorldMatrix); + // PxRigidStatic 씬의 정적 바디 인터페이스 PSX::PxRigidStatic* pActor = m_pPhysics->createRigidStatic(pxWorldMatrix); @@ -494,18 +495,24 @@ unordered_set::iterator CPhysX_Manager::Detach_Actor(PSX::PxActor return iterOut; } -void CPhysX_Manager::Release_Actor(PSX::PxActor& Actor, _uint iLevel) +void CPhysX_Manager::Release_Actor(PSX::PxActor& Actor) { // 혹시 활성화 맵에 들어있을 수도 있으니 검사 - unordered_set::iterator iterResult = Detach_Actor(Actor, iLevel); - if (m_pRestBodies[iLevel].end() != iterResult) { // 방금 전까지만 해도 활성화 중이었던 액터 라면 - m_pRestBodies[iLevel].erase(iterResult); // 바로 지워줌 + unordered_set::iterator iterResult = {}; + _uint iReleasedLevel = UINT_MAX; + for (_uint iLevel = 0; iLevel < m_iMaxLevel; ++iLevel) { + iterResult = Detach_Actor(Actor, iLevel); + if (m_pRestBodies[iLevel].end() != iterResult) { // 방금 전까지만 해도 활성화 중이었던 액터 라면 + m_pRestBodies[iLevel].erase(iterResult); // 바로 지워줌 + iReleasedLevel = iLevel; + break; + } } - else { - m_pActiveBodys[iLevel].erase(&Actor); - m_pRestBodies[iLevel].erase(&Actor); + if (UINT_MAX == iReleasedLevel) { + m_pActiveBodys[iReleasedLevel].erase(&Actor); + m_pRestBodies[iReleasedLevel].erase(&Actor); } - Actor.release(); + //Actor.release(); } PSX::PxController* CPhysX_Manager::Add_CapsuleController(PSX::PxCapsuleControllerDesc& Desc) @@ -647,7 +654,7 @@ HRESULT CPhysX_Manager::Initialize(_uint iLevel) PlaneData.pOwner = nullptr; PlaneData.pBody = nullptr; - PSX::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 50), *m_pMaterials[ENUM_CLASS(PXMATERIAL::DEFAULT)]); + PSX::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 85), *m_pMaterials[ENUM_CLASS(PXMATERIAL::DEFAULT)]); pGroundPlane->userData = &PlaneData; pGroundPlane->setName("PHYSX_MANAGER_PLANE"); m_pScene->addActor(*pGroundPlane); diff --git a/Jusin154_Team3D/Engine/Private/VIBuffer_Terrain.cpp b/Jusin154_Team3D/Engine/Private/VIBuffer_Terrain.cpp index 960749a85..a4624b6ac 100644 --- a/Jusin154_Team3D/Engine/Private/VIBuffer_Terrain.cpp +++ b/Jusin154_Team3D/Engine/Private/VIBuffer_Terrain.cpp @@ -393,9 +393,11 @@ HRESULT CVIBuffer_Terrain::Initialize(void* pArg) void CVIBuffer_Terrain::ConvertToHeightField(const _tchar* pStaticKey) { + PSX::PxHeightFieldDesc Desc{}; + Desc.format = PSX::PxHeightFieldFormat::eS16_TM; + vector pxSamples = {}; pxSamples.resize(m_iNumVerticesZ * m_iNumVerticesX); - for (_uint iRow = 0; iRow < m_iNumVerticesZ; ++iRow) { for (_uint iCol = 0; iCol < m_iNumVerticesX; ++iCol) { _uint iIndex = iRow * m_iNumVerticesX + iCol; @@ -411,11 +413,9 @@ void CVIBuffer_Terrain::ConvertToHeightField(const _tchar* pStaticKey) pxSample.clearTessFlag(); } } + Desc.nbRows = m_iNumVerticesX; + Desc.nbColumns = m_iNumVerticesZ; - PSX::PxHeightFieldDesc Desc{}; - Desc.format = PSX::PxHeightFieldFormat::eS16_TM; - Desc.nbRows = m_iNumVerticesZ; - Desc.nbColumns = m_iNumVerticesX; Desc.samples.data = pxSamples.data(); Desc.samples.stride = sizeof(PSX::PxHeightFieldSample); @@ -426,7 +426,6 @@ void CVIBuffer_Terrain::ConvertToHeightField(const _tchar* pStaticKey) else { m_pGameInstance->RegistHeight(pStaticKey, Desc, m_pGameInstance->Get_NextLevelID()); } - } _bool CVIBuffer_Terrain::Picking(_fmatrix WorldMatrix, _float3* pOut) diff --git a/Jusin154_Team3D/Engine/Public/Engine_Enum.h b/Jusin154_Team3D/Engine/Public/Engine_Enum.h index 34afc696f..f9d34fdee 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Enum.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Enum.h @@ -184,6 +184,7 @@ enum class PXOBJECT : _uint { #pragma endregion #pragma region NPC NPC = 500, + OLLIVANDER, #pragma endregion #pragma region ITEM diff --git a/Jusin154_Team3D/Engine/Public/GameInstance.h b/Jusin154_Team3D/Engine/Public/GameInstance.h index 15f7b7479..5979532e8 100644 --- a/Jusin154_Team3D/Engine/Public/GameInstance.h +++ b/Jusin154_Team3D/Engine/Public/GameInstance.h @@ -223,7 +223,7 @@ class ENGINE_DLL CGameInstance final : public CBase void ReleaseController(_uint iControllerIndex); void Attach_Actor(PSX::PxActor& Actor, _uint iLevel); void Detach_Actor(PSX::PxActor& pActor, _uint iLevel); - void Release_Actor(PSX::PxActor& Actor, _uint iLevel); + void Release_Actor(PSX::PxActor& Actor); HRESULT ConvertToTriMeshes(vector& Meshes, vector& pxTriMeshes, _fmatrix WorldMatrix = XMMatrixIdentity()); #ifdef EDITOR_PROJECT HRESULT SaveTriMeshes(const _char* pPath, vector& TriMeshes); diff --git a/Jusin154_Team3D/Engine/Public/PhysX_Manager.h b/Jusin154_Team3D/Engine/Public/PhysX_Manager.h index 5d56c7dbc..a5897fa25 100644 --- a/Jusin154_Team3D/Engine/Public/PhysX_Manager.h +++ b/Jusin154_Team3D/Engine/Public/PhysX_Manager.h @@ -51,7 +51,7 @@ class CPhysX_Manager final : public CBase void ClearScene(_uint iLevel); void Attach_Actor(PSX::PxActor& Actor, _uint iLevel); unordered_set::iterator Detach_Actor(PSX::PxActor& Actor, _uint iLevel); - void Release_Actor(PSX::PxActor& Actor, _uint iLevel); + void Release_Actor(PSX::PxActor& Actor); #pragma endregion #pragma region CHARACTER_CONTROLLER /* dev-treadmill.tistory.com/158 */ From 009b530b91d147ce48224034cdf2a66326abad46 Mon Sep 17 00:00:00 2001 From: kimnuri Date: Tue, 23 Dec 2025 02:33:06 +0900 Subject: [PATCH 2/2] [add] NPC Actor --- Jusin154_Team3D/Client/Default/Client.vcxproj | 4 + .../Client/Default/Client.vcxproj.filters | 24 ++- .../Private/CallBack_NonPlayable_Behavior.cpp | 94 +++++++++ .../CallBack_NonPlayable_HitReport.cpp | 195 ++++++++++++++++++ .../Client/Private/Camera_Debug.cpp | 2 +- .../Client/Private/Camera_Gaze.cpp | 2 +- .../Private/MapElement_Interactable.cpp | 3 - .../Client/Private/NPC_Ollivander.cpp | 93 ++++++++- Jusin154_Team3D/Client/Private/Player.cpp | 2 +- .../Public/CallBack_NonPlayable_Behavior.h | 42 ++++ .../Public/CallBack_NonPlayable_HitReport.h | 50 +++++ .../Client/Public/NPC_Ollivander.h | 12 +- 12 files changed, 509 insertions(+), 14 deletions(-) create mode 100644 Jusin154_Team3D/Client/Private/CallBack_NonPlayable_Behavior.cpp create mode 100644 Jusin154_Team3D/Client/Private/CallBack_NonPlayable_HitReport.cpp create mode 100644 Jusin154_Team3D/Client/Public/CallBack_NonPlayable_Behavior.h create mode 100644 Jusin154_Team3D/Client/Public/CallBack_NonPlayable_HitReport.h diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj b/Jusin154_Team3D/Client/Default/Client.vcxproj index 42e196758..a81cb07a4 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj @@ -161,6 +161,8 @@ call Update_Resources.bat + + @@ -389,6 +391,8 @@ call Update_Resources.bat + + diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters index 0b117a485..da7ac3ab7 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters @@ -688,7 +688,7 @@ 02.GameObjects\Effect\Effects\Transformation\TransformationSide - + 02.GameObjects\UI\SpellLearn_Canvas\SpellLearn_Panel\SpellLearn_Slot @@ -704,6 +704,12 @@ 02.GameObjects\UI\SpellLearn_Canvas\SpellLearn_Panel\SpellLearn_Booster + + 02.GameObjects\PhysX\CallBack\Behavior\NPC + + + 02.GameObjects\PhysX\CallBack\HitReport\NPC + @@ -1451,7 +1457,7 @@ {064b5e2f-dcde-47fd-a43d-43e25800393d} - + {d9c0bcb6-64f6-4b58-a68d-ff04c91b9861} @@ -1467,6 +1473,12 @@ {dd7d2910-1d3d-42c4-9390-ac60685357ee} + + {954ad10f-edc4-4dda-a2e1-741a418831e8} + + + {b265ac30-97f5-4dac-bc6b-b11fba1c5ad8} + @@ -2102,7 +2114,7 @@ 02.GameObjects\NPC\Ally\GateKeeper - + 02.GameObjects\UI\SpellLearn_Canvas\SpellLearn_Panel\SpellLearn_Slot @@ -2118,6 +2130,12 @@ 02.GameObjects\UI\SpellLearn_Canvas\SpellLearn_Panel\SpellLearn_Booster + + 02.GameObjects\PhysX\CallBack\Behavior\NPC + + + 02.GameObjects\PhysX\CallBack\HitReport\NPC + diff --git a/Jusin154_Team3D/Client/Private/CallBack_NonPlayable_Behavior.cpp b/Jusin154_Team3D/Client/Private/CallBack_NonPlayable_Behavior.cpp new file mode 100644 index 000000000..90dce5274 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/CallBack_NonPlayable_Behavior.cpp @@ -0,0 +1,94 @@ +#include "pch.h" +#include "CallBack_NonPlayable_Behavior.h" +#include "GameInstance.h" + + +CCallBack_NonPlayable_Behavior::CCallBack_NonPlayable_Behavior() +{ +} + +CCallBack_NonPlayable_Behavior::~CCallBack_NonPlayable_Behavior() +{ +} + +PSX::PxControllerBehaviorFlags CCallBack_NonPlayable_Behavior::getBehaviorFlags(const PSX::PxShape& shape, const PSX::PxActor& actor) +{ + if (nullptr == actor.userData) { + return PSX::PxControllerBehaviorFlags(0); + } + PSX::PxControllerBehaviorFlags eResults = PSX::PxControllerBehaviorFlags(0); + PhsXUserData* pActorData = static_cast(actor.userData); + switch (pActorData->eKind) + { + case PHYSX_KIND::BODY_STATIC: + eResults = PSX::PxControllerBehaviorFlag::eCCT_SLIDE | PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; + break; + case PHYSX_KIND::BODY_DYNAMIC: + switch (pActorData->iSubKind) + { + case 20: + eResults = PSX::PxControllerBehaviorFlag::eCCT_SLIDE; + break; + case 21: + eResults = PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; + break; + case 22: + eResults = PSX::PxControllerBehaviorFlag::eCCT_SLIDE | PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; + break; + case 23: + eResults = PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; + break; + case 24: + eResults = PSX::PxControllerBehaviorFlags(0); + break; + default: + break; + } + break; + case PHYSX_KIND::CCTActor: + // Action + break; + case PHYSX_KIND::OBSTACLEActor: + break; + default: + break; + } + + return eResults; +} + +PSX::PxControllerBehaviorFlags CCallBack_NonPlayable_Behavior::getBehaviorFlags(const PSX::PxController& controller) +{ + // CCT끼리 부딪힐 때를 굳이 안 쓰면 0 리턴 + return PSX::PxControllerBehaviorFlag::eCCT_SLIDE; +} + +PSX::PxControllerBehaviorFlags CCallBack_NonPlayable_Behavior::getBehaviorFlags(const PSX::PxObstacle& obstacle) +{ + // Obstacle이 움직이는 발판이다? + // 여기서 ride/slide 세팅 + //return PSX::PxControllerBehaviorFlag::eCCT_CAN_RIDE_ON_OBJECT; + + return PSX::PxControllerBehaviorFlags(0); +} + +HRESULT CCallBack_NonPlayable_Behavior::Initialize(CCharacter_Controller* pController) +{ + m_pController = pController; + m_pGameInstance = CGameInstance::GetInstance(); + SAFE_ADDREF(m_pController); + SAFE_ADDREF(m_pGameInstance); + return S_OK; +} + +HRESULT CCallBack_NonPlayable_Behavior::Finalize() +{ + SAFE_RELEASE(m_pGameInstance); + SAFE_RELEASE(m_pController); + return S_OK; +} + +CCallBack_NonPlayable_Behavior* CCallBack_NonPlayable_Behavior::Create() +{ + return new CCallBack_NonPlayable_Behavior(); +} diff --git a/Jusin154_Team3D/Client/Private/CallBack_NonPlayable_HitReport.cpp b/Jusin154_Team3D/Client/Private/CallBack_NonPlayable_HitReport.cpp new file mode 100644 index 000000000..fe36e9a90 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/CallBack_NonPlayable_HitReport.cpp @@ -0,0 +1,195 @@ +#include "pch.h" +#include "CallBack_NonPlayable_HitReport.h" +#include "GameInstance.h" +#include "GameObject.h" + +CCallBack_NonPlayable_HitReport::CCallBack_NonPlayable_HitReport() +{ +} + +CCallBack_NonPlayable_HitReport::~CCallBack_NonPlayable_HitReport() +{ +} + +void CCallBack_NonPlayable_HitReport::BeginFrame() +{ + // 매 프레임 초기화 + m_vClimbNormal = { 0.f, 1.f, 0.f }; + m_bGroundHit = { false }; + m_fBestNormal = { 0.f }; +} + +void CCallBack_NonPlayable_HitReport::onShapeHit(const PSX::PxControllerShapeHit& hit) +{ + PSX::PxController* pController = hit.controller; + PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점 + PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말 + PSX::PxVec3 vDir = hit.dir; // 시도한 move 방향 + _float fLength = hit.length; // 시도한 move 길이 + + PSX::PxShape* pShape = hit.shape; + PSX::PxRigidActor* pActor = hit.actor; + + if (nullptr != pController && nullptr != pActor) { + PhsXUserData* pTargetActorData = static_cast(pActor->userData); + PhsXUserData* pOwnerActorData = static_cast(pController->getActor()->userData); + if (nullptr == pTargetActorData) { // missing user data + return; + } + + switch (pTargetActorData->eKind) + { + case PHYSX_KIND::BODY_STATIC: + switch (PXOBJECT(pTargetActorData->iSubKind)) + { + case PXOBJECT::TERRAIN: + case PXOBJECT::FLOOR: + case PXOBJECT::ROAD: + if (vWorldNormal.y > 0) { + _float fDotValue = vWorldNormal.dot({ 0.f, 1.f, 0.f }); + if (m_fBestNormal < fDotValue) { + m_bGroundHit = true; + m_fBestNormal = fDotValue; + m_vClimbNormal = { vWorldNormal.x, vWorldNormal.y, vWorldNormal.z }; + } + } + break; + default: + break; + } + break; + case PHYSX_KIND::BODY_DYNAMIC: + { + switch (PXOBJECT(pTargetActorData->iSubKind)) + { + case PXOBJECT::END: + break; + case PXOBJECT::BOX: + { + PSX::PxRigidDynamic* pDynamic = static_cast(pActor); + //pDynamic->setRigidBodyFlag(PSX::PxRigidBodyFlag::eKINEMATIC, false); + PSX::PxVec3 vCompressedDir = -vWorldNormal; + vCompressedDir.normalize(); + pDynamic->addForce(vCompressedDir * fLength * 1000.f, PSX::PxForceMode::eFORCE); + } break; + case PXOBJECT::DOOR: + { + PSX::PxRigidDynamic* pDynamic = static_cast(pActor); + _float fDot = vDir.dot(PSX::PxVec3(0.f, 1.f, 0.f)); + if (fDot > 0) { + pDynamic->addTorque(PSX::PxVec3(0.f, 1.f, 0.f) * fLength * 100.f, PSX::PxForceMode::eFORCE); + } + else { + pDynamic->addTorque(PSX::PxVec3(0.f, -1.f, 0.f) * fLength * 100.f, PSX::PxForceMode::eFORCE); + } + } break; + default: + { + } break; + } + } break; + case PHYSX_KIND::CCTActor: + assert(false); + break; + case PHYSX_KIND::OBSTACLEActor: + break; + default: + break; + } + } +} + +void CCallBack_NonPlayable_HitReport::onControllerHit(const PSX::PxControllersHit& hit) +{ + PSX::PxController* pController = hit.controller; + PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점 + PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말 + PSX::PxVec3 vDir = hit.dir; // 시도한 move 방향 + _float fLength = hit.length; // 시도한 move 길이 + + PSX::PxController* pOtherController = hit.other; // 다른 컨트롤러 + + if (nullptr != pController && nullptr != pOtherController) { + PhsXUserData* pActorData = static_cast(pOtherController->getActor()->userData); + assert(nullptr != pActorData); // missing user data + + switch (pActorData->eKind) + { + case PHYSX_KIND::BODY_STATIC: + assert(false); + break; + case PHYSX_KIND::BODY_DYNAMIC: + assert(false); + break; + case PHYSX_KIND::CCTActor: + // Action + break; + case PHYSX_KIND::OBSTACLEActor: + break; + default: + break; + } + } +} + +void CCallBack_NonPlayable_HitReport::onObstacleHit(const PSX::PxControllerObstacleHit& hit) +{ + PSX::PxController* pController = hit.controller; + PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점 + PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말 + PSX::PxVec3 vDir = hit.dir; // 시도한 move 방향 + _float fLength = hit.length; // 시도한 move 길이 + + const void* pOtherController = hit.userData; // 장애물 + + //switch (pOtherController.member) + //{ + //default: + // break; + //} +} + +void CCallBack_NonPlayable_HitReport::Set_CurrentSlop() +{ + m_pController->Rewind_Grounded(); + if (m_bGroundHit) + { + m_pController->Set_OnGroundFlag(m_bGroundHit); + float fDot = clamp(m_fBestNormal, -1.0f, 1.0f); + float fAngleRad = acosf(fDot); + float fAngleDeg = XMConvertToDegrees(fAngleRad); + + m_pController->Set_CurrentSlope(fAngleDeg, m_vClimbNormal); + } +} + +HRESULT CCallBack_NonPlayable_HitReport::Initialize(CCharacter_Controller* pController) +{ + m_pController = pController; + m_pGameInstance = CGameInstance::GetInstance(); + SAFE_ADDREF(m_pController); + SAFE_ADDREF(m_pGameInstance); + return S_OK; +} + +HRESULT CCallBack_NonPlayable_HitReport::Finalize() +{ + SAFE_RELEASE(m_pGameInstance); + SAFE_RELEASE(m_pController); + return S_OK; +} + +_bool CCallBack_NonPlayable_HitReport::IsOnGround() +{ + return m_bGroundHit; +} + +_vector CCallBack_NonPlayable_HitReport::Get_GroundVector() +{ + return XMLoadFloat3(&m_vClimbNormal); +} + +CCallBack_NonPlayable_HitReport* CCallBack_NonPlayable_HitReport::Create() +{ + return new CCallBack_NonPlayable_HitReport(); +} diff --git a/Jusin154_Team3D/Client/Private/Camera_Debug.cpp b/Jusin154_Team3D/Client/Private/Camera_Debug.cpp index 9bdac8bb4..2a7cfea87 100644 --- a/Jusin154_Team3D/Client/Private/Camera_Debug.cpp +++ b/Jusin154_Team3D/Client/Private/Camera_Debug.cpp @@ -18,7 +18,7 @@ CCamera_Debug::CCamera_Debug(const CCamera_Debug& rhs) void CCamera_Debug::Priority_Update(_float fTimeDelta) { #ifdef _DEBUG - m_pGameInstance->Bind_Camera(g_iStaticLevel, CAMERA_DEBUG, false); + m_pGameInstance->Bind_Camera(NEXT_LEVEL, CAMERA_DEBUG, false); #endif // _DEBUG if (FAILED(m_pGameInstance->IsBinded_Camera(CAMERA_DEBUG))) { diff --git a/Jusin154_Team3D/Client/Private/Camera_Gaze.cpp b/Jusin154_Team3D/Client/Private/Camera_Gaze.cpp index 57bbfb0aa..1fb18dc42 100644 --- a/Jusin154_Team3D/Client/Private/Camera_Gaze.cpp +++ b/Jusin154_Team3D/Client/Private/Camera_Gaze.cpp @@ -105,7 +105,7 @@ void CCamera_Gaze::Toggle_Priority() } else { m_iPriority = 55; - m_pGameInstance->Bind_Camera(g_iStaticLevel, CAMERA_SHOULDER, false); + m_pGameInstance->Bind_Camera(NEXT_LEVEL, CAMERA_SHOULDER, false); } } diff --git a/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp b/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp index 8a4b63b17..72c108d92 100644 --- a/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp +++ b/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp @@ -482,9 +482,6 @@ CGameObject* CMapElement_Interactable::Clone(void* pArg, CGameObject* pOwner) void CMapElement_Interactable::Free() { - if (nullptr != m_pRigidBody) { - m_pGameInstance->Release_Actor(*m_pRigidBody->Get_Actor()); - } __super::Free(); SAFE_RELEASE(m_pRigidBody); diff --git a/Jusin154_Team3D/Client/Private/NPC_Ollivander.cpp b/Jusin154_Team3D/Client/Private/NPC_Ollivander.cpp index 64f579d26..722ee994c 100644 --- a/Jusin154_Team3D/Client/Private/NPC_Ollivander.cpp +++ b/Jusin154_Team3D/Client/Private/NPC_Ollivander.cpp @@ -4,6 +4,8 @@ #include "GameInstance.h" #include "InfoInstance.h" #include "Player.h" +#include "CallBack_NonPlayable_Behavior.h" +#include "CallBack_NonPlayable_HitReport.h" CNPC_Ollivander::CNPC_Ollivander(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CUnit(pDevice, pContext) @@ -31,14 +33,75 @@ void CNPC_Ollivander::Update(_float fTimeDelta) Describe_Entity(); #endif // _DEBUG + if (false == m_bEntered) { + if (true == CastToPlayer()) { + m_vEnteringTimer.x += fTimeDelta; + if (m_vEnteringTimer.x > m_vEnteringTimer.y) { + m_vEnteringTimer.x -= m_vEnteringTimer.y; + m_bEntered = true; + // Active(); + } +#ifdef _DEBUG + GUI::Begin("UNIT"); + if (GUI::CollapsingHeader("Ollivander")) { + GUI::Text("Timer :%.1f", m_vEnteringTimer.x); + GUI::Text("Hello"); + } + GUI::End(); +#endif // _DEBUG + } + } + else { + if (false == CastToPlayer()) { + m_vEnteringTimer.x += fTimeDelta; + if (m_vEnteringTimer.x > m_vEnteringTimer.y) { + m_vEnteringTimer.x -= m_vEnteringTimer.y; + m_bEntered = false; + // DeActive(), Ready To Enter; + } +#ifdef _DEBUG + GUI::Begin("UNIT"); + if (GUI::CollapsingHeader("Ollivander")) { + GUI::Text("Timer :%.1f", m_vEnteringTimer.x); + GUI::Text("CoolTime"); + } + GUI::End(); +#endif // _DEBUG + } + else { +#ifdef _DEBUG + GUI::Begin("UNIT"); + if (GUI::CollapsingHeader("Ollivander")) { + GUI::Text("Timer :%.1f", m_vEnteringTimer.x); + GUI::Text("You must go Out"); + } + GUI::End(); +#endif // _DEBUG + } + } + + if (false == CastToPlayer() && false == m_bEntered) { +#ifdef _DEBUG + GUI::Begin("UNIT"); + if (GUI::CollapsingHeader("Ollivander")) { + GUI::Text("Timer :%.1f", m_vEnteringTimer.x); + GUI::Text("Waiting For ReEnter"); + } + GUI::End(); +#endif // _DEBUG + } + + { // 세트 + m_pCallBack_HitReport->BeginFrame(); m_pCharacter_Controller->Move(fTimeDelta); + m_pCallBack_HitReport->Set_CurrentSlop(); } } void CNPC_Ollivander::Late_Update(_float fTimeDelta) { - m_pTransformCom->Set_State(STATE::POSITION, m_pTransformCom->Get_EstimatedPositionByMomentum()); + m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_FootPosition()); m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); @@ -148,6 +211,19 @@ HRESULT CNPC_Ollivander::Bind_ShaderResources() return S_OK; } +_bool CNPC_Ollivander::CastToPlayer() +{ + _vector vCurrentPos = m_pTransformCom->Get_State(STATE::POSITION); + _vector vTargetPos = {}; + pair pairAllyInfo = m_pInfoInstance->Get_NearestPlayerAlly(m_pTransformCom->Get_State(STATE::POSITION)); + vTargetPos = pairAllyInfo.second->Get_State(STATE::POSITION); + _float fLength = XMVectorGetX(XMVector4Length(vTargetPos - vCurrentPos)); + if (fLength < m_fEncounterDistance) { + return true; + } + return false; +} + HRESULT CNPC_Ollivander::Initialize_Prototype() { return S_OK; @@ -162,7 +238,10 @@ HRESULT CNPC_Ollivander::Initialize(void* pArg) return E_FAIL; } m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(40.f, 4.f, 68.9f, 1.f)); + m_pCharacter_Controller->Set_Position(XMVectorSet(40.f, 4.f, 68.9f, 1.f)); m_pModelCom->Set_AnimationIndex(0, true); + m_pCallBack_Behavior->Initialize(m_pCharacter_Controller); + m_pCallBack_HitReport->Initialize(m_pCharacter_Controller); return S_OK; } @@ -200,8 +279,8 @@ HRESULT CNPC_Ollivander::Ready_Components(void* pArg) Desc.fStepOffset = { 0.02f }; Desc.fRadius = 0.5f; Desc.fHeight = 0.6f; - Desc.pCallback_HitReport = nullptr; - Desc.pCallback_Behavior = nullptr; + Desc.pCallback_HitReport = m_pCallBack_HitReport = CCallBack_NonPlayable_HitReport::Create(); + Desc.pCallback_Behavior = m_pCallBack_Behavior = CCallBack_NonPlayable_Behavior::Create(); Desc.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY; Desc.fWalkableSlope = 45.f; if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), (CComponent**)&m_pCharacter_Controller, &Desc))) { @@ -246,6 +325,14 @@ void CNPC_Ollivander::Free() CInfoInstance* pInfo = m_pInfoInstance; m_pInfoInstance = nullptr; } + if (nullptr != m_pCallBack_Behavior) { + m_pCallBack_Behavior->Finalize(); + } + if (nullptr != m_pCallBack_HitReport) { + m_pCallBack_HitReport->Finalize(); + } + Safe_Delete(m_pCallBack_Behavior); + Safe_Delete(m_pCallBack_HitReport); } #ifdef _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index 1aa8cf79d..b8180b899 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -9,8 +9,8 @@ #include "Wand.h" #include "Item_Potion.h" #include "Character_Controller.h" -#include "CallBack_Playable_Behavior.h" #include "CamPosition_Shoulder.h" +#include "CallBack_Playable_Behavior.h" #include "CallBack_Playable_HitReport.h" #include "Monster.h" #include "Broom.h" diff --git a/Jusin154_Team3D/Client/Public/CallBack_NonPlayable_Behavior.h b/Jusin154_Team3D/Client/Public/CallBack_NonPlayable_Behavior.h new file mode 100644 index 000000000..91b97d1cc --- /dev/null +++ b/Jusin154_Team3D/Client/Public/CallBack_NonPlayable_Behavior.h @@ -0,0 +1,42 @@ +#pragma once + +#include "Client_Define.h" +#include "GameObject.h" + +NS_BEGIN(Client) + +class CCallBack_NonPlayable_Behavior final : public PSX::PxControllerBehaviorCallback +{ + // 구현 예시 + // CCT는 RigidBody의 PxSimulationEventCallback에 안걸리고, 이 전용 콜백에서 처리되는 구조임 + // + // PxUserControllerHitReport = "무엇과 부딪혔는지 알려줌(이벤트 알림)" + // PxControllerBehaviorCallback = "부딪힌 것에 대해 어떤 행동 정책을 쓸지 물어봄(질의)" + // PxSimulationEventCallback = "씬 전체에 대한 글로벌 콜백(일반 물리 이벤트)" +private: + CCallBack_NonPlayable_Behavior(); +public: + ~CCallBack_NonPlayable_Behavior(); + +public: + // PxControllerBehaviorCallback을(를) 통해 상속됨 + // 충돌알림이 아닌, 행동정책 정해주기. CCT vs CCT는 지원안함 + // slopeLimit로 미끄러져 갈 수 있는지 없는지 이분법적인 계산 대신, 원하는 물체에 대해서만 미끄러운 표면으로 정의해줌 + // 주인이 되는 CCT가 이 물체에 대해 이 물체를 어떻게 해야 할까? -> (타고 올라갈까? Ride?) (미끄러져갈까? Slide?) ( 직접 내가 구현할까? user defined ride? ) + virtual PSX::PxControllerBehaviorFlags getBehaviorFlags(const PSX::PxShape& shape, const PSX::PxActor& actor) override; + + virtual PSX::PxControllerBehaviorFlags getBehaviorFlags(const PSX::PxController& controller) override; + + virtual PSX::PxControllerBehaviorFlags getBehaviorFlags(const PSX::PxObstacle& obstacle) override; + +public: + HRESULT Initialize(CCharacter_Controller* pController); + HRESULT Finalize(); +private: + CCharacter_Controller* m_pController = { nullptr }; + CGameInstance* m_pGameInstance = { nullptr }; + +public: + static CCallBack_NonPlayable_Behavior* Create(); +}; +NS_END diff --git a/Jusin154_Team3D/Client/Public/CallBack_NonPlayable_HitReport.h b/Jusin154_Team3D/Client/Public/CallBack_NonPlayable_HitReport.h new file mode 100644 index 000000000..dcb1be3bd --- /dev/null +++ b/Jusin154_Team3D/Client/Public/CallBack_NonPlayable_HitReport.h @@ -0,0 +1,50 @@ +#pragma once + +#include "Client_Define.h" +#include "GameObject.h" + +NS_BEGIN(Client) + +class CCallBack_NonPlayable_HitReport final : public PSX::PxUserControllerHitReport +{ + // 구현 예시 + // CCT는 RigidBody의 PxSimulationEventCallback에 안걸리고, 이 전용 콜백에서 처리되는 구조임 + // + // PxUserControllerHitReport = "무엇과 부딪혔는지 알려줌(이벤트 알림)" + // PxControllerBehaviorCallback = "부딪힌 것에 대해 어떤 행동 정책을 쓸지 물어봄(질의)" + // PxSimulationEventCallback = "씬 전체에 대한 글로벌 콜백(일반 물리 이벤트)" +private: + CCallBack_NonPlayable_HitReport(); +public: + ~CCallBack_NonPlayable_HitReport(); + + void BeginFrame(); + +public: + // PxUserControllerHitReport을(를) 통해 상속됨 + // 충돌알림!! + // 주인이 되는 CCT가 이 물체에 대해 어떻게 반응해야 할까? + virtual void onShapeHit(const PSX::PxControllerShapeHit& hit) override; // statc, rigid 등과 부딪힌 경우 + + virtual void onControllerHit(const PSX::PxControllersHit& hit) override; // 다른 CCT와 부딪힌 경우 + + virtual void onObstacleHit(const PSX::PxControllerObstacleHit& hit) override; // 사용자 정의 장애물과 부딪힌 경우 + + void Set_CurrentSlop(); + +public: + HRESULT Initialize(CCharacter_Controller* pController); + HRESULT Finalize(); + _bool IsOnGround(); + _vector Get_GroundVector(); +private: + CCharacter_Controller* m_pController = { nullptr }; + CGameInstance* m_pGameInstance = { nullptr }; + + _float3 m_vClimbNormal = { 0.f, 1.f, 0.f }; + _float m_fBestNormal = { 0.f }; + _bool m_bGroundHit = { false }; +public: + static CCallBack_NonPlayable_HitReport* Create(); +}; +NS_END diff --git a/Jusin154_Team3D/Client/Public/NPC_Ollivander.h b/Jusin154_Team3D/Client/Public/NPC_Ollivander.h index 5c69772c2..97af286d0 100644 --- a/Jusin154_Team3D/Client/Public/NPC_Ollivander.h +++ b/Jusin154_Team3D/Client/Public/NPC_Ollivander.h @@ -19,14 +19,22 @@ class CNPC_Ollivander final : public CUnit virtual HRESULT Render() override; virtual HRESULT Render_Shadow(SHADOW eType) override; protected: - CInfoInstance* m_pInfoInstance = { nullptr }; - CCharacter_Controller* m_pCharacter_Controller = { nullptr }; + CInfoInstance* m_pInfoInstance = { nullptr }; + CCharacter_Controller* m_pCharacter_Controller = { nullptr }; + class CCallBack_NonPlayable_Behavior* m_pCallBack_Behavior = { nullptr }; + class CCallBack_NonPlayable_HitReport* m_pCallBack_HitReport = { nullptr }; + CUnit* m_pPlayerAllyUnit = { nullptr }; + + _bool m_bEntered = { false }; + _float2 m_vEnteringTimer = { 0.f, 1.f }; + _float m_fEncounterDistance = { 10.f }; protected: virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; HRESULT Ready_Components(void* pArg); HRESULT Bind_ShaderResources() override; + _bool CastToPlayer(); public: static CNPC_Ollivander* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);