[fix] RenderObject RigidBody 사용 유무 분리

This commit is contained in:
Chanbin Kim
2026-01-15 00:03:06 +09:00
parent 4930cc361f
commit b979816449
6 changed files with 19 additions and 8 deletions
+9 -3
View File
@@ -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<CTransform>();
const string strKey = CMyTools::ToString(Desc.ModelPrototypeTags.front()) + to_string(iKeyIndex);
@@ -30,7 +30,7 @@ HRESULT CMapObject_Render::Initialize(void* pArg)
//m_Type = static_cast<MAPOBJECT_RENDER_TYPE>(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;
}
+1 -1
View File
@@ -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);
@@ -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 };
@@ -14,6 +14,7 @@ class CMapPartObject abstract : public CPartObject
{
public:
typedef struct tagMapObject_Desc {
_bool hasCollisionMesh{};
_uint iRenderType{};
CTransform* pParentTransform = { nullptr };
_float3 vScale;
@@ -2683,7 +2683,7 @@
<Position x="115.97964" y="15.399979" z="127.5776"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
<MapContainerType type="0"/>
<MapContainerType type="2"/>
<BoundingBox_Min x="-5.1330199" y="-0.31850505" z="-3.73068"/>
<BoundingBox_Max x="3.1891599" y="12.063789" z="5.5602298"/>
<PartObject Lod_Level="3" Key_Index="0">