diff --git a/Jusin154_Team3D/Editor/Private/DebugCamera.cpp b/Jusin154_Team3D/Editor/Private/DebugCamera.cpp index 0bfc1cf3e..803bda53a 100644 --- a/Jusin154_Team3D/Editor/Private/DebugCamera.cpp +++ b/Jusin154_Team3D/Editor/Private/DebugCamera.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "DebugCamera.h" #include "Shader.h" @@ -95,6 +95,9 @@ HRESULT CDebugCamera::Initialize(void* pArg) m_pTransformCom->LookAt(XMVectorSetW(XMLoadFloat3(&pDesc->vAt), 1.f)); m_matInitial = *m_pTransformCom->Get_WorldMatrixPtr(); m_bActive = true; + + m_pGameInstance->Add_Camera(NEXT_LEVEL, this, m_pCameraKey); + m_pGameInstance->Bind_Camera(NEXT_LEVEL, m_pCameraKey, false); return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp index ef9680e6b..d166f23c6 100644 --- a/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Level_EffectViewer.h" #include "GameInstance.h" #include "Level_Loading.h" @@ -46,7 +46,7 @@ void CLevel_EffectViewer::Update(_float fTimeDelta) HRESULT CLevel_EffectViewer::Render() { - SetWindowText(g_hWnd, TEXT("ÀÌÆåÆ® ·¹º§ÀÔ´Ï´Ù")); + SetWindowText(g_hWnd, TEXT("ì�´íŽ™íŠ¸ 레벨입니다")); GUI::ShowDemoWindow(); return S_OK; } @@ -62,6 +62,7 @@ HRESULT CLevel_EffectViewer::Ready_Layer_Camera(const _wstring& strLayerTag) CameraDesc.vEye = _float3(0.f, 10.f, -10.f); CameraDesc.vAt = _float3(0.f, 0.f, 0.f); CameraDesc.fSpeedPerSec = 5.f; + CameraDesc.pCameraKey = TEXT("Debug_Camera"); CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f); CameraDesc.fMouseSensor = 0.1f; diff --git a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp index bf8300d89..5e9d33220 100644 --- a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Level_ObjectViewer.h" #include "GameInstance.h" #include "Level_Loading.h" @@ -54,7 +54,7 @@ void CLevel_ObjectViewer::Update(_float fTimeDelta) HRESULT CLevel_ObjectViewer::Render() { - SetWindowText(g_hWnd, TEXT("¿ÀºêÁ§Æ® ·¹º§ÀÔ´Ï´Ù")); + SetWindowText(g_hWnd, TEXT("오브ì �트 레벨입니다")); //GUI::ShowDemoWindow(); return S_OK; } @@ -464,6 +464,7 @@ HRESULT CLevel_ObjectViewer::Ready_Layer_Camera(const _wstring& strLayerTag) CameraDesc.vEye = _float3(0.f, 30.f, -10.f); CameraDesc.vAt = _float3(0.f, 0.f, 0.f); CameraDesc.fSpeedPerSec = 5.f; + CameraDesc.pCameraKey = TEXT("Debug_Camera"); CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f); CameraDesc.fMouseSensor = 0.1f; diff --git a/Jusin154_Team3D/Editor/Private/Level_PhysXLab.cpp b/Jusin154_Team3D/Editor/Private/Level_PhysXLab.cpp index 54db9e602..93e00cd5c 100644 --- a/Jusin154_Team3D/Editor/Private/Level_PhysXLab.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_PhysXLab.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Level_PhysXLab.h" #include "GameInstance.h" @@ -24,7 +24,7 @@ void CLevel_PhysXLab::Update(_float fTimeDelta) HRESULT CLevel_PhysXLab::Render() { - SetWindowText(g_hWnd, TEXT("PhysXEditor·¹º§ÀÔ´Ï´Ù")); + SetWindowText(g_hWnd, TEXT("PhysXEditor레벨입니다")); GUI::ShowDemoWindow(); return S_OK; } @@ -70,10 +70,11 @@ HRESULT CLevel_PhysXLab::Ready_Layer_Camera(const _wstring& strLayerTag) CDebugCamera::CAMERA_DEBUG_DESC CameraDesc{}; CameraDesc.fFovy = XMConvertToRadians(60.0f); CameraDesc.fNear = 0.1f; - CameraDesc.fFar = 5000.f; + CameraDesc.fFar = 500.f; CameraDesc.vEye = _float3(0.f, 10.f, -10.f); CameraDesc.vAt = _float3(0.f, 0.f, 0.f); CameraDesc.fSpeedPerSec = 2.f; + CameraDesc.pCameraKey = TEXT("Debug_Camera"); CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f); CameraDesc.fMouseSensor = 0.1f; diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 7cc594b77..ff03c0836 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -580,25 +580,29 @@ HRESULT CLoader::Loading_For_PhysXLevel() } ModelPrototypeTags.push_back(strFileName); - ModelPrototypePath.push_back(file.path()); - _uint iNumMesh = pModel->Get_NumMeshes(); + { /* cache rigidbody */ // More Info In 리지드바디, CCT, 엔진ì�´ë„˜ + ModelPrototypePath.push_back(file.path()); - CRigidBody::RIGIDBODY_PROTOTYPEDESC Desc{}; - for (_uint i = 0; i < iNumMesh; ++i) { - _string strDestName = pModel->Get_MeshName(i) + to_string(i); - { - Desc.eType = ACTOR::TRIANGLEMESH; - Desc.ePxRigidBodyFlags = {}; - Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE }; - Desc.ePxMaterialTypes = PXMATERIAL::DEFAULT; - Desc.vMatInfo = _float3(0.5f, 0.5f, 0.6f); - Desc.fContactOffset = 0.f; - } - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, CMyTools::ToWstring(strDestName).c_str(), CRigidBody::Create(m_pDevice, m_pContext, Desc)))) { - return E_FAIL; + _uint iNumMesh = pModel->Get_NumMeshes(); + + CRigidBody::RIGIDBODY_PROTOTYPEDESC Desc{}; + for (_uint i = 0; i < iNumMesh; ++i) { + _string strDestName = pModel->Get_MeshName(i) + to_string(i); + { // basic static RIGIDBODY + Desc.eType = ACTOR::TRIANGLEMESH; + Desc.ePxRigidBodyFlags = {}; + Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE }; + Desc.ePxMaterialTypes = PXMATERIAL::DEFAULT; + Desc.vMatInfo = _float3(0.5f, 0.5f, 0.6f); + Desc.fContactOffset = 0.f; + } + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, CMyTools::ToWstring(strDestName).c_str(), CRigidBody::Create(m_pDevice, m_pContext, Desc)))) { + return E_FAIL; + } } } + } 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/Engine/Default/Engine.vcxproj.filters b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters index f1f28be21..d997876cf 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters @@ -226,9 +226,6 @@ {96600587-16b1-4627-914d-7fc413c501ba} - - {a60a7ba5-a937-41d7-baac-db67f86f3ba1} - {5948985e-f67e-4627-aca4-09b8e9edc359} @@ -250,6 +247,9 @@ {1eafb189-2d0c-4ad7-8690-10a517668206} + + {a60a7ba5-a937-41d7-baac-db67f86f3ba1} + @@ -445,7 +445,7 @@ 02.Element\02.Component\06.Model\Instance_Model - 01.Utility\06. Picking + 01.Utility\06.Picking 01.Utility\06.ComputeShader @@ -1023,7 +1023,7 @@ 01.Utility\06.ComputeShader - 01.Utility\06. Picking + 01.Utility\06.Picking 02.Element\02.Component\02.VIBuffer\Terrain diff --git a/Jusin154_Team3D/Engine/Private/Camera.cpp b/Jusin154_Team3D/Engine/Private/Camera.cpp index f0d9fb141..e809ad4ec 100644 --- a/Jusin154_Team3D/Engine/Private/Camera.cpp +++ b/Jusin154_Team3D/Engine/Private/Camera.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Camera.h" CCamera::CCamera(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -32,6 +32,7 @@ HRESULT CCamera::Initialize(void* pArg) m_fFar = pDesc->fFar; m_bActive = false; m_iPriority = pDesc->iPriority; + m_pCameraKey = pDesc->pCameraKey; m_pFollowTarget = pDesc->pFollowTarget; SAFE_ADDREF(m_pFollowTarget); m_pLookTarget = pDesc->pLookTarget; @@ -81,12 +82,12 @@ void CCamera::Transition(_float fTimeDelta) void CCamera::Active_Camera(pair<_float4, _float3>& pairTransitionInfo) { //if (true == m_bTransitionLerp) { - m_pTransformCom->Set_WorldMatrix(XMMatrixAffineTransformation(XMVectorSplatOne(), XMVectorZero(), - XMLoadFloat4(&pairTransitionInfo.first), XMLoadFloat3(&pairTransitionInfo.second))); - m_fTransitionCurrentTime = 0.f; - m_bIsCurrentTransition = true; + // m_pTransformCom->Set_WorldMatrix(XMMatrixAffineTransformation(XMVectorSplatOne(), XMVectorZero(), + // XMLoadFloat4(&pairTransitionInfo.first), XMLoadFloat3(&pairTransitionInfo.second))); + // m_fTransitionCurrentTime = 0.f; + // m_bIsCurrentTransition = true; //} - //m_bActive = true; + m_bActive = true; } void CCamera::DeActive_Camera(pair<_float4, _float3>& pairTransition) diff --git a/Jusin154_Team3D/Engine/Private/Camera_Manager.cpp b/Jusin154_Team3D/Engine/Private/Camera_Manager.cpp index b79c844f6..3d1329dab 100644 --- a/Jusin154_Team3D/Engine/Private/Camera_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/Camera_Manager.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Camera_Manager.h" #include "Camera.h" #include "GameInstance.h" @@ -66,6 +66,14 @@ HRESULT CCamera_Manager::IsBinded_Camera(const _wstring& wstrCameraKey) return E_FAIL; } +void CCamera_Manager::Force_CamPosition(_fvector vPos) +{ + if (nullptr == m_pCurrentMainCamera) + return; + + m_pCurrentMainCamera->Get_Component()->Set_State(STATE::POSITION, XMVectorSetW(vPos, 1.f)); +} + const _float* CCamera_Manager::Get_CurrentCameraFar() { return &m_fFar; @@ -92,9 +100,13 @@ CCamera* CCamera_Manager::Find_Camera(_uint iLevel, const _wstring& wstrCameraKe HRESULT CCamera_Manager::Clear_Cameras(_uint iLevel) { if (nullptr != m_pCurrentMainCamera) { - pair<_float4, _float3> pairTransitionInfo = { }; - m_pCurrentMainCamera->DeActive_Camera(pairTransitionInfo); - SAFE_RELEASE(m_pCurrentMainCamera); + for (pair& pairCamera : m_Cameras[iLevel]) { + if (m_pCurrentMainCamera == pairCamera.second) { + pair<_float4, _float3> pairTransitionInfo = { }; + m_pCurrentMainCamera->DeActive_Camera(pairTransitionInfo); + SAFE_RELEASE(m_pCurrentMainCamera); + } + } } for (auto& iter : m_Cameras[iLevel]) { SAFE_RELEASE(iter.second); diff --git a/Jusin154_Team3D/Engine/Private/Character_Controller.cpp b/Jusin154_Team3D/Engine/Private/Character_Controller.cpp index c518f534b..9dc306cea 100644 --- a/Jusin154_Team3D/Engine/Private/Character_Controller.cpp +++ b/Jusin154_Team3D/Engine/Private/Character_Controller.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Character_Controller.h" #include "GameInstance.h" @@ -29,7 +29,7 @@ HRESULT CCharacter_Controller::Render() { case ACTOR::BOX: { - // vVolume = half-extents(Hx,Hy,Hz) ¶ó°í °¡Á¤ + // vVolume = half-extents(Hx,Hy,Hz) ë�¼ê³  가정 const _matrix ScaleMatrix = XMMatrixScaling(vVolume.x / 0.5f, vVolume.y / 0.5f, @@ -129,13 +129,13 @@ _float3 CCharacter_Controller::Get_Volume() void CCharacter_Controller::Move(_float fTimeDelta) { - PSX::PxVec3 pxVecMomentum = {}; // ¼ø°£ À̵¿·® - _float fMinimumDistant = FLT_EPSILON3; // À̵¿·® ¿ÀÂ÷ Çã¿ëÄ¡, ( Å©¸é Ŭ¼ö·Ï À̵¿ÀÌ ´õ ÀÏÂï ³¡³­´Ù, ¼ø°£ À̵¿·®º¸´Ù °°°Å³ª ´õ Å©¸é ¾È¿òÁ÷Àϵí? ) + PSX::PxVec3 pxVecMomentum = {}; // 순간 ì�´ë�™ëŸ‰ + _float fMinimumDistant = FLT_EPSILON3; // ì�´ë�™ëŸ‰ 오차 허용치, ( í�¬ë©´ í�´ìˆ˜ë¡� ì�´ë�™ì�´ ë�” ì�¼ì°� ë��난다, 순간 ì�´ë�™ëŸ‰ë³´ë‹¤ 같거나 ë�” í�¬ë©´ 안움ì§�ì�¼ë“¯? ) _vector vMomentum = m_pTransform->Get_CurrentMomentum(); XMStoreFloat3((_float3*)&pxVecMomentum, vMomentum); - PSX::PxControllerFilters pxFilter = {}; // Ãæµ¹ ´ë»ó ÇÊÅÍ - const PSX::PxObstacleContext* pPxObstacles = { nullptr }; // ij¸¯ÅͰ¡ Ãæµ¹ÇؾßÇÒ Ãß°¡ÀûÀÎ Àå¾Ö¹° °´Ã¼?, ´êÀº Àå¾Ö¹°Àº ij½ÃµÈ´Ù? + PSX::PxControllerFilters pxFilter = {}; // ì¶©ë�Œ 대ìƒ� í•„í„° + const PSX::PxObstacleContext* pPxObstacles = { nullptr }; // ìº�릭터가 ì¶©ë�Œí•´ì•¼í•  추가ì �ì�¸ 장애물 ê°�ì²´?, ë‹¿ì�€ 장애물ì�€ ìº�시ë�œë‹¤? // eCOLLISION_SIDES = (1 << 0), //!< Character is colliding to the sides. @@ -209,7 +209,7 @@ HRESULT CCharacter_Controller::Initialize(void* pArg) PSX::PxCapsuleControllerDesc Desc{}; Desc.radius = pDesc->tCapsuleInfo.fRadius; Desc.height = pDesc->tCapsuleInfo.fHeight; - Desc.climbingMode = pDesc->tCapsuleInfo.eClimbingMode; // ±âº» eEASY + Desc.climbingMode = pDesc->tCapsuleInfo.eClimbingMode; // 기본 eEASY Desc.contactOffset = pDesc->fContactOffset; Desc.material = m_pGameInstance->Get_Material(&pDesc->fMaterial); m_pController = m_pGameInstance->Add_CapsuleController(Desc); @@ -220,7 +220,7 @@ HRESULT CCharacter_Controller::Initialize(void* pArg) #endif // _DEBUG } break; default: - assert(false); // PhysX¿¡¼­ ºÒ°¡´É + assert(false); // PhysXì—�서 불가능 return E_FAIL; break; } diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index caec4e169..6a0fddd43 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "GameInstance.h" #include "Prototype_Manager.h" #include "GameObject_Manager.h" @@ -314,23 +314,23 @@ void CGameInstance::Present_TimeCost() const float minY = 0.f; float maxY = 0.025f; - //float threshold = 166.f / 250.f; // ¾à 0.664f + //float threshold = 166.f / 250.f; // 약 0.664f ImVec2 graph_size(0, 80.0f); ImVec2 start_pos = GUI::GetCursorScreenPos(); GUI::PlotLines("##FrameCount", values, IM_ARRAYSIZE(values), values_offset, overlay, minY, maxY, ImVec2(0, 80.0f)); - // PlotLinesÀÇ ½ÇÁ¦ Ç¥½Ã ¿µ¿ª °¡Á®¿À±â + // PlotLinesì�˜ 실제 표시 ì˜�ì—­ 가져오기 ImVec2 plot_min = GUI::GetItemRectMin(); ImVec2 plot_max = GUI::GetItemRectMax(); - // ±âÁؼ± (60FPS) - float threshold = 1.0f / 60.0f; // 0.0166ÃÊ + // 기준선 (60FPS) + float threshold = 1.0f / 60.0f; // 0.0166ì´ˆ float normalized = (threshold - minY) / (maxY - minY); float y = plot_max.y - normalized * (plot_max.y - plot_min.y); - // »¡°£ ¼± ±×¸®±â + // 빨간 ì„  그리기 ImDrawList* draw_list = GUI::GetWindowDrawList(); draw_list->AddLine( ImVec2(plot_min.x, y), @@ -525,6 +525,10 @@ const _float* CGameInstance::Get_CurrentCameraFar() { return m_pCamera_Manager->Get_CurrentCameraFar(); } +void CGameInstance::Force_CamPosition(_fvector vPos) +{ + return m_pCamera_Manager->Force_CamPosition(vPos); +} HRESULT CGameInstance::Ready_Shadow_Light(const SHADOW_LIGHT_DESC& Desc) { return m_pShadow->Ready_Shadow_Light(Desc); @@ -561,7 +565,7 @@ SaveModel* CGameInstance::Load_SaveModel(const _char* filePath) #pragma region PhysX_Manager PSX::PxMaterial* CGameInstance::Get_Material(_float3* vMatInfo) { - return m_pPhysX_Manager->Get_Material(vMatInfo); + return m_pPhysX_Manager->Create_Material(vMatInfo); } void CGameInstance::RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTriMesh) diff --git a/Jusin154_Team3D/Engine/Private/GameObject_Manager.cpp b/Jusin154_Team3D/Engine/Private/GameObject_Manager.cpp index d45517faa..0ceedfeb9 100644 --- a/Jusin154_Team3D/Engine/Private/GameObject_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/GameObject_Manager.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "GameObject_Manager.h" #include "Layer.h" @@ -15,7 +15,7 @@ HRESULT CGameObject_Manager::Initialize(_uint iNumLevels) m_iNumLevels = iNumLevels; m_pLayers = new map[iNumLevels]; - + return S_OK; } @@ -39,6 +39,7 @@ HRESULT CGameObject_Manager::Add_GameObject_ToLayer(_uint iLayerLevelIndex, cons void CGameObject_Manager::Priority_Update(_float fTimeDelta) { + Describe_Entity(); #ifdef _DEBUG m_pGameInstance->Compute_TimeDelta(TEXT("Timer_PriorityUpdate")); #endif // _DEBUG @@ -157,3 +158,46 @@ void CGameObject_Manager::Free() Safe_Delete_Array(m_pLayers); } + +#ifdef _DEBUG + +void CGameObject_Manager::Describe_Entity() +{ + ImGuiWindowFlags window_flags = ImGuiWindowFlags_HorizontalScrollbar; + GUI::Begin("Object_Manager"); + GUI::Text("Levels : "); GUI::SameLine(); + if (GUI::BeginTabBar("Levels")) { + for (_uint i = 0; i < m_iNumLevels; ++i) { + + if (GUI::BeginTabItem(to_string(i).c_str(), nullptr)) { // Insert Here Level Names + GUI::BeginChild("Object_Lists"); + if (GUI::BeginTabBar("Layers")) { + string strlayerName; + for (pair< const _wstring, CLayer*>& pairLayer : m_pLayers[i]) { + size_t pos = pairLayer.first.find(TEXT("Layer_")); + strlayerName = "NOT_STARTED_WITH_Layer_"; + if (pos != wstring::npos) { + strlayerName = CMyTools::ToString(pairLayer.first.c_str() + pos + wcslen(TEXT("Layer_"))).c_str(); + } + if (GUI::BeginTabItem(strlayerName.c_str(), nullptr)) { + if (GUI::BeginChild("Items", ImVec2(0, 0), 0, window_flags)) { + pairLayer.second->Describe_Entity(); + GUI::EndChild(); + } + GUI::EndTabItem(); + } + } + GUI::EndTabBar(); + } + GUI::EndChild(); + GUI::EndTabItem(); + } + } + GUI::EndTabBar(); + } + GUI::End(); +} + + +#endif // _DEBUG + diff --git a/Jusin154_Team3D/Engine/Private/Layer.cpp b/Jusin154_Team3D/Engine/Private/Layer.cpp index 19935a629..bfbddb5b3 100644 --- a/Jusin154_Team3D/Engine/Private/Layer.cpp +++ b/Jusin154_Team3D/Engine/Private/Layer.cpp @@ -1,14 +1,12 @@ -#include "pch.h" +#include "pch.h" #include "Layer.h" #include "GameObject.h" #include "GameInstance.h" -CLayer::CLayer() -{ -} - -CLayer::~CLayer() +CLayer::CLayer(): + m_pGameInstance(CGameInstance::GetInstance()) { + SAFE_ADDREF(m_pGameInstance); } HRESULT CLayer::Initialize() @@ -89,9 +87,9 @@ void CLayer::Free() for (auto& iter : m_ObjectList) { SAFE_RELEASE(iter); - } + } m_ObjectList.clear(); - m_ObjectList.clear(); + SAFE_RELEASE(m_pGameInstance); } CLayer* CLayer::Create() @@ -106,3 +104,21 @@ CLayer* CLayer::Create() return pInstance; } + +#ifdef _DEBUG + +void CLayer::Describe_Entity() +{ + _int iIndex = 0; + + for (CGameObject*& iter : m_ObjectList) + { + GUI::PushID(iter); + if (GUI::SmallButton((to_string(iIndex) + " : " + typeid(*iter).name()).c_str())) { + m_pGameInstance->Force_CamPosition(iter->Get_WorldPostion() - XMVectorSet(0.f, -1.f, 1.f, 0.f) * 10.f); + } iIndex++; + GUI::PopID(); + } +} + +#endif // _DEBUG diff --git a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp index 50c8631c5..7ffca330b 100644 --- a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "PhysX_Manager.h" #include "GameObject.h" #include "GameInstance.h" @@ -31,14 +31,13 @@ CPhysX_Manager::CPhysX_Manager(ID3D11Device* pDevice, ID3D11DeviceContext* pCont const PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody& RigidBody) { _matrix WorldMatrix = RigidBody.Get_TransformPtr()->Get_XMWorldMatrix(); - PSX::PxTransform pxWorldMatrix = XMWorldToPx_NoScale(WorldMatrix); - // PxRigidDynamic ¾ÀÀÇ µ¿Àû ¹Ùµð ÀÎÅÍÆäÀ̽º + // PxRigidDynamic 씬ì�˜ ë�™ì � 바디 ì�¸í„°íŽ˜ì�´ìФ PSX::PxRigidDynamic* pActorDynamic = m_pPhysics->createRigidDynamic(pxWorldMatrix); pActorDynamic->userData = &RigidBody; - PSX::PxShape* pClone = nullptr; + PSX::PxShape* pShape = nullptr; PSX::PxGeometryHolder geoHolder = {}; _float3 vVolume = RigidBody.Get_HalfGeometryInfo(); @@ -46,29 +45,27 @@ const PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody& RigidBod switch (RigidBody.Get_Type()) { case ACTOR::BOX: geoHolder = PSX::PxBoxGeometry(PSX::PxVec3(vVolume.x, vVolume.y, vVolume.z)); - pClone = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.box(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]); - assert(nullptr != pClone); + pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.box(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]); break; case ACTOR::CAPSULE: geoHolder = PSX::PxCapsuleGeometry(vVolume.x, vVolume.y); - pClone = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.capsule(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]); - assert(nullptr != pClone); + pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.capsule(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]); break; case ACTOR::SPHERE: geoHolder = PSX::PxCapsuleGeometry(vVolume.x); - pClone = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.sphere(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]); - assert(nullptr != pClone); + pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.sphere(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]); break; default: - assert(false); break; + assert(false); + break; } + assert(nullptr != pShape); - pClone->setFlags(RigidBody.Get_ShapeFlags()); - pClone->setContactOffset(RigidBody.Get_ContactOffset()); - pClone->setRestOffset(0.f); + pShape->setFlags(RigidBody.Get_ShapeFlags()); + pShape->setContactOffset(RigidBody.Get_ContactOffset()); + pShape->setRestOffset(0.f); - - pActorDynamic->attachShape(*pClone); + pActorDynamic->attachShape(*pShape); PSX::PxRigidBodyFlags pxRigidFlags = RigidBody.Get_RigidBodyFlags(); pActorDynamic->setRigidBodyFlags(pxRigidFlags); @@ -90,60 +87,70 @@ const PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody& RigidBod const PSX::PxRigidStatic* CPhysX_Manager::Add_StaticActor(CRigidBody& RigidBody) { _matrix WorldMatrix = RigidBody.Get_TransformPtr()->Get_XMWorldMatrix(); - PSX::PxTransform pxWorldMatrix = XMWorldToPx_NoScale(WorldMatrix); - - // PxRigidStatic ¾ÀÀÇ Á¤Àû ¹Ùµð ÀÎÅÍÆäÀ̽º - PSX::PxTriangleMesh* pPxMesh = { nullptr }; - { - auto iter = m_TriangleMeshes.find(RigidBody.Get_PxMeshKey()); - if (m_TriangleMeshes.end() == iter) { - assert(false); - return nullptr; - } - pPxMesh = iter->second; - } - _vector vPos, vRotq, vScale; - XMMatrixDecompose(&vScale, &vRotq, &vPos, WorldMatrix); - - vRotq = XMQuaternionNormalize(vRotq); - - PSX::PxTransform out; - XMStoreFloat3((_float3*)&out.p, vPos); - XMStoreFloat4((_float4*)&out.q, vRotq); - PSX::PxMeshScale meshScale( - PSX::PxVec3(fabsf(vScale.m128_f32[0]), fabsf(vScale.m128_f32[1]), fabsf(vScale.m128_f32[2])), - PSX::PxQuat(PSX::PxIdentity) // ½ºÄÉÀÏ ÃàÀº ·ÎÄà ±âÁØ(º¸Åë Identity°¡ °¡Àå ¾ÈÀü) - ); - PSX::PxTriangleMeshGeometry* pPxMeshGeometry = new PSX::PxTriangleMeshGeometry(pPxMesh, meshScale); - { - pPxMeshGeometry->meshFlags |= PSX::PxMeshGeometryFlag::eDOUBLE_SIDED; - PX_ASSERT(pPxMeshGeometry.isValid()); // À¯È¿¼º üũ - m_TriangleMeshGeometry.emplace(RigidBody.Get_PxMeshKey(), pPxMeshGeometry); - } + // PxRigidStatic 씬ì�˜ ì •ì � 바디 ì�¸í„°íŽ˜ì�´ìФ PSX::PxRigidStatic* pActor = m_pPhysics->createRigidStatic(pxWorldMatrix); - PSX::PxShape* pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActor, *pPxMeshGeometry, *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]); - - pShape->setFlag(PSX::PxShapeFlag::eSCENE_QUERY_SHAPE, true); - pShape->setFlag(PSX::PxShapeFlag::eSIMULATION_SHAPE, true); - pActor->userData = &RigidBody; + + PSX::PxShape* pShape = { nullptr }; + PSX::PxTriangleMesh* pPxMesh = Find_TriangleMesh(RigidBody.Get_PxMeshKey()); + PSX::PxTriangleMeshGeometry* pPxMeshGeometry = { nullptr }; + + switch (RigidBody.Get_Type()) + { + case ACTOR::PLANE: + break; + case ACTOR::TRIANGLEMESH: + { // SetUp Geometry + _vector vPos, vRotq, vScale; + XMMatrixDecompose(&vScale, &vRotq, &vPos, WorldMatrix); + vRotq = XMQuaternionNormalize(vRotq); + + PSX::PxTransform out; + XMStoreFloat3((_float3*)&out.p, vPos); + XMStoreFloat4((_float4*)&out.q, vRotq); + PSX::PxMeshScale meshScale( + PSX::PxVec3(fabsf(vScale.m128_f32[0]), fabsf(vScale.m128_f32[1]), fabsf(vScale.m128_f32[2])), + PSX::PxQuat(PSX::PxIdentity) // 스케ì�¼ ì¶•ì�€ 로컬 기준 + ); + pPxMeshGeometry = new PSX::PxTriangleMeshGeometry(pPxMesh, meshScale); + + // GeoFlag 중 ë�”블사ì�´ë“œëŠ” ì�´ì œ ì§€ì›� 안함, í• ê±°ë©´ ë…¸ë§� 뒤집어서 하ë�¼ê³  함 + // pPxMeshGeometry->meshFlags |= PSX::PxMeshGeometryFlag::eDOUBLE_SIDED; + // 유효성 ì²´í�¬ + PX_ASSERT(pPxMeshGeometry.isValid()); + m_TriangleMeshGeometry.emplace(RigidBody.Get_PxMeshKey(), pPxMeshGeometry); + } + break; + case ACTOR::HEIGHTFIELD: + break; + default: + assert(false); + break; + } + + pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActor, *pPxMeshGeometry, *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]); + + pShape->setFlags(RigidBody.Get_ShapeFlags()); + pShape->setContactOffset(RigidBody.Get_ContactOffset()); + pShape->setRestOffset(0.f); + m_RigidBodys.emplace_back(&RigidBody, pActor); m_pScene->addActor(*pActor); return pActor; } -PSX::PxMaterial* CPhysX_Manager::Get_Material(const _float3* vMatInfo) +PSX::PxMaterial* CPhysX_Manager::Create_Material(const _float3* vMatInfo) { PSX::PxMaterial* pPxMaterial = m_pPhysics->createMaterial(vMatInfo->x, vMatInfo->y, vMatInfo->z); return pPxMaterial; } -void CPhysX_Manager::RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTriMesh) { +void CPhysX_Manager::RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTriMesh) +{ m_TriangleMeshes.emplace(CMyTools::ToWstring(pName), pPxTriMesh); - } HRESULT CPhysX_Manager::ConvertToTriMeshes(vector& Meshes, vector& pxTriMeshes, _fmatrix WorldMatrix) @@ -233,8 +240,8 @@ HRESULT CPhysX_Manager::LoadTriMeshes(const _char* pPath, vector& TriMeshes) //{ // filesystem::path pathPhysX = pPath; @@ -312,8 +319,8 @@ void CPhysX_Manager::Update(_float fTimeDelta) _bool bResult = m_pScene->fetchResults(true); } { // Post - // Update_Dynamic_ActiveActors(); - Update_Dynamic_AllActors(); + Update_Dynamic_ActiveActors(); + //Update_Dynamic_AllActors(); } } @@ -427,7 +434,7 @@ HRESULT CPhysX_Manager::Initialize() } - { // ¾À ¼¼ÆÃ + { // 씬 세팅 m_ToleranceScale.length = 1.f; // 1 meter m_ToleranceScale.speed = GRAVITY; // @@ -440,7 +447,7 @@ HRESULT CPhysX_Manager::Initialize() sceneDesc.gravity = PSX::PxVec3(0.f, -GRAVITY, 0.f); - m_pDispatcher = PSX::PxDefaultCpuDispatcherCreate(2/*cpu ÄÚ¾î °¹¼ö*/); + m_pDispatcher = PSX::PxDefaultCpuDispatcherCreate(2/*cpu 코어 갯수*/); if (nullptr == m_pDispatcher) { assert(false); return E_FAIL; @@ -459,7 +466,7 @@ HRESULT CPhysX_Manager::Initialize() m_pCCTManager->setOverlapRecoveryModule(false); } - // µð¹ö±×¼­¹öÀÇ Å¬¶ó ¼¼ÆÃ + // 디버그서버ì�˜ í�´ë�¼ 세팅 PSX::PxPvdSceneClient* pPvdClient = m_pScene->getScenePvdClient(); if (nullptr != pPvdClient) { pPvdClient->setScenePvdFlag(PSX::PxPvdSceneFlag::eTRANSMIT_CONSTRAINTS, true); @@ -469,7 +476,7 @@ HRESULT CPhysX_Manager::Initialize() // m_pScene->overlap();?????? -#ifdef ±â¹«¸® +#ifdef 기무리 m_pMaterials.reserve(ENUM_CLASS(PXMATERIAL::END)); m_pMaterials.push_back(m_pPhysics->createMaterial(0.5f, 0.5f, 0.6f)); PSX::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 0), *m_pMaterials[ENUM_CLASS(PXMATERIAL::DEFAULT)]); @@ -491,7 +498,7 @@ HRESULT CPhysX_Manager::Initialize() // } // } //} -#endif // ±â¹«¸® +#endif // 기무리 @@ -500,7 +507,7 @@ HRESULT CPhysX_Manager::Initialize() HRESULT CPhysX_Manager::Connect_DebugServer() { - // ³×Æ®¿öÅ© µð¹ö°Å Àü¼Û°´Ã¼ »ý¼º + // 네트워í�¬ 디버거 전송ê°�ì²´ ìƒ�성 m_pTransport = PSX::PxDefaultPvdSocketTransportCreate("127.0.0.1", 5425, 10); if (nullptr == m_pTransport) { assert(false); diff --git a/Jusin154_Team3D/Engine/Public/Camera.h b/Jusin154_Team3D/Engine/Public/Camera.h index d871a705c..595ab25f9 100644 --- a/Jusin154_Team3D/Engine/Public/Camera.h +++ b/Jusin154_Team3D/Engine/Public/Camera.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "GameObject.h" @@ -9,10 +9,11 @@ class ENGINE_DLL CCamera abstract : public CGameObject public: typedef struct tagCameraDesc : public CTransform::TRANSFORM_DESC { - _float fFovy{}, fNear{}, fFar{}; - _uint iPriority = { UINT_MAX }; - CGameObject* pFollowTarget = { nullptr }; - CGameObject* pLookTarget = { nullptr }; + _float fFovy{}, fNear{}, fFar{}; + _uint iPriority = { UINT_MAX }; + const _wchar* pCameraKey = { }; + CGameObject* pFollowTarget = { nullptr }; + CGameObject* pLookTarget = { nullptr }; }CAMERA_DESC; protected: @@ -48,6 +49,7 @@ class ENGINE_DLL CCamera abstract : public CGameObject _bool m_bActive = { false }; + const _wchar* m_pCameraKey = { nullptr }; CGameObject* m_pFollowTarget = { nullptr }; CGameObject* m_pLookTarget = { nullptr }; @@ -65,4 +67,4 @@ class ENGINE_DLL CCamera abstract : public CGameObject virtual void Free() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Public/Camera_Manager.h b/Jusin154_Team3D/Engine/Public/Camera_Manager.h index 49b20ed78..a6c31d7dc 100644 --- a/Jusin154_Team3D/Engine/Public/Camera_Manager.h +++ b/Jusin154_Team3D/Engine/Public/Camera_Manager.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Base.h" NS_BEGIN(Engine) @@ -17,8 +17,9 @@ class CCamera_Manager final : public CBase HRESULT Bind_Camera(_uint iLevel, const _wstring& wstrCameraKey, _bool bIgnorePriority); HRESULT IsBinded_Camera(const _wstring& wstrCameraKey); - const _float* Get_CurrentCameraFar(); + void Force_CamPosition(_fvector vPos); + const _float* Get_CurrentCameraFar(); private: ID3D11Device* m_pDevice = { nullptr }; @@ -42,4 +43,4 @@ class CCamera_Manager final : public CBase virtual void Free()override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Public/Character_Controller.h b/Jusin154_Team3D/Engine/Public/Character_Controller.h index 5e92e8839..c633c6a49 100644 --- a/Jusin154_Team3D/Engine/Public/Character_Controller.h +++ b/Jusin154_Team3D/Engine/Public/Character_Controller.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Component.h" NS_BEGIN(Engine) @@ -14,7 +14,7 @@ class ENGINE_DLL CCharacter_Controller final : { _float fRadius; _float fHeight; - PSX::PxCapsuleClimbingMode::Enum eClimbingMode; // ±âº» (eEASY, stepOffset °ªÀÌ ¹«Á¦ÇÑ), (eCONSTRAINED, stepOffset °ªÀÌ Á¦´ë·Î ¸ÔÀ½) + PSX::PxCapsuleClimbingMode::Enum eClimbingMode; // 기본 (eEASY, stepOffset ê°’ì�´ 무제한), (eCONSTRAINED, stepOffset ê°’ì�´ 제대로 먹ì�Œ) }; typedef struct tagCharacter_ControllerDesc { @@ -22,18 +22,18 @@ class ENGINE_DLL CCharacter_Controller final : ACTOR eBodyType = { ACTOR::END }; _float fContactOffset = { 0.f }; _float3 fMaterial = { 0.5f, 0.5f, 0.6f }; - _bool bAutoStepping = { false }; // °è´Ü ³ôÀÌ Å¸°Ô ÇÒ°ÇÁö // ¹Ú½º ÄݶóÀÌ´õ´Â »ý°¢ÇÑ´ë·Î µÇ´Âµ¥ ĸ½¶Àº ¹Ù´ÚÀÇ ±¸Ã¼ ¶§¹®¿¡ ¿¹»óº¸´Ù ´õ ³ôÀº °÷±îÁö ¿À¸¦ ¼ö ÀÖÀ½ - _float fStepOffset = { 0.05f }; // Çã¿ë°¡´ÉÇÑ °è´Ü ³ôÀÌ, ÀÛ°Ô À¯ÁöÇÏ´Â°Ô ÁÁÀ½ + _bool bAutoStepping = { false }; // 계단 높ì�´ 타게 í• ê±´ì§€ // 박스 콜ë�¼ì�´ë�”는 ìƒ�ê°�한대로 ë�˜ëŠ”ë�° 캡ìŠ�ì�€ 바닥ì�˜ 구체 때문ì—� 예ìƒ�보다 ë�” 높ì�€ 곳까지 오를 수 있ì�Œ + _float fStepOffset = { 0.05f }; // 허용가능한 계단 높ì�´, 작게 유지하는게 좋ì�Œ function funcHitCallback = { nullptr }; function funcBehaviorCallback = { nullptr }; - // Ÿ°í ¿Ã¶ó°¥ ¼ö ¾ø´Â °æ»ç¸éÀÇ °¢µµ¸¦ Á¤ÀÇÇÔ. 0.f ¸é ºñȰ¼ºÈ­ µÊ - // _float fSlopeLimit = { ÄÚ»çÀΰ¢µµ }; + // 타고 올ë�¼ê°ˆ 수 없는 경사면ì�˜ ê°�ë�„를 ì •ì�˜í•¨. 0.f ë©´ 비활성화 ë�¨ + // _float fSlopeLimit = { 코사ì�¸ê°�ë�„ }; union { - _float3 vBoxSize; // ¹Ú½º´Â AABBÀÓ + _float3 vBoxSize; // 박스는 AABBìž„ CapsuleInfo tCapsuleInfo; }; }Character_Controller_DESC; @@ -47,18 +47,18 @@ class ENGINE_DLL CCharacter_Controller final : virtual HRESULT Render() override; #endif - _float Get_ContactOffset() const { return m_pController->getContactOffset(); } - void Set_ContactOffset(_float fValue) const { return m_pController->setContactOffset((PSX::PxF32)fValue); } + _float Get_ContactOffset() const { return m_pController->getContactOffset(); } + void Set_ContactOffset(_float fValue) const { return m_pController->setContactOffset((PSX::PxF32)fValue); } - void Move(_float fTimeDelta); // À̵¿ - void Set_Position(_fvector vNewPos); // ¼ø°£À̵¿ - _vector Get_Position(); - _float3 Get_FootPosition(); // ContactOffsetÀÌ °í·ÁµÈ ¹ß¹Ù´Ú À§Ä¡( ½ÇÁ¦º¸´Ù ´õ ¾Æ·¡¿¡ À§Ä¡ÇÑ´Ù´Â ¶æ ) + void Move(_float fTimeDelta); // ì�´ë�™ + void Set_Position(_fvector vNewPos); // 순간ì�´ë�™ + _vector Get_Position(); + _float3 Get_FootPosition(); // ContactOffsetì�´ ê³ ë ¤ë�œ 발바닥 위치( 실제보다 ë�” 아래ì—� 위치한다는 뜻 ) - void Resize_Volume(_float fHeight); // ³ôÀ̸¦ ¼öÁ¤ÇÏ°í ¹Ù´Ú¿¡ ºÙÀÓ - void Modify_Volume(_float3 fVolume); - _float3 Get_Volume(); + void Resize_Volume(_float fHeight); // 높ì�´ë¥¼ 수정하고 바닥ì—� 붙임 + void Modify_Volume(_float3 fVolume); + _float3 Get_Volume(); private: ACTOR m_eBodyType = { ACTOR::END }; @@ -89,4 +89,4 @@ class ENGINE_DLL CCharacter_Controller final : virtual void Describe_Entity() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Public/Engine_Enum.h b/Jusin154_Team3D/Engine/Public/Engine_Enum.h index 01b17de36..639e278be 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Enum.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Enum.h @@ -174,4 +174,4 @@ NS_END // // PhysX Particle들ì�´ 닿는 순간 ê·¸ 파티í�´ì�„ 'í�¡ìˆ˜'해서 제거함 // // (default = off) // [ePARTICLE_DRAIN], -//}; \ No newline at end of file +//}; diff --git a/Jusin154_Team3D/Engine/Public/GameInstance.h b/Jusin154_Team3D/Engine/Public/GameInstance.h index 0433ef372..19510e2d7 100644 --- a/Jusin154_Team3D/Engine/Public/GameInstance.h +++ b/Jusin154_Team3D/Engine/Public/GameInstance.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Prototype_Manager.h" #include "GameObject_Manager.h" @@ -163,6 +163,7 @@ class ENGINE_DLL CGameInstance final : public CBase HRESULT Bind_Camera(_uint iLevel, const _wstring& strCameraKey, _bool bIgnorePriority); HRESULT IsBinded_Camera(const _wstring& strCameraKey); const _float* Get_CurrentCameraFar(); + void Force_CamPosition(_fvector vPos); #pragma endregion #pragma region SHADOW @@ -191,7 +192,7 @@ class ENGINE_DLL CGameInstance final : public CBase HRESULT ConvertToTriMeshes(vector& Meshes, vector& pxTriMeshes, _fmatrix WorldMatrix = XMMatrixIdentity()); HRESULT SaveTriMeshes(const _char* pPath, vector& TriMeshes); - HRESULT LoadTriMeshes(const _char* pPath, vector& TriMeshes); // ¸ðµ¨ ºÒ·¯¿Ô´ø °æ·Î¿¡ ±×´ë·Î ÀÖÀ½ + HRESULT LoadTriMeshes(const _char* pPath, vector& TriMeshes); // 모ë�¸ 불러왔ë�˜ 경로ì—� 그대로 있ì�Œ #pragma endregion @@ -254,4 +255,4 @@ class ENGINE_DLL CGameInstance final : public CBase virtual void Free() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Public/GameObject_Manager.h b/Jusin154_Team3D/Engine/Public/GameObject_Manager.h index 795b351a3..39d622ba3 100644 --- a/Jusin154_Team3D/Engine/Public/GameObject_Manager.h +++ b/Jusin154_Team3D/Engine/Public/GameObject_Manager.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Base.h" @@ -34,6 +34,12 @@ class ENGINE_DLL CGameObject_Manager final : public CBase static CGameObject_Manager* Create(_uint iNumLevels); virtual void Free() override; +#ifdef _DEBUG + void Describe_Entity(); +#endif // _DEBUG + + + }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Public/Layer.h b/Jusin154_Team3D/Engine/Public/Layer.h index 7bb2cfef1..cb6ea67c4 100644 --- a/Jusin154_Team3D/Engine/Public/Layer.h +++ b/Jusin154_Team3D/Engine/Public/Layer.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Base.h" NS_BEGIN(Engine) @@ -7,7 +7,7 @@ class ENGINE_DLL CLayer final : public CBase { private: CLayer(); - virtual ~CLayer(); + virtual ~CLayer() = default; public: virtual void Priority_Update(_float fTimeDelta); virtual void Update(_float fTimeDelta); @@ -40,8 +40,13 @@ class ENGINE_DLL CLayer final : public CBase HRESULT Initialize(); public: - virtual void Free() override; static CLayer* Create(); + virtual void Free() override; + + +#ifdef _DEBUG + void Describe_Entity(); +#endif // _DEBUG }; diff --git a/Jusin154_Team3D/Engine/Public/PhysX/geometry/PxTriangleMeshGeometry.h b/Jusin154_Team3D/Engine/Public/PhysX/geometry/PxTriangleMeshGeometry.h index 719c49540..72e5911c4 100644 --- a/Jusin154_Team3D/Engine/Public/PhysX/geometry/PxTriangleMeshGeometry.h +++ b/Jusin154_Team3D/Engine/Public/PhysX/geometry/PxTriangleMeshGeometry.h @@ -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 diff --git a/Jusin154_Team3D/Engine/Public/PhysX_Manager.h b/Jusin154_Team3D/Engine/Public/PhysX_Manager.h index ad0abf562..281e67edc 100644 --- a/Jusin154_Team3D/Engine/Public/PhysX_Manager.h +++ b/Jusin154_Team3D/Engine/Public/PhysX_Manager.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Base.h" @@ -17,14 +17,14 @@ class CPhysX_Manager final : public CBase public: /* dev-treadmill.tistory.com/155 */ -// HRESULT Update_RegionOfInterest(); ( Ãæµ¹ Äøµ, ÇÊÅ͸µµµ °Ë»öÇØ¾ßÇÔ ) -// Aggregate ( Ãæµ¹ ±×·ì, ÀÌ ±×·ì³¢¸®´Â ¼­·Î Ãæµ¹°Ë»ç¸¦ ÇÏÁö ¾ÊÀ½, ÁöÇü, ·¹±×µ¹ µî ) +// HRESULT Update_RegionOfInterest(); ( ì¶©ë�Œ 컬ë§�, í•„í„°ë§�ë�„ 검색해야함 ) +// Aggregate ( ì¶©ë�Œ 그룹, ì�´ 그룹ë�¼ë¦¬ëŠ” 서로 ì¶©ë�Œê²€ì‚¬ë¥¼ 하지 않ì�Œ, 지형, 레그ë�Œ 등 ) const PSX::PxRigidDynamic* Add_DynamicActor(CRigidBody& RigidBody); const PSX::PxRigidStatic* Add_StaticActor(CRigidBody& RigidBody); void RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTriMesh); - PSX::PxMaterial* Get_Material(const _float3* vMatInfo); + PSX::PxMaterial* Create_Material(const _float3* vMatInfo); HRESULT ConvertToTriMeshes(vector& Meshes, vector& pxTriMeshes, _fmatrix WorldMatrix); HRESULT SaveTriMeshes(const _char* pPath, vector& TriMeshes); @@ -57,16 +57,16 @@ class CPhysX_Manager final : public CBase ID3D11Device* m_pDevice = { nullptr }; ID3D11DeviceContext* m_pContext = { nullptr }; - PSX::PxDefaultAllocator m_AllocatorCallBack = { }; // ÇÇÁ÷½º µ¿ÀûÇÒ´çÀÚ - PSX::PxDefaultErrorCallback m_ErrorCallBack = { }; // ÇÇÁ÷½º ¿À·ùó¸®ÀÚ - PSX::PxDefaultCpuDispatcher* m_pDispatcher = { nullptr }; // ÇÇÁ÷½º CPUµð½ºÆÐÃÄ ( ÇöÀç ÇÇÁ÷½º´Â CPU only ) - PSX::PxTolerancesScale m_ToleranceScale = PSX::PxTolerancesScale(); // ÇÇÁ÷½º °øÂ÷ÀÇ ÁýÇÕ ( ±âº» ´ÜÀ§ ÁýÇÕ ) - PSX::PxFoundation* m_pFoundation = { nullptr }; // ÇÇÁ÷½º ÃʱâÈ­ Á¾·á ´ã´çÀÚ - PSX::PxPhysics* m_pPhysics = { nullptr }; // ÇÇÁ÷½º °´Ã¼ÀÇ »ý¼º, ÃʱâÈ­, Á¶ÀÛ ´ã´ç (½Ì±ÛÅæ) + PSX::PxDefaultAllocator m_AllocatorCallBack = { }; // 피ì§�스 ë�™ì �할당ìž� + PSX::PxDefaultErrorCallback m_ErrorCallBack = { }; // 피ì§�스 오류처리ìž� + PSX::PxDefaultCpuDispatcher* m_pDispatcher = { nullptr }; // 피ì§�스 CPU디스패ì³� ( 현재 피ì§�스는 CPU only ) + PSX::PxTolerancesScale m_ToleranceScale = PSX::PxTolerancesScale(); // 피ì§�스 공차ì�˜ ì§‘í•© ( 기본 단위 ì§‘í•© ) + PSX::PxFoundation* m_pFoundation = { nullptr }; // 피ì§�스 초기화 종료 담당ìž� + PSX::PxPhysics* m_pPhysics = { nullptr }; // 피ì§�스 ê°�ì²´ì�˜ ìƒ�성, 초기화, ì¡°ìž‘ 담당 (싱글톤) - PSX::PxScene* m_pScene = { nullptr }; // ÇÇÁ÷½º ½Ã¹Ä·¹À̼ÇÀÇ °ø°£ - PSX::PxControllerManager* m_pCCTManager = { nullptr }; // ÇÇÁ÷½º ij¸¯ÅÍ ÄÁÆ®·Ñ·¯¸¦ ÀüºÎ ÃßÀûÇÏ°í ¸Å´Ï¡ÇÔ - PSX::PxPvd* m_pPvd = { nullptr }; // ÇÇÁ÷½º ½Ã¹Ä·¹ÀÌ¼Ç µð¹ö±ëÀ» À§ÇÑ µµ±¸ + PSX::PxScene* m_pScene = { nullptr }; // 피ì§�스 시뮬레ì�´ì…˜ì�˜ 공간 + PSX::PxControllerManager* m_pCCTManager = { nullptr }; // 피ì§�스 ìº�릭터 컨트롤러를 ì „ë¶€ ì¶”ì �하고 매니징함 + PSX::PxPvd* m_pPvd = { nullptr }; // 피ì§�스 시뮬레ì�´ì…˜ 디버깅ì�„ 위한 ë�„구 PSX::PxCookingParams* m_pCookingParam = { nullptr }; PSX::PxPvdTransport* m_pTransport = { nullptr }; @@ -90,4 +90,4 @@ class CPhysX_Manager final : public CBase virtual void Free() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Engine/Public/RigidBody.h b/Jusin154_Team3D/Engine/Public/RigidBody.h index 2de7495d8..d04ccf0e7 100644 --- a/Jusin154_Team3D/Engine/Public/RigidBody.h +++ b/Jusin154_Team3D/Engine/Public/RigidBody.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Component.h" NS_BEGIN(PSX) @@ -13,17 +13,17 @@ class CMesh; class ENGINE_DLL CRigidBody final : public CComponent { public: // MORE INFO ON ENGINE_ENUM - typedef struct tagRigidBody_PrototypeDesc // ´Ù ä¿ì¼¼¿ä NONE »©°í, ¸ñÀû¿¡ ¾È¸Â´Â°Å »©°í + typedef struct tagRigidBody_PrototypeDesc // 다 채우세요 NONE 빼고, 목ì �ì—� 안맞는거 빼고 { ACTOR eType; PSX::PxRigidBodyFlags ePxRigidBodyFlags = { /* NONE */}; PSX::PxShapeFlags ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE }; PXMATERIAL ePxMaterialTypes = { PXMATERIAL::DEFAULT }; - _float3 vMatInfo = { 0.5f, 0.5f, 0.6f }; // ÇÇÁ÷½º °´Ã¼ÀÇ ¼Ó¼º µî - _float fContactOffset = { 0.05f }; // Á¢ÃË À¯°Ý ¿ÀÇÁ¼Â + _float3 vMatInfo = { 0.5f, 0.5f, 0.6f }; // 피ì§�스 ê°�ì²´ì�˜ ì†�성 등 + _float fContactOffset = { 0.05f }; // ì ‘ì´‰ 유격 오프셋 #pragma region DYNAMIC - _float3 vhalfGeometryInfo; // ¹Ú½º´Â vSize, ĸ½¶Àº radius, height·Î ¾¸ - _float fDensity = { 1000.f }; // ¹Ðµµ, ½ÇÁ¦ ¹«°Ô´Â ºÎÇÇ¿¡ µû¶ó ´Þ¶óÁü + _float3 vhalfGeometryInfo; // 박스는 vSize, 캡ìŠ�ì�€ radius, height로 씀 + _float fDensity = { 1000.f }; // ë°€ë�„, 실제 무게는 부피ì—� ë”°ë�¼ 달ë�¼ì§� #pragma endregion #pragma region STATIC #pragma endregion @@ -63,7 +63,7 @@ class ENGINE_DLL CRigidBody final : public CComponent PSX::PxRigidBodyFlags m_ePxRigidBodyFlags = {}; PXMATERIAL m_eMatType = { PXMATERIAL::END }; _float m_fContactOffset = { 0.05f }; - const PSX::PxActor* m_pRigidBody = { nullptr }; // ½ÇÁ¦ ½Ã¹Ä·¹À̼ÇÀ» µµ´Â º»Ã¼ + const PSX::PxActor* m_pRigidBody = { nullptr }; // 실제 시뮬레ì�´ì…˜ì�„ ë�„는 본체 CTransform* m_pTransform = { nullptr }; @@ -74,7 +74,7 @@ class ENGINE_DLL CRigidBody final : public CComponent _float m_fDensity = { 1000.f }; #pragma endregion #pragma region STATIC - _wstring m_wstrMeshKey = { }; // ¦²á ½ºÅÂÆ½ ¸Þ½ÃÀÇ triangleMesh Ű + _wstring m_wstrMeshKey = { }; // ì§�ê¿� 스태틱 메시ì�˜ triangleMesh 키 #pragma endregion private: @@ -97,4 +97,4 @@ class ENGINE_DLL CRigidBody final : public CComponent virtual void Describe_Entity() override; }; -NS_END \ No newline at end of file +NS_END