From b97981644994a9a8ca356089014d83f4aece36c4 Mon Sep 17 00:00:00 2001 From: Chanbin Kim <127280695+JinhoBa@users.noreply.github.com> Date: Thu, 15 Jan 2026 00:03:06 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20RenderObject=20RigidBody=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=20=EC=9C=A0=EB=AC=B4=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jusin154_Team3D/Client/Private/MapInfo.cpp | 12 +++++++++--- Jusin154_Team3D/Client/Private/MapObject_Render.cpp | 9 ++++++--- Jusin154_Team3D/Client/Public/MapInfo.h | 2 +- Jusin154_Team3D/Client/Public/MapObject_Render.h | 1 + Jusin154_Team3D/Client/Public/MapPartObject.h | 1 + .../Data/Map/Hogsmeade_MapContainer_Data.xml | 2 +- 6 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Jusin154_Team3D/Client/Private/MapInfo.cpp b/Jusin154_Team3D/Client/Private/MapInfo.cpp index 074e2c48a..c2d973f48 100644 --- a/Jusin154_Team3D/Client/Private/MapInfo.cpp +++ b/Jusin154_Team3D/Client/Private/MapInfo.cpp @@ -92,6 +92,7 @@ HRESULT CMapInfo::Load_MapObjects(const _char* pFileName, const _wchar* pLayerTa /* Container */ for (auto* Container = root->FirstChildElement("Container"); Container; Container = Container->NextSiblingElement("Container")) { + _bool hasCollisionMesh = false; const _char* pName = {}; _uint iMapContainerType = {}; Container->QueryUnsignedAttribute("MapContainerType", &iMapContainerType); @@ -108,11 +109,16 @@ HRESULT CMapInfo::Load_MapObjects(const _char* pFileName, const _wchar* pLayerTa { Load_StreetContainer(Container, &pContainerObject, pLayerTag); } + else if (2 == iMapContainerType) + { + hasCollisionMesh = true; + Load_BuildingContainer(Container, &pContainerObject, pLayerTag); + } else { return E_FAIL; } - if (FAILED(Load_MapRenderObjects(Container, pContainerObject, pLayerTag))){ + if (FAILED(Load_MapRenderObjects(Container, pContainerObject, pLayerTag, hasCollisionMesh))){ return E_FAIL; } @@ -172,7 +178,7 @@ HRESULT CMapInfo::Load_MapObjects(const _char* pFileName, const _wchar* pLayerTa return S_OK; } -HRESULT CMapInfo::Load_MapRenderObjects(tinyxml2::XMLElement* Container, CMapContainer* pContainerObject, const _wchar* pLayerTag) +HRESULT CMapInfo::Load_MapRenderObjects(tinyxml2::XMLElement* Container, CMapContainer* pContainerObject, const _wchar* pLayerTag, _bool hasCollisionMesh) { #pragma region ADD_PARTOBJECT for (auto* PartObject = Container->FirstChildElement("PartObject"); PartObject; PartObject = PartObject->NextSiblingElement("PartObject")) @@ -192,7 +198,7 @@ HRESULT CMapInfo::Load_MapRenderObjects(tinyxml2::XMLElement* Container, CMapCon Desc.ModelPrototypeTags.push_back(CMyTools::ToWstring(strTag)); } - + Desc.hasCollisionMesh = hasCollisionMesh; Desc.iMaxLodLevel = iLodLevel; Desc.pParentTransform = pContainerObject->Get_Component(); const string strKey = CMyTools::ToString(Desc.ModelPrototypeTags.front()) + to_string(iKeyIndex); diff --git a/Jusin154_Team3D/Client/Private/MapObject_Render.cpp b/Jusin154_Team3D/Client/Private/MapObject_Render.cpp index 985e44d08..603fb26af 100644 --- a/Jusin154_Team3D/Client/Private/MapObject_Render.cpp +++ b/Jusin154_Team3D/Client/Private/MapObject_Render.cpp @@ -30,7 +30,7 @@ HRESULT CMapObject_Render::Initialize(void* pArg) //m_Type = static_cast(pDesc->iRenderType); m_iMaxLodLevel = pDesc->iMaxLodLevel; - + m_hasCollisionMesh = pDesc->hasCollisionMesh; for (_uint i = 0; i < m_iMaxLodLevel + 1; i++) { m_ModelPrototypeTags.push_back(pDesc->ModelPrototypeTags[i]); @@ -60,8 +60,11 @@ HRESULT CMapObject_Render::Initialize(void* pArg) _matrix ColliderMatrix = XMMatrixTranslation(vOffset.x, vOffset.y, vOffset.z) * XMLoadFloat4x4(&m_CombinedWorldMatrix); XMStoreFloat4(&m_vExtentPosition, ColliderMatrix.r[3]); - ReadyForPhysX(); - ConvertToPhysX(); + if(false == m_hasCollisionMesh) + { + ReadyForPhysX(); + ConvertToPhysX(); + } return S_OK; } diff --git a/Jusin154_Team3D/Client/Public/MapInfo.h b/Jusin154_Team3D/Client/Public/MapInfo.h index a349b95f9..42ffc523b 100644 --- a/Jusin154_Team3D/Client/Public/MapInfo.h +++ b/Jusin154_Team3D/Client/Public/MapInfo.h @@ -20,7 +20,7 @@ class CMapInfo final : public CBase public: HRESULT Load_MapObjects(const _char* pFilePath, const _wchar* pLayerTag); - HRESULT Load_MapRenderObjects(tinyxml2::XMLElement* Container, class CMapContainer* pContainerObject, const _wchar* pLayerTag); + HRESULT Load_MapRenderObjects(tinyxml2::XMLElement* Container, class CMapContainer* pContainerObject, const _wchar* pLayerTag, _bool hasCollisionMesh); HRESULT Load_LightElements(const _char* pFileName, const _wchar* pLayerTag); HRESULT Load_InteractableElements(const _char* pFileName, const _wchar* pLayerTag); diff --git a/Jusin154_Team3D/Client/Public/MapObject_Render.h b/Jusin154_Team3D/Client/Public/MapObject_Render.h index 35f91ed18..b02e6687b 100644 --- a/Jusin154_Team3D/Client/Public/MapObject_Render.h +++ b/Jusin154_Team3D/Client/Public/MapObject_Render.h @@ -32,6 +32,7 @@ class CMapObject_Render final : public CMapPartObject // Render PartObject HRESULT Add_LodModel(const _tchar* pModelPrototypeTag); private: + _bool m_hasCollisionMesh = {}; _bool m_bReadyToCreatePhysX = { false }; _bool m_bConverted = { false }; diff --git a/Jusin154_Team3D/Client/Public/MapPartObject.h b/Jusin154_Team3D/Client/Public/MapPartObject.h index 6cd557d1e..a0398fdd3 100644 --- a/Jusin154_Team3D/Client/Public/MapPartObject.h +++ b/Jusin154_Team3D/Client/Public/MapPartObject.h @@ -14,6 +14,7 @@ class CMapPartObject abstract : public CPartObject { public: typedef struct tagMapObject_Desc { + _bool hasCollisionMesh{}; _uint iRenderType{}; CTransform* pParentTransform = { nullptr }; _float3 vScale; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Hogsmeade_MapContainer_Data.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Hogsmeade_MapContainer_Data.xml index ab0062bf0..823eec3eb 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Hogsmeade_MapContainer_Data.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Hogsmeade_MapContainer_Data.xml @@ -2683,7 +2683,7 @@ - +