From cf8cc51908bb95d54d7bbeab58ca08cfad24c259 Mon Sep 17 00:00:00 2001 From: kimnuri Date: Wed, 14 Jan 2026 16:28:00 +0900 Subject: [PATCH 1/4] [add] TrollSlamScnene --- .../Client/Private/Camera_Cinematic.cpp | 1 + Jusin154_Team3D/Client/Private/Player.cpp | 3 + Jusin154_Team3D/Client/Private/Troll.cpp | 19 + .../Data/CutScene/TrollIntroCutScene.xml | 541 +++++++++++++++++- 4 files changed, 553 insertions(+), 11 deletions(-) diff --git a/Jusin154_Team3D/Client/Private/Camera_Cinematic.cpp b/Jusin154_Team3D/Client/Private/Camera_Cinematic.cpp index 94175f264..c42135acc 100644 --- a/Jusin154_Team3D/Client/Private/Camera_Cinematic.cpp +++ b/Jusin154_Team3D/Client/Private/Camera_Cinematic.cpp @@ -150,6 +150,7 @@ void CCamera_Cinematic::Trigger(CTimeSocket& Socket) m_pTransformCom->Set_WorldMatrix(pContents->pxTransform); m_pFollowTargetPart->Set_WorldPostion(m_pTransformCom->Get_State(STATE::POSITION)); m_pLookTargetPart->Set_WorldPostion(m_pTransformCom->Get_State(STATE::POSITION) + m_pTransformCom->Get_State(STATE::LOOK)); + Clear_Lerp_Rotation(); Clear_Lerp_Translation(); } break; case TIMESOCKET_FUNC::TRANSLATION: diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index 9f7f4cc4b..a68024007 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -575,6 +575,9 @@ void CPlayer::Trigger(CTimeSocket& Socket) m_pModelCom->Set_AnimationIndex(m_Animation[STATEANIM::SPAWN].first, m_Animation[STATEANIM::SPAWN].second); } } + else if (pContents->vFlags.b[2]) { + m_pFSM->Change_State(FSMSTATE::DODGE); + } } break; case TIMESOCKET_FUNC::BIND_SOCKET_MATRIX: { diff --git a/Jusin154_Team3D/Client/Private/Troll.cpp b/Jusin154_Team3D/Client/Private/Troll.cpp index d45b069d0..c3fde33c8 100644 --- a/Jusin154_Team3D/Client/Private/Troll.cpp +++ b/Jusin154_Team3D/Client/Private/Troll.cpp @@ -454,6 +454,10 @@ void CTroll::Trigger(CTimeSocket& Socket) { if (pContents->vFlags.b[0]){ m_pFSM->Change_State(FSMSTATE::RUSH); + } else if (pContents->vFlags.b[1]) { + m_pFSM->Change_State(FSMSTATE::SLAM); + }else if (pContents->vFlags.b[2]) { + m_pFSM->Change_State(FSMSTATE::IDLE); } } break; case TIMESOCKET_FUNC::SET_ANIMSTATE: @@ -461,6 +465,21 @@ void CTroll::Trigger(CTimeSocket& Socket) if (pContents->vFlags.b[0]){ auto& pairAnimation = m_Animation[STATEANIM::RUSH_LOOP]; m_pModelCom->Set_AnimationIndex(pairAnimation.first, pairAnimation.second); + } else if (pContents->vFlags.b[1]) { + auto& pairAnimation = m_Animation[STATEANIM::SLAM]; + m_pModelCom->Set_AnimationIndex(pairAnimation.first, pairAnimation.second); + } else if (pContents->vFlags.b[2]) { + auto& pairAnimation = m_Animation[STATEANIM::IDLE]; + m_pModelCom->Set_AnimationIndex(pairAnimation.first, pairAnimation.second); + } + } break; + case TIMESOCKET_FUNC::LOOK_AT: + { + if (pContents->vFlags.b[0]) { + m_pTransformCom->LookAt_Horizontal(XMVectorSetW(XMLoadFloat3((_float3*)&pContents->pxTransform.p), 1.f)); + } + else { + m_pTransformCom->LookAt_Horizontal(pContents->pOtherTarget->Get_WorldPostion()); } } break; case TIMESOCKET_FUNC::END_CINEMATIC: diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/CutScene/TrollIntroCutScene.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/CutScene/TrollIntroCutScene.xml index acc7e4ff4..4b27f5fda 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/CutScene/TrollIntroCutScene.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/CutScene/TrollIntroCutScene.xml @@ -298,6 +298,117 @@ + + + + + + + + + + + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + + + + + + + + + + + + + + + + + + + + + + false + false + true + false + false + false + false + false + false + false + false + false + false + false + false + false + + + + + + + + + + + + + + + + + + + + + + false + false + true + false + false + false + false + false + false + false + false + false + false + false + false + false + + + + + + + + + + + @@ -935,7 +1046,7 @@ - + @@ -1053,7 +1164,7 @@ - + @@ -1159,10 +1270,8 @@ - - - - + + @@ -1199,13 +1308,13 @@ - - + + - - + + @@ -1236,7 +1345,417 @@ - + + + + + + + + + + + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + + + + + + + + + + + + + + + + + + + + + + + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + + + + + + + + + + + + + + + + + + + + + + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + + + + + + + + + + + + + + + + + + + + + + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + + + + + + + + + + + + + + + + + + + + + + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + + + + + + + + + + + + + + + + + + + + + + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + + + + + + + + + + + + + + + + + + + + + + false + true + false + false + false + false + false + false + false + false + false + false + false + false + false + false + + + + + + + + + + + + + + + + + + + + + + false + true + false + false + false + false + false + false + false + false + false + false + false + false + false + false + + + + + + + + + + + + + + + + + + + + + + + + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + + + + + + + + + + + + + + + + + + + + + + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + + + + + + + + + + + + + + + + + + + + + + false + false + true + false + false + false + false + false + false + false + false + false + false + false + false + false + + + + + + + + + + + + From 414998c08451c9490802f32525ab7dc3f1fffb4b Mon Sep 17 00:00:00 2001 From: kimnuri Date: Wed, 14 Jan 2026 17:10:38 +0900 Subject: [PATCH 2/4] [add] SceneSkip --- .../Client/Private/Camera_Debug.cpp | 19 ++++++++++--------- .../Client/Private/CutSceneInfo.cpp | 14 ++++++++++++++ .../Client/Private/MapElement_Cave.cpp | 2 +- .../Client/Private/NPCInteraction.cpp | 1 - Jusin154_Team3D/Client/Public/CutSceneInfo.h | 3 ++- 5 files changed, 27 insertions(+), 12 deletions(-) diff --git a/Jusin154_Team3D/Client/Private/Camera_Debug.cpp b/Jusin154_Team3D/Client/Private/Camera_Debug.cpp index e5404bec9..d4929b680 100644 --- a/Jusin154_Team3D/Client/Private/Camera_Debug.cpp +++ b/Jusin154_Team3D/Client/Private/Camera_Debug.cpp @@ -24,7 +24,8 @@ void CCamera_Debug::Priority_Update(_float fTimeDelta) if (FAILED(m_pGameInstance->IsBinded_Camera(CAMERA_DEBUG))) { return; } - Transition(fTimeDelta); + const _float fFixedDebugTimeDelta = 1.f / 60.f; + Transition(fFixedDebugTimeDelta); _float3 vCamPos = {}; _float3 vSetPos = {}; XMStoreFloat3(&vCamPos, m_pTransformCom->Get_State(STATE::POSITION)); @@ -39,22 +40,22 @@ void CCamera_Debug::Priority_Update(_float fTimeDelta) #pragma region Position _float fSpeed = 5.f; if (m_pGameInstance->Key_Pressing(DIK_W)) { - m_pTransformCom->Go_Straight(fTimeDelta * fSpeed); + m_pTransformCom->Go_Straight(fFixedDebugTimeDelta * fSpeed); } if (m_pGameInstance->Key_Pressing(DIK_A)) { - m_pTransformCom->Go_Left(fTimeDelta * fSpeed); + m_pTransformCom->Go_Left(fFixedDebugTimeDelta * fSpeed); } if (m_pGameInstance->Key_Pressing(DIK_S)) { - m_pTransformCom->Go_Backward(fTimeDelta * fSpeed); + m_pTransformCom->Go_Backward(fFixedDebugTimeDelta * fSpeed); } if (m_pGameInstance->Key_Pressing(DIK_D)) { - m_pTransformCom->Go_Right(fTimeDelta * fSpeed); + m_pTransformCom->Go_Right(fFixedDebugTimeDelta * fSpeed); } if (m_pGameInstance->Key_Pressing(DIK_SPACE)) { - m_pTransformCom->Go_Up(fTimeDelta * fSpeed); + m_pTransformCom->Go_Up(fFixedDebugTimeDelta * fSpeed); } if (m_pGameInstance->Key_Pressing(DIK_C)) { - m_pTransformCom->Go_Down(fTimeDelta * fSpeed); + m_pTransformCom->Go_Down(fFixedDebugTimeDelta * fSpeed); } if (m_pGameInstance->Key_Pressing(DIK_TAB)) { Set_InitialPos(); @@ -81,8 +82,8 @@ void CCamera_Debug::Priority_Update(_float fTimeDelta) #pragma region Angle _float3 fMove = m_pGameInstance->Get_MouseMove(); - m_pTransformCom->Turn(XMVectorSet(0.f, 1.f, 0.f, 0.f), fTimeDelta * fMove.x * m_fMouseSensor); - m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::RIGHT), fTimeDelta * fMove.y * m_fMouseSensor); + m_pTransformCom->Turn(XMVectorSet(0.f, 1.f, 0.f, 0.f), fFixedDebugTimeDelta * fMove.x * m_fMouseSensor); + m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::RIGHT), fFixedDebugTimeDelta * fMove.y * m_fMouseSensor); #pragma endregion diff --git a/Jusin154_Team3D/Client/Private/CutSceneInfo.cpp b/Jusin154_Team3D/Client/Private/CutSceneInfo.cpp index ef6fed292..3cbce44e0 100644 --- a/Jusin154_Team3D/Client/Private/CutSceneInfo.cpp +++ b/Jusin154_Team3D/Client/Private/CutSceneInfo.cpp @@ -17,6 +17,9 @@ CCutSceneInfo::CCutSceneInfo() } void CCutSceneInfo::Update(_float fTimeDelta) { + if (m_pGameInstance->Key_Pressing(DIK_LCONTROL) && m_pGameInstance->Key_Pressing(DIK_RCONTROL) && m_pGameInstance->Key_Pressing(DIK_LSHIFT)&& m_pGameInstance->Key_Pressing(DIK_RSHIFT) && m_pGameInstance->Key_Pressing(DIK_LALT) && m_pGameInstance->Key_Pressing(DIK_RALT)) { + Set_AllActiveEventsExit(); + } #ifdef _DEBUG Describe_Entity(); #endif // _DEBUG @@ -572,3 +575,14 @@ void CCutSceneInfo::Load_CutSceneXML(const string& path) pair<_string, TimeLine*> pairResult = { _string(pContentsNode->Name()), pTimeLine }; m_pInfoInstance->Load_Events(pairResult); } + +void CCutSceneInfo::Set_AllActiveEventsExit() +{ + map<_string, TimeLine*>::iterator iter = m_funcActiveEvents.begin(); + for (; iter != m_funcActiveEvents.end();++iter) { + for (list::iterator socketIter = (*iter).second->m_Sockets.begin(); + socketIter != (*iter).second->m_Sockets.end(); ++socketIter) { + (*socketIter)->Trigger(1.f - FLT_EPSILON); + } + } +} diff --git a/Jusin154_Team3D/Client/Private/MapElement_Cave.cpp b/Jusin154_Team3D/Client/Private/MapElement_Cave.cpp index cbfda2425..bffdd0152 100644 --- a/Jusin154_Team3D/Client/Private/MapElement_Cave.cpp +++ b/Jusin154_Team3D/Client/Private/MapElement_Cave.cpp @@ -162,7 +162,7 @@ HRESULT CMapElement_Cave::Ready_TriggerBox() CTriggerBox::TRIGGERBOX_DESC Desc = {}; XMStoreFloat4(&Desc.vPosition_Radius, m_pTransformCom->Get_State(STATE::POSITION)); - Desc.vPosition_Radius.w = 10.f; + Desc.vPosition_Radius.w = 3.f; m_pTriggerBox = CTriggerBox::Create(m_pDevice, m_pContext, &Desc); diff --git a/Jusin154_Team3D/Client/Private/NPCInteraction.cpp b/Jusin154_Team3D/Client/Private/NPCInteraction.cpp index 835ea50ff..e3f09a8b8 100644 --- a/Jusin154_Team3D/Client/Private/NPCInteraction.cpp +++ b/Jusin154_Team3D/Client/Private/NPCInteraction.cpp @@ -196,7 +196,6 @@ void CNPCInteraction::Priority_Update(_float fTimeDelta) m_fFontSize = 0; m_pTransformCom->Set_State(STATE::POSITION, XMLoadFloat4(&m_pBoxInfo.fPosition)); } - } void CNPCInteraction::Update(_float fTimeDelta) diff --git a/Jusin154_Team3D/Client/Public/CutSceneInfo.h b/Jusin154_Team3D/Client/Public/CutSceneInfo.h index c046f9424..24ba1473e 100644 --- a/Jusin154_Team3D/Client/Public/CutSceneInfo.h +++ b/Jusin154_Team3D/Client/Public/CutSceneInfo.h @@ -25,7 +25,7 @@ class CCutSceneInfo final : public CBase void Active_Event(_string& strKey); HRESULT DeActive_ActiveEvent(_string& strKey); void Load_Events(pair<_string, TimeLine*>& pairTimeLine); - HRESULT Clear_AllEvents(); + HRESULT Clear_AllEvents(); private: CGameInstance* m_pGameInstance = { nullptr }; class CInfoInstance* m_pInfoInstance = { nullptr }; @@ -40,6 +40,7 @@ class CCutSceneInfo final : public CBase void Update_WaitEvents(_float fTimeDelta); HRESULT Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); void Load_CutSceneXML(const string& path); + void Set_AllActiveEventsExit(); #ifdef _DEBUG public: From 5f9e5c188a64d48ad7453eaeea3f1e83f73da3ea Mon Sep 17 00:00:00 2001 From: kimnuri Date: Wed, 14 Jan 2026 17:11:41 +0900 Subject: [PATCH 3/4] [add] SceneSkip --- Jusin154_Team3D/Client/Private/CutSceneInfo.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Jusin154_Team3D/Client/Private/CutSceneInfo.cpp b/Jusin154_Team3D/Client/Private/CutSceneInfo.cpp index 3cbce44e0..1fecb9d22 100644 --- a/Jusin154_Team3D/Client/Private/CutSceneInfo.cpp +++ b/Jusin154_Team3D/Client/Private/CutSceneInfo.cpp @@ -580,6 +580,7 @@ void CCutSceneInfo::Set_AllActiveEventsExit() { map<_string, TimeLine*>::iterator iter = m_funcActiveEvents.begin(); for (; iter != m_funcActiveEvents.end();++iter) { + iter->second->m_vTimer.x = 1.f - FLT_EPSILON; for (list::iterator socketIter = (*iter).second->m_Sockets.begin(); socketIter != (*iter).second->m_Sockets.end(); ++socketIter) { (*socketIter)->Trigger(1.f - FLT_EPSILON); From 7cb89d906763cacd5ef5547c80b1fe89d1603e99 Mon Sep 17 00:00:00 2001 From: kimnuri Date: Wed, 14 Jan 2026 21:22:51 +0900 Subject: [PATCH 4/4] =?UTF-8?q?[add]=20MapProp=20=EB=B2=BD=EC=B6=A9?= =?UTF-8?q?=EB=8F=8C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Client/Private/Level_GamePlay.cpp | 8 +- Jusin154_Team3D/Client/Private/Loader.cpp | 4 +- .../Private/MapElement_Interactable.cpp | 166 +++++++----------- .../Client/Public/MapElement_Interactable.h | 1 + 4 files changed, 67 insertions(+), 112 deletions(-) diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index 88a37285b..ec76dca51 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -126,7 +126,7 @@ HRESULT CLevel_GamePlay::Initialize(void* pArg) _bool bLoadNPC = { true }; #ifdef _DEBUG #ifdef 기무리 - bLoadNPC = false; + bLoadNPC = true; #endif #endif // _DEBUG if (true == bLoadNPC) { @@ -365,7 +365,7 @@ HRESULT CLevel_GamePlay::Ready_Background() #ifdef 기무리 isReady_Background = true; isReady_Hogsmeade = true; - isReady_Hogwart = false; + isReady_Hogwart = true; #endif // #ifdef 나 isReady_Background = false; @@ -1140,8 +1140,8 @@ HRESULT CLevel_GamePlay::Ready_Layer_Npc() isLoad_NPC = false; #endif // #ifdef 기무리 - isLoad_NPC = false; - isLoad_RandomNPC = false; + isLoad_NPC = true; + isLoad_RandomNPC = true; #endif // #ifdef 나 isLoad_RandomNPC = true; diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index 84c1503c1..2b8768e0c 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -563,9 +563,9 @@ HRESULT CLoader::Loading_For_GamePlay() #endif // #ifdef 기무리 isLoad_Background = true; - isLoad_Hogwart = false; + isLoad_Hogwart = true; isLoad_UI_SEQUANTIAL = false; - isLoad_NPC = false; + isLoad_NPC = true; isLoad_Monster = true; #endif // #ifdef 나 diff --git a/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp b/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp index 96e04adb8..87d4830e3 100644 --- a/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp +++ b/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp @@ -99,7 +99,7 @@ void CMapElement_Interactable::Late_Update(_float fTimeDelta) { if (m_bVisible) { - if (m_isGraped == true) + if (m_bThrow == true) { _float fRadius = m_pModelComs[0]->Get_Radius(); @@ -344,123 +344,77 @@ ON_COLLISION_INFO CMapElement_Interactable::CollisionCheck(_fvector StartPos, _f _float fDistance = XMVectorGetX(XMVector3Length(vEndPos - vStartPos)); - PSX::PxSweepBuffer pxBuffer = {}; + PSX::PxSweepBufferN<12> pxBuffer = {}; - _bool bHit = m_pGameInstance->SphereCast(fRadius, vStartPos, vDir, fDistance, PSX::PxHitFlag::ePOSITION | PSX::PxHitFlag::eNORMAL, PSX::PxQueryFlag::eDYNAMIC, pxBuffer); - - const PSX::PxSweepHit& hit = pxBuffer.block; - PSX::PxRigidActor* pActor = hit.actor; - PSX::PxShape* pShape = hit.shape; + _bool bHit = m_pGameInstance->SphereCast(fRadius, vStartPos, vDir, fDistance, PSX::PxHitFlag::eDEFAULT, PSX::PxQueryFlag::eDYNAMIC | PSX::PxQueryFlag::eSTATIC | PSX::PxQueryFlag::eNO_BLOCK, pxBuffer); ON_COLLISION_INFO tagCollInfo = {}; - + XMStoreFloat4(&tagCollInfo.vHitDir, vDir); tagCollInfo.vWorldPos.w = 1.f; - if (bHit) { - - memcpy_s(&tagCollInfo.vWorldPos, sizeof(tagCollInfo.vWorldPos), &hit.position, sizeof(hit.position)); - - memcpy_s(&tagCollInfo.vWorldNomal, sizeof(tagCollInfo.vWorldNomal), &hit.normal, sizeof(hit.normal)); - XMStoreFloat4(&tagCollInfo.vHitDir, vDir); - tagCollInfo.fLength = fDistance; - - - if (nullptr != pActor && nullptr != pActor->userData) - { - PHYSX_USERDATA* pUserData = static_cast(pActor->userData); - tagCollInfo.pObject = pUserData->pOwner; - - switch (pUserData->eKind) - { - case PHYSX_KIND::CCTActor: - { - switch (PXOBJECT(pUserData->iSubKind)) - { - case PXOBJECT::MONSTER: + HRESULT hr = CheckHit(&pxBuffer.block, tagCollInfo); + if (FAILED(hr)) { + PSX::PxSweepHit* hits = pxBuffer.touches; + _uint iHitCount = pxBuffer.getNbTouches(); + for (_uint i = 0; i < iHitCount; ++i) { + PSX::PxSweepHit* pHit = &pxBuffer.touches[i]; + hr = CheckHit(pHit, tagCollInfo); + if (SUCCEEDED(hr)) { break; - case PXOBJECT::GOBLIN_WARRIOR: - { - pUserData->pOwner->OnCollision(this, &tagCollInfo); - m_bHit = true; } - break; - case PXOBJECT::GOBLIN_MAGICIAN: - { - pUserData->pOwner->OnCollision(this, &tagCollInfo); - m_bHit = true; - } - break; - case PXOBJECT::GOBLIN_ASSASSIN: - { - pUserData->pOwner->OnCollision(this, &tagCollInfo); - m_bHit = true; - } - break; - case PXOBJECT::TROLL: - { - pUserData->pOwner->OnCollision(this, &tagCollInfo); - m_bHit = true; - } - break; - case PXOBJECT::RANROK_BODY: - case PXOBJECT::RANROK: - { - pUserData->pOwner->OnCollision(this, &tagCollInfo); - m_bHit = true; - } - break; - } - } } } } - - if (bHit == false) - { - memcpy_s(&tagCollInfo.vWorldPos, sizeof(tagCollInfo.vWorldPos), &hit.position, sizeof(hit.position)); - memcpy_s(&tagCollInfo.vWorldNomal, sizeof(tagCollInfo.vWorldNomal), &hit.normal, sizeof(hit.normal)); - XMStoreFloat4(&tagCollInfo.vHitDir, vDir); - tagCollInfo.fLength = fDistance; - tagCollInfo.pObject = this; - - bHit = m_pGameInstance->SphereCast(fRadius, vStartPos, vDir, fDistance, PSX::PxHitFlag::ePOSITION | PSX::PxHitFlag::eNORMAL, PSX::PxQueryFlag::eSTATIC, pxBuffer); - - const PSX::PxSweepHit& hit = pxBuffer.block; - PSX::PxRigidActor* pActor = hit.actor; - PSX::PxShape* pShape = hit.shape; - - tagCollInfo.vWorldPos.w = 1.f; - - if (bHit) - { - memcpy_s(&tagCollInfo.vWorldPos, sizeof(tagCollInfo.vWorldPos), &hit.position, sizeof(hit.position)); - memcpy_s(&tagCollInfo.vWorldNomal, sizeof(tagCollInfo.vWorldNomal), &hit.normal, sizeof(hit.normal)); - XMStoreFloat4(&tagCollInfo.vHitDir, vDir); - tagCollInfo.fLength = fDistance; - - if (nullptr != pActor && nullptr != pActor->userData) - { - PHYSX_USERDATA* pUserData = static_cast(pActor->userData); - tagCollInfo.pObject = pUserData->pOwner; - - switch (PXOBJECT(pUserData->iSubKind)) - { - case PXOBJECT::TERRAIN: - { - /* TODO, 터레인 안됨 */ - m_bHit = true; - break; - } - } - - } - } - - - } - return tagCollInfo; } +HRESULT CMapElement_Interactable::CheckHit(PSX::PxSweepHit* pHit, ON_COLLISION_INFO& Info) +{ + HRESULT hr = E_FAIL; + PSX::PxActor* pActor = pHit->actor; + PSX::PxShape* pShape = pHit->shape; + PHYSX_USERDATA* pUserData = { nullptr }; + CGameObject* pTarget = { nullptr }; + if (nullptr != pActor && nullptr != pActor->userData || nullptr != pShape && nullptr != pShape->userData) { + pUserData = static_cast(pActor->userData); + if (nullptr == pUserData) { + pUserData = static_cast(pShape->userData); + } + switch (pUserData->eKind) + { + case PHYSX_KIND::BODY_STATIC: + case PHYSX_KIND::CCTActor: + { + switch (PXOBJECT(pUserData->iSubKind)) + { + case PXOBJECT::TERRAIN: + case PXOBJECT::GOBLIN_WARRIOR: + case PXOBJECT::GOBLIN_MAGICIAN: + case PXOBJECT::GOBLIN_ASSASSIN: + case PXOBJECT::TROLL: + case PXOBJECT::RANROK_BODY: + case PXOBJECT::RANROK: + { + hr = S_OK; + m_bHit = true; + } break; + default: + break; + } + } break; + default: + break; + } + } + if (SUCCEEDED(hr)) { + memcpy_s(&Info.vWorldPos, sizeof(Info.vWorldPos), &pHit->position, sizeof(pHit->position)); + memcpy_s(&Info.vWorldNomal, sizeof(Info.vWorldNomal), &pHit->normal, sizeof(pHit->normal)); + Info.fLength = pHit->distance; + Info.pObject = pUserData->pOwner; + Info.pObject->OnCollision(this, &Info); + } + return hr; +} + CMapElement_Interactable* CMapElement_Interactable::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { CMapElement_Interactable* pInstance = new CMapElement_Interactable(pDevice, pContext); diff --git a/Jusin154_Team3D/Client/Public/MapElement_Interactable.h b/Jusin154_Team3D/Client/Public/MapElement_Interactable.h index 9a8b9982f..67c48aa7f 100644 --- a/Jusin154_Team3D/Client/Public/MapElement_Interactable.h +++ b/Jusin154_Team3D/Client/Public/MapElement_Interactable.h @@ -62,6 +62,7 @@ class CMapElement_Interactable final : public CMapElement virtual HRESULT Initialize(void* pArg) override; virtual HRESULT Ready_Components(void* pArg) override; virtual HRESULT Bind_ShaderResources() override; + HRESULT CheckHit(PSX::PxSweepHit* pHit, ON_COLLISION_INFO& Info); public: static CMapElement_Interactable* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);