From 9964127ea1cf0310f0ebcfb77f5017a176c9123e Mon Sep 17 00:00:00 2001 From: kimnuri Date: Tue, 11 Nov 2025 22:25:23 +0900 Subject: [PATCH] =?UTF-8?q?[add]=20=ED=94=BC=EC=A7=81=EC=8A=A4=20=EB=A9=94?= =?UTF-8?q?=EC=8B=9C=20=EC=A0=80=EC=9E=A5=EC=98=B5=EC=85=98=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20[add]=20=EC=9B=94=EB=93=9C=ED=96=89=EB=A0=AC=20?= =?UTF-8?q?=EA=B3=B1=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bin/Resources/Models/River/River.ste | Bin 0 -> 4016 bytes Jusin154_Team3D/Editor/Private/Loader.cpp | 5 +- .../Engine/Private/GameInstance.cpp | 8 +-- Jusin154_Team3D/Engine/Private/Mesh.cpp | 10 +-- Jusin154_Team3D/Engine/Private/Model.cpp | 38 ++++++----- .../Engine/Private/PhysX_Manager.cpp | 63 ++++++++++++++---- Jusin154_Team3D/Engine/Public/GameInstance.h | 6 +- Jusin154_Team3D/Engine/Public/Mesh.h | 2 +- Jusin154_Team3D/Engine/Public/Model.h | 3 +- Jusin154_Team3D/Engine/Public/PhysX_Manager.h | 7 +- 10 files changed, 90 insertions(+), 52 deletions(-) create mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Models/River/River.ste diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/River/River.ste b/Jusin154_Team3D/Editor/Bin/Resources/Models/River/River.ste new file mode 100644 index 0000000000000000000000000000000000000000..16f6d43fbfbbb55998159ae2153843cdd056614c GIT binary patch literal 4016 zcmbW4dsNd$7RM(+G$N1i4&nnvBqAbjf`TFm2tH6MT3cTgm#)~;a@t}=YiU;0x~&#> zTanfR7UX4lR0RbELNk+s3W|^jmRESKSaoTwLf6W&--&vTr)U4@>F>v9?!7Z}=jM0k zlHX)aSg3*s#vA(vhKC0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yu6fZ6@oSk@=lwe3E!(vWO5)qMNir7;Mok*oJPq7peo?TlZ z{eUkB0I^^j@CP#R8t?+%z!Ug@`CuOK0DPgjU=DBt?jRB@0wEv*EC+#L0oV+-fFQ6C z1cSeTIIsdN1>qnJECx$}9E1V|cpdx|;D|{0Z<}@CWx#ic@9i?M608PmKn!>ZM1v@> z3QPk|U^+n743*#rIR#7wGk^=230%P};0$I1OTaH)7rc6K)IfFOoCJ6c;pj#-f=yrp h;8pYrSPxzWytXWW6%Ye!U<>Sk4UhnP-~c9r{{cX7D?|VQ literal 0 HcmV?d00001 diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 79fd65e57..fcea2c7c8 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -491,10 +491,9 @@ HRESULT CLoader::Loading_For_PhysXLevel() m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), CRigidBody::Create(m_pDevice, m_pContext, Desc)); } - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_River_Col_Model"), - //CModel::Create(m_pDevice, m_pContext, MODEL::ENVIROMENT, "../Bin/Resources/Models/River/River.fbx", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))){ - CModel::Create(m_pDevice, m_pContext, MODEL::ENVIROMENT, "../Bin/Resources/Models/River/River.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))){ + CModel::Create(m_pDevice, m_pContext, MODEL::ENVIROMENT, "../Bin/Resources/Models/River/River.fbx", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))){ + //CModel::Create(m_pDevice, m_pContext, MODEL::ENVIROMENT, "../Bin/Resources/Models/River/River.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))){ return E_FAIL; } diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index 963ed2cb7..45a5c2a57 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -575,15 +575,15 @@ void CGameInstance::ReleaseController(_uint iControllerIndex) { m_pPhysX_Manager->ReleaseController(iControllerIndex); } -HRESULT CGameInstance::ConvertToTriMeshes(vector& Meshes, vector& pxTriMeshes) +HRESULT CGameInstance::ConvertToTriMeshes(vector& Meshes, vector& pxTriMeshes, _fmatrix WorldMatrix) { - return m_pPhysX_Manager->ConvertToTriMeshes(Meshes, pxTriMeshes); + return m_pPhysX_Manager->ConvertToTriMeshes(Meshes, pxTriMeshes, WorldMatrix); } -_bool CGameInstance::SaveTriMeshes(const _char* pPath, vector& TriMeshes) +HRESULT CGameInstance::SaveTriMeshes(const _char* pPath, vector& TriMeshes) { return m_pPhysX_Manager->SaveTriMeshes(pPath, TriMeshes); } -_bool CGameInstance::LoadTriMeshes(const _char* pPath, vector& TriMeshes) +HRESULT CGameInstance::LoadTriMeshes(const _char* pPath, vector& TriMeshes) { return m_pPhysX_Manager->LoadTriMeshes(pPath, TriMeshes); } diff --git a/Jusin154_Team3D/Engine/Private/Mesh.cpp b/Jusin154_Team3D/Engine/Private/Mesh.cpp index 86001e55a..a15a39e79 100644 --- a/Jusin154_Team3D/Engine/Private/Mesh.cpp +++ b/Jusin154_Team3D/Engine/Private/Mesh.cpp @@ -607,16 +607,16 @@ HRESULT CMesh::SaveAsBinary(HANDLE hFile, DWORD& dwByte) return S_OK; } -PSX::PxTriangleMesh* CMesh::ConvertToPxMesh(const PSX::PxCookingParams* pParam, PSX::PxPhysics* pPhysX) +PSX::PxTriangleMesh* CMesh::ConvertToPxMesh(const PSX::PxCookingParams* pParam, PSX::PxPhysics* pPhysX, _fmatrix WorldMatrix) { - PSX::PxTriangleMeshDesc tMeshDesc; - vector Vertices; - vector Triangles; + PSX::PxTriangleMeshDesc tMeshDesc = {}; + vector Vertices = {}; + vector Triangles = {}; { tMeshDesc.points.count = m_iNumVertices; tMeshDesc.points.stride = sizeof(PSX::PxVec3); Vertices.resize(m_iNumVertices); - memcpy_s(Vertices.data(), sizeof(PSX::PxVec3) * m_iNumVertices, m_pVertexPositions, sizeof(_float3) * m_iNumVertices); + XMVector3TransformCoordStream(reinterpret_cast(Vertices.data()), sizeof(PSX::PxVec3), (_float3*)m_pVertexPositions, sizeof(_float3), m_iNumVertices, WorldMatrix); tMeshDesc.points.data = Vertices.data(); } { diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index 0cb830ce0..bca22724b 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -345,17 +345,28 @@ HRESULT CModel::Ready_Meshes(MODEL eType, const aiScene* pAIScene, _fmatrix& Pre return S_OK; } -HRESULT CModel::Ready_PhysXMeshes(MODEL eType) +HRESULT CModel::Ready_PhysXMeshes() { m_iNumPhysXMeshes = m_iNumMeshes; m_TriMeshes.reserve(m_iNumMeshes); - m_pGameInstance->ConvertToTriMeshes(m_Meshes, m_TriMeshes); + m_pGameInstance->ConvertToTriMeshes(m_Meshes, m_TriMeshes, m_pTransform->Get_XMWorldMatrix()); return S_OK; } +HRESULT CModel::Save_PhysXTriMeshes(const _char* pModelFilePath) +{ + if (FAILED(Ready_PhysXMeshes())) { + return E_FAIL; + } + for (_uint i = 0; i < m_iNumMeshes; ++i) { + m_pGameInstance->RegistTriMesh(m_Meshes[i]->Get_Name(), m_TriMeshes[i]); + } + return m_pGameInstance->SaveTriMeshes(pModelFilePath, m_TriMeshes); +} + HRESULT CModel::Ready_Materials(const aiScene* pAIScene, const _char* pModelFilePath) { m_iNumMaterials = pAIScene->mNumMaterials; @@ -810,9 +821,6 @@ HRESULT CModel::Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fma if (FAILED(Ready_Materials_FromFile(m_pAIScene, pModelFilePath))) { return E_FAIL; } - if (FAILED(Ready_PhysXMeshes(eType))) { - return E_FAIL; - } } else { @@ -847,6 +855,7 @@ HRESULT CModel::Initialize_Prototype() HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix) { + m_eType = eType; _char szTextureFileName[MAX_PATH] = {}; _char szDir[MAX_PATH] = {}; _char szName[MAX_PATH] = {}; @@ -855,12 +864,13 @@ HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _ if (strcmp(".bin", szEXT) == 0) { - _char Temp[256]; - strcpy_s(Temp, szDir); - strcat_s(Temp, szName); - strcat_s(Temp, ".bin"); LoadData(pModelFilePath); - m_pGameInstance->LoadTriMeshes(pModelFilePath, m_TriMeshes); + if (MODEL::ENVIROMENT == m_eType) { + m_pGameInstance->LoadTriMeshes(pModelFilePath, m_TriMeshes); + for (_uint i = 0; i < m_iNumMeshes; ++i) { + m_pGameInstance->RegistTriMesh(m_Meshes[i]->Get_Name(), m_TriMeshes[i]); + } + } } else if (strcmp(".fbx", szEXT) == 0) { @@ -870,17 +880,12 @@ HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _ strcat_s(Temp, ".bin"); Assimp_Model_Load(pModelFilePath, eType, PreTransformMatrix, 0); SaveAssimpModel(Temp); - m_pGameInstance->SaveTriMeshes(pModelFilePath, m_TriMeshes); - for (_uint i = 0; i < m_iNumMeshes; ++i) { - m_pGameInstance->RegistTriMesh(m_Meshes[i]->Get_Name(), m_TriMeshes[i]); - } return S_OK; } m_pSaveModel = m_pGameInstance->Load_SaveModel(pModelFilePath); - m_eType = eType; XMStoreFloat4x4(&m_PreTransformMatrix, PreTransformMatrix); Ready_Bones(m_pSaveModel->Nodes, 0, -1); @@ -897,9 +902,6 @@ HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _ return E_FAIL; } - for (_uint i = 0; i < m_iNumMeshes; ++i) { - m_pGameInstance->RegistTriMesh(m_Meshes[i]->Get_Name(), m_TriMeshes[i]); - } return S_OK; diff --git a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp index f1072ddcd..ae36e22e0 100644 --- a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp @@ -129,11 +129,11 @@ void CPhysX_Manager::RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxT m_TriangleMeshGeometry.emplace(CMyTools::ToWstring(pName), pGeometry); } -HRESULT CPhysX_Manager::ConvertToTriMeshes(vector& Meshes, vector& pxTriMeshes) +HRESULT CPhysX_Manager::ConvertToTriMeshes(vector& Meshes, vector& pxTriMeshes, _fmatrix WorldMatrix) { for (size_t i = 0; i < Meshes.size(); ++i) { - PSX::PxTriangleMesh* pTriangleMesh = Meshes[i]->ConvertToPxMesh(m_pCookingParam, m_pPhysics); + PSX::PxTriangleMesh* pTriangleMesh = Meshes[i]->ConvertToPxMesh(m_pCookingParam, m_pPhysics, WorldMatrix); if (nullptr == pTriangleMesh) { return E_FAIL; } @@ -144,23 +144,22 @@ HRESULT CPhysX_Manager::ConvertToTriMeshes(vector& Meshes, vector< return S_OK; } -_bool CPhysX_Manager::SaveTriMeshes(const _char* pPath, vector& TriMeshes) +HRESULT CPhysX_Manager::SaveTriMeshes(const _char* pPath, vector& TriMeshes) { filesystem::path pathPhysX = pPath; - pathPhysX.replace_extension(".xml"); + pathPhysX.replace_extension(".Pxml"); if (TriMeshes.empty()){ - return false; + return E_FAIL; } filesystem::create_directories(pathPhysX.parent_path()); - PSX::PxSerializationRegistry* pSerializationRegistry = PSX::PxSerialization::createSerializationRegistry(*m_pPhysics); PSX::PxCollection* pCollections = PxCreateCollection(); if (nullptr == pCollections) { pSerializationRegistry->release(); assert(pCollections); - return false; + return E_FAIL; } for (PSX::PxTriangleMesh* pTriMesh : TriMeshes) { @@ -171,32 +170,30 @@ _bool CPhysX_Manager::SaveTriMeshes(const _char* pPath, vectorrelease(); pCollections->release(); pSerializationRegistry->release(); assert(ok); - return ok; + return (ok ? S_OK : E_FAIL); } -_bool CPhysX_Manager::LoadTriMeshes(const _char* pPath, vector& TriMeshes) +HRESULT CPhysX_Manager::LoadTriMeshes(const _char* pPath, vector& TriMeshes) { filesystem::path pathPhysX = pPath; - pathPhysX.replace_extension(".xml"); + pathPhysX.replace_extension(".Pxml"); PSX::PxSerializationRegistry* pSerializationRegistry = PSX::PxSerialization::createSerializationRegistry(*m_pPhysics); PSX::PxDefaultFileInputData InputData(pathPhysX.string().c_str()); PSX::PxCollection* extRefs = PxCreateCollection(); - //PSX::PxCollection* pCollections = PSX::PxSerialization::createCollectionFromBinary(&InputData, *pSerializationRegistry, extRefs); PSX::PxCollection* pCollections = PSX::PxSerialization::createCollectionFromXml(InputData, *m_pCookingParam, *pSerializationRegistry, extRefs); if (nullptr == pCollections) { extRefs->release(); pSerializationRegistry->release(); assert(pCollections); - return false; + return E_FAIL; } const PSX::PxU32 iNumTriMeshes = pCollections->getNbObjects(); @@ -214,9 +211,47 @@ _bool CPhysX_Manager::LoadTriMeshes(const _char* pPath, vectorrelease(); pCollections->release(); pSerializationRegistry->release(); - return true; + return S_OK; } +// 바이너리 로드에는 128B 정렬된 메모리 포인터를 넘겨야 함. InputData 그대로 넘기면 안됨 +// 심지어 바이너리로 불러온 블럭은 피직스의 모든 메시들을 릴리즈 한 뒤에 해제 해야 함 +//_bool CPhysX_Manager::LoadTriMeshes_Binary(const _char* pPath, vector& TriMeshes) +//{ +// filesystem::path pathPhysX = pPath; +// pathPhysX.replace_extension(".bmap"); +// +// PSX::PxSerializationRegistry* pSerializationRegistry = PSX::PxSerialization::createSerializationRegistry(*m_pPhysics); +// +// PSX::PxDefaultFileInputData InputData(pathPhysX.string().c_str()); +// PSX::PxCollection* extRefs = PxCreateCollection(); +// +// PSX::PxCollection* pCollections = PSX::PxSerialization::createCollectionFromBinary(&InputData, *pSerializationRegistry, extRefs); +// if (nullptr == pCollections) { +// extRefs->release(); +// pSerializationRegistry->release(); +// assert(pCollections); +// return false; +// } +// +// const PSX::PxU32 iNumTriMeshes = pCollections->getNbObjects(); +// TriMeshes.reserve(iNumTriMeshes); +// for (PSX::PxU32 i = 0; i < iNumTriMeshes; ++i) { +// PSX::PxBase& pObject = pCollections->getObject(i); +// +// if (pObject.getConcreteType() == PSX::PxConcreteType::eTRIANGLE_MESH_BVH34) { +// PSX::PxTriangleMesh* pTriMesh = static_cast(&pObject); +// pTriMesh->acquireReference(); +// TriMeshes.push_back(pTriMesh); +// } +// } +// +// extRefs->release(); +// pCollections->release(); +// pSerializationRegistry->release(); +// return true; +//} + PSX::PxTriangleMesh* CPhysX_Manager::Find_TriangleMesh(const _wstring& wstrMeshKey) { map<_wstring, PSX::PxTriangleMesh*>::iterator iter = m_TriangleMeshes.find(wstrMeshKey); diff --git a/Jusin154_Team3D/Engine/Public/GameInstance.h b/Jusin154_Team3D/Engine/Public/GameInstance.h index d148096df..d891916d0 100644 --- a/Jusin154_Team3D/Engine/Public/GameInstance.h +++ b/Jusin154_Team3D/Engine/Public/GameInstance.h @@ -189,9 +189,9 @@ class ENGINE_DLL CGameInstance final : public CBase PSX::PxController* Get_Controller(_uint iControllerIndex); void ReleaseController(_uint iControllerIndex); - HRESULT ConvertToTriMeshes(vector& Meshes, vector& pxTriMeshes); - _bool SaveTriMeshes(const _char* pPath, vector& TriMeshes); - _bool LoadTriMeshes(const _char* pPath, vector& TriMeshes); + HRESULT ConvertToTriMeshes(vector& Meshes, vector& pxTriMeshes, _fmatrix WorldMatrix); + HRESULT SaveTriMeshes(const _char* pPath, vector& TriMeshes); + HRESULT LoadTriMeshes(const _char* pPath, vector& TriMeshes); #pragma endregion diff --git a/Jusin154_Team3D/Engine/Public/Mesh.h b/Jusin154_Team3D/Engine/Public/Mesh.h index 57fba9a7f..d821533d6 100644 --- a/Jusin154_Team3D/Engine/Public/Mesh.h +++ b/Jusin154_Team3D/Engine/Public/Mesh.h @@ -28,7 +28,7 @@ class ENGINE_DLL CMesh final : public CVIBuffer public: static CMesh* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, vector& Bones, const aiMesh* pAIMesh, _fmatrix& PreTransformMatrix); HRESULT SaveAsBinary(HANDLE hFile, DWORD& dwByte); - PSX::PxTriangleMesh* ConvertToPxMesh(const PSX::PxCookingParams* pParam, PSX::PxPhysics* pPhysX); + PSX::PxTriangleMesh* ConvertToPxMesh(const PSX::PxCookingParams* pParam, PSX::PxPhysics* pPhysX, _fmatrix WorldMatrix); #endif // EDITOR_PROJECT public: diff --git a/Jusin154_Team3D/Engine/Public/Model.h b/Jusin154_Team3D/Engine/Public/Model.h index 35b6fd35b..91ff20068 100644 --- a/Jusin154_Team3D/Engine/Public/Model.h +++ b/Jusin154_Team3D/Engine/Public/Model.h @@ -61,7 +61,8 @@ class ENGINE_DLL CModel final : public CComponent static CModel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex); HRESULT Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex); HRESULT Ready_Meshes(MODEL eType, const aiScene* pAIScene, _fmatrix& PreTransformMatrix); - HRESULT Ready_PhysXMeshes(MODEL eType); + HRESULT Ready_PhysXMeshes(); + HRESULT Save_PhysXTriMeshes(const _char* pModelFilePath); HRESULT Ready_Materials(const aiScene* pAIScene, const _char* pModelFilePath); HRESULT Ready_Materials_FromFile(const aiScene* pAIScene, const _char* pModelFilePath); HRESULT Ready_Animations(const aiScene* pAIScene); diff --git a/Jusin154_Team3D/Engine/Public/PhysX_Manager.h b/Jusin154_Team3D/Engine/Public/PhysX_Manager.h index ae345ebd9..ef2a593ec 100644 --- a/Jusin154_Team3D/Engine/Public/PhysX_Manager.h +++ b/Jusin154_Team3D/Engine/Public/PhysX_Manager.h @@ -27,9 +27,10 @@ class CPhysX_Manager final : public CBase PSX::PxMaterial* Get_Material(_float3& vMatInfo); PSX::PxShape* Create_Shape(ACTOR eType, _float3& vhalfGeometryInfo, PSX::PxMaterial& pxMaterial, _bool bExclusive, PSX::PxShapeFlags ePxShapeFlag); - HRESULT ConvertToTriMeshes(vector& Meshes, vector& pxTriMeshes); - _bool SaveTriMeshes(const _char* pPath, vector& TriMeshes); - _bool LoadTriMeshes(const _char* pPath, vector& TriMeshes); + HRESULT ConvertToTriMeshes(vector& Meshes, vector& pxTriMeshes, _fmatrix WorldMatrix); + HRESULT SaveTriMeshes(const _char* pPath, vector& TriMeshes); + HRESULT LoadTriMeshes(const _char* pPath, vector& TriMeshes); + //HRESULT LoadTriMeshes_Binary(const _char* pPath, vector& TriMeshes); PSX::PxTriangleMesh* Find_TriangleMesh(const _wstring& wstrMeshKey); void Update(_float fTimeDelta);