diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index c55466116..5498ce62c 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -3772,7 +3772,7 @@ HRESULT CLoader::Loading_For_Field() /* For.Prototype_Component_DecalBox */ if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_DecalBox"), - CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Effect/Decal/DecalBox.fbx", XMMatrixIdentity())))) + CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Effect/Decal/DecalBox.bin", XMMatrixIdentity())))) return E_FAIL; m_strMessage = TEXT("텍스쳐를(을) 로딩 중 입니다."); diff --git a/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp b/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp index 371a2eaf0..9c2155651 100644 --- a/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp +++ b/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp @@ -207,8 +207,10 @@ void CMapElement_Interactable::OnCollision(CGameObject* pOther, void* pDesc) m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(0.f, -999.f, 0.f, 1.f)); m_pInfoInstance->Deregist_ActiveInteractive(this); } - else + else{ + m_pInfoInstance->Deregist_ActiveInteractive(this); Set_Dead(); + } } HRESULT CMapElement_Interactable::Ready_Components(void* pArg) @@ -492,11 +494,12 @@ void CMapElement_Interactable::Free() SAFE_RELEASE(m_pShaderCom); SAFE_RELEASE(m_pEffectPool); - if (nullptr != m_pInfoInstance) { - CInfoInstance* pInfo = m_pInfoInstance; - m_pInfoInstance = nullptr; - pInfo->Deregist_ActiveInteractive(this); + if (!m_isPooled) { + if (nullptr != m_pInfoInstance) { + m_pInfoInstance = nullptr; + } } + for (auto& pModel : m_pModelComs){ SAFE_RELEASE(pModel); } diff --git a/Jusin154_Team3D/Client/Private/Player_States.cpp b/Jusin154_Team3D/Client/Private/Player_States.cpp index 604900d21..5b2b472ab 100644 --- a/Jusin154_Team3D/Client/Private/Player_States.cpp +++ b/Jusin154_Team3D/Client/Private/Player_States.cpp @@ -1068,6 +1068,7 @@ void CPlayer::Behavior_CombatEnter() m_pFSM->Enable_State(FSMSTATE::ANCIENT_THROW); pairAnimInfo = m_Animation[STATEANIM::ANCIENT_THROW]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + SAFE_RELEASE(m_pGrapInteractive); m_pGrapInteractive = m_LockOnInfo.pInteractive; SAFE_ADDREF(m_pGrapInteractive); m_pGrapInteractive->Set_KinematicFlag(true); @@ -1123,6 +1124,7 @@ HRESULT CPlayer::Behavior_CombatExitCheck() if (nullptr != m_LockOnInfo.pInteractive) { m_pFSM->Enable_State(FSMSTATE::ANCIENT_THROW); pairAnimInfo = m_Animation[STATEANIM::ANCIENT_THROW]; + SAFE_RELEASE(m_pGrapInteractive); m_pGrapInteractive = m_LockOnInfo.pInteractive; SAFE_ADDREF(m_pGrapInteractive); m_pGrapInteractive->Set_KinematicFlag(true); diff --git a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp index 605dd3997..abd974a8d 100644 --- a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp @@ -527,6 +527,7 @@ PSX::PxHeightField* CPhysX_Manager::Find_HeightField(const _tchar* pFieldName, _ void CPhysX_Manager::Update_Kinematic() { + list ReleasedList = {}; for (_uint iLevel = 0; iLevel < m_iMaxLevel; ++iLevel) { for (auto& pBody : m_pActiveBodys[iLevel]) { PSX::PxRigidDynamic* pActor = pBody->is(); @@ -536,6 +537,10 @@ void CPhysX_Manager::Update_Kinematic() if (pActor->getRigidBodyFlags() & PSX::PxRigidBodyFlag::eKINEMATIC) { + if (nullptr == pBody->userData) { + ReleasedList.emplace_back(pBody); + continue; + } PHYSX_USERDATA* pUserData = (PHYSX_USERDATA*)pBody->userData; if (false == pUserData->bAutoOwnerTranslation) { continue; @@ -546,6 +551,10 @@ void CPhysX_Manager::Update_Kinematic() } } } + for (list::iterator ReleasedActor = ReleasedList.begin(); ReleasedActor != ReleasedList.end();) { + Detach_Actor(*(*ReleasedActor), m_pGameInstance->Get_CurrentLevelID()); + ReleasedActor = ReleasedList.erase(ReleasedActor); + } } void CPhysX_Manager::Update(_float fTimeDelta) @@ -573,6 +582,7 @@ void CPhysX_Manager::Update(_float fTimeDelta) } void CPhysX_Manager::Update_Dynamic_ActiveActors() { + list ReleasedList = {}; PSX::PxU32 iNumActiveActor = {}; PSX::PxActor** ppActiveActors = m_pScene->getActiveActors(iNumActiveActor); @@ -581,6 +591,7 @@ void CPhysX_Manager::Update_Dynamic_ActiveActors() PSX::PxRigidDynamic* pActorDynamic = ppActiveActors[i]->is(); if (nullptr != pActorDynamic) { if (nullptr == ppActiveActors[i]->userData) { + ReleasedList.emplace_back(ppActiveActors[i]); continue; } if (false == pUserData->bAutoOwnerTranslation) { @@ -596,6 +607,10 @@ void CPhysX_Manager::Update_Dynamic_ActiveActors() pTransform->Set_WorldMatrix(WorldMatrix); } } + for (list::iterator ReleasedActor = ReleasedList.begin(); ReleasedActor != ReleasedList.end();) { + Detach_Actor(*(*ReleasedActor), m_pGameInstance->Get_CurrentLevelID()); + ReleasedActor = ReleasedList.erase(ReleasedActor); + } } void CPhysX_Manager::FixCapsuleShapeAxisToY(PSX::PxShape* pShape) diff --git a/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic.cpp b/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic.cpp index 530b24ca6..82e25252e 100644 --- a/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic.cpp +++ b/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic.cpp @@ -475,10 +475,11 @@ CComponent* CRigidBody_Dynamic::Clone(void* pArg, CGameObject* pOwner) void CRigidBody_Dynamic::Free() { - __super::Free(); if (nullptr != m_pRigidBody) { + m_pRigidBody->userData = nullptr; m_pRigidBody = nullptr; } + __super::Free(); } #ifdef _DEBUG