[fix] LOD_Static Issue

This commit is contained in:
kimnuri
2026-01-10 17:03:52 +09:00
parent dce568752e
commit 093e78400d
13 changed files with 110 additions and 111 deletions
@@ -328,6 +328,7 @@ call Update_Resources.bat
<ClInclude Include="..\Public\State_Broom_Ride_Move.h" /> <ClInclude Include="..\Public\State_Broom_Ride_Move.h" />
<ClInclude Include="..\public\MiniMap_Camera.h" /> <ClInclude Include="..\public\MiniMap_Camera.h" />
<ClInclude Include="..\Public\Goblin_Teleport.h" /> <ClInclude Include="..\Public\Goblin_Teleport.h" />
<ClInclude Include="..\Public\TriggerBox.h" />
<ClInclude Include="..\Public\Troll_State_Stun.h" /> <ClInclude Include="..\Public\Troll_State_Stun.h" />
<ClInclude Include="..\Public\State_Sustain.h" /> <ClInclude Include="..\Public\State_Sustain.h" />
<ClInclude Include="..\Public\WandEnd.h" /> <ClInclude Include="..\Public\WandEnd.h" />
@@ -634,6 +635,7 @@ call Update_Resources.bat
<ClCompile Include="..\Private\State_Tucked.cpp" /> <ClCompile Include="..\Private\State_Tucked.cpp" />
<ClCompile Include="..\Private\StunEffect.cpp" /> <ClCompile Include="..\Private\StunEffect.cpp" />
<ClCompile Include="..\Private\Goblin_Teleport.cpp" /> <ClCompile Include="..\Private\Goblin_Teleport.cpp" />
<ClCompile Include="..\Private\TriggerBox.cpp" />
<ClCompile Include="..\Private\Troll_State_Stun.cpp" /> <ClCompile Include="..\Private\Troll_State_Stun.cpp" />
<ClCompile Include="..\Private\WandEnd.cpp" /> <ClCompile Include="..\Private\WandEnd.cpp" />
<ClCompile Include="..\Private\Magic_Icon.cpp" /> <ClCompile Include="..\Private\Magic_Icon.cpp" />
@@ -913,7 +913,7 @@
</ClInclude> </ClInclude>
<ClInclude Include="..\Public\Duelist_ProtegoHit.h"> <ClInclude Include="..\Public\Duelist_ProtegoHit.h">
<Filter>02.GameObjects\Effect\MonsterEffect\Duelist_Protego\Duelist_ProtegoHit</Filter> <Filter>02.GameObjects\Effect\MonsterEffect\Duelist_Protego\Duelist_ProtegoHit</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\Public\Ranrok_Prop.h"> <ClInclude Include="..\Public\Ranrok_Prop.h">
<Filter>02.GameObjects\Effect\MonsterEffect\Ranrok\Ranrok_Prop</Filter> <Filter>02.GameObjects\Effect\MonsterEffect\Ranrok\Ranrok_Prop</Filter>
</ClInclude> </ClInclude>
@@ -923,6 +923,7 @@
<ClInclude Include="..\Public\Ranrok_ENUM.h"> <ClInclude Include="..\Public\Ranrok_ENUM.h">
<Filter>02.GameObjects\NPC\Hostile\Monster\Ranrok</Filter> <Filter>02.GameObjects\NPC\Hostile\Monster\Ranrok</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\Public\TriggerBox.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Image Include="Client.ico"> <Image Include="Client.ico">
@@ -2778,6 +2779,7 @@
<ClCompile Include="..\Private\State_Block.cpp"> <ClCompile Include="..\Private\State_Block.cpp">
<Filter>04.Mechanic\State\State_Combat\State_Block</Filter> <Filter>04.Mechanic\State\State_Combat\State_Block</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\Private\TriggerBox.cpp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\Private\Goblin_States.cpp"> <ClCompile Include="..\Private\Goblin_States.cpp">
@@ -146,22 +146,7 @@ HRESULT CCutSceneInfo::Ready_GameplayCutScenes()
HRESULT CCutSceneInfo::Ready_FieldCutScenes() HRESULT CCutSceneInfo::Ready_FieldCutScenes()
{ {
{ {
CMonster* pMonster = { nullptr }; Load_CutSceneXML("../Bin/Resources/Data/CutScene/RanrokCutScene.xml");
CCamera* pCamera = { nullptr };
{
CLayer* pLayer = m_pGameInstance->Get_Layer(NEXT_LEVEL, LAYER_MONSTER);
if (nullptr != pLayer) {
pMonster = pLayer->Get_Object<CRanrok>();
}
}
{
pCamera = m_pGameInstance->Get_Camera(NEXT_LEVEL, CAMERA_CINEMATIC);
}
if (nullptr == pMonster || nullptr == pCamera) {
return E_FAIL;
}
Load_CutSceneXML("../Bin/Resources/Data/CutScene/RanrokCutScene.xml", pCamera, pMonster);
} }
return S_OK; return S_OK;
} }
@@ -332,7 +317,7 @@ static void ReadFloat4(tinyxml2::XMLElement* param11Node, _float4& outValue)
} }
void CCutSceneInfo::Load_CutSceneXML(const string& path, CCamera* pCamera) void CCutSceneInfo::Load_CutSceneXML(const string& path)
{ {
tinyxml2::XMLDocument doc; tinyxml2::XMLDocument doc;
if (doc.LoadFile(path.c_str()) != tinyxml2::XML_SUCCESS) { if (doc.LoadFile(path.c_str()) != tinyxml2::XML_SUCCESS) {
@@ -387,7 +372,7 @@ void CCutSceneInfo::Load_CutSceneXML(const string& path, CCamera* pCamera)
{ {
if (strcmp(pTargetText, "CAMERA_CINEMATIC") == 0) if (strcmp(pTargetText, "CAMERA_CINEMATIC") == 0)
{ {
CCamera* pEventTarget = pCamera; CCamera* pEventTarget = m_pGameInstance->Get_Camera(NEXT_LEVEL, CAMERA_CINEMATIC);
SocketContents.pEventTarget = pEventTarget; SocketContents.pEventTarget = pEventTarget;
SocketContents.funcEvent = [pEventTarget](CTimeSocket& Socket) { pEventTarget->Trigger(Socket); }; SocketContents.funcEvent = [pEventTarget](CTimeSocket& Socket) { pEventTarget->Trigger(Socket); };
} }
@@ -439,7 +424,7 @@ void CCutSceneInfo::Load_CutSceneXML(const string& path, CCamera* pCamera)
} }
else if (string_view(pTypeIdText) == "CAMERA_CINEMATIC") else if (string_view(pTypeIdText) == "CAMERA_CINEMATIC")
{ {
SocketContents.pOtherTarget = pCamera; SocketContents.pOtherTarget = m_pGameInstance->Get_Camera(NEXT_LEVEL, CAMERA_CINEMATIC);
} }
else if (string_view(pTypeIdText) == "CAMERA_SHOULDER") else if (string_view(pTypeIdText) == "CAMERA_SHOULDER")
{ {
@@ -473,6 +458,9 @@ void CCutSceneInfo::Load_CutSceneXML(const string& path, CCamera* pCamera)
} }
pTimeLine->m_Sockets.push_back(pSocket); pTimeLine->m_Sockets.push_back(pSocket);
} }
tinyxml2::XMLElement* pTriggerNode = pContentsNode->FirstChildElement("Trigger");
//pTriggerNode->QueryIntAttribute("W", )
pTimeLine->m_Sockets.sort([](CTimeSocket* a, CTimeSocket* b) { pTimeLine->m_Sockets.sort([](CTimeSocket* a, CTimeSocket* b) {
return a->m_Contents.fRatio < b->m_Contents.fRatio; return a->m_Contents.fRatio < b->m_Contents.fRatio;
}); });
@@ -151,13 +151,11 @@ void CMapElement_Static::ReadyForPhysX()
} }
m_bConverted = true; m_bConverted = true;
_uint iLevel = NEXT_LEVEL; _uint iLevel = NEXT_LEVEL;
for (_uint iIndexLOD = 0; iIndexLOD < m_iMaxLodLevel + 1; ++iIndexLOD)
{
CModel* pModel = m_pModelComs[iIndexLOD];
if (FAILED(pModel->Ready_PhysXMeshes(XMMatrixIdentity(), iLevel))) { CModel* pModel = m_pModelComs[0];
assert(false);
} if (FAILED(pModel->Ready_PhysXMeshes(XMMatrixIdentity(), iLevel))) {
assert(false);
} }
} }
@@ -169,25 +167,23 @@ void CMapElement_Static::ConvertToPhysX()
m_bReadyToCreatePhysX = true; m_bReadyToCreatePhysX = true;
m_RigidBodies.resize(m_iMaxLodLevel + 1); m_RigidBodies.resize(m_iMaxLodLevel + 1);
for (_uint iIndexLOD = 0; iIndexLOD < m_iMaxLodLevel + 1; ++iIndexLOD)
CModel* pModel = m_pModelComs[0];
_uint iNumMeshes = pModel->Get_NumMeshes();
for (_uint iIndex = 0; iIndex < iNumMeshes; ++iIndex)
{ {
CModel* pModel = m_pModelComs[iIndexLOD]; _wstring wstrName = CMyTools::ToWstring(pModel->Get_MeshName(iIndex)) + to_wstring(iIndex);
CRigidBody_Static* pRigidBody = { nullptr };
_uint iNumMeshes = pModel->Get_NumMeshes(); CRigidBody_Static::RIGIDBODY_STATIC_DESC Desc = {};
Desc.iSubKind = ENUM_CLASS(PXOBJECT::TERRAIN);
for (_uint iIndex = 0; iIndex < iNumMeshes; ++iIndex) Desc.pMeshName = wstrName.c_str();
{ Desc.pWorldMatrix = m_pTransformCom->Get_WorldMatrixPtr();
_wstring wstrName = CMyTools::ToWstring(pModel->Get_MeshName(iIndex)) + to_wstring(iIndex); if (FAILED(__super::Add_Asset_Component(NEXT_LEVEL, wstrName, (CComponent**)&pRigidBody, &Desc))) {
CRigidBody_Static* pRigidBody = { nullptr }; assert(false);
CRigidBody_Static::RIGIDBODY_STATIC_DESC Desc = {};
Desc.iSubKind = ENUM_CLASS(PXOBJECT::TERRAIN);
Desc.pMeshName = wstrName.c_str();
Desc.pWorldMatrix = m_pTransformCom->Get_WorldMatrixPtr();
if (FAILED(__super::Add_Asset_Component(NEXT_LEVEL, wstrName, (CComponent**)&pRigidBody, &Desc))) {
assert(false);
}
m_RigidBodies[iIndexLOD].push_back(pRigidBody);
} }
m_RigidBodies[iIndex].push_back(pRigidBody);
} }
} }
@@ -143,26 +143,23 @@ void CMapObject_Collision::ReadyForPhysX()
} }
m_bConverted = true; m_bConverted = true;
_uint iLevel = NEXT_LEVEL; _uint iLevel = NEXT_LEVEL;
for (_uint iIndexLOD = 0; iIndexLOD < m_iMaxLodLevel + 1; ++iIndexLOD)
{
CModel* pModel = m_pModelComs[iIndexLOD];
_matrix parentMatrix = m_pParentTransformCom->Get_XMWorldMatrix(); CModel* pModel = m_pModelComs[0];
_matrix idenMatrix = XMMatrixIdentity(); _matrix parentMatrix = m_pParentTransformCom->Get_XMWorldMatrix();
_bool bSkip = { false }; _matrix idenMatrix = XMMatrixIdentity();
for (_int i = 0; i < 4; ++i) { _bool bSkip = { false };
if (false == XMVector4NearEqual(idenMatrix.r[i], parentMatrix.r[i], XMVectorReplicate(FLT_EPSILON5))) { for (_int i = 0; i < 4; ++i) {
if (FAILED(pModel->Ready_PhysXMeshes(XMLoadFloat4x4(&m_CombinedWorldMatrix), iLevel))) { if (false == XMVector4NearEqual(idenMatrix.r[i], parentMatrix.r[i], XMVectorReplicate(FLT_EPSILON5))) {
assert(false); if (FAILED(pModel->Ready_PhysXMeshes(XMLoadFloat4x4(&m_CombinedWorldMatrix), iLevel))) {
}
bSkip = true;
break;
}
}
if (false == bSkip) {
if (FAILED(pModel->Ready_PhysXMeshes(m_pParentTransformCom->Get_XMWorldMatrix(), iLevel))) {
assert(false); assert(false);
} }
bSkip = true;
break;
}
}
if (false == bSkip) {
if (FAILED(pModel->Ready_PhysXMeshes(m_pParentTransformCom->Get_XMWorldMatrix(), iLevel))) {
assert(false);
} }
} }
} }
@@ -174,26 +171,22 @@ void CMapObject_Collision::ConvertToPhysX()
} }
m_bReadyToCreatePhysX = true; m_bReadyToCreatePhysX = true;
m_RigidBodies.resize(m_iMaxLodLevel + 1); CModel* pModel = m_pModelComs[0];
for (_uint iIndexLOD = 0; iIndexLOD < m_iMaxLodLevel + 1; ++iIndexLOD)
{
CModel* pModel = m_pModelComs[iIndexLOD];
_uint iNumMeshes = pModel->Get_NumMeshes(); _uint iNumMeshes = pModel->Get_NumMeshes();
for (_uint iIndex = 0; iIndex < iNumMeshes; ++iIndex) for (_uint iIndex = 0; iIndex < iNumMeshes; ++iIndex)
{ {
_wstring wstrName = CMyTools::ToWstring(pModel->Get_MeshName(iIndex)) + to_wstring(iIndex); _wstring wstrName = CMyTools::ToWstring(pModel->Get_MeshName(iIndex)) + to_wstring(iIndex);
CRigidBody_Static* pRigidBody = { nullptr }; CRigidBody_Static* pRigidBody = { nullptr };
CRigidBody_Static::RIGIDBODY_STATIC_DESC Desc = {}; CRigidBody_Static::RIGIDBODY_STATIC_DESC Desc = {};
Desc.iSubKind = ENUM_CLASS(PXOBJECT::TERRAIN); Desc.iSubKind = ENUM_CLASS(PXOBJECT::TERRAIN);
Desc.pMeshName = wstrName.c_str(); Desc.pMeshName = wstrName.c_str();
Desc.pWorldMatrix = m_pTransformCom->Get_WorldMatrixPtr(); Desc.pWorldMatrix = m_pTransformCom->Get_WorldMatrixPtr();
if (FAILED(__super::Add_Asset_Component(NEXT_LEVEL, wstrName, (CComponent**)&pRigidBody, &Desc))) { if (FAILED(__super::Add_Asset_Component(NEXT_LEVEL, wstrName, (CComponent**)&pRigidBody, &Desc))) {
assert(false); assert(false);
}
m_RigidBodies[iIndexLOD].push_back(pRigidBody);
} }
m_RigidBodies[iIndex] = pRigidBody;
} }
} }
@@ -278,10 +271,7 @@ void CMapObject_Collision::Free()
} m_pModelComs.clear(); } m_pModelComs.clear();
for (_uint i = 0; i < m_RigidBodies.size(); ++i) { for (_uint i = 0; i < m_RigidBodies.size(); ++i) {
for (_uint j = 0; j < m_RigidBodies[i].size(); ++j) { SAFE_RELEASE(m_RigidBodies[i]);
SAFE_RELEASE(m_RigidBodies[i][j]);
}
m_RigidBodies[i].clear();
} m_RigidBodies.clear(); } m_RigidBodies.clear();
m_ModelPrototypeTags.clear(); m_ModelPrototypeTags.clear();
@@ -158,13 +158,11 @@ void CMapObject_Render::ReadyForPhysX()
m_bConverted = true; m_bConverted = true;
_uint iLevel = NEXT_LEVEL; _uint iLevel = NEXT_LEVEL;
for (_uint iIndexLOD = 0; iIndexLOD < m_iMaxLodLevel + 1; ++iIndexLOD)
{
CModel* pModel = m_pModelComs[iIndexLOD];
if (FAILED(pModel->Ready_PhysXMeshes(XMMatrixIdentity(), iLevel))) { CModel* pModel = m_pModelComs[0];
assert(false);
} if (FAILED(pModel->Ready_PhysXMeshes(XMMatrixIdentity(), iLevel))) {
assert(false);
} }
} }
@@ -176,25 +174,23 @@ void CMapObject_Render::ConvertToPhysX()
m_bReadyToCreatePhysX = true; m_bReadyToCreatePhysX = true;
m_RigidBodies.resize(m_iMaxLodLevel + 1); m_RigidBodies.resize(m_iMaxLodLevel + 1);
for (_uint iIndexLOD = 0; iIndexLOD < m_iMaxLodLevel + 1; ++iIndexLOD)
CModel* pModel = m_pModelComs[0];
_uint iNumMeshes = pModel->Get_NumMeshes();
for (_uint iIndex = 0; iIndex < iNumMeshes; ++iIndex)
{ {
CModel* pModel = m_pModelComs[iIndexLOD]; _wstring wstrName = CMyTools::ToWstring(pModel->Get_MeshName(iIndex)) + to_wstring(iIndex);
CRigidBody_Static* pRigidBody = { nullptr };
_uint iNumMeshes = pModel->Get_NumMeshes(); CRigidBody_Static::RIGIDBODY_STATIC_DESC Desc = {};
Desc.iSubKind = ENUM_CLASS(PXOBJECT::TERRAIN);
for (_uint iIndex = 0; iIndex < iNumMeshes; ++iIndex) Desc.pMeshName = wstrName.c_str();
{ Desc.pWorldMatrix = &m_CombinedWorldMatrix;
_wstring wstrName = CMyTools::ToWstring(pModel->Get_MeshName(iIndex)) + to_wstring(iIndex); if (FAILED(__super::Add_Asset_Component(NEXT_LEVEL, wstrName, (CComponent**)&pRigidBody, &Desc))) {
CRigidBody_Static* pRigidBody = { nullptr }; assert(false);
CRigidBody_Static::RIGIDBODY_STATIC_DESC Desc = {};
Desc.iSubKind = ENUM_CLASS(PXOBJECT::TERRAIN);
Desc.pMeshName = wstrName.c_str();
Desc.pWorldMatrix = &m_CombinedWorldMatrix;
if (FAILED(__super::Add_Asset_Component(NEXT_LEVEL, wstrName, (CComponent**)&pRigidBody, &Desc))) {
assert(false);
}
m_RigidBodies[iIndexLOD].push_back(pRigidBody);
} }
m_RigidBodies[iIndex] = pRigidBody;
} }
} }
@@ -305,9 +301,7 @@ void CMapObject_Render::Free()
SAFE_RELEASE(m_pDefaultGlassTextureCom); SAFE_RELEASE(m_pDefaultGlassTextureCom);
for (_uint i = 0; i < m_RigidBodies.size(); ++i) { for (_uint i = 0; i < m_RigidBodies.size(); ++i) {
for (_uint j = 0; j < m_RigidBodies[i].size(); ++j) { SAFE_RELEASE(m_RigidBodies[i]);
SAFE_RELEASE(m_RigidBodies[i][j]);
}
} m_RigidBodies.clear(); } m_RigidBodies.clear();
for (auto& pModel : m_pModelComs) for (auto& pModel : m_pModelComs)
@@ -0,0 +1,2 @@
#include "pch.h"
#include "TriggerBox.h"
@@ -375,6 +375,7 @@ typedef struct tagEffectInfo
struct TimeLine { struct TimeLine {
_float2 m_vTimer = {}; _float2 m_vTimer = {};
_uint m_eTypeTimeLine = {}; _uint m_eTypeTimeLine = {};
list<CTimeSocket*> m_Sockets = {}; list<CTimeSocket*> m_Sockets = {};
}; };
NS_END NS_END
+1 -1
View File
@@ -37,7 +37,7 @@ class CCutSceneInfo final : public CBase
private: private:
HRESULT Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); HRESULT Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex);
void Load_CutSceneXML(const string& path, CCamera* pCamera); void Load_CutSceneXML(const string& path);
#ifdef _DEBUG #ifdef _DEBUG
public: public:
@@ -25,7 +25,7 @@ class CMapObject_Collision final : public CMapPartObject // 충돌용 Mesh
void ConvertToPhysX(); void ConvertToPhysX();
private: private:
CShader* m_pShaderCom = { nullptr }; CShader* m_pShaderCom = { nullptr };
vector<vector<CRigidBody_Static*>> m_RigidBodies; vector<CRigidBody_Static*> m_RigidBodies;
vector<CModel*> m_pModelComs; vector<CModel*> m_pModelComs;
_bool m_bReadyToCreatePhysX = { false }; _bool m_bReadyToCreatePhysX = { false };
@@ -48,7 +48,7 @@ class CMapObject_Render final : public CMapPartObject // Render PartObject
CShader* m_pShaderCom = { nullptr }; CShader* m_pShaderCom = { nullptr };
CTexture* m_pDefaultGlassTextureCom = { nullptr }; CTexture* m_pDefaultGlassTextureCom = { nullptr };
vector<CModel*> m_pModelComs; vector<CModel*> m_pModelComs;
vector<vector<CRigidBody_Static*>> m_RigidBodies; vector<CRigidBody_Static*> m_RigidBodies;
vector<_wstring> m_ModelPrototypeTags; vector<_wstring> m_ModelPrototypeTags;
vector<_uint> m_ModelPathIndices = {}; vector<_uint> m_ModelPathIndices = {};
@@ -0,0 +1,23 @@
#pragma once
#include "Client_Define.h"
#include "GameInstance.h"
NS_BEGIN(Engine)
NS_END
NS_BEGIN(Client)
class CTriggerBox final : public CBase
{
private:
CTriggerBox();
virtual ~CTriggerBox() = default;
public:
static CTriggerBox Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID, void* pArg);
virtual void Free() override;
};
NS_END
@@ -702,4 +702,5 @@
<string tag =""/> <string tag =""/>
</Param_12> </Param_12>
</Socket> </Socket>
<Trigger X="11.494" Y="7.807" Z="27.081" W="5.f"/>
</RanrokIntro> </RanrokIntro>