Merge pull request #332 from SpicyGangjeong/MapTool

Map tool
This commit is contained in:
JinhoBa
2025-12-05 15:08:00 +09:00
committed by GitHub
33 changed files with 732 additions and 109 deletions
@@ -937,9 +937,6 @@
<ClCompile Include="..\Private\Monster.cpp">
<Filter>02.GameObjects\Monster</Filter>
</ClCompile>
<ClCompile Include="..\private\MapContainer.cpp">
<Filter>02.GameObjects\Environment\00.MapContainer</Filter>
</ClCompile>
<ClCompile Include="..\private\BuildingContainer.cpp">
<Filter>02.GameObjects\Environment\00.MapContainer\BuildingContainer</Filter>
</ClCompile>
@@ -124,9 +124,8 @@ HRESULT CInstancedProp::Load_InstancedProp(const _char* pFilePath)
WorldMatrices.reserve(iNumWorldMatrix);
_float4x4 WorldMatrix = {};
FileIn.read(reinterpret_cast<char*>(&WorldMatrix), sizeof(_float4x4));
for (_uint i = 1; i < iNumWorldMatrix; ++i)
for (_uint i = 0; i < iNumWorldMatrix; ++i)
{
FileIn.read(reinterpret_cast<char*>(&WorldMatrix), sizeof(_float4x4));
@@ -163,7 +163,7 @@ HRESULT CLevel_GamePlay::Ready_Background()
CInfoInstance::GetInstance()->Load_MapObjects("ClientTest");
/* 전체 맵 */
//CInfoInstance::GetInstance()->Load_MapObjects("Map1129");
CInfoInstance::GetInstance()->Load_MapObjects("Hogsmeade_MapContainer_Data");
/* 조명 오브젝트 */
CInfoInstance::GetInstance()->Load_LightElements("LightElement");
@@ -38,11 +38,14 @@ void CLight_Main::Priority_Update(_float fTimeDelta)
void CLight_Main::Update(_float fTimeDelta)
{
#ifdef _DEBUG
GUI::Begin("Main_Light");
#ifdef _DEBUG
m_pLightCom->Describe_Entity();
#endif // _DEBUG
GUI::End();
#endif // _DEBUG
}
void CLight_Main::Late_Update(_float fTimeDelta)
+13 -1
View File
@@ -483,6 +483,16 @@ HRESULT CLoader::Loading_For_GamePlay()
".bin", false
));
}
{/* Step and Stair */
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/GroundSurfaces",
".bin", false
));
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Collision/GroundSurfaces",
".bin", false
));
}
}
#pragma endregion
@@ -1175,7 +1185,9 @@ HRESULT CLoader::Loading_For_GamePlay()
Desc.fDensity = 1.f;
Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY());
Desc.eLockFlag = {};
Desc.vAutoDamping = { 1.f, 1.f };
Desc.vAutoDamping = { 100.f, 100.f };
Desc.vLocalRotQ = { 0.f, 0.f, 0.f, 1.f };
Desc.vLocalTranslation = { 0.f, 0.f, 0.f };
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_HEAVY_WALL"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) {
+3 -2
View File
@@ -79,8 +79,9 @@ HRESULT CMapInfo::Load_MapObjects(const _char* pFileName)
{
const _char* pName = {};
_uint iMapContainerType = {};
Container->QueryStringAttribute("Name", &pName);
Container->QueryUnsignedAttribute("MapContainerType", &iMapContainerType);
//Container->QueryUnsignedAttribute("MapContainerType", &iMapContainerType);
Container->FirstChildElement("MapContainerType")->QueryUnsignedAttribute("type", &iMapContainerType);
CMapContainer* pContainerObject = nullptr;
+1 -3
View File
@@ -59,9 +59,7 @@ void CTerrain::Update(_float fTimeDelta)
{
#ifdef _DEBUG
Describe_Entity();
#endif // _DEBUG
#endif // DEBUG
}
void CTerrain::Late_Update(_float fTimeDelta)
@@ -3686,4 +3686,220 @@
<Rotation x="0" y="109.99998" z="0"/>
</PartObject>
</Container>
<Container Name="HM_HIGHTSTREET_1">
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
<PartObject Lod_Level="2" Key_Index="0" Render_Type="0">
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_C</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_C_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_C_Lod2</PrototypeTag>
<Position x="43.060459" y="4.4474273" z="86.324295"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="-1.9999999"/>
</PartObject>
<PartObject Lod_Level="2" Key_Index="1" Render_Type="0">
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_C</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_C_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_C_Lod2</PrototypeTag>
<Position x="43.16312" y="5.1212273" z="87.537697"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="-3.0000002"/>
</PartObject>
<PartObject Lod_Level="2" Key_Index="2" Render_Type="0">
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_C</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_C_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_C_Lod2</PrototypeTag>
<Position x="43.246662" y="5.8459349" z="88.465637"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="-3.0000002"/>
</PartObject>
<Collision Lod_Level="0" Key_Index="0">
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_01_A_COL</PrototypeTag>
<Position x="43.272125" y="4.5027952" z="86.833504"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="-1.9999999"/>
</Collision>
<Collision Lod_Level="0" Key_Index="0">
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_01_A_COL</PrototypeTag>
<Position x="43.313957" y="5.0392594" z="87.718208"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="-3.0000002"/>
</Collision>
<Collision Lod_Level="0" Key_Index="0">
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_01_A_COL</PrototypeTag>
<Position x="43.331394" y="5.6026211" z="88.623962"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="-3.0000002"/>
</Collision>
<Collision Lod_Level="0" Key_Index="0">
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_01_A_COL</PrototypeTag>
<Position x="43.442574" y="5.9601059" z="89.690971"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="-3.0000002"/>
</Collision>
</Container>
<Container Name="HM_PlazzaStep_1">
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
<PartObject Lod_Level="3" Key_Index="0" Render_Type="0">
<PrototypeTag>Prototype_GameObject_SM_HM_PlazaSteps_A</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_PlazaSteps_A_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_PlazaSteps_A_Lod2</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_PlazaSteps_A_Lod3</PrototypeTag>
<Position x="108.98026" y="12.006719" z="98.133469"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="-2.6680425e-08" y="120" z="0.50003815"/>
</PartObject>
<PartObject Lod_Level="3" Key_Index="1" Render_Type="0">
<PrototypeTag>Prototype_GameObject_SM_HM_PlazaSteps_A</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_PlazaSteps_A_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_PlazaSteps_A_Lod2</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_PlazaSteps_A_Lod3</PrototypeTag>
<Position x="94.653152" y="7.0902638" z="87.852188"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="3" Key_Index="2" Render_Type="0">
<PrototypeTag>Prototype_GameObject_SM_HM_PlazaSteps_A</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_PlazaSteps_A_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_PlazaSteps_A_Lod2</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_PlazaSteps_A_Lod3</PrototypeTag>
<Position x="94.30027" y="8.9721889" z="94.704437"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="3" Key_Index="3" Render_Type="0">
<PrototypeTag>Prototype_GameObject_SM_HM_PlazaSteps_A</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_PlazaSteps_A_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_PlazaSteps_A_Lod2</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_PlazaSteps_A_Lod3</PrototypeTag>
<Position x="111.71465" y="14.805841" z="104.53838"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="15.000003" z="0"/>
</PartObject>
<PartObject Lod_Level="3" Key_Index="4" Render_Type="0">
<PrototypeTag>Prototype_GameObject_SM_HM_PlazaSteps_A</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_PlazaSteps_A_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_PlazaSteps_A_Lod2</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_PlazaSteps_A_Lod3</PrototypeTag>
<Position x="111.50461" y="13.667078" z="102.27715"/>
<Scale x="0.99999994" y="1" z="0.99999994"/>
<Rotation x="0" y="18.000004" z="0"/>
</PartObject>
<Collision Lod_Level="0" Key_Index="0">
<PrototypeTag>Prototype_GameObject_SM_HM_PlazaSteps_A_Small_COL</PrototypeTag>
<Position x="109.02284" y="12.009924" z="98.142662"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="-2.6680425e-08" y="120" z="0.50003815"/>
</Collision>
<Collision Lod_Level="0" Key_Index="0">
<PrototypeTag>Prototype_GameObject_SM_HM_PlazaSteps_A_Small_COL</PrototypeTag>
<Position x="94.647194" y="7.0425816" z="87.874741"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</Collision>
<Collision Lod_Level="0" Key_Index="0">
<PrototypeTag>Prototype_GameObject_SM_HM_PlazaSteps_A_Small_COL</PrototypeTag>
<Position x="94.29937" y="8.9283915" z="94.739632"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</Collision>
<Collision Lod_Level="0" Key_Index="0">
<PrototypeTag>Prototype_GameObject_SM_HM_PlazaSteps_A_Small_COL</PrototypeTag>
<Position x="111.70499" y="14.759014" z="104.55251"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="15.000003" z="0"/>
</Collision>
<Collision Lod_Level="0" Key_Index="0">
<PrototypeTag>Prototype_GameObject_SM_HM_PlazaSteps_A_Small_COL</PrototypeTag>
<Position x="111.49685" y="13.618633" z="102.31825"/>
<Scale x="0.99999994" y="1" z="0.99999994"/>
<Rotation x="0" y="18.000004" z="0"/>
</Collision>
</Container>
<Container Name="HM_HighStreet_2">
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
<PartObject Lod_Level="3" Key_Index="2" Render_Type="0">
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_A</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_A_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_A_Lod2</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_A_Lod3</PrototypeTag>
<Position x="54.502098" y="7.9298048" z="102.99089"/>
<Scale x="0.99999994" y="0.99999994" z="1"/>
<Rotation x="5" y="49.999996" z="-3.8342409"/>
</PartObject>
<PartObject Lod_Level="3" Key_Index="3" Render_Type="0">
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_A</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_A_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_A_Lod2</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_A_Lod3</PrototypeTag>
<Position x="56.1898" y="8.8552332" z="104.5234"/>
<Scale x="0.99999994" y="0.99999994" z="1"/>
<Rotation x="5" y="49.999996" z="-3.8342409"/>
</PartObject>
<PartObject Lod_Level="3" Key_Index="4" Render_Type="0">
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_A</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_A_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_A_Lod2</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_A_Lod3</PrototypeTag>
<Position x="53.122005" y="6.8031578" z="101.34745"/>
<Scale x="0.99999994" y="1" z="0.99999994"/>
<Rotation x="0" y="50" z="0"/>
</PartObject>
<PartObject Lod_Level="3" Key_Index="5" Render_Type="0">
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_A</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_A_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_A_Lod2</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_A_Lod3</PrototypeTag>
<Position x="58.088501" y="9.7055407" z="106.00336"/>
<Scale x="0.99999994" y="0.99999994" z="1"/>
<Rotation x="5" y="49.999996" z="-3.8342409"/>
</PartObject>
<PartObject Lod_Level="3" Key_Index="6" Render_Type="0">
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_A</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_A_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_A_Lod2</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_A_Lod3</PrototypeTag>
<Position x="59.941898" y="10.550675" z="107.57169"/>
<Scale x="0.99999994" y="0.99999994" z="1"/>
<Rotation x="5" y="49.999996" z="-3.8342409"/>
</PartObject>
<PartObject Lod_Level="3" Key_Index="7" Render_Type="0">
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_A</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_A_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_A_Lod2</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_Stone_Steps_High_Street_A_Lod3</PrototypeTag>
<Position x="60.668945" y="10.918675" z="108.6668"/>
<Scale x="0.99999994" y="1" z="0.99999994"/>
<Rotation x="0" y="50" z="0"/>
</PartObject>
<Collision Lod_Level="0" Key_Index="0">
<PrototypeTag>Prototype_GameObject_SM_HM_High_Street_Stairs_A_COL</PrototypeTag>
<Position x="54.589691" y="8.3145065" z="103.22376"/>
<Scale x="0.99999994" y="0.99999994" z="1.0000001"/>
<Rotation x="10.000001" y="50.000008" z="-7.6926308"/>
</Collision>
<Collision Lod_Level="0" Key_Index="0">
<PrototypeTag>Prototype_GameObject_SM_HM_High_Street_Stairs_B_COL</PrototypeTag>
<Position x="53.374268" y="6.9218588" z="100.79335"/>
<Scale x="0.99999994" y="1" z="0.99999994"/>
<Rotation x="0" y="50" z="0"/>
</Collision>
<Collision Lod_Level="0" Key_Index="0">
<PrototypeTag>Prototype_GameObject_SM_HM_High_Street_Stairs_A_COL</PrototypeTag>
<Position x="57.332142" y="9.6449766" z="105.63279"/>
<Scale x="0.99999994" y="0.99999994" z="0.99999988"/>
<Rotation x="10.000001" y="50.000008" z="-7.6926308"/>
</Collision>
<Collision Lod_Level="0" Key_Index="0">
<PrototypeTag>Prototype_GameObject_SM_HM_High_Street_Stairs_B_COL</PrototypeTag>
<Position x="60.616646" y="11.076958" z="107.7627"/>
<Scale x="0.99999994" y="0.99999994" z="1"/>
<Rotation x="9.999999" y="48" z="-7.4653044"/>
</Collision>
</Container>
</Land>
+46 -2
View File
@@ -1037,6 +1037,8 @@ HRESULT CLoader::Loading_For_Effect()
Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY());
Desc.eLockFlag = {};
Desc.vAutoDamping = { };
Desc.vLocalRotQ = { 0.f, 0.f, 0.f, 1.f };
Desc.vLocalTranslation = { 0.f, 0.f, 0.f };
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) {
return E_FAIL;
@@ -1055,6 +1057,8 @@ HRESULT CLoader::Loading_For_Effect()
Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY());
Desc.eLockFlag = {};
Desc.vAutoDamping = { 100.f, 100.f };
Desc.vLocalRotQ = { 0.f, 0.f, 0.f, 1.f };
Desc.vLocalTranslation = { 0.f, 0.f, 0.f };
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_HEAVY_WALL"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) {
return E_FAIL;
@@ -1389,6 +1393,8 @@ HRESULT CLoader::Loading_For_PhysXLevel()
Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY());
Desc.eLockFlag = {};
Desc.vAutoDamping = { };
Desc.vLocalRotQ = { 0.f, 0.f, 0.f, 1.f };
Desc.vLocalTranslation = { 0.f, 0.f, 0.f };
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) {
return E_FAIL;
@@ -1408,6 +1414,8 @@ HRESULT CLoader::Loading_For_PhysXLevel()
Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY());
Desc.eLockFlag = {};
Desc.vAutoDamping = { 100.f, 100.f };
Desc.vLocalRotQ = { 0.f, 0.f, 0.f, 1.f };
Desc.vLocalTranslation = { 0.f, 0.f, 0.f };
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_HEAVY_WALL"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) {
return E_FAIL;
@@ -1427,6 +1435,8 @@ HRESULT CLoader::Loading_For_PhysXLevel()
Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY());
Desc.eLockFlag = { PSX::PxRigidDynamicLockFlag::eLOCK_ANGULAR_X | PSX::PxRigidDynamicLockFlag::eLOCK_ANGULAR_Z | PSX::PxRigidDynamicLockFlag::eLOCK_LINEAR_Y };
Desc.vAutoDamping = { 10.f, 10.f };
Desc.vLocalRotQ = { 0.f, 0.f, 0.f, 1.f };
Desc.vLocalTranslation = { 0.f, 0.f, 0.f };
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_PLATFORM"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) {
return E_FAIL;
@@ -1444,6 +1454,8 @@ HRESULT CLoader::Loading_For_PhysXLevel()
Desc.vhalfGeometryInfo = { 3.5f, 1.5f, 0.25f };
Desc.fDensity = 10.f;
PSX::PxTransform pxPivotTransform = PSX::PxTransform(PSX::PxVec3(3.5f, 1.5f, 0.f));
Desc.vLocalRotQ = { 0.f, 0.f, 0.f, 1.f };
Desc.vLocalTranslation = { 0.f, 0.f, 0.f };
Desc.pxMassCenter = pxPivotTransform;
Desc.eLockFlag = {
@@ -1476,6 +1488,8 @@ HRESULT CLoader::Loading_For_PhysXLevel()
Desc.pxMassCenter = pxPivotTransform;
Desc.eLockFlag = { };
Desc.vAutoDamping = { 10.f, 10.f };
Desc.vLocalRotQ = { 0.f, 0.f, 0.f, 1.f };
Desc.vLocalTranslation = { 0.f, 0.f, 0.f };
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_DOOR"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) {
return E_FAIL;
@@ -1888,6 +1902,8 @@ HRESULT CLoader::Loading_For_ObjectViewer()
Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY());
Desc.eLockFlag = {};
Desc.vAutoDamping = { 100.f, 100.f };
Desc.vLocalRotQ = { 0.f, 0.f, 0.f, 1.f };
Desc.vLocalTranslation = { 0.f, 0.f, 0.f };
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_HEAVY_WALL"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) {
@@ -2300,7 +2316,7 @@ HRESULT CLoader::Loading_For_MapViewer()
///* BLDG_TeaShop */
/*if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TeaShop\\Meshes",
".bin", false, ModelPrototypeTags, ModelPrototypePath)))
".fbx", false, ModelPrototypeTags, ModelPrototypePath)))
return E_FAIL;
if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TeaShop\\Collision",
".bin", false, ModelPrototypeTags, ModelPrototypePath)))
@@ -2417,10 +2433,21 @@ HRESULT CLoader::Loading_For_MapViewer()
/* Doors */
if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Doors",
".fbx", true, ModelPrototypeTags, ModelPrototypePath)))
".bin", false, ModelPrototypeTags, ModelPrototypePath)))
return E_FAIL;
/* Barrel */
if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Objects\\Meshes",
".bin", false, ModelPrototypeTags, ModelPrototypePath)))
return E_FAIL;
/* Step */
if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\GroundSurfaces",
".fbx", true, ModelPrototypeTags, ModelPrototypePath)))
return E_FAIL;
if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\GroundSurfaces",
".fbx", true, ModelPrototypeTags, ModelPrototypePath)))
return E_FAIL;
#pragma endregion
@@ -2757,6 +2784,23 @@ vector<vector<FOLDER_LOAD*>*> Contents(iLoadCount);
m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다.");
CRigidBody_Dynamic::RIGIDBODY_PROTOTYPE_DYNAMIC_DESC Desc{};
{
Desc.eType = ACTOR::BOX;
Desc.ePxRigidBodyFlags = { PSX::PxRigidBodyFlag::eKINEMATIC };
Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE };
Desc.ePxMaterialTypes = { PXMATERIAL::DEFAULT };
Desc.vMatInfo = { 0.5f, 0.5f, 0.6f };
Desc.fContactOffset = { 0.05f };
Desc.vhalfGeometryInfo = { 0.5f, 0.5f, 0.5f };
Desc.fDensity = 10.f;
Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY());
Desc.eLockFlag = {};
Desc.vAutoDamping = { };
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) {
return E_FAIL;
}
/* For.Prototype_Component_Collider */
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_Collider"),
@@ -50,6 +50,9 @@ HRESULT CMapElement_Interactable::Initialize(void* pArg)
m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z));
#endif // _DEBUG
m_vBoxSize = _float3(1.f, 1.f, 1.f);
m_pActor = static_cast<PSX::PxRigidDynamic*>(m_pRigidBody->Get_Actor());
return S_OK;
}
@@ -62,20 +65,21 @@ void CMapElement_Interactable::Priority_Update(_float fTimeDelta)
void CMapElement_Interactable::Update(_float fTimeDelta)
{
}
void CMapElement_Interactable::Late_Update(_float fTimeDelta)
{
#ifdef _DEBUG
if (m_bSelected)
{
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&m_vPosition), 1.f));
m_pTransformCom->Set_Scale(m_vScale);
m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z));
}
}
void CMapElement_Interactable::Late_Update(_float fTimeDelta)
{
#ifdef _DEBUG
#endif
if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) {
if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pModelComs[0]->Get_Radius())) {
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
}
}
@@ -92,7 +96,7 @@ HRESULT CMapElement_Interactable::Render()
if (FAILED(m_pModelComs[0]->Bind_Material(i, m_pShaderCom))) {
return E_FAIL;
}
if (m_bSelected)
if (m_bSelected && m_bUseSelectColor)
{
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::MAPTOOL)))) {
return E_FAIL;
@@ -111,6 +115,12 @@ HRESULT CMapElement_Interactable::Render()
}
}
#ifdef _DEBUG
if (FAILED(m_pRigidBody->Render())) {
return E_FAIL;
}
#endif // _DEBUG
return S_OK;
}
@@ -137,6 +147,17 @@ HRESULT CMapElement_Interactable::Ready_Components(void* pArg)
reinterpret_cast<CComponent**>(&m_pShaderCom))))
return E_FAIL;
ELEMENT_INTERACTABLE_DESC* pPhysXDummyDesc = static_cast<ELEMENT_INTERACTABLE_DESC*>(pArg);
// RIGID_BODY
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
Desc.iSubKind = ENUM_CLASS(PXOBJECT::BOX);//pPhysXDummyDesc->iSubKind;
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), (CComponent**)&m_pRigidBody, &Desc))) {
return E_FAIL;
}
return S_OK;
}
@@ -187,9 +208,14 @@ CGameObject* CMapElement_Interactable::Clone(void* pArg, CGameObject* pOwner)
void CMapElement_Interactable::Free()
{
if (nullptr != m_pRigidBody) {
m_pGameInstance->Release_Actor(*m_pRigidBody->Get_Actor());
}
__super::Free();
SAFE_RELEASE(m_pRigidBody);
SAFE_RELEASE(m_pShaderCom);
for (auto& pModel : m_pModelComs)
SAFE_RELEASE(pModel);
}
@@ -201,34 +227,82 @@ void CMapElement_Interactable::Describe_Entity()
if (nullptr == m_pGameInstance)
return;
PSX::PxVec3 vDir = PSX::PxVec3(0.f, 1.f, 0.f);
if (GUI::CollapsingHeader("Rigid Body"))
{
GUI::InputFloat("Power", &m_fPower);
if (GUI::Button("Move Test"))
{
m_pActor = static_cast<PSX::PxRigidDynamic*>(m_pRigidBody->Get_Actor());
if(nullptr != m_pActor)
{
m_pActor->wakeUp();
m_pActor->addForce(vDir * m_fPower * 100000.f, PSX::PxForceMode::eFORCE);
}
}
if (GUI::Button("OFF_Kinematic"))
{
m_pActor = static_cast<PSX::PxRigidDynamic*>(m_pRigidBody->Get_Actor());
if (nullptr != m_pActor)
m_pActor->setRigidBodyFlag(PSX::PxRigidBodyFlag::eKINEMATIC, false);
}
if (GUI::Button("ON_Kinematic"))
{
m_pActor = static_cast<PSX::PxRigidDynamic*>(m_pRigidBody->Get_Actor());
if (nullptr != m_pActor)
m_pActor->setRigidBodyFlag(PSX::PxRigidBodyFlag::eKINEMATIC, true);
}
if(GUI::InputFloat("Mass", &m_fMass))
m_pActor->setMass(m_fMass);
m_pRigidBody->Describe_Entity();
}
GUI::Text(CMyTools::ToString(m_ModelPrototypeTags[m_iLodIndex]).c_str());
GUI::InputInt("Lod Level", (_int*)(&m_iLodIndex));
m_iLodIndex = max(0, m_iLodIndex);
m_iLodIndex = min(m_iMaxLodLevel, m_iLodIndex);
GUI::Checkbox("Select Color ON / OFF", &m_bUseSelectColor);
GUI::Text("----- Transfrom ----");
GUI::InputFloat("X##Position", &m_vPosition.x, 0.1f, 1.f);
GUI::InputFloat("Y##Position", &m_vPosition.y, 0.1f, 1.f);
GUI::InputFloat("Z##Position", &m_vPosition.z, 0.1f, 1.f);
_float3 vMove = {};
GUI::InputFloat("Right", &vMove.x, 0.05f, 0.1f);
GUI::InputFloat("Up", &vMove.y, 0.05f, 0.1f);
GUI::InputFloat("Look", &vMove.z, 0.05f, 0.1f);
//m_pTransformCom->Move_Right(vMove.x);
//m_pTransformCom->Move_Up(vMove.y);
//m_pTransformCom->Move_Look(vMove.z);
//XMStoreFloat3(&m_vPosition, m_pTransformCom->Get_State(STATE::POSITION));
if (m_pGameInstance->Mouse_Down(DIM_LBUTTON) && m_pGameInstance->Key_Pressing(DIK_LSHIFT))
{
CTerrain* pTerrain = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Terrain"))->Get_Object<CTerrain>();
if (nullptr != pTerrain)
_float3 vPosition = {};
if (m_pGameInstance->isPicking(&vPosition))
{
pTerrain->Get_Component<CVIBuffer_Terrain>()->Picking(pTerrain->Get_Component<CTransform>()->Get_XMWorldMatrix(), &m_vPosition);
memcpy(&m_vPosition, &vPosition, sizeof(_float3));
m_pTransformCom->Set_State(STATE::POSITION, XMLoadFloat3(&m_vPosition));
}
}
GUI::Text("----- Rotation ----");
GUI::InputFloat("X##Rotation", &m_vRotation.x, 10.f, 45.f);
GUI::InputFloat("Y##Rotation", &m_vRotation.y, 10.f, 45.f);
GUI::InputFloat("Z##Rotation", &m_vRotation.z, 10.f, 45.f);
GUI::InputFloat("X##Rotation", &m_vRotation.x, 1.f, 15.f);
GUI::InputFloat("Y##Rotation", &m_vRotation.y, 1.f, 15.f);
GUI::InputFloat("Z##Rotation", &m_vRotation.z, 1.f, 15.f);
GUI::Text("----- Scale ----");
GUI::InputFloat("X##Scale", &m_vScale.x, 0.1f, 1.f);
GUI::InputFloat("Y##Scale", &m_vScale.y, 0.1f, 1.f);
GUI::InputFloat("Z##Scale", &m_vScale.z, 0.1f, 1.f);
GUI::InputFloat("X##Scale", &m_vScale.x, 0.05f, 0.1f);
GUI::InputFloat("Y##Scale", &m_vScale.y, 0.05f, 0.1f);
GUI::InputFloat("Z##Scale", &m_vScale.z, 0.05f, 0.1f);
m_vScale.x = max(0.01f, m_vScale.x);
m_vScale.y = max(0.01f, m_vScale.y);
@@ -239,3 +313,55 @@ void CMapElement_Interactable::Describe_Entity()
m_bSelected = true;
}
HRESULT CMapElement_Interactable::Save_XML(tinyxml2::XMLDocument& doc, tinyxml2::XMLElement* root)
{
tinyxml2::XMLElement* object = doc.NewElement("Object");
object->SetAttribute("Type", ENUM_CLASS(MAPOBJECT_TYPE::ELEMENT_INTERACT));
object->SetAttribute("ID", ENUM_CLASS(m_eInteractableID));
object->SetAttribute("Lod_Level", m_iLodIndex);
root->InsertEndChild(object);
#pragma region PROTOTYPETAG
for (_uint i = 0; i < m_iLodIndex + 1; ++i)
{
tinyxml2::XMLElement* prototype = doc.NewElement("PrototypeTag");
prototype->SetText(CMyTools::ToString(m_ModelPrototypeTags[i]).c_str());
object->InsertEndChild(prototype);
}
#pragma endregion
#pragma region TRANSFORM
_float3 vPosition = {};
XMStoreFloat3(&vPosition, m_pTransformCom->Get_State(STATE::POSITION));
_float3 vScale = m_pTransformCom->Get_Scale();
_float3 vRotation = {};
XMStoreFloat3(&vRotation, m_pTransformCom->Get_RollPitchYawVector());
vRotation.x = XMConvertToDegrees(vRotation.x);
vRotation.y = XMConvertToDegrees(vRotation.y);
vRotation.z = XMConvertToDegrees(vRotation.z);
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;
}
@@ -42,7 +42,7 @@ void CMapObject_Collision::Late_Update(_float fTimeDelta)
#endif
XMStoreFloat4x4(&m_CombinedWorldMatrix, m_pTransformCom->Get_XMWorldMatrix() * m_pParentTransformCom->Get_XMWorldMatrix());
if (m_pGameInstance->Key_Pressing(DIK_V)){
if (m_bVisible){
if (m_pGameInstance->isIn_WorldFrustum(XMLoadFloat4(reinterpret_cast<_float4*>(m_CombinedWorldMatrix.m[3])), m_pTransformCom->Get_Radius())) {
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
}
@@ -96,7 +96,7 @@ HRESULT CMapObject_Collision::Initialize_Prototype()
HRESULT CMapObject_Collision::Initialize(void* pArg)
{
m_iMaxLodLevel = 0;
m_bVisible = true;
MAPOBJECT_LOD_DESC* pDesc = static_cast<MAPOBJECT_LOD_DESC*>(pArg);
m_iMaxLodLevel = pDesc->iMaxLodLevel;
@@ -115,6 +115,7 @@ HRESULT CMapObject_Collision::Initialize(void* pArg)
#ifdef _DEBUG
m_bSelected = false;
m_bVisible = false;
m_vPosition = pDesc->vPosition;
m_vScale = pDesc->vScale;
m_vRotation = pDesc->vRotation;
@@ -233,20 +234,28 @@ void CMapObject_Collision::Describe_Entity()
//ImGui::Text(CMyTools::ToString(m_strModelPrototypeTag).c_str());
GUI::Checkbox("Visible", &m_bVisible);
_float3 vMove = {};
ImGui::Text("----- Transfrom ----");
ImGui::InputFloat("X##Position", &m_vPosition.x, 0.1f, 1.f);
ImGui::InputFloat("Y##Position", &m_vPosition.y, 0.1f, 1.f);
ImGui::InputFloat("Z##Position", &m_vPosition.z, 0.1f, 1.f);
ImGui::InputFloat("Right", &vMove.x, 0.05f, 0.1f);
ImGui::InputFloat("Up", &vMove.y, 0.05f, 0.1f);
ImGui::InputFloat("Look", &vMove.z, 0.05f, 0.1f);
m_pTransformCom->Move_Right(vMove.x);
m_pTransformCom->Move_Up(vMove.y);
m_pTransformCom->Move_Look(vMove.z);
XMStoreFloat3(&m_vPosition, m_pTransformCom->Get_State(STATE::POSITION));
if (m_pGameInstance->Mouse_Down(DIM_LBUTTON) && m_pGameInstance->Key_Pressing(DIK_LSHIFT))
{
CTerrain* pTerrain = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Terrain"))->Get_Object<CTerrain>();
if (nullptr != pTerrain)
_float3 vPosition = {};
if (m_pGameInstance->isPicking(&vPosition))
{
pTerrain->Get_Component<CVIBuffer_Terrain>()->Picking(pTerrain->Get_Component<CTransform>()->Get_XMWorldMatrix(), &m_vPosition);
memcpy(&m_vPosition, &vPosition, sizeof(_float3));
m_pTransformCom->Set_State(STATE::POSITION, XMLoadFloat3(&m_vPosition));
}
}
ImGui::Text("----- Rotation ----");
ImGui::InputFloat("X##Rotation", &m_vRotation.x, 10.f, 45.f);
ImGui::InputFloat("Y##Rotation", &m_vRotation.y, 10.f, 45.f);
@@ -58,7 +58,10 @@ HRESULT CMapObject_Manager::Initialize(void* pArg)
m_iContainerObjectIndex = 99;
//m_pContainer = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Building"))->Get_Object<CBuildingContainer>();
if (FAILED(Load_MapData("Map1129")))
if (FAILED(Load_MapData("Map1205")))
return E_FAIL;
if (FAILED(Load_LightObject("LightElement")))
return E_FAIL;
/*if (FAILED(Load_LightObject("LightElement")))
return E_FAIL;
@@ -409,7 +412,7 @@ HRESULT CMapObject_Manager::Save_MapData(const _char* pFileName)
prototype->SetText(CMyTools::ToString(pElement->Get_PrototypeTag(i)).c_str());
object->InsertEndChild(prototype);
}
#pragma endregion
#pragma endregion // PROTOTYPETAG
#pragma region TRANSFORM
_float3 vPosition = {};
@@ -440,11 +443,11 @@ HRESULT CMapObject_Manager::Save_MapData(const _char* pFileName)
Rotation->SetAttribute("y", vRotation.y);
Rotation->SetAttribute("z", vRotation.z);
object->InsertEndChild(Rotation);
#pragma endregion
#pragma endregion // TRANSFORM
}
}
#pragma endregion
#pragma endregion // ELEMENT_INTERACTABEL
// ?ú?å
@@ -1184,8 +1187,6 @@ HRESULT CMapObject_Manager::Save_LightObject(const _char* pFileName)
tinyxml2::XMLElement* root = doc.NewElement("MapLightObjects");
doc.InsertEndChild(root);
if (nullptr != pLayer)
{
const list<CGameObject*>* pList = pLayer->Get_Objects();
@@ -1200,7 +1201,6 @@ HRESULT CMapObject_Manager::Save_LightObject(const _char* pFileName)
if (FAILED(pElement->Save_XML(doc, root)))
return E_FAIL;
}
#pragma endregion
}
if (doc.SaveFile(strPath.c_str()) != tinyxml2::XML_SUCCESS) {
@@ -1302,6 +1302,101 @@ HRESULT CMapObject_Manager::Load_LightObject(const _char* pFileName)
return S_OK;
}
HRESULT CMapObject_Manager::Save_InteractObject(const _char* pFileName)
{
CLayer* pLayer = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Element_Interactable"));
if (nullptr != pLayer)
return S_OK;
tinyxml2::XMLDocument doc;
string strPath = "../Bin/Resources/Data/Map/" + string(pFileName) + ".xml";
tinyxml2::XMLError loadResult = doc.LoadFile(strPath.c_str());
doc.Clear();
doc.InsertFirstChild(doc.NewDeclaration());
tinyxml2::XMLElement* Element_Interactable = doc.NewElement("Element_Interactable");
doc.InsertEndChild(Element_Interactable);
#pragma region ELEMENT_INTERACTABEL
if (nullptr != pLayer)
{
const list<CGameObject*>* pList = pLayer->Get_Objects();
for (auto pGamObject : *pList)
{
CMapElement* pElement = dynamic_cast<CMapElement*>(pGamObject);
if (nullptr == pElement)
return E_FAIL;
if (FAILED(pElement->Save_XML(doc, Element_Interactable)))
return E_FAIL;
}
}
#pragma endregion // ELEMENT_INTERACTABEL
return S_OK;
}
HRESULT CMapObject_Manager::Load_InteractObject(const _char* pFileName)
{
tinyxml2::XMLDocument xmlDoc;
string strPath = "../Bin/Resources/Data/Map/" + string(pFileName) + ".xml";
if ((tinyxml2::XML_SUCCESS != xmlDoc.LoadFile(strPath.c_str())))
return E_FAIL;
tinyxml2::XMLElement* root = xmlDoc.FirstChildElement("MapLightObjects");
if (nullptr == root)
{
MSG_BOX("Failed to Find root");
return S_OK;
}
for (auto* Object = root->FirstChildElement("Object"); Object; Object = Object->NextSiblingElement("Object"))
{
CMapElement_Interactable::ELEMENT_INTERACTABLE_DESC Desc = {};
/* Model Prototypes */
Object->QueryUnsignedAttribute("Lod_Level", &Desc.iMaxLodLevel);
Object->QueryUnsignedAttribute("Lod_Level", &Desc.iInteractableID);
string strTag = {};
for (auto* PrototypeTag = Object->FirstChildElement("PrototypeTag"); PrototypeTag; PrototypeTag = PrototypeTag->NextSiblingElement("PrototypeTag"))
{
strTag = PrototypeTag->GetText();
Desc.ModelPrototypeTags.push_back(CMyTools::ToWstring(strTag));
}
/* Transform */
auto* Position = Object->FirstChildElement("Position");
Position->QueryFloatAttribute("x", &Desc.vPosition.x);
Position->QueryFloatAttribute("y", &Desc.vPosition.y);
Position->QueryFloatAttribute("z", &Desc.vPosition.z);
auto* Scale = Object->FirstChildElement("Scale");
Scale->QueryFloatAttribute("x", &Desc.vScale.x);
Scale->QueryFloatAttribute("y", &Desc.vScale.y);
Scale->QueryFloatAttribute("z", &Desc.vScale.z);
auto* Rotation = Object->FirstChildElement("Rotation");
Rotation->QueryFloatAttribute("x", &Desc.vRotation.x);
Rotation->QueryFloatAttribute("y", &Desc.vRotation.y);
Rotation->QueryFloatAttribute("z", &Desc.vRotation.z);
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CMapElement_Interactable>(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Element_Interactable"), &Desc)))
return E_FAIL;
}
MSG_BOX("Successed to Create Interactalbe Element");
return S_OK;
}
void CMapObject_Manager::Update_PrototypeList()
{
GUI::Begin("Model Prototype List");
@@ -1594,6 +1689,7 @@ void CMapObject_Manager::Create_Elemnt(_wstring& strPrototypeTag)
{
MAPOBJECT_LOD_DESC Desc = {};
CMapElement_Light::MAPELEMENT_LIGHT_DESC Light_Desc = {};
CMapElement_Interactable::ELEMENT_INTERACTABLE_DESC Interactable_Desc = {};
vector<_wstring> PrototypeTags;
vector<_uint> LodModelIndices;
@@ -1607,13 +1703,13 @@ void CMapObject_Manager::Create_Elemnt(_wstring& strPrototypeTag)
PrototypeTags.push_back(strLodTag);
}
Light_Desc.iMaxLodLevel = Desc.iMaxLodLevel = (_uint)LodModelIndices.size() - 1;
Light_Desc.ModelPrototypeTags = Desc.ModelPrototypeTags = PrototypeTags;
Light_Desc.pParentTransform = Desc.pParentTransform = m_pTransformCom;
Light_Desc.vPosition = Desc.vPosition = _float3(0.f, 0.f, 0.f);
Light_Desc.vRotation = Desc.vRotation = _float3(0.f, 0.f, 0.f);
Light_Desc.vScale = Desc.vScale = _float3(1.f, 1.f, 1.f);
Light_Desc.pModelPathIndices =Desc.pModelPathIndices = &LodModelIndices;
Interactable_Desc.iMaxLodLevel = Light_Desc.iMaxLodLevel = Desc.iMaxLodLevel = (_uint)LodModelIndices.size() - 1;
Interactable_Desc.ModelPrototypeTags = Light_Desc.ModelPrototypeTags = Desc.ModelPrototypeTags = PrototypeTags;
Interactable_Desc.pParentTransform = Light_Desc.pParentTransform = Desc.pParentTransform = m_pTransformCom;
Interactable_Desc.vPosition = Light_Desc.vPosition = Desc.vPosition = _float3(0.f, 0.f, 0.f);
Interactable_Desc.vRotation = Light_Desc.vRotation = Desc.vRotation = _float3(0.f, 0.f, 0.f);
Interactable_Desc.vScale = Light_Desc.vScale = Desc.vScale = _float3(1.f, 1.f, 1.f);
Interactable_Desc.pModelPathIndices = Light_Desc.pModelPathIndices =Desc.pModelPathIndices = &LodModelIndices;
if (ADD_TYPE::ELEMENT_STATIC == m_eType)
{
@@ -1621,6 +1717,8 @@ void CMapObject_Manager::Create_Elemnt(_wstring& strPrototypeTag)
}
else if (ADD_TYPE::ELEMENT_INTERACT == m_eType)
{
Interactable_Desc.iInteractableID = 0;
m_pGameInstance->Add_GameObject_ToLayer<CMapElement_Interactable>(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Element_Interact"), &Desc);
}
else if (ADD_TYPE::ELEMENT_LIGHT == m_eType)
+3 -3
View File
@@ -86,9 +86,9 @@ void CTerrain::Priority_Update(_float fTimeDelta)
#pragma endregion
#pragma region HEIGHT MAP
//HRESULT hr = {};
//if(GUI::Button("Save HeightMap"))
// hr = m_pVIBufferCom->Save_HeightMap("Hogsmeade_HeightMap.bin");
HRESULT hr = {};
if(GUI::Button("Save HeightMap"))
hr = m_pVIBufferCom->Save_HeightMap("Hogsmeade_HeightMap2.bin");
//if(GUI::Button("Load HeightMap"))
// hr = m_pVIBufferCom->Load_HeightMap("Hogsmeade_HeightMap.bin");
#pragma endregion
@@ -1,4 +1,4 @@
#pragma once
 #pragma once
#include "Editor_Define.h"
#include "GameObject.h"
@@ -45,6 +45,8 @@ namespace Editor
};
enum class BLOOM_TYPE { NONE , BASIC , MULTIPLY , END};
enum class ELEMENT_INTERACTABLE_ID {BARREL, END};
}
using namespace Editor;
@@ -1,12 +1,19 @@
#pragma once
#pragma once
#include "Editor_Define.h"
#include "MapElement.h"
NS_BEGIN(Editor)
class CMapElement_Interactable : public CMapElement
class CMapElement_Interactable final : public CMapElement
{
public:
typedef struct tagElement_Interactable_Desc : MAPOBJECT_LOD_DESC
{
_uint iInteractableID = {};
_uint iSubKind = {};
}ELEMENT_INTERACTABLE_DESC;
private:
CMapElement_Interactable(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
CMapElement_Interactable(const CMapElement_Interactable& rhs);
@@ -19,7 +26,19 @@ class CMapElement_Interactable : public CMapElement
virtual HRESULT Render() override;
private:
_uint m_iSaveIndex = {}; // 원래 위치 받아올때 필요한 인덱스
ELEMENT_INTERACTABLE_ID m_eInteractableID = { ELEMENT_INTERACTABLE_ID::END};
CRigidBody* m_pRigidBody = { nullptr };
PSX::PxRigidDynamic* m_pActor = { nullptr };
#ifdef _DEBUG
_bool m_bUseSelectColor = { true };
_float m_fPower = {};
_float m_fMass = {};
_float3 m_vBoxSize = {};
#endif // _DEBUG
private:
virtual HRESULT Initialize_Prototype() override;
@@ -32,6 +51,7 @@ class CMapElement_Interactable : public CMapElement
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
virtual void Free() override;
void Describe_Entity() override;
virtual HRESULT Save_XML(tinyxml2::XMLDocument& doc, tinyxml2::XMLElement* root)override;
};
NS_END
NS_END
@@ -64,6 +64,9 @@ class CMapObject_Manager final : public CGameObject
HRESULT Save_LightObject(const _char* pFileName);
HRESULT Load_LightObject(const _char* pFileName);
HRESULT Save_InteractObject(const _char* pFileName);
HRESULT Load_InteractObject(const _char* pFileName);
#pragma endregion
void Update_PrototypeList();
@@ -114,7 +114,7 @@ HRESULT CGameInstance::Initialize_Engine(const ENGINE_DESC& EngineDesc, ID3D11De
return E_FAIL;
}
m_pResource_Manager = CResource_Manager::Create(*ppDevice, 500);
m_pResource_Manager = CResource_Manager::Create(*ppDevice, 1000);
if (nullptr == m_pResource_Manager) {
return E_FAIL;
}
+1 -27
View File
@@ -83,7 +83,7 @@ HRESULT CMaterial::Initialize(const _char* pModelFilePath, const aiMaterial* pAI
if (FAILED(hr)) {
return E_FAIL;
}
m_strPath[i].push_back(szSaveDir);
//m_strPath[i].push_back(szSaveDir);
m_SRVs[i].push_back(pSRV);
}
}
@@ -353,32 +353,6 @@ HRESULT CMaterial::Add_Texture(const _char* pTextureFolderPath, string& FileType
strTexturePath = CMyTools::ToString(szTextureFilePath);
}
//_string strPrefix = "C:";
//_string strSearchString = "MeshTable";
//_string strResultPath = {};
//size_t mapRePos = strTexturePath.find(strSearchString);
//if (mapRePos != std::string::npos)
//{
// size_t startPos = mapRePos + strSearchString.length();
// // 'MapRe' 뒤에 오는 경로 건너뛰기
// if (startPos < strTexturePath.length() &&
// (strTexturePath[startPos] == '\\' || strTexturePath[startPos] == '/')) {
// startPos++;
// }
// // 'MapRe' 이후의 나머지 경로를 추출
// strResultPath = strTexturePath;//.substr(startPos);
//}
//else
//{
// MSG_BOX("FAILED to Find Path");
//}
//replace(strResultPath.begin(), strResultPath.end(), '\\', '/');
m_SaveMaterial.Path[ENUM_CLASS(eTexture)].push_back(strTexturePath);
m_SRVs[ENUM_CLASS(eTexture)].push_back(pSRV);
@@ -68,7 +68,7 @@ ID3D11ShaderResourceView* CResource_Manager::Load_SRV(const _char* pFilePath)
HRESULT hr = {};
hr = CreateDDSTextureFromFile(m_pDevice, CMyTools::ToWstring(szTextureFilePath).c_str(), nullptr, &pSRV, 1024); // 일단 dds로 시도하고
hr = CreateDDSTextureFromFile(m_pDevice, CMyTools::ToWstring(szTextureFilePath).c_str(), nullptr, &pSRV); // 일단 dds로 시도하고
if (FAILED(hr)) {
memset(szTextureFilePath, 0, sizeof(_char) * MAX_PATH); // 실패하면 원래 확장자로 다시 시도
strcat_s(szTextureFilePath, szTextureFileName);
@@ -87,7 +87,9 @@ ID3D11ShaderResourceView* CResource_Manager::Load_SRV(const _char* pFilePath)
return nullptr;
m_Resources.emplace(CMyTools::ToWstring(szFileName), pSRV);
#ifdef _DEBUG
++m_iCount;
#endif // _DEBUG
return pSRV;
}
+3 -1
View File
@@ -14,7 +14,9 @@ CRigidBody::CRigidBody(const CRigidBody& rhs) :
m_ePxRigidBodyFlags(rhs.m_ePxRigidBodyFlags),
m_ePxShapeFlags(rhs.m_ePxShapeFlags),
m_eMatType(rhs.m_eMatType),
m_fContactOffset(rhs.m_fContactOffset)
m_fContactOffset(rhs.m_fContactOffset),
m_vLocalRotQ(rhs.m_vLocalRotQ),
m_vLocalTranslation(rhs.m_vLocalTranslation)
{
}
@@ -48,7 +48,67 @@ HRESULT CRigidBody_Dynamic::Render()
}
return S_OK;
}
#endif
void CRigidBody_Dynamic::Set_HalfGeometryInfo(_float3 vhalfGeometryInfo)
{
m_vhalfGeometryInfo = vhalfGeometryInfo;
PSX::PxShape* pShape = { nullptr };
m_pRigidBody->getShapes(&pShape, m_pRigidBody->getNbShapes());
switch (m_eActorType)
{
case ACTOR::BOX:
{
PSX::PxBoxGeometry Geometry((const PSX::PxBoxGeometry&)pShape->getGeometry());
Geometry.halfExtents = { vhalfGeometryInfo.x, vhalfGeometryInfo.y, vhalfGeometryInfo.z };
if (false == Geometry.isValid()) {
assert(false);
}
pShape->setGeometry(Geometry);
} break;
case ACTOR::CAPSULE:
{
PSX::PxCapsuleGeometry Geometry((const PSX::PxCapsuleGeometry&)pShape->getGeometry());
Geometry.halfHeight = { vhalfGeometryInfo.y };
Geometry.radius = { vhalfGeometryInfo.x };
if (false == Geometry.isValid()) {
assert(false);
}
pShape->setGeometry(Geometry);
} break;
case ACTOR::SPHERE:
{
PSX::PxSphereGeometry Geometry((const PSX::PxSphereGeometry&)pShape->getGeometry());
Geometry.radius = { vhalfGeometryInfo.x };
if (false == Geometry.isValid()) {
assert(false);
}
pShape->setGeometry(Geometry);
} break;
default:
break;
}
#ifdef _DEBUG
if (nullptr != m_pMainShape) {
m_pMainShape.release();
m_pMainShape = nullptr;
}
if (nullptr != m_pSubShape) {
m_pSubShape.release();
m_pSubShape = nullptr;
}
Add_DebugShape();
#endif // _DEBUG
}
void CRigidBody_Dynamic::Move_LocalPos(_float4 vNewRotQ, _float3 vNewTranslation)
{
m_vLocalRotQ = vNewRotQ;
m_vLocalTranslation = vNewTranslation;
PSX::PxShape* pShape = { nullptr };
m_pRigidBody->getShapes(&pShape, m_pRigidBody->getNbShapes());
pShape->setLocalPose(PSX::PxTransform(vNewTranslation.x, vNewTranslation.y, vNewTranslation.z, PSX::PxQuat(vNewRotQ.x, vNewRotQ.y, vNewRotQ.z, vNewRotQ.w)));
}
// _DEBUG
void CRigidBody_Dynamic::Add_Force(_fvector vForce, PSX::PxForceMode::Enum eType)
{
PSX::PxVec3 vPxForce = {};
@@ -125,6 +185,8 @@ HRESULT CRigidBody_Dynamic::Initialize_Prototype(RIGIDBODY_PROTOTYPE_DYNAMIC_DES
m_eLockFlag = Desc.eLockFlag;
m_PxMassCenter = Desc.pxMassCenter;
m_vDamping = Desc.vAutoDamping;
m_vLocalRotQ = Desc.vLocalRotQ;
m_vLocalTranslation = Desc.vLocalTranslation;
return S_OK;
}
@@ -150,6 +212,8 @@ HRESULT CRigidBody_Dynamic::Initialize(void* pArg)
m_pRigidBody->setRigidDynamicLockFlags(m_eLockFlag);
m_pRigidBody->setLinearDamping(m_vDamping.x);
m_pRigidBody->setAngularDamping(m_vDamping.y);
Move_LocalPos(m_vLocalRotQ, m_vLocalTranslation);
//m_pRigidBody->joint;
//PSX::PxRevol
@@ -213,5 +277,40 @@ void CRigidBody_Dynamic::Free()
void CRigidBody_Dynamic::Describe_Entity()
{
GUI::BeginChild(("Child ID: " + to_string((size_t)(this))).c_str());
GUI::Text("ReSize"); GUI::SameLine();
if (GUI::DragFloat3("##Size", (_float*)&m_vhalfGeometryInfo, 0.01f, 0.01f, 10.f, "%.3f")) {
Set_HalfGeometryInfo(m_vhalfGeometryInfo);
}
GUI::Text("Translation"); GUI::SameLine();
if (GUI::DragFloat3("##LocalPos", (_float*)&m_vLocalTranslation, 0.125f, -10.f, 10.f, "%.4f")) {
Move_LocalPos(m_vLocalRotQ, m_vLocalTranslation);
}
_vector q = XMLoadFloat4(&m_vLocalRotQ);
// 기본 방향벡터 (엔진 기준)
_vector forward = XMVector3Rotate(XMVectorSet(0, 0, 1, 0), q);
_vector right = XMVector3Rotate(XMVectorSet(1, 0, 0, 0), q);
_vector up = XMVector3Rotate(XMVectorSet(0, 1, 0, 0), q);
// --- RPY 계산 ---
_float fYaw = atan2f(XMVectorGetX(forward), XMVectorGetZ(forward));
_float fPitch = asinf(-XMVectorGetY(forward));
_float fRoll = atan2f(XMVectorGetY(right), XMVectorGetY(up)); // 수정된 Roll 계산
_float3 vRPY = { fRoll, fPitch, fYaw }; // Roll-Pitch-Yaw 순서 정렬
// --- GUI 편집 ---
GUI::Text("Rotation (Roll Pitch Yaw)");
GUI::SameLine();
if (GUI::DragFloat3("##LocalRotq", (_float*)&vRPY,
XMConvertToRadians(0.5f), -XM_2PI, XM_2PI, "%.5f"))
{
// XMQuaternionRotationRollPitchYaw는 (Yaw→Pitch→Roll) 순서
_vector vRotq = XMQuaternionRotationRollPitchYaw(vRPY.z, vRPY.y, vRPY.x);
XMStoreFloat4(&m_vLocalRotQ, vRotq);
Move_LocalPos(m_vLocalRotQ, m_vLocalTranslation);
}
GUI::EndChild();
}
#endif // _DEBUG
@@ -20,6 +20,8 @@ HRESULT CRigidBody_Static::Initialize_Prototype(RIGIDBODY_STATIC_PROTOTYPEDESC&
m_ePxShapeFlags = Desc.ePxShapeFlags;
m_eMatType = Desc.ePxMaterialTypes;
m_fContactOffset = Desc.fContactOffset;
m_vLocalRotQ = Desc.vLocalRotQ;
m_vLocalTranslation = Desc.vLocalTranslation;
return S_OK;
}
+6 -2
View File
@@ -40,11 +40,13 @@ _uint CTexture::Get_Size()
{
return (_uint)m_SRVs.size();
}
#ifdef EDITOR_PROJECT
_bool CTexture::Compare_GroupName(_wstring wstrGroupName)
{
return m_wstrPrototypeName == wstrGroupName;
}
#endif // EDITOR_PROJECT
#ifdef _DEBUG
void CTexture::HoverName()
@@ -78,8 +80,10 @@ HRESULT CTexture::Initialize_Prototype(TEXTURE_LOAD_TYPE eType, const _tchar* pT
default:
break;
}
#ifdef EDITOR_PROJECT
m_wstrPrototypeName = wstrPrototypeName;
#endif // EDITOR_PROJECT
return S_OK;
}
+1 -2
View File
@@ -278,11 +278,10 @@ class ENGINE_DLL CGameInstance final : public CBase
class CThreadHolder* m_pThreadHolder = { nullptr };
class CFog* m_pFog = { nullptr };
class CResource_Manager* m_pResource_Manager = { nullptr };
mt19937 m_Rng{ random_device{}() };
#ifdef _DEBUG
private:
_float m_fTimer_PriorityUpdate = { 0.f };
_float m_fTimer_Update = { 0.f };
_float m_fTimer_LateUpdate = { 0.f };
+9 -6
View File
@@ -12,21 +12,24 @@ class ENGINE_DLL CMaterial final : public CBase
public:
HRESULT Bind_SRV(class CShader* pShader);
SaveMaterial Get_SaveMaterial() { return m_SaveMaterial; }
private:
class CGameInstance* m_pGameInstance = { nullptr };
ID3D11Device* m_pDevice = { nullptr };
ID3D11DeviceContext* m_pContext = { nullptr };
class CGameInstance* m_pGameInstance = { nullptr };
ID3D11Device* m_pDevice = { nullptr };
ID3D11DeviceContext* m_pContext = { nullptr };
vector<ID3D11ShaderResourceView*> m_SRVs[AI_TEXTURE_TYPE_MAX];
SaveMaterial m_SaveMaterial;
#ifdef EDITOR_PROJECT
public:
SaveMaterial Get_SaveMaterial() { return m_SaveMaterial; }
static CMaterial* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, const aiMaterial* pAIMaterial);
static CMaterial* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pMaterialFilePath, const _char* pTextureFilePath);
private:
vector<string> m_strPath[AI_TEXTURE_TYPE_MAX];
SaveMaterial m_SaveMaterial;
HRESULT Initialize(const _char* pModelFilePath, const aiMaterial* pAIMaterial);
HRESULT Initialize(const _char* pMaterialFilePath, const _char* pTextureFilePath);
HRESULT Read_MaterialFile(const _char* pMaterialFilePath, const _char* pTextureFolderPath);
@@ -1,4 +1,4 @@
// Redistribution and use in source and binary forms, with or without
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// * Redistributions of source code must retain the above copyright
@@ -20,7 +20,10 @@ class CResource_Manager final : public CBase
ID3D11ShaderResourceView* Load_SRV(const _char* pFilePath);
private:
#ifdef _DEBUG
_uint m_iCount = {};
#endif // DEBUG
ID3D11Device* m_pDevice = { nullptr };
unordered_map<_wstring, ID3D11ShaderResourceView*> m_Resources;
+4 -1
View File
@@ -16,7 +16,8 @@ class ENGINE_DLL CRigidBody abstract : public CComponent
PXMATERIAL ePxMaterialTypes = { PXMATERIAL::DEFAULT };
_float3 vMatInfo = { 0.5f, 0.5f, 0.6f }; // 피직스 객체의 속성 등
_float fContactOffset = { 0.05f }; // 접촉 유격 오프셋
_float4 vLocalRotQ = { 0.f, 0.f, 0.f, 1.f };
_float3 vLocalTranslation = { 0.f, 0.f, 0.f };
}RIGIDBODY_PROTOTYPEDESC;
typedef struct tagRigidBody_Desc
@@ -44,6 +45,8 @@ class ENGINE_DLL CRigidBody abstract : public CComponent
PSX::PxShapeFlags m_ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE };
PXMATERIAL m_eMatType = { PXMATERIAL::END };
_float m_fContactOffset = { 0.05f };
_float4 m_vLocalRotQ = { 0.f, 0.f, 0.f, 1.f };
_float3 m_vLocalTranslation = { 0.f, 0.f, 0.f };
CTransform* m_pTransform = { nullptr };
PhsXUserData m_tagData = {};
@@ -34,6 +34,8 @@ class ENGINE_DLL CRigidBody_Dynamic : public CRigidBody
virtual PSX::PxRigidDynamic* Get_Actor() override { return m_pRigidBody; };
_float3 Get_HalfGeometryInfo() const { return m_vhalfGeometryInfo; }
void Set_HalfGeometryInfo(_float3 vhalfGeometryInfo);
void Move_LocalPos(_float4 vNewRotQ, _float3 vNewTranslation);
_float Get_Density() const { return m_fDensity; }
virtual void Add_Force(_fvector vForce, PSX::PxForceMode::Enum eType = PSX::PxForceMode::Enum::eFORCE); // 속도 + 방향
+2
View File
@@ -18,7 +18,9 @@ class ENGINE_DLL CTexture final :
vector<ID3D11ShaderResourceView*>* Get_Texture() { return &m_SRVs; }
ID3D11ShaderResourceView* Get_SRV(_uint iTextureIndex);
_uint Get_Size();
#ifdef EDITOR_PROJECT
_bool Compare_GroupName(_wstring wstrGroupName);
#endif //
#ifdef _DEBUG
void HoverName();