[add] MapObject_Manager 수정

Path 인덱스 가져올 수 있도록 함
This commit is contained in:
kimnuri
2025-11-12 17:36:16 +09:00
parent 3134e5645b
commit 6d0df5c7ea
18 changed files with 342 additions and 175 deletions
@@ -125,6 +125,10 @@
<AdditionalLibraryDirectories>../../EngineSDK/Lib/$(ConfigurationName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>Engine.lib;fmod_vc.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
@@ -147,6 +151,10 @@
<AdditionalLibraryDirectories>../../EngineSDK/Lib/$(ConfigurationName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>Engine.lib;fmod_vc.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\Public\Client_Define.h" />
+10 -2
View File
@@ -110,7 +110,7 @@
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>EDITOR_PROJECT;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>EDITOR_PROJECT;$(USERNAME);_DEBUG;_WINDOWS;%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalIncludeDirectories>../../EngineSDK/Inc/;../Public/;../../EngineSDK/Inc/DirectXTK/;../../EngineSDK/Inc/fMod/;../../EngineSDK/Inc/IMGUI/;../../EngineSDK/Inc/FX11/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@@ -125,6 +125,10 @@
<AdditionalLibraryDirectories>../../EngineSDK/Lib/$(ConfigurationName)/;../ThirdPartyLib/ZLib/$(ConfigurationName)/;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>Engine.lib;fmod_vc.lib;Crypt32.lib;assimp-vc145-mtd.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
@@ -132,7 +136,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>EDITOR_PROJECT;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>EDITOR_PROJECT;$(USERNAME);NDEBUG;_WINDOWS;%(PreprocessorDefinitions);%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalIncludeDirectories>../../EngineSDK/Inc/;../Public/;../../EngineSDK/Inc/DirectXTK/;../../EngineSDK/Inc/fMod/;../../EngineSDK/Inc/IMGUI/;../../EngineSDK/Inc/FX11/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@@ -147,6 +151,10 @@
<AdditionalLibraryDirectories>../../EngineSDK/Lib/$(ConfigurationName)/;../ThirdPartyLib/ZLib/$(ConfigurationName)/;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>Engine.lib;fmod_vc.lib;Crypt32.lib;assimp-vc145-mt.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\Public\Body.h" />
@@ -124,11 +124,6 @@ HRESULT CDummy_PhysXPlayable::Ready_Components(void* pArg)
}
}
/* Com_Model */
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Steve_Model"),
reinterpret_cast<CComponent**>(&m_pModelCom))))
return E_FAIL;
/* Com_Shader */
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_ANIMMESH,
reinterpret_cast<CComponent**>(&m_pShaderCom))))
@@ -43,7 +43,7 @@ HRESULT CLevel_MapViewer::Initialize()
return E_FAIL;
}
if (FAILED(Ready_Layer_MapObjectManager(TEXT("Layer_MapObjectManager")))) {
if (FAILED(Ready_Layer_MapObjectManager(LAYER_MAPOBJECTMANAGER))) {
return E_FAIL;
}
@@ -8,6 +8,8 @@
#include "Dummy_PhysXBox.h"
#include "Dummy_PhysXPlayable.h"
#include "Dummy_PhysXMesh.h"
#include "MapObject_Manager.h"
#include "BuildingContainer.h"
CLevel_PhysXLab::CLevel_PhysXLab(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
@@ -85,38 +87,43 @@ HRESULT CLevel_PhysXLab::Ready_Layer_Camera(const _wstring& strLayerTag)
HRESULT CLevel_PhysXLab::Ready_Layer_Terrain(const _wstring& strLayerTag)
{
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CTerrain>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
return E_FAIL;
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CMapObject_Manager>(g_iStaticLevel, NEXT_LEVEL, LAYER_MAPOBJECTMANAGER)))
return E_FAIL;
return S_OK;
}
HRESULT CLevel_PhysXLab::Ready_Layer_PhysXObjects(const _wstring& strLayerTag)
{
for (int i = 0; i < 50; ++i) {
CDummy_PhysXBox::BOXSTARTPOS_DESC Desc{};
Desc.vPos = { m_pGameInstance->Random_Float(0.f, 30.f), m_pGameInstance->Random_Float(3.f, 33.f), m_pGameInstance->Random_Float(0.f, 30.f) };
Desc.vRotRPY = { m_pGameInstance->Random_Float(0.f, XM_2PI), m_pGameInstance->Random_Float(0.f, XM_2PI), m_pGameInstance->Random_Float(0.f, XM_2PI) };
//for (int i = 0; i < 50; ++i) {
// CDummy_PhysXBox::BOXSTARTPOS_DESC Desc{};
// Desc.vPos = { m_pGameInstance->Random_Float(0.f, 30.f), m_pGameInstance->Random_Float(3.f, 33.f), m_pGameInstance->Random_Float(0.f, 30.f) };
// Desc.vRotRPY = { m_pGameInstance->Random_Float(0.f, XM_2PI), m_pGameInstance->Random_Float(0.f, XM_2PI), m_pGameInstance->Random_Float(0.f, XM_2PI) };
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXBox>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) {
return E_FAIL;
}
}
{
CDummy_PhysXPlayable::BOXSTARTPOS_DESC Desc{};
Desc.vPos = { 0.f, 10.f, 0.f };
Desc.vRotRPY = { 0.f, 0.f, 0.f };
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXPlayable>(g_iStaticLevel, NEXT_LEVEL, LAYER_PLAYER, &Desc))) {
return E_FAIL;
}
}
// if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXBox>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) {
// return E_FAIL;
// }
//}
//
//{
// CDummy_PhysXPlayable::BOXSTARTPOS_DESC Desc{};
// Desc.vPos = { 0.f, 10.f, 0.f };
// Desc.vRotRPY = { 0.f, 0.f, 0.f };
// if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXPlayable>(g_iStaticLevel, NEXT_LEVEL, LAYER_PLAYER, &Desc))) {
// return E_FAIL;
// }
//}
{
CDummy_PhysXMesh::BOXSTARTPOS_DESC Desc{};
Desc.vPos = { 0.f, 10.f, 0.f };
Desc.vRotRPY = { 0.f, 0.f, 0.f };
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXMesh>(g_iStaticLevel, NEXT_LEVEL, LAYER_CHUNK, &Desc))) {
return E_FAIL;
}
}
//{
// CDummy_PhysXMesh::BOXSTARTPOS_DESC Desc{};
// Desc.vPos = { 0.f, 10.f, 0.f };
// Desc.vRotRPY = { 0.f, 0.f, 0.f };
// if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_PhysXMesh>(g_iStaticLevel, NEXT_LEVEL, LAYER_CHUNK, &Desc))) {
// return E_FAIL;
// }
//}
return S_OK;
}
+106 -75
View File
@@ -13,7 +13,6 @@
#include "Body.h"
#include "Hair.h"
#include "Dummy_Goblin.h"
#include "Dummy_Goblin.h"
#include "DummyObject.h"
#include <filesystem>
@@ -34,7 +33,6 @@
#include "Active_Icon.h"
#include "MiniMap_Panel.h"
#include "MiniMap_TrimBorder.h"
#include "Loading_Panel.h"
#include "LoadingWidget.h"
@@ -497,17 +495,71 @@ HRESULT CLoader::Loading_For_PhysXLevel()
Desc.tRigidDynamicDesc.vMatInfo = { 0.5f, 0.5f, 0.6f };
Desc.tRigidDynamicDesc.ePxShapeFlag = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE };
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("PHYSX_DYNAMIC_BOX"), CRigidBody::Create(m_pDevice, m_pContext, Desc)))) {
return E_FAIL;
}
}
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.01f, 0.01f, 0.01f) * XMMatrixIdentity())))){
CModel::Create(m_pDevice, m_pContext, MODEL::ENVIROMENT, "../Bin/Resources/Models/River/River.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity())))){
return E_FAIL;
}
//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.01f, 0.01f, 0.01f) * XMMatrixIdentity())))){
// CModel::Create(m_pDevice, m_pContext, MODEL::ENVIROMENT, "../Bin/Resources/Models/River/River.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity())))){
// return E_FAIL;
//}
{
CModel* pModel = (CModel*)m_pGameInstance->Find_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_River_Col_Model"));
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), CCharacter_Controller::Create(m_pDevice, m_pContext)))) {
return E_FAIL;
}
}
m_strMessage = TEXT("Texture Loading..");
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("TerrainTest"),
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Cursor/UI_T_CursorRings.dds"), 0)))) {
return E_FAIL;
}
m_strMessage = TEXT("Model Loading..");
//if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Box"),
// CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Box/Box.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))){
// return E_FAIL;
//}
#ifdef 기무리
vector<_wstring> ModelPrototypeTags = {};
vector<filesystem::path> ModelPrototypePath = {};
//for (const auto& file : filesystem::directory_iterator("..\\Bin\\Resources\\Models\\MapMesh"))
for (const auto& file : filesystem::directory_iterator("C:\\Users\\kimnuri\\Desktop\\Hogwart\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Terrain"))
{
if (file.is_directory()){
continue;
}
string ext = file.path().extension().string();
//if (strcmp(ext.c_str(), ".bin"))
// continue;
if (strcmp(ext.c_str(), ".fbx"))
continue;
_char szFilePath[MAX_PATH] = {};
strcpy_s(szFilePath, MAX_PATH, file.path().string().c_str());
_wstring strFileName = L"Prototype_GameObject_" + file.path().stem().wstring();
CModel* pModel = CModel::Create(m_pDevice, m_pContext, MODEL::ENVIROMENT, szFilePath);
/*For Prototype_Component_Model_*/
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, strFileName, pModel ))){
return E_FAIL;
}
ModelPrototypeTags.push_back(strFileName);
ModelPrototypePath.push_back(file.path());
_uint iNumMesh = pModel->Get_NumMeshes();
CRigidBody::RIGIDBODY_PROTOTYPEDESC Desc{};
@@ -520,49 +572,23 @@ HRESULT CLoader::Loading_For_PhysXLevel()
}
}
}
{
m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), CCharacter_Controller::Create(m_pDevice, m_pContext));
}
m_strMessage = TEXT("Texture Loading..");
m_strMessage = TEXT("Model Loading..");
#ifdef 기무리
for (const auto& file : filesystem::directory_iterator("C:\\Users\\82103\\Desktop\\MapRe\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes"))
{
if (file.is_directory())
continue;
string ext = file.path().extension().string();
if (strcmp(ext.c_str(), ".bin"))
continue;
_char szFilePath[MAX_PATH] = {};
strcpy_s(szFilePath, MAX_PATH, file.path().string().c_str());
_wstring strFileName = L"Prototype_GameObject_" + file.path().stem().wstring();
/*For Prototype_Component_Model_*/
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, strFileName,
CModel::Create(m_pDevice, m_pContext, MODEL::ENVIROMENT, szFilePath))))
return E_FAIL;
ModelPrototypeTags.push_back(strFileName);
}
#endif // 기무리
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Steve_Model"),
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Steve/Steve.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity()))))
if (FAILED(m_pGameInstance->Add_Prototype<CMapObject_Manager>(g_iStaticLevel, CMapObject_Manager::Create(m_pDevice, m_pContext, ModelPrototypeTags, ModelPrototypePath)))){
return E_FAIL;
}
#endif // 기무리
m_strMessage = TEXT("Shader Loading..");
m_strMessage = TEXT("Prototype Loading..");
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Terrain"),
CVIBuffer_Terrain::Create(m_pDevice, m_pContext, nullptr, 100, 100))))
return E_FAIL;
if (FAILED(m_pGameInstance->Add_Prototype<CTerrain>(g_iStaticLevel, CTerrain::Create(m_pDevice, m_pContext))))
return E_FAIL;
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXBox>(g_iStaticLevel, CDummy_PhysXBox::Create(m_pDevice, m_pContext)))) {
return E_FAIL;
}
@@ -573,6 +599,12 @@ HRESULT CLoader::Loading_For_PhysXLevel()
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Prototype<CMapObject_Static>(g_iStaticLevel, CMapObject_Static::Create(m_pDevice, m_pContext))))
return E_FAIL;
if (FAILED(m_pGameInstance->Add_Prototype<CMapObject_LOD>(g_iStaticLevel, CMapObject_LOD::Create(m_pDevice, m_pContext))))
return E_FAIL;
m_strMessage = TEXT("Loading Success!");
m_isFinished = true;
@@ -706,17 +738,22 @@ HRESULT CLoader::Loading_For_MapViewer()
m_strMessage = TEXT("모델를(을) 로딩 중 입니다.");
vector<_wstring> ModelPrototypeTags;
vector<_wstring> ModelPrototypeTags = {};
vector<filesystem::path> ModelPrototypePath = {};
for (const auto& file : filesystem::directory_iterator("C:\\Users\\82103\\Desktop\\MapRe\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes"))
for (const auto& file : filesystem::directory_iterator("C:\\Users\\kimnuri\\Desktop\\Hogwart\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Terrain"))
{
if (file.is_directory())
continue;
string ext = file.path().extension().string();
if (strcmp(ext.c_str(), ".bin"))
//if (strcmp(ext.c_str(), ".bin")){
// continue;
//}
if (strcmp(ext.c_str(), ".fbx")){
continue;
}
_char szFilePath[MAX_PATH] = {};
@@ -724,36 +761,27 @@ HRESULT CLoader::Loading_For_MapViewer()
_wstring strFileName = L"Prototype_GameObject_" + file.path().stem().wstring();
CModel* pModel = CModel::Create(m_pDevice, m_pContext, MODEL::ENVIROMENT, szFilePath);
/*For Prototype_Component_Model_*/
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, strFileName,
CModel::Create(m_pDevice, m_pContext, MODEL::ENVIROMENT, szFilePath))))
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, strFileName, pModel)))
return E_FAIL;
ModelPrototypeTags.push_back(strFileName);
ModelPrototypePath.emplace_back(file.path());
_uint iNumMesh = pModel->Get_NumMeshes();
CRigidBody::RIGIDBODY_PROTOTYPEDESC Desc{};
for (_uint i = 0; i < iNumMesh; ++i) {
Desc.eType = ACTOR::TRIANGLEMESH;
Desc.tRigidStaticDesc.szMeshName = pModel->Get_MeshName(i);
Desc.tRigidStaticDesc.vMatInfo = _float3(0.5f, 0.5f, 0.6f);
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, CMyTools::ToWstring(Desc.tRigidStaticDesc.szMeshName).c_str(), CRigidBody::Create(m_pDevice, m_pContext, Desc)))) {
return E_FAIL;
}
}
}
//for (const auto& file : filesystem::directory_iterator("C:\\Users\\82103\\Desktop\\MapRe\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes\\3Broom_Kit"))
//{
// if (file.is_directory())
// continue;
// string ext = file.path().extension().string();
// if (strcmp(ext.c_str(), ".fbx"))
// continue;
// _char szFilePath[MAX_PATH] = {};
// strcpy_s(szFilePath, MAX_PATH, file.path().string().c_str());
// _wstring strFileName = L"Prototype_GameObject_" + file.path().stem().wstring();
// /*For Prototype_Component_Model_*/
// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, strFileName,
// CModel::Create(m_pDevice, m_pContext, MODEL::ENVIROMENT, szFilePath))))
// return E_FAIL;
// ModelPrototypeTags.push_back(strFileName);
//}
m_strMessage = TEXT("쉐이더를(을) 로딩 중 입니다.");
@@ -781,9 +809,12 @@ HRESULT CLoader::Loading_For_MapViewer()
return E_FAIL;
/* For.Prototype_GameObject_MapObject_Manager */
if (FAILED(m_pGameInstance->Add_Prototype<CMapObject_Manager>(g_iStaticLevel, CMapObject_Manager::Create(m_pDevice, m_pContext, ModelPrototypeTags))))
if (FAILED(m_pGameInstance->Add_Prototype<CMapObject_Manager>(g_iStaticLevel, CMapObject_Manager::Create(m_pDevice, m_pContext, ModelPrototypeTags, ModelPrototypePath))))
return E_FAIL;
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_PhysXMesh>(g_iStaticLevel, CDummy_PhysXMesh::Create(m_pDevice, m_pContext)))) {
return E_FAIL;
}
m_strMessage = TEXT("로딩이 완료되었습니다..");
m_isFinished = true;
@@ -6,6 +6,7 @@
#include "Layer.h"
#include "Terrain.h"
#include "VIBuffer_Terrain.h"
#include "MapObject_Manager.h"
CMapObject_LOD::CMapObject_LOD(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
: CMapObject(pDevice, pContext)
@@ -31,6 +32,7 @@ HRESULT CMapObject_LOD::Initialize(void* pArg)
for (_uint i = 0; i < m_iMaxLodLevel + 1; i++)
{
m_ModelPrototypeTags.push_back(pDesc->ModelPrototypeTags[i]);
m_ModelPathIndices.push_back((*pDesc->pModelPathIndices)[i]);
}
if (FAILED(__super::Initialize(pArg)))
@@ -271,5 +273,41 @@ void CMapObject_LOD::Describe_Entity()
if (GUI::Button("Delete"))
m_bDead = true;
if (GUI::Button("Bake_StaticPhysXMesh")) {
GUI::OpenPopup("BakeStaticPhysXMesh##popup");
}
if (GUI::BeginPopup("BakeStaticPhysXMesh##popup")) {
if (GUI::Button("No")) {
GUI::CloseCurrentPopup();
}
GUI::SameLine();
if (GUI::Button("Bake!!!")) {
CMapObject_Manager* pManager = m_pGameInstance->Get_Layer(CURRENT_LEVEL, LAYER_MAPOBJECTMANAGER)->Get_Object<CMapObject_Manager>();
for (_uint i = 0; i < (_uint)m_ModelPrototypeTags.size(); ++i) {
filesystem::path filePath = pManager->Get_PrototypePath(m_ModelPathIndices[i]);
CModel* pModel = m_pModelComs[i];
_uint iNumMesh = pModel->Get_NumMeshes();
pModel->Save_PhysXTriMeshes(filePath.string().c_str());
CRigidBody::RIGIDBODY_DESC Desc{};
Desc.eType = ACTOR::TRIANGLEMESH;
for (_uint i = 0; i < iNumMesh; ++i)
{ // RIGID_BODY
Desc.tRigidStaticDesc.szMeshName = pModel->Get_MeshName(i);
if (FAILED(Add_Asset_Component(g_iStaticLevel, CMyTools::ToWstring(pModel->Get_MeshName(i)).c_str(), nullptr, &Desc))) {
assert(false);
}
}
}
GUI::CloseCurrentPopup();
}
GUI::EndPopup();
}
m_bSelected = true;
}
@@ -19,26 +19,28 @@ CMapObject_Manager::CMapObject_Manager(const CMapObject_Manager& rhs)
: CGameObject(rhs)
, m_ModelPrototypeTags{ rhs.m_ModelPrototypeTags }
, m_LODModelPrototypeTags{ rhs.m_LODModelPrototypeTags }
, m_ModelPrototypePaths{ rhs.m_ModelPrototypePaths }
{
}
HRESULT CMapObject_Manager::Initialize_Prototype(vector<_wstring>& ModelPrototypeTags)
HRESULT CMapObject_Manager::Initialize_Prototype(vector<_wstring>& ModelPrototypeTags, vector<filesystem::path>& ModelPrototypePaths)
{
for (auto& Tag : ModelPrototypeTags)
//for (auto& Tag : ModelPrototypeTags)
for (_uint i = 0 ; i < ModelPrototypeTags.size(); ++i)
{
if (_wstring::npos != Tag.find(L"Lod"))
if (_wstring::npos != ModelPrototypeTags[i].find(L"Lod"))
{
m_LODModelPrototypeTags.push_back(Tag);
m_LODModelPrototypeTags.push_back(ModelPrototypeTags[i]);
}
m_ModelPrototypeTags.push_back(Tag);
m_ModelPrototypeTags.push_back(ModelPrototypeTags[i]);
m_ModelPrototypePaths.push_back(ModelPrototypePaths[i]);
}
return S_OK;
}
HRESULT CMapObject_Manager::Initialize(void* pArg)
HRESULT CMapObject_Manager::Initialize(void* pArg)
{
if (FAILED(__super::Initialize(pArg)))
return E_FAIL;
@@ -122,6 +124,11 @@ HRESULT CMapObject_Manager::Render()
return S_OK;
}
const filesystem::path CMapObject_Manager::Get_PrototypePath(_uint iModelIndex)
{
return m_ModelPrototypePaths[iModelIndex];
}
HRESULT CMapObject_Manager::Ready_Components()
{
__super::Ready_Components(nullptr);
@@ -416,7 +423,7 @@ HRESULT CMapObject_Manager::Load_MapData(const _char* pFileName)
#pragma region MAPOBJECT_STATIC
if (0 == iLodLevel) /* MapObject_Static */
{
CMapObject_Static::MAPOBJECT_STATIC_DESC Desc = {};
MAPOBJECT_STATIC_DESC Desc = {};
string strTag = {};
auto* PrototypeTag = PartObject->FirstChildElement("PrototypeTag");
@@ -452,7 +459,7 @@ HRESULT CMapObject_Manager::Load_MapData(const _char* pFileName)
#pragma region MAPOBJECT_LOD
else
{
CMapObject_LOD::MAPOBJECT_LOD_DESC Desc = {};
MAPOBJECT_LOD_DESC Desc = {};
string strTag = {};
for (auto* PrototypeTag = PartObject->FirstChildElement("PrototypeTag"); PrototypeTag; PrototypeTag = PrototypeTag->NextSiblingElement("PrototypeTag"))
{
@@ -567,7 +574,7 @@ HRESULT CMapObject_Manager::Load_ContainerData(const _char* pFileName, const _ch
#pragma region MAPOBJECT_STATIC
if (0 == iLodLevel) /* MapObject_Static */
{
CMapObject_Static::MAPOBJECT_STATIC_DESC Desc = {};
MAPOBJECT_STATIC_DESC Desc = {};
string strTag = {};
auto* PrototypeTag = PartObject->FirstChildElement("PrototypeTag");
@@ -603,7 +610,7 @@ HRESULT CMapObject_Manager::Load_ContainerData(const _char* pFileName, const _ch
#pragma region MAPOBJECT_LOD
else
{
CMapObject_LOD::MAPOBJECT_LOD_DESC Desc = {};
MAPOBJECT_LOD_DESC Desc = {};
string strTag = {};
for (auto* PrototypeTag = PartObject->FirstChildElement("PrototypeTag"); PrototypeTag; PrototypeTag = PrototypeTag->NextSiblingElement("PrototypeTag"))
{
@@ -647,24 +654,30 @@ HRESULT CMapObject_Manager::Load_ContainerData(const _char* pFileName, const _ch
void CMapObject_Manager::Update_PrototypeList()
{
GUI::Begin("Model Prototype List");
for (auto& Tag : m_ModelPrototypeTags)
_uint iMaxSize = (_uint)m_ModelPrototypeTags.size();
for (_uint i = 0; i < iMaxSize; ++i)
{
if (_wstring::npos != Tag.find(L"Lod"))
auto& Tag = m_ModelPrototypeTags[i];
if (_wstring::npos != Tag.find(L"Lod")){
continue;
}
if (ImGui::Button(CMyTools::ToString(Tag).c_str()))
{
_uint iNumLodModel = {};
vector<_uint> LodModelIndices;
if(false == Find_Lod_Prototype(Tag, &iNumLodModel))
if(false == Find_Lod_Prototype(Tag, LodModelIndices))
{
CMapObject_Static::MAPOBJECT_STATIC_DESC Desc = {};
MAPOBJECT_STATIC_DESC Desc = {};
Desc.strModelPrototypeTag = Tag;
Desc.pParentTransform = m_pTransformCom;
Desc.vPosition = _float3(0.f, 0.f, 0.f);
Desc.vRotation = _float3(0.f, 0.f, 0.f);
Desc.vScale = _float3(1.f, 1.f, 1.f);
Desc.iModelPathIndex = i;
CMapObject_Static* pMapObject = { nullptr };
const string strKey = CMyTools::ToString(Tag);
@@ -678,7 +691,7 @@ void CMapObject_Manager::Update_PrototypeList()
}
else
{
CMapObject_LOD::MAPOBJECT_LOD_DESC Desc = {};
MAPOBJECT_LOD_DESC Desc = {};
vector<_wstring> PrototypeTags;
@@ -689,6 +702,7 @@ void CMapObject_Manager::Update_PrototypeList()
Desc.vPosition = _float3(0.f, 0.f, 0.f);
Desc.vRotation = _float3(0.f, 0.f, 0.f);
Desc.vScale = _float3(1.f, 1.f, 1.f);
Desc.pModelPathIndices = &LodModelIndices;
CMapObject_LOD* pMapObject = { nullptr };
const string strKey = CMyTools::ToString(Tag);
@@ -700,7 +714,7 @@ void CMapObject_Manager::Update_PrototypeList()
m_MapObjects.push_back(pMapObject);
for (_uint i = 0; i < iNumLodModel; ++i)
for (_uint i = 0; i < LodModelIndices.size(); ++i)
{
_wstring strLodTag = Tag + L"_Lod" + to_wstring(i + 1);
@@ -806,25 +820,28 @@ void CMapObject_Manager::Update_ContainerObject()
GUI::End();
}
_bool CMapObject_Manager::Find_Lod_Prototype(_wstring strPrototypeTag, _uint* iCount)
_bool CMapObject_Manager::Find_Lod_Prototype(_wstring strPrototypeTag, vector<_uint>& LodModelIndices)
{
for (auto& Tag : m_LODModelPrototypeTags)
// for (auto& Tag : m_LODModelPrototypeTags)
for(_uint i = 0 ; i < m_ModelPrototypeTags.size(); ++i)
{
if (_wstring::npos != Tag.find(strPrototypeTag))
(*iCount)++;
if (_wstring::npos != m_ModelPrototypeTags[i].find(strPrototypeTag))
LodModelIndices.push_back(i);
}
if (0 < *iCount)
if (0 < LodModelIndices.size()) {
return true;
}
return false;
//if (0 < *iCount)
// return true;
}
CMapObject_Manager* CMapObject_Manager::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, vector<_wstring>& ModelPrototypeTags)
CMapObject_Manager* CMapObject_Manager::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, vector<_wstring>& ModelPrototypeTags, vector<filesystem::path>& ModelPrototypePaths)
{
CMapObject_Manager* pInstance = new CMapObject_Manager(pDevice, pContext);
if (FAILED(pInstance->Initialize_Prototype(ModelPrototypeTags)))
if (FAILED(pInstance->Initialize_Prototype(ModelPrototypeTags, ModelPrototypePaths)))
{
MSG_BOX("Failed to Created : CMapObject_Manager");
Safe_Release(pInstance);
@@ -6,6 +6,7 @@
#include "Layer.h"
#include "Terrain.h"
#include "VIBuffer_Terrain.h"
#include "MapObject_Manager.h"
CMapObject_Static::CMapObject_Static(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
: CMapObject(pDevice, pContext)
@@ -97,6 +98,7 @@ HRESULT CMapObject_Static::Initialize(void* pArg)
MAPOBJECT_STATIC_DESC* pDesc = static_cast<MAPOBJECT_STATIC_DESC*>(pArg);
m_strModelPrototypeTag = pDesc->strModelPrototypeTag;
m_iModelPathIndex = pDesc->iModelPathIndex;
if (FAILED(__super::Initialize(pArg)))
return E_FAIL;
@@ -235,5 +237,37 @@ void CMapObject_Static::Describe_Entity()
if (ImGui::Button("Delete"))
m_bDead = true;
if (GUI::Button("Bake_StaticPhysXMesh")) {
GUI::OpenPopup("BakeStaticPhysXMesh##popup");
}
if (GUI::BeginPopup("BakeStaticPhysXMesh##popup")) {
if (GUI::Button("No")) {
GUI::CloseCurrentPopup();
}
GUI::SameLine();
if (GUI::Button("Bake!!!")) {
CMapObject_Manager* pManager = m_pGameInstance->Get_Layer(CURRENT_LEVEL, LAYER_MAPOBJECTMANAGER)->Get_Object<CMapObject_Manager>();
filesystem::path filePath = pManager->Get_PrototypePath(m_iModelPathIndex);
m_pModelCom->Save_PhysXTriMeshes(CMyTools::ToString(pManager->Get_PrototypePath(m_iModelPathIndex)).c_str());
_uint iNumMesh = m_pModelCom->Get_NumMeshes();
CRigidBody::RIGIDBODY_DESC Desc{};
Desc.eType = ACTOR::TRIANGLEMESH;
for (_uint i = 0; i < iNumMesh; ++i)
{ // RIGID_BODY
Desc.tRigidStaticDesc.szMeshName = m_pModelCom->Get_MeshName(i);
if (FAILED(Add_Asset_Component(g_iStaticLevel, CMyTools::ToWstring(m_pModelCom->Get_MeshName(i)).c_str(), nullptr, &Desc))) {
assert(false);
}
}
GUI::CloseCurrentPopup();
}
GUI::EndPopup();
}
m_bSelected = true;
}
@@ -3,6 +3,8 @@
#include <process.h>
#include "../Default/framework.h"
#include "wincrypt.h"
#include "Engine_Define.h"
#include "Editor_Macro.h"
#include "Editor_Struct.h"
@@ -51,6 +51,8 @@ namespace Editor {
#define LAYER_CELL TEXT("Layer_Cell")
#define LAYER_TRIGGER TEXT("Layer_Trigger")
#define LAYER_MAPOBJECTMANAGER TEXT("Layer_MapObjectManager")
#pragma endregion
#pragma region MACRO_TEXTURE
+27 -2
View File
@@ -1,5 +1,30 @@
#pragma once
namespace Editor {
NS_BEGIN(Engine)
class CTransform;
NS_END
}
NS_BEGIN(Editor)
typedef struct tagMapObject_Desc {
CTransform* pParentTransform = { nullptr };
_float3 vScale;
_float3 vRotation;
_float3 vPosition;
}MAPOBJECT;
typedef struct tagMapObjectStaticDesc : public tagMapObject_Desc
{
_uint iMaxLodLevel{};
_wstring strModelPrototypeTag;
_uint iModelPathIndex = { UINT_MAX };
}MAPOBJECT_STATIC_DESC;
typedef struct tagMapObjectLodDesc : public tagMapObject_Desc
{
_uint iMaxLodLevel{};
vector<_wstring> ModelPrototypeTags;
vector<_uint>* pModelPathIndices = { nullptr };
}MAPOBJECT_LOD_DESC;
NS_END
+2 -11
View File
@@ -5,18 +5,8 @@
NS_BEGIN(Editor)
class CMapObject_LOD final : public CMapObject
class CMapObject_LOD final : public CMapObject // LOD 있는 애들
{
public:
typedef struct tagMapObjectLodDesc : public PARTOBJECT_DESC
{
_uint iMaxLodLevel{};
vector<_wstring> ModelPrototypeTags;
_float3 vPosition;
_float3 vScale;
_float3 vRotation;
}MAPOBJECT_LOD_DESC;
private:
CMapObject_LOD(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
CMapObject_LOD(const CMapObject_LOD& Prototype);
@@ -42,6 +32,7 @@ class CMapObject_LOD final : public CMapObject
_uint m_iLodIndex = {};
vector<_wstring> m_ModelPrototypeTags;
vector<_uint> m_ModelPathIndices = { };
@@ -18,18 +18,21 @@ class CMapObject_Manager final : public CGameObject
virtual ~CMapObject_Manager() = default;
public:
virtual HRESULT Initialize_Prototype(vector<_wstring>& ModelPrototypeTags);
virtual HRESULT Initialize_Prototype(vector<_wstring>& ModelPrototypeTags, vector<filesystem::path>& ModelPrototypePaths);
virtual HRESULT Initialize(void* pArg) override;
virtual void Priority_Update(_float fTimeDelta) override;
virtual void Update(_float fTimeDelta) override;
virtual void Late_Update(_float fTimeDelta) override;
virtual HRESULT Render() override;
const filesystem::path Get_PrototypePath(_uint iModelIndex);
private:
class CMapObject* m_pSelectObject = { nullptr };
list<class CMapObject*> m_MapObjects = {};
vector<_wstring> m_ModelPrototypeTags;
vector<_wstring> m_LODModelPrototypeTags;
vector<filesystem::path> m_ModelPrototypePaths;
_uint m_iContainerObjectIndex = {};
@@ -51,10 +54,10 @@ class CMapObject_Manager final : public CGameObject
void Update_Edit();
void Update_ContainerObject();
_bool Find_Lod_Prototype(_wstring strPrototypeTag, _uint* iCount);
_bool Find_Lod_Prototype(_wstring strPrototypeTag, vector<_uint>& LodModelIndices);
public:
static CMapObject_Manager* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, vector<_wstring>& ModelPrototypeTags);
static CMapObject_Manager* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, vector<_wstring>& ModelPrototypeTags, vector<filesystem::path>& ModelPrototypePaths);
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override;
virtual void Free() override;
virtual void Describe_Entity() override;
@@ -5,18 +5,8 @@
NS_BEGIN(Editor)
class CMapObject_Static final : public CMapObject
class CMapObject_Static final : public CMapObject // LOD 모델이 없는 애들
{
public:
typedef struct tagMapObjectStaticDesc : public PARTOBJECT_DESC
{
_uint iMaxLodLevel{};
_wstring strModelPrototypeTag;
_float3 vPosition;
_float3 vScale;
_float3 vRotation;
}MAPOBJECT_STATIC_DESC;
private:
CMapObject_Static(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
CMapObject_Static(const CMapObject_Static& Prototype);
@@ -36,6 +26,7 @@ class CMapObject_Static final : public CMapObject
CModel* m_pModelCom = { nullptr };
_wstring m_strModelPrototypeTag;
_uint m_iModelPathIndex = { UINT_MAX };
private:
virtual HRESULT Initialize_Prototype() override;
+21 -1
View File
@@ -126,6 +126,16 @@
<AdditionalLibraryDirectories>../ThirdPartyLib/fMod/;../ThirdPartyLib/DirectXTK/;../ThirdPartyLib/FX11/;../ThirdPartyLib/Assimp/;../ThirdPartyLib/PhysX/PhysX_$(Configuration)/;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>d3d11.lib;fmod_vc.lib;dinput8.lib;LowLevel_static_64.lib;LowLevelAABB_static_64.lib;LowLevelDynamics_static_64.lib;PhysX_64.lib;PhysXCommon_64.lib;PhysXCooking_64.lib;PhysXExtensions_static_64.lib;PhysXFoundation_64.lib;PhysXPvdSDK_static_64.lib;PhysXTask_static_64.lib;SceneQuery_static_64.lib;SimulationController_static_64.lib;PhysXCharacterKinematic_static_64.lib;DirectXTKd.lib;Effects11d.lib;assimp-vc145-mtd.lib;%(AdditionalDependencies);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PreBuildEvent>
<Command>cd /d "$(SolutionDir)"
call CleanUp.bat
</Command>
</PreBuildEvent>
<PostBuildEvent>
<Command>cd /d "$(SolutionDir)"
call Update_Lib.bat
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
@@ -133,7 +143,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>EDITOR_PROJECT;ENGINE_EXPORTS;IMGUI_EXPORTS;TINYXML2_EXPORT;$(USERDOMAIN);NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>EDITOR_PROJECT;ENGINE_EXPORTS;IMGUI_EXPORTS;TINYXML2_EXPORT;$(USERNAME);NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<AdditionalIncludeDirectories>../Public/;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
@@ -149,6 +159,16 @@
<AdditionalLibraryDirectories>../ThirdPartyLib/fMod/;../ThirdPartyLib/DirectXTK/;../ThirdPartyLib/FX11/;../ThirdPartyLib/Assimp/;../ThirdPartyLib/PhysX/PhysX_$(Configuration)/;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>d3d11.lib;fmod_vc.lib;dinput8.lib;LowLevel_static_64.lib;LowLevelAABB_static_64.lib;LowLevelDynamics_static_64.lib;PhysX_64.lib;PhysXCommon_64.lib;PhysXCooking_64.lib;PhysXExtensions_static_64.lib;PhysXFoundation_64.lib;PhysXPvdSDK_static_64.lib;PhysXTask_static_64.lib;SceneQuery_static_64.lib;SimulationController_static_64.lib;PhysXCharacterKinematic_static_64.lib;DirectXTK.lib;Effects11.lib;assimp-vc145-mt.lib;%(AdditionalDependencies);%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PreBuildEvent>
<Command>cd /d "$(SolutionDir)"
call CleanUp.bat
</Command>
</PreBuildEvent>
<PostBuildEvent>
<Command>cd /d "$(SolutionDir)"
call Update_Lib.bat
</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="..\Private\Animation.cpp" />
+7 -12
View File
@@ -431,10 +431,13 @@ HRESULT CModel::Ready_Materials_FromFile(const aiScene* pAIScene, const _char* p
getline(file, strText);
// value
_uint iBeginIndex = (_uint)strText.find("Environment");
_uint iEndIndex = (_uint)strText.find('.');
if ((_uint)strText.size() < iEndIndex - iBeginIndex)
_int iBeginIndex = (_int)strText.find("Environment");
_int iEndIndex = (_int)strText.find('.');
if (-1 == iBeginIndex || -1 == iEndIndex) {
MSG_BOX("Fail Path _ NotExist"); // Not Exsist
return S_OK;
}
if ((_int)strText.size() < iEndIndex - iBeginIndex)
{
MSG_BOX("Fail Path");
return E_FAIL;
@@ -815,17 +818,9 @@ HRESULT CModel::Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fma
#pragma region Material
if (MODEL::ENVIROMENT == eType)
{
#ifdef 기무리
if (FAILED(Ready_Materials(m_pAIScene, pModelFilePath))) {
return E_FAIL;
}
#endif // 기무리
#ifndef 기무리
if (FAILED(Ready_Materials_FromFile(m_pAIScene, pModelFilePath))) {
return E_FAIL;
}
#endif // !기무리
}
else
{
@@ -85,7 +85,7 @@ struct SaveBone
XMFLOAT4X4 OffsetMatrix;
int BoneIndex = {};
unsigned int WeightsCount = {};
vector<SaveBoneWeight>Weights;
vector<SaveBoneWeight>Weights = {};
};
struct SaveNode