From 06b5319c1566647a9f7f361540eb6874d6dd7ebe Mon Sep 17 00:00:00 2001 From: Chanbin Kim <127280695+JinhoBa@users.noreply.github.com> Date: Fri, 2 Jan 2026 10:07:52 +0900 Subject: [PATCH] =?UTF-8?q?[add]=20RaceRing=20=EB=B0=B0=EC=B9=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Client/Default/Client.vcxproj.filters | 38 +-- .../Client/Private/BroomRaceManager.cpp | 53 +++++ .../Client/Private/BroomRacerAI.cpp | 4 +- .../Client/Private/Level_GamePlay.cpp | 12 +- Jusin154_Team3D/Client/Private/Loader.cpp | 4 +- Jusin154_Team3D/Client/Private/Player.cpp | 4 +- Jusin154_Team3D/Client/Private/RaceRing.cpp | 18 +- .../Client/Public/BroomRaceManager.h | 3 +- Jusin154_Team3D/Client/Public/Client_Macro.h | 1 + Jusin154_Team3D/Client/Public/RaceRing.h | 4 +- .../Data/Map/Hogsmeade_MapContainer_Data.xml | 2 +- .../Data/Map/RaceRing/RaceRing_Data.xml | 73 ++++++ Jusin154_Team3D/Editor/Default/Editor.vcxproj | 2 + .../Editor/Default/Editor.vcxproj.filters | 9 + .../Editor/Private/Level_MapViewer.cpp | 60 ++--- Jusin154_Team3D/Editor/Private/Loader.cpp | 165 ++++++------- .../Editor/Private/MapObject_Manager.cpp | 87 ++++++- Jusin154_Team3D/Editor/Private/RaceRing.cpp | 218 ++++++++++++++++++ .../Editor/Public/MapObject_Manager.h | 5 + Jusin154_Team3D/Editor/Public/RaceRing.h | 45 ++++ 20 files changed, 655 insertions(+), 152 deletions(-) create mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Data/Map/RaceRing/RaceRing_Data.xml create mode 100644 Jusin154_Team3D/Editor/Private/RaceRing.cpp create mode 100644 Jusin154_Team3D/Editor/Public/RaceRing.h diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters index 69ee6ed7c..8b1dd71e2 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters @@ -2,25 +2,25 @@ - 02.GameObjects\ReparoObject\99.Define\00.DEFAULT + 99.Define\00.DEFAULT - 02.GameObjects\ReparoObject\99.Define\00.DEFAULT + 99.Define\00.DEFAULT - 02.GameObjects\ReparoObject\99.Define\00.DEFAULT + 99.Define\00.DEFAULT - 02.GameObjects\ReparoObject\99.Define\00.DEFAULT + 99.Define\00.DEFAULT - 02.GameObjects\ReparoObject\99.Define + 99.Define - 02.GameObjects\ReparoObject\99.Define + 99.Define - 02.GameObjects\ReparoObject\99.Define + 99.Define 00.MainApp @@ -146,7 +146,7 @@ 02.GameObjects\Environment\01.MapPartObject - 02.GameObjects\ReparoObject\99.Define + 99.Define 02.GameObjects\Environment\01.MapPartObject\Collision @@ -803,10 +803,10 @@ - 02.GameObjects\ReparoObject\99.Define\00.DEFAULT + 99.Define\00.DEFAULT - 02.GameObjects\ReparoObject\99.Define\00.DEFAULT + 99.Define\00.DEFAULT @@ -1656,22 +1656,22 @@ {4fbbe0ec-6b65-49f1-a72d-fe73ddbf2b4d} - - {2899f7fc-0ed2-41c0-8e24-0d89f08ffc39} - - - {05a0db73-4fbf-456c-9137-bb605c632d68} - {2e3b9cee-41ee-4984-a1d0-3aaebbcf41a4} + + {2899f7fc-0ed2-41c0-8e24-0d89f08ffc39} + + + {05a0db73-4fbf-456c-9137-bb605c632d68} + - 02.GameObjects\ReparoObject\99.Define\00.DEFAULT + 99.Define\00.DEFAULT - 02.GameObjects\ReparoObject\99.Define\00.DEFAULT + 99.Define\00.DEFAULT 00.MainApp @@ -2459,7 +2459,7 @@ - 02.GameObjects\ReparoObject\99.Define\00.DEFAULT + 99.Define\00.DEFAULT \ No newline at end of file diff --git a/Jusin154_Team3D/Client/Private/BroomRaceManager.cpp b/Jusin154_Team3D/Client/Private/BroomRaceManager.cpp index d17d99620..9989ee920 100644 --- a/Jusin154_Team3D/Client/Private/BroomRaceManager.cpp +++ b/Jusin154_Team3D/Client/Private/BroomRaceManager.cpp @@ -160,6 +160,13 @@ void CBroomRaceManager::Free() void CBroomRaceManager::Describe_Entity() { + if (GUI::Button("Add Race Ring")) + { + if (FAILED(Load_RaceRing())) + { + MSG_BOX("Failed Load RaceRing"); + } + } if (GUI::Button("Race Start")) { m_eRaceState = ENUM_CLASS(RACE_STATE::READY); @@ -379,3 +386,49 @@ void CBroomRaceManager::Push_RaceRing(CRaceRing* Ring) SAFE_ADDREF(Ring); } +HRESULT CBroomRaceManager::Load_RaceRing() +{ + tinyxml2::XMLDocument xmlDoc; + + string strPath = "../Bin/Resources/Data/Map/RaceRing/RaceRing_Data.xml"; + + if ((tinyxml2::XML_SUCCESS != xmlDoc.LoadFile(strPath.c_str()))) + return E_FAIL; + + tinyxml2::XMLElement* root = xmlDoc.FirstChildElement("Ring"); + + if (nullptr == root) + { + MSG_BOX("Failed to Find root"); + return S_OK; + } + + for (auto* Object = root->FirstChildElement("Object"); Object; Object = Object->NextSiblingElement("Object")) + { + CRaceRing::RACERING_DESC Desc = {}; + + Desc.pBroomRaceManager = this; + + /* Transform */ + auto* Rotation = Object->FirstChildElement("Scale"); + Rotation->QueryFloatAttribute("x", &Desc.vScale.x); + Rotation->QueryFloatAttribute("y", &Desc.vScale.y); + Rotation->QueryFloatAttribute("z", &Desc.vScale.z); + + auto* Scale = Object->FirstChildElement("Rotation"); + Scale->QueryFloatAttribute("x", &Desc.vRotation.x); + Scale->QueryFloatAttribute("y", &Desc.vRotation.y); + Scale->QueryFloatAttribute("z", &Desc.vRotation.z); + + auto* Position = Object->FirstChildElement("Position"); + Position->QueryFloatAttribute("x", &Desc.vPosition.x); + Position->QueryFloatAttribute("y", &Desc.vPosition.y); + Position->QueryFloatAttribute("z", &Desc.vPosition.z); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_RING, &Desc))) + return E_FAIL; + } + + return S_OK; +} + diff --git a/Jusin154_Team3D/Client/Private/BroomRacerAI.cpp b/Jusin154_Team3D/Client/Private/BroomRacerAI.cpp index f2adcb02d..b4252b716 100644 --- a/Jusin154_Team3D/Client/Private/BroomRacerAI.cpp +++ b/Jusin154_Team3D/Client/Private/BroomRacerAI.cpp @@ -90,13 +90,13 @@ HRESULT CBroomRacerAI::Initialize(void* pArg) m_pBroomRaceManager = static_cast(pArg); - CBroomRaceManager::RacerInfo Info; + /*CBroomRaceManager::RacerInfo Info; Info.pAI = this; Info.curRing = 0; Info.prevPos = Get_WorldPostion(); - m_pBroomRaceManager->Push_BroomRacer(Info); + m_pBroomRaceManager->Push_BroomRacer(Info);*/ m_LaneOffsetX = m_pGameInstance->Real_Random_Float(-3.f, 3.f); m_LaneOffsetY = m_pGameInstance->Real_Random_Float(-3.f, 3.f); diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index 90654d47c..b57f6525d 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -94,9 +94,9 @@ HRESULT CLevel_GamePlay::Initialize(void* pArg) return E_FAIL; } - if (FAILED(Ready_Layer_RaceRing(TEXT("Layer_RaceRing")))) { - return E_FAIL; - } + //if (FAILED(Ready_Layer_RaceRing(TEXT("Layer_RaceRing")))) { + // return E_FAIL; + //} if (FAILED(Ready_Layer_ReparoObject(TEXT("Layer_ReparoObject")))) { return E_FAIL; @@ -325,8 +325,8 @@ HRESULT CLevel_GamePlay::Ready_Background() #ifdef gimch isReady_Background = true; - isReady_Hogsmeade = true; - isReady_Hogwart = false; + isReady_Hogsmeade = false; + isReady_Hogwart = true; #endif // gimch #ifdef Bin isReady_Background = false; @@ -744,7 +744,7 @@ HRESULT CLevel_GamePlay::Ready_Layer_RaceRing(const _wstring& strLayerTag) CRaceRing::RACERING_DESC RaceRingDesc{}; RaceRingDesc.pBroomRaceManager = m_pBroomRaceManager; - RaceRingDesc.iIndex = i; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &RaceRingDesc))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index ce046d8cf..b53fc3c2b 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -374,8 +374,8 @@ HRESULT CLoader::Loading_For_GamePlay() #ifdef _DEBUG #ifdef gimch - isLoad_Background = true; - isLoad_Hogwart = false; + isLoad_Background = false; + isLoad_Hogwart = true; isLoad_UI_SEQUANTIAL = false; #endif // gimch #ifdef 진우 diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index 9361d0dab..7cfa775c4 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -94,7 +94,7 @@ HRESULT CPlayer::Initialize(void* pArg) m_pBroomRaceManager = pDesc->pBroomRaceManager; - if (m_pBroomRaceManager) + /*if (m_pBroomRaceManager) { CBroomRaceManager::RacerInfo Info; @@ -103,7 +103,7 @@ HRESULT CPlayer::Initialize(void* pArg) Info.prevPos = Get_WorldPostion(); m_pBroomRaceManager->Push_BroomRacer(Info); - } + }*/ } #ifdef _DEBUG diff --git a/Jusin154_Team3D/Client/Private/RaceRing.cpp b/Jusin154_Team3D/Client/Private/RaceRing.cpp index 9617d7c93..bc7828b29 100644 --- a/Jusin154_Team3D/Client/Private/RaceRing.cpp +++ b/Jusin154_Team3D/Client/Private/RaceRing.cpp @@ -30,14 +30,19 @@ HRESULT CRaceRing::Initialize(void* pArg) return E_FAIL; } - m_pBroomRaceManager = static_cast(pArg)->pBroomRaceManager; - m_iIndex = static_cast(pArg)->iIndex; - _float X = m_pGameInstance->Real_Random_Float(-200.f, 200.f); - _float Y = m_pGameInstance->Real_Random_Float(15.f, 60.f); - _float Z = m_pGameInstance->Real_Random_Float(-50.f, 50.f); + + //m_iIndex = static_cast(pArg)->iIndex; + //_float X = m_pGameInstance->Real_Random_Float(-200.f, 200.f); + //_float Y = m_pGameInstance->Real_Random_Float(15.f, 60.f); + //_float Z = m_pGameInstance->Real_Random_Float(-50.f, 50.f); - m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet((_float)m_iIndex *100.f, Y, Z, 1.f)); + RACERING_DESC* pDesc = static_cast(pArg); + m_pBroomRaceManager = pDesc->pBroomRaceManager; + _float3 vRotation = pDesc->vRotation; + m_pTransformCom->Rotation(XMConvertToRadians(vRotation.x), XMConvertToRadians(vRotation.y), XMConvertToRadians(vRotation.z)); + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(pDesc->vPosition.x, pDesc->vPosition.y, pDesc->vPosition.z, 1.f)); + m_pTransformCom->Set_Scale(pDesc->vScale); m_pBroomRaceManager->Push_RaceRing(this); return S_OK; @@ -54,7 +59,6 @@ void CRaceRing::Priority_Update(_float fTimeDelta) void CRaceRing::Update(_float fTimeDelta) { m_pModelCom->Combined_BoneMatrix(); - } void CRaceRing::Late_Update(_float fTimeDelta) diff --git a/Jusin154_Team3D/Client/Public/BroomRaceManager.h b/Jusin154_Team3D/Client/Public/BroomRaceManager.h index b97efbb80..74c28bca4 100644 --- a/Jusin154_Team3D/Client/Public/BroomRaceManager.h +++ b/Jusin154_Team3D/Client/Public/BroomRaceManager.h @@ -41,6 +41,8 @@ class CBroomRaceManager final : public CGameObject void Push_BroomRacer(RacerInfo Info); void Push_RaceRing(class CRaceRing* Ring); _int Get_RaceState() const { return m_eRaceState; } + + HRESULT Load_RaceRing(); private: CInfoInstance* m_pInfoInstance = { nullptr }; @@ -73,7 +75,6 @@ class CBroomRaceManager final : public CGameObject virtual void Free() override; #ifdef _DEBUG virtual void Describe_Entity() override; - #endif }; diff --git a/Jusin154_Team3D/Client/Public/Client_Macro.h b/Jusin154_Team3D/Client/Public/Client_Macro.h index 9e18c3844..82a9a0e03 100644 --- a/Jusin154_Team3D/Client/Public/Client_Macro.h +++ b/Jusin154_Team3D/Client/Public/Client_Macro.h @@ -67,6 +67,7 @@ namespace Client { #define LAYER_UNIFIED TEXT("Layer_Unified") #define LAYER_DOOR TEXT("Layer_Door") #define LAYER_HIDDEN TEXT("Layer_HIDDEN") +#define LAYER_RING TEXT("Layer_Ring") #define LAYER_MAPOBJECTMANAGER TEXT("Layer_MapObjectManager") diff --git a/Jusin154_Team3D/Client/Public/RaceRing.h b/Jusin154_Team3D/Client/Public/RaceRing.h index bc6385b74..947cb43ff 100644 --- a/Jusin154_Team3D/Client/Public/RaceRing.h +++ b/Jusin154_Team3D/Client/Public/RaceRing.h @@ -11,7 +11,9 @@ class CRaceRing final : public CGameObject typedef struct RaceRingDesc { class CBroomRaceManager* pBroomRaceManager = { nullptr }; - _int iIndex = { 0 }; + _float3 vPosition{}; + _float3 vRotation{}; + _float3 vScale{}; }RACERING_DESC; private: CRaceRing(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); 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 86ccaa0b7..d35dcebef 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 @@ -6,7 +6,7 @@ - + Prototype_GameObject_SM_HM_Ollivanders_Railing_Post_A Prototype_GameObject_SM_HM_Ollivanders_Railing_Post_A_Lod1 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/RaceRing/RaceRing_Data.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/RaceRing/RaceRing_Data.xml new file mode 100644 index 000000000..13979eb07 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/RaceRing/RaceRing_Data.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index 60d2b6464..8211584b0 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -211,6 +211,7 @@ call Update_Shaders.bat + @@ -471,6 +472,7 @@ call Update_Shaders.bat + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index 4a975a728..2d67996b8 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -712,6 +712,9 @@ {1402a2f4-a28b-4f95-b4ec-249a840fa819} + + {189b5f72-c985-4bf8-a33e-4257f6d74d25} + @@ -1443,6 +1446,9 @@ 02.GameObjects\Env\06.InstancedProp\Light + + 02.GameObjects\RaceRing + @@ -2182,6 +2188,9 @@ 02.GameObjects\Env\06.InstancedProp\Light + + 02.GameObjects\RaceRing + diff --git a/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp index af7fb8fda..33d66d872 100644 --- a/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp @@ -64,21 +64,21 @@ HRESULT CLevel_MapViewer::Initialize() return E_FAIL; } - //if (FAILED(Ready_Layer_Land(TEXT("Layer_Land")))) { - // return E_FAIL; - //} - - if (FAILED(Ready_Layer_InstanceProp(TEXT("Layer_InstanceProp")))) { + if (FAILED(Ready_Layer_Land(TEXT("Layer_Land")))) { return E_FAIL; } + /*if (FAILED(Ready_Layer_InstanceProp(TEXT("Layer_InstanceProp")))) { + return E_FAIL; + }*/ + //if (FAILED(Ready_Layer_BuildingContainer(TEXT("Layer_Building")))) { // return E_FAIL; //} - //if (FAILED(Ready_Layer_Unified(TEXT("Layer_Unified")))) { - // return E_FAIL; - //} + if (FAILED(Ready_Layer_Unified(TEXT("Layer_Unified")))) { + return E_FAIL; + } /*if (FAILED(Ready_Layer_Door(TEXT("Layer_Door")))) { return E_FAIL; @@ -427,27 +427,27 @@ HRESULT CLevel_MapViewer::Ready_Layer_InstanceProp(const _wstring& strLayerTag) CInstancedProp_Light::INSTANCE_PROP_LIGHT_DESC LightDesc = {}; - /* LightPost */ - LightDesc.bEditMode = false; - LightDesc.isShake = false; - LightDesc.iGlassMeshIndex = 0; - LightDesc.vRadius = _float2(0.f, 0.f); - LightDesc.vSpeed = _float2(0.f, 0.f); - LightDesc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_LightPost"; - LightDesc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Light_Post_Floating.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &LightDesc))) - return E_FAIL; + ///* LightPost */ + //LightDesc.bEditMode = false; + //LightDesc.isShake = false; + //LightDesc.iGlassMeshIndex = 0; + //LightDesc.vRadius = _float2(0.f, 0.f); + //LightDesc.vSpeed = _float2(0.f, 0.f); + //LightDesc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_LightPost"; + //LightDesc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Light_Post_Floating.bin"; + //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &LightDesc))) + // return E_FAIL; - /* LightPost_Floating */ - LightDesc.bEditMode = false; - LightDesc.isShake = false; - LightDesc.iGlassMeshIndex = 1; - LightDesc.vRadius = _float2(0.f, 0.f); - LightDesc.vSpeed = _float2(0.f, 0.f); - LightDesc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_Light_Post_Floating"; - LightDesc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/LightPost.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &LightDesc))) - return E_FAIL; + ///* LightPost_Floating */ + //LightDesc.bEditMode = false; + //LightDesc.isShake = false; + //LightDesc.iGlassMeshIndex = 1; + //LightDesc.vRadius = _float2(0.f, 0.f); + //LightDesc.vSpeed = _float2(0.f, 0.f); + //LightDesc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_Light_Post_Floating"; + //LightDesc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/LightPost.bin"; + //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &LightDesc))) + // return E_FAIL; return S_OK; } @@ -569,8 +569,8 @@ HRESULT CLevel_MapViewer::Ready_Layer_Player_And_Ranrok() } - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Monster")))) - return E_FAIL; + /*if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Monster")))) + return E_FAIL;*/ return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 1c0302774..520a8ca92 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -167,6 +167,8 @@ #include "MapElement_Chest.h" #include "MapElement_Chest_Lid.h" #include "LightSpawner.h" +#include "RaceRing.h" + #pragma endregion @@ -2411,10 +2413,10 @@ HRESULT CLoader::Loading_For_MapViewer() return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Ranrok_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Monster/ConjuredDragon/ConjuredDragon.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixRotationZ(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) { - return E_FAIL; - } + //if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Ranrok_Model"), + // CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Monster/ConjuredDragon/ConjuredDragon.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixRotationZ(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) { + // return E_FAIL; + //} if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Playable_Model"), CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Human/PlayableCharacter/Playable.bin", XMMatrixRotationZ(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) { @@ -2663,6 +2665,7 @@ HRESULT CLoader::Loading_For_MapViewer() vector<_wstring> ModelPrototypeTags = {}; vector ModelPrototypePath = {}; + #pragma region HOGSMEADE /* Hogsmead LOD */ if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\HogsmeadeLOD\\ProxyAssets", @@ -2852,108 +2855,106 @@ HRESULT CLoader::Loading_For_MapViewer() //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_J\\Collision", // ".fbx", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; - - #pragma endregion - +_bool bLoadHogsmeade = false; + if (bLoadHogsmeade) + { #pragma region HOGSMEADE_OBJECT + /* Light */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\LightPosts", + ".bin", false, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; -// /* Fences */ -//if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\fences", -// ".fbx", false, ModelPrototypeTags, ModelPrototypePath))) -// return E_FAIL; + /* Doors */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Doors", + ".bin", false, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; -/* Light */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\LightPosts", - ".bin", false, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; + /* Step */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\GroundSurfaces", + ".bin", false, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; -/* Doors */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Doors", - ".bin", false, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\GroundSurfaces", + ".bin", false, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; -/* Step */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\GroundSurfaces", - ".bin", false, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; + /* Box */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\MiscProps", + ".bin", false, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\GroundSurfaces", - ".bin", false, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; + /* TeaShop Table */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Tables", + ".bin", false, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; -/* Box */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\MiscProps", - ".bin", false, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; - -/* TeaShop Table */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Tables", - ".bin", false, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; - -/* TeaShop Chair*/ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Chairs", - ".bin", false, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; + /* TeaShop Chair*/ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Chairs", + ".bin", false, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; -/* Barrel */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Objects\\Meshes", - ".bin", false, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; + /* Barrel */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Objects\\Meshes", + ".bin", false, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; -/* Object Interactables */ -/* Chest */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Objects\\Interactables", - ".bin", false, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; + /* Object Interactables */ + /* Chest */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Objects\\Interactables", + ".bin", false, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; #pragma endregion #pragma region HOGSMEADE_LOD -/* SUB_HogsHead */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_HogsHead\\SUB_HogsHead_EXTLOD\\ProxyAssets", - ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; -/* SUB_PippensPotions */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_PippensPotions\\SUB_Pippens_EXTLOD\\ProxyAssets", - ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; -/* GEN_E_LOD */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_GEN_E\\SUB_GEN_E_EXTLOD\\ProxyAssets", - ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; -/* GEN_F_LOD */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_GEN_F\\SUB_GEN_F_EXTLOD\\ProxyAssets", - ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; -/* GEN_G_LOD */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_GEN_G\\SUB_GEN_G_EXTLOD\\ProxyAssets", - ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; -/* GEN_H_LOD */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_GEN_H\\SUB_GEN_H_EXTLOD\\ProxyAssets", - ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; -/* GEN_J_LOD */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_GEN_J\\SUB_GEN_J_EXTLOD\\ProxyAssets", - ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; + /* SUB_HogsHead */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_HogsHead\\SUB_HogsHead_EXTLOD\\ProxyAssets", + ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; + /* SUB_PippensPotions */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_PippensPotions\\SUB_Pippens_EXTLOD\\ProxyAssets", + ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; + /* GEN_E_LOD */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_GEN_E\\SUB_GEN_E_EXTLOD\\ProxyAssets", + ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; + /* GEN_F_LOD */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_GEN_F\\SUB_GEN_F_EXTLOD\\ProxyAssets", + ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; + /* GEN_G_LOD */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_GEN_G\\SUB_GEN_G_EXTLOD\\ProxyAssets", + ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; + /* GEN_H_LOD */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_GEN_H\\SUB_GEN_H_EXTLOD\\ProxyAssets", + ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; + /* GEN_J_LOD */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_GEN_J\\SUB_GEN_J_EXTLOD\\ProxyAssets", + ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; #pragma endregion - + } #pragma region HOGWART -_bool bHogwartLoad = { false }; +_bool bHogwartLoad = { true }; /* Hogwart LOD */ if (FAILED(MapFolderLoad("../Bin/Resources/Models/MapMesh/Game/Environment/Hogwarts/HogwartsLOD", ".bin", false, ModelPrototypeTags, ModelPrototypePath))) return E_FAIL; +if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_RaceRing_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Object/RaceRing/SM_BRR_RaceRing_01.bin", XMMatrixRotationX(XMConvertToRadians(90.f)) * XMMatrixIdentity())))) + return E_FAIL; + if(bHogwartLoad) { /* QuidditchPitch */ @@ -3247,7 +3248,7 @@ vector> jobFutures; _uint iLoadCount = 46; vector*> Contents(iLoadCount); -_bool isLoad_Map = { true }; +_bool isLoad_Map = { false }; if(isLoad_Map) { { /* Terrain */ @@ -3852,6 +3853,10 @@ if(isLoad_Map) if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummyDecal::Create(m_pDevice, m_pContext)))) return E_FAIL; + /* For.Prototype_GameObject_RaceRing */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CRaceRing::Create(m_pDevice, m_pContext)))) + return E_FAIL; + /* For.Prototype_GameObject_MapObject_Manager */ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CMapObject_Manager::Create(m_pDevice, m_pContext, ModelPrototypeTags, ModelPrototypePath)))) return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp b/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp index 24e4c9338..296f3b16a 100644 --- a/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp +++ b/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp @@ -15,6 +15,7 @@ #include "MapElement_Lake.h" #include "LightSpawner.h" #include "DummyDecal.h" +#include "RaceRing.h" CMapObject_Manager::CMapObject_Manager(ID3D11Device * pDevice, ID3D11DeviceContext * pContext) @@ -93,6 +94,10 @@ HRESULT CMapObject_Manager::Initialize(void* pArg) //m_pInfoInstance->Load_Decal("Duengon_Decal_Data"); //m_pInfoInstance->Load_PointLights("Duengon_PointLight_Data"); #pragma endregion + if (FAILED(Load_MapData("Hogwart_MapContainer_Data", LAYER_HOGWART))) + return E_FAIL; + if (FAILED(Load_MapData("HogwartMap1221", LAYER_HOGWART))) + return E_FAIL; #pragma region Light @@ -206,8 +211,9 @@ void CMapObject_Manager::Update(_float fTimeDelta) Update_Edit(); - Update_LightSpawer(); + //Update_LightSpawer(); //Update_Decal(); + Update_RaceRing(); Update_Unified(); @@ -1945,6 +1951,51 @@ HRESULT CMapObject_Manager::Save_Decal(const _char* pFileName) return S_OK; } +HRESULT CMapObject_Manager::Save_RaceRing(const _char* pFileName) +{ + CLayer* pLayer = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_RaceRing")); + + if (nullptr == pLayer) + return S_OK; + + tinyxml2::XMLDocument doc; + string strPath = "../Bin/Resources/Data/Map/RaceRing/" + string(pFileName) + ".xml"; + + tinyxml2::XMLError loadResult = doc.LoadFile(strPath.c_str()); + + doc.Clear(); + doc.InsertFirstChild(doc.NewDeclaration()); + + tinyxml2::XMLElement* root = doc.NewElement("Ring"); + doc.InsertEndChild(root); + + if (nullptr != pLayer) + { + const list* pList = pLayer->Get_Objects(); + + for (auto pGamObject : *pList) + { + CRaceRing* pRaceRing = dynamic_cast(pGamObject); + + if (nullptr == pRaceRing) + return E_FAIL; + + if (FAILED(pRaceRing->Save_XML(doc, root))) + return E_FAIL; + } + } + + if (doc.SaveFile(strPath.c_str()) != tinyxml2::XML_SUCCESS) { + MSG_BOX("Failed to Save File"); + } + else + { + MSG_BOX("Succeed to Save DummyDecals"); + } + + return S_OK; +} + void CMapObject_Manager::Update_PrototypeList() { GUI::Begin("Model Prototype List"); @@ -2282,6 +2333,40 @@ void CMapObject_Manager::Update_Decal() GUI::End(); } +void CMapObject_Manager::Update_RaceRing() +{ + GUI::Begin("RaceRing Editor"); + if (GUI::Button("Save RaceRings")) + { + Save_RaceRing("RaceRing_Data"); + } + if (GUI::Button("Load Ring")) + { + //m_pInfoInstance->Load_Decal("Duengon_Decal_Data"); + } + if (GUI::Button("Add Ring")) + { + m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_RaceRing")); + } + + GUI::InputInt("Index : ", (_int*)&m_iSelectedIndex); + CLayer* pLayer = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_RaceRing")); + + if (nullptr != pLayer) + { + _uint iIndex = {}; + for (auto& pObject : *pLayer->Get_Objects()) + { + if (m_iSelectedIndex == iIndex) + pObject->Describe_Entity(); + + ++iIndex; + } + } + + GUI::End(); +} + void CMapObject_Manager::Create_PartObject(_wstring& strPrototypeTag) { vector<_uint> LodModelIndices; diff --git a/Jusin154_Team3D/Editor/Private/RaceRing.cpp b/Jusin154_Team3D/Editor/Private/RaceRing.cpp new file mode 100644 index 000000000..c84d9945d --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/RaceRing.cpp @@ -0,0 +1,218 @@ +#include "pch.h" +#include "RaceRing.h" + +#include "GameInstance.h" + +CRaceRing::CRaceRing(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CGameObject(pDevice, pContext) +{ +} + +CRaceRing::CRaceRing(const CRaceRing& Prototype) + : CGameObject(Prototype) +{ +} + +HRESULT CRaceRing::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CRaceRing::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) { + return E_FAIL; + } + + if (FAILED(Ready_Components())) { + return E_FAIL; + } + + m_iIndex = 0; + + return S_OK; +} + +void CRaceRing::Priority_Update(_float fTimeDelta) +{ +#ifdef _DEBUG + +#endif // _DEBUG +} + +void CRaceRing::Update(_float fTimeDelta) +{ + m_pModelCom->Combined_BoneMatrix(); +} + +void CRaceRing::Late_Update(_float fTimeDelta) +{ + m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); +} + +HRESULT CRaceRing::Render() +{ + if (!m_pModelCom) + return S_OK; + + if (!m_bVisible) + return S_OK; + + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + + _uint iNumMeshes = m_pModelCom->Get_NumMeshes(); + + for (_uint i = 0; i < iNumMeshes; i++) + { + if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Render(i))) { + return E_FAIL; + } + } + + + return S_OK; +} + +HRESULT CRaceRing::Ready_Components() +{ + __super::Ready_Components(nullptr); + + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_RaceRing_Model"), + reinterpret_cast(&m_pModelCom)))) + return E_FAIL; + + /* Com_Shader */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH, + reinterpret_cast(&m_pShaderCom)))) + return E_FAIL; + + return S_OK; +} + +HRESULT CRaceRing::Bind_ShaderResources() +{ + if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", m_pTransformCom->Get_WorldMatrixPtr()))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_PrevWorldMatrix", m_pTransformCom->Get_PrevWorldMatrixPtr()))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevViewMatrix", D3DTS::VIEW))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevProjMatrix", D3DTS::PROJ))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { + return E_FAIL; + } + + return S_OK; +} + +CRaceRing* CRaceRing::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CRaceRing* pInstance = new CRaceRing(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CRaceRing"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CRaceRing::Clone(void* pArg, CGameObject* pOwner) +{ + CRaceRing* pInstance = new CRaceRing(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CRaceRing"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CRaceRing::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pModelCom); + +} +#ifdef _DEBUG + +void CRaceRing::Describe_Entity() +{ + m_pTransformCom->Describe_Entity(); + + if (m_pGameInstance->Mouse_Down(DIM_LBUTTON) && m_pGameInstance->Key_Pressing(DIK_LSHIFT)) + { + _float3 vPosition = {}; + if (m_pGameInstance->isPicking(&vPosition)) + { + vPosition.y += 20.7f; + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&vPosition), 1.f)); + } + } +} + +HRESULT CRaceRing::Save_XML(tinyxml2::XMLDocument& doc, tinyxml2::XMLElement* root) +{ + tinyxml2::XMLElement* object = doc.NewElement("Object"); + object->SetAttribute("Type", 0); + root->InsertEndChild(object); + +#pragma region TRANSFORM + _float3 vPosition = {}; + XMStoreFloat3(&vPosition, m_pTransformCom->Get_State(STATE::POSITION)); + + _float3 vScale = m_pTransformCom->Get_Scale(); + + _float3 vRotation = m_pTransformCom->Get_Rotation(); + + tinyxml2::XMLElement* Position = doc.NewElement("Position"); + Position->SetAttribute("x", vPosition.x); + Position->SetAttribute("y", vPosition.y); + Position->SetAttribute("z", vPosition.z); + object->InsertEndChild(Position); + + tinyxml2::XMLElement* Scale = doc.NewElement("Scale"); + Scale->SetAttribute("x", vScale.x); + Scale->SetAttribute("y", vScale.y); + Scale->SetAttribute("z", vScale.z); + object->InsertEndChild(Scale); + + tinyxml2::XMLElement* Rotation = doc.NewElement("Rotation"); + Rotation->SetAttribute("x", vRotation.x); + Rotation->SetAttribute("y", vRotation.y); + Rotation->SetAttribute("z", vRotation.z); + object->InsertEndChild(Rotation); +#pragma endregion + + return S_OK; +} + +#endif // _DEBUG diff --git a/Jusin154_Team3D/Editor/Public/MapObject_Manager.h b/Jusin154_Team3D/Editor/Public/MapObject_Manager.h index b52048882..b6b1686eb 100644 --- a/Jusin154_Team3D/Editor/Public/MapObject_Manager.h +++ b/Jusin154_Team3D/Editor/Public/MapObject_Manager.h @@ -84,6 +84,10 @@ class CMapObject_Manager final : public CGameObject HRESULT Save_PointLightObject(const _char* pFileName); HRESULT Save_Decal(const _char* pFileName); + + HRESULT Save_RaceRing(const _char* pFileName); + + #pragma endregion void Update_PrototypeList(); @@ -93,6 +97,7 @@ class CMapObject_Manager final : public CGameObject void Update_Unified(); void Update_LightSpawer(); void Update_Decal(); + void Update_RaceRing(); void Create_PartObject(_wstring& strPrototypeTag); void Create_Elemnt(_wstring& strPrototypeTag); diff --git a/Jusin154_Team3D/Editor/Public/RaceRing.h b/Jusin154_Team3D/Editor/Public/RaceRing.h new file mode 100644 index 000000000..445b1a9ac --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/RaceRing.h @@ -0,0 +1,45 @@ +#pragma once + +#include "Editor_Define.h" +#include "PartObject.h" + +NS_BEGIN(Editor) + +class CRaceRing final : public CGameObject +{ +private: + CRaceRing(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CRaceRing(const CRaceRing& Prototype); + virtual ~CRaceRing() = default; + +public: + virtual HRESULT Initialize_Prototype() override; + 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; + void Set_Target(_bool bTarget) { m_bTarget = bTarget; } + +private: + CShader* m_pShaderCom = { nullptr }; + CModel* m_pModelCom = { nullptr }; + _bool m_bTarget = { false }; + _int m_iIndex = {}; + +private: + HRESULT Ready_Components(); + HRESULT Bind_ShaderResources(); + +public: + static CRaceRing* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr)override; + virtual void Free() override; + +#ifdef _DEBUG + void Describe_Entity() override; + HRESULT Save_XML(tinyxml2::XMLDocument& doc, tinyxml2::XMLElement* root); +#endif // _DEBUG +}; + +NS_END