diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index 107c74e21..c56951785 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -339,8 +339,8 @@ HRESULT CLevel_GamePlay::Ready_Background() isReady_Hogwart = false; #endif // #ifdef 기무리 - isReady_Background = false; - isReady_Hogsmeade = false; + isReady_Background = true; + isReady_Hogsmeade = true; isReady_Hogwart = false; #endif // #ifdef 나 diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index f0ff3d5e3..3897b397e 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -403,10 +403,10 @@ HRESULT CLoader::Loading_For_GamePlay() isLoad_UI_SEQUANTIAL = false; #endif // #ifdef 기무리 - isLoad_Background = false; + isLoad_Background = true; isLoad_Hogwart = false; isLoad_UI_SEQUANTIAL = false; - isLoad_NPC = false; + isLoad_NPC = true; isLoad_Monster = true; #endif // #ifdef 나 diff --git a/Jusin154_Team3D/Client/Private/NPC_EleazarFig.cpp b/Jusin154_Team3D/Client/Private/NPC_EleazarFig.cpp index a07507f8c..2f3c247e5 100644 --- a/Jusin154_Team3D/Client/Private/NPC_EleazarFig.cpp +++ b/Jusin154_Team3D/Client/Private/NPC_EleazarFig.cpp @@ -36,12 +36,17 @@ void CNPC_EleazarFig::Update(_float fTimeDelta) #ifdef _DEBUG Describe_Entity(); #endif // _DEBUG + { // 세트 + m_pCallBack_HitReport->BeginFrame(); + m_pCharacter_Controller->Move(fTimeDelta); + m_pCallBack_HitReport->Set_CurrentSlop(); + } } void CNPC_EleazarFig::Late_Update(_float fTimeDelta) { + m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_FootPosition()); m_pRigidBody->Set_Position(m_pTransformCom->Get_State(STATE::POSITION), true); - m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); Set_Shadow(m_pGameInstance->IsIn_ShadowViewFrustum(m_pTransformCom->Get_State(STATE::POSITION), m_pTransformCom->Get_Radius())); @@ -177,9 +182,13 @@ HRESULT CNPC_EleazarFig::Initialize(void* pArg) _vector vPos = XMLoadFloat4(&pDesc->vPos); m_pTransformCom->Set_State(STATE::POSITION, vPos); + m_pCharacter_Controller->Set_Position(vPos); m_pTransformCom->Rotation(XMLoadFloat4(&pDesc->vRotQ)); m_pModelCom->Set_AnimationIndex(0, true); + m_pCallBack_Behavior->Initialize(m_pCharacter_Controller); + m_pCallBack_HitReport->Initialize(m_pCharacter_Controller); + m_bNpc = true; return S_OK; } @@ -204,6 +213,27 @@ HRESULT CNPC_EleazarFig::Ready_Components(void* pArg) reinterpret_cast(&m_pModelCom)))) { 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.2f; + Desc.fHeight = 0.3f; + 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))) { + return E_FAIL; + } + m_pCharacter_Controller->SetGravity(true); + } { // DO CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; Desc.iSubKind = ENUM_CLASS(PXOBJECT::ELEAZARFIG); @@ -244,11 +274,20 @@ void CNPC_EleazarFig::Free() { __super::Free(); + SAFE_RELEASE(m_pCharacter_Controller); SAFE_RELEASE(m_pRigidBody); if (nullptr != m_pInfoInstance) { 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/NPC_Ollivander.cpp b/Jusin154_Team3D/Client/Private/NPC_Ollivander.cpp index 5454e0b4f..e9088015e 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" #include "NPCInteraction.h" CNPC_Ollivander::CNPC_Ollivander(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -35,13 +37,20 @@ void CNPC_Ollivander::Update(_float fTimeDelta) #ifdef _DEBUG Describe_Entity(); #endif // _DEBUG + { // 세트 + m_pCallBack_HitReport->BeginFrame(); + m_pCharacter_Controller->Move(fTimeDelta); + m_pCallBack_HitReport->Set_CurrentSlop(); + } // m_pNPCInteraction->Set_Visible(0 < m_iEntered); - m_pRigidBody->Set_Position(m_pTransformCom->Get_State(STATE::POSITION), true); } void CNPC_Ollivander::Late_Update(_float fTimeDelta) { + m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_FootPosition()); + m_pRigidBody->Set_Position(m_pTransformCom->Get_State(STATE::POSITION), true); + m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); Set_Shadow(m_pGameInstance->IsIn_ShadowViewFrustum(m_pTransformCom->Get_State(STATE::POSITION), m_pTransformCom->Get_Radius())); @@ -184,10 +193,12 @@ HRESULT CNPC_Ollivander::Initialize(void* pArg) _vector vPos = XMLoadFloat4(&pDesc->vPos); m_pTransformCom->Set_State(STATE::POSITION, vPos); + m_pCharacter_Controller->Set_Position(vPos); m_pTransformCom->Rotation(XMLoadFloat4(&pDesc->vRotQ)); m_pModelCom->Set_AnimationIndex(0, true); - + m_pCallBack_Behavior->Initialize(m_pCharacter_Controller); + m_pCallBack_HitReport->Initialize(m_pCharacter_Controller); m_bNpc = true; return S_OK; } @@ -214,6 +225,27 @@ 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.2f; + Desc.fHeight = 0.3f; + 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))) { + return E_FAIL; + } + m_pCharacter_Controller->SetGravity(true); + } { // DO CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; Desc.iSubKind = ENUM_CLASS(PXOBJECT::OLLIVANDER); @@ -265,12 +297,21 @@ void CNPC_Ollivander::Free() { __super::Free(); + SAFE_RELEASE(m_pCharacter_Controller); SAFE_RELEASE(m_pNpcStat); SAFE_RELEASE(m_pRigidBody); if (nullptr != m_pInfoInstance) { 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/RandomNpc.cpp b/Jusin154_Team3D/Client/Private/RandomNpc.cpp index 4cebaa53a..ebcfb5905 100644 --- a/Jusin154_Team3D/Client/Private/RandomNpc.cpp +++ b/Jusin154_Team3D/Client/Private/RandomNpc.cpp @@ -5,6 +5,8 @@ #include "InfoInstance.h" #include "Player.h" #include "NPCInteraction.h" +#include "CallBack_NonPlayable_Behavior.h" +#include "CallBack_NonPlayable_HitReport.h" CRandomNpc::CRandomNpc(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CUnit(pDevice, pContext) @@ -37,9 +39,12 @@ HRESULT CRandomNpc::Initialize(void* pArg) _vector vPos = XMLoadFloat4(&pDesc->vPos); m_pTransformCom->Set_State(STATE::POSITION, vPos); + m_pCharacter_Controller->Set_Position(vPos); m_pTransformCom->Rotation(XMLoadFloat4(&pDesc->vRotQ)); m_pModelCom->Set_AnimationIndex(0, true); + m_pCallBack_Behavior->Initialize(m_pCharacter_Controller); + m_pCallBack_HitReport->Initialize(m_pCharacter_Controller); m_bNpc = true; return S_OK; } @@ -62,13 +67,19 @@ void CRandomNpc::Update(_float fTimeDelta) #ifdef _DEBUG Describe_Entity(); #endif // _DEBUG + { // 세트 + m_pCallBack_HitReport->BeginFrame(); + m_pCharacter_Controller->Move(fTimeDelta); + m_pCallBack_HitReport->Set_CurrentSlop(); + } /*m_pNPCInteraction->Set_Visible(0 < m_iEntered);*/ - m_pRigidBody->Set_Position(m_pTransformCom->Get_State(STATE::POSITION), true); } void CRandomNpc::Late_Update(_float fTimeDelta) { + m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_FootPosition()); + m_pRigidBody->Set_Position(m_pTransformCom->Get_State(STATE::POSITION), true); m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); Set_Shadow(m_pGameInstance->IsIn_ShadowViewFrustum(m_pTransformCom->Get_State(STATE::POSITION), m_pTransformCom->Get_Radius())); @@ -262,7 +273,27 @@ HRESULT CRandomNpc::Ready_Components(void* pArg) reinterpret_cast(&m_pShaderCom)))) { 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.2f; + Desc.fHeight = 0.3f; + 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))) { + return E_FAIL; + } + m_pCharacter_Controller->SetGravity(true); + } { // DO CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; Desc.iSubKind = ENUM_CLASS(PXOBJECT::OLLIVANDER); @@ -309,12 +340,21 @@ void CRandomNpc::Free() { __super::Free(); + SAFE_RELEASE(m_pCharacter_Controller); SAFE_RELEASE(m_pNpcStat); SAFE_RELEASE(m_pRigidBody); if (nullptr != m_pInfoInstance) { 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/Public/NPC_EleazarFig.h b/Jusin154_Team3D/Client/Public/NPC_EleazarFig.h index 037482767..2b89e6499 100644 --- a/Jusin154_Team3D/Client/Public/NPC_EleazarFig.h +++ b/Jusin154_Team3D/Client/Public/NPC_EleazarFig.h @@ -26,7 +26,10 @@ class CNPC_EleazarFig final : public CUnit virtual void OnRayCollision(CGameObject* pCaster, _uint iCastedOrder, _float fDistance, _float3 vCastedWorldPos)override; protected: CInfoInstance* m_pInfoInstance = { nullptr }; + CCharacter_Controller* m_pCharacter_Controller = { nullptr }; CRigidBody_Dynamic* m_pRigidBody = { nullptr }; + class CCallBack_NonPlayable_Behavior* m_pCallBack_Behavior = { nullptr }; + class CCallBack_NonPlayable_HitReport* m_pCallBack_HitReport = { nullptr }; CUnit* m_pPlayerAllyUnit = { nullptr }; diff --git a/Jusin154_Team3D/Client/Public/NPC_Ollivander.h b/Jusin154_Team3D/Client/Public/NPC_Ollivander.h index ae5211035..55db63f8b 100644 --- a/Jusin154_Team3D/Client/Public/NPC_Ollivander.h +++ b/Jusin154_Team3D/Client/Public/NPC_Ollivander.h @@ -29,7 +29,10 @@ class CNPC_Ollivander final : public CUnit protected: CInfoInstance* m_pInfoInstance = { nullptr }; + CCharacter_Controller* m_pCharacter_Controller = { nullptr }; CRigidBody_Dynamic* m_pRigidBody = { nullptr }; + class CCallBack_NonPlayable_Behavior* m_pCallBack_Behavior = { nullptr }; + class CCallBack_NonPlayable_HitReport* m_pCallBack_HitReport = { nullptr }; CUnit* m_pPlayerAllyUnit = { nullptr }; CNPC_Ollivander* m_pNPC_Ollivander = { nullptr }; diff --git a/Jusin154_Team3D/Client/Public/RandomNpc.h b/Jusin154_Team3D/Client/Public/RandomNpc.h index 8c1a9003a..338fdf82c 100644 --- a/Jusin154_Team3D/Client/Public/RandomNpc.h +++ b/Jusin154_Team3D/Client/Public/RandomNpc.h @@ -2,7 +2,6 @@ #include "Client_Define.h" #include "Unit.h" -#include "NPC_Ollivander.h" NS_BEGIN(Client) @@ -30,7 +29,10 @@ class CRandomNpc final : public CUnit virtual _wstring Get_Name() override; protected: CInfoInstance* m_pInfoInstance = { nullptr }; + CCharacter_Controller* m_pCharacter_Controller = { nullptr }; CRigidBody_Dynamic* m_pRigidBody = { nullptr }; + class CCallBack_NonPlayable_Behavior* m_pCallBack_Behavior = { nullptr }; + class CCallBack_NonPlayable_HitReport* m_pCallBack_HitReport = { nullptr }; CUnit* m_pPlayerAllyUnit = { nullptr }; CRandomNpc* m_pNPC_Ollivander = { nullptr }; diff --git a/Jusin154_Team3D/Engine/Public/CallBack_QueryFilterCallback.h b/Jusin154_Team3D/Engine/Public/CallBack_QueryFilterCallback.h index 520078614..d0cbce828 100644 --- a/Jusin154_Team3D/Engine/Public/CallBack_QueryFilterCallback.h +++ b/Jusin154_Team3D/Engine/Public/CallBack_QueryFilterCallback.h @@ -30,6 +30,11 @@ class CPhysX_CctQueryFilterCallback final : public PSX::PxQueryFilterCallback case PXOBJECT::JOINT_ANCHOR: return PSX::PxQueryHitType::eNONE; break; + case PXOBJECT::NPC: + case PXOBJECT::OLLIVANDER: + case PXOBJECT::ELEAZARFIG: + return PSX::PxQueryHitType::eNONE; + break; default: break; }