diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index b34993f38..b6d3293ed 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -1816,6 +1816,25 @@ HRESULT CLoader::Loading_For_GamePlay() return E_FAIL; } } + { + CRigidBody_Dynamic::RIGIDBODY_PROTOTYPE_DYNAMIC_DESC Desc{}; + Desc.eType = ACTOR::SPHERE; + 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.01f, 0.01f, 0.01f }; + Desc.fContactOffset = { 0.01f }; + Desc.vhalfGeometryInfo = { 0.120f, 0.460f, 0.010f }; + Desc.fDensity = 100.f; + Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY()); + Desc.eLockFlag = {}; + Desc.vAutoDamping = { 1.f, 1.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_Player_LowerBound"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) { + return E_FAIL; + } + } { if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DynamicJoint"), CDynamic_D6Joint::Create(m_pDevice, m_pContext)))) { return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/PlayerRobe.cpp b/Jusin154_Team3D/Client/Private/PlayerRobe.cpp index 35ecc61ef..52e2e8823 100644 --- a/Jusin154_Team3D/Client/Private/PlayerRobe.cpp +++ b/Jusin154_Team3D/Client/Private/PlayerRobe.cpp @@ -14,8 +14,13 @@ CPlayerRobe::CPlayerRobe(const CPlayerRobe& Prototype) void CPlayerRobe::Priority_Update(_float fTimeDelta) { #ifdef _DEBUG +#ifdef 기무리 + Update_RobeJoints(); +#endif // 기무리 + Describe_Entity(); #endif // _DEBUG + } void CPlayerRobe::Update(_float fTimeDelta) @@ -130,6 +135,8 @@ HRESULT CPlayerRobe::Update_LegsPosition() } #endif // _DEBUG } + m_pLower0Bound->Move_Kinematic(m_pParentTransformCom->Get_XMWorldMatrix(), false); + m_pLower1Bound->Move_Kinematic(m_pParentTransformCom->Get_XMWorldMatrix(), false); return S_OK; } @@ -175,9 +182,121 @@ HRESULT CPlayerRobe::Render_Legs() [this]() { m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0); }); + m_pLower0Bound->Render([this]() { + m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0); + }); + m_pLower1Bound->Render([this]() { + m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0); + }); return S_OK; } +HRESULT CPlayerRobe::Update_RobeJoints() +{ + for (_uint i = ENUM_CLASS(PLAYER_JOINT_ORDER::ORIGIN_TO_RUP_START); i < ENUM_CLASS(PLAYER_JOINT_ORDER::END); ++i) { + m_JointDescriptions[i].InitFromJoint(*m_pDynamicJoints[i]); + switch (PLAYER_JOINT_ORDER(i)) + { + /* From Origin */ + case PLAYER_JOINT_ORDER::ORIGIN_TO_RUP_START: + case PLAYER_JOINT_ORDER::ORIGIN_TO_TUP_START: + case PLAYER_JOINT_ORDER::ORIGIN_TO_LUP_START: + m_JointDescriptions[i].iMotionTwist = 0; + m_JointDescriptions[i].iMotionSwing1 = 0; + m_JointDescriptions[i].iMotionSwing2 = 0; + m_JointDescriptions[i].fLinearLimit = 0.f; + m_JointDescriptions[i].fTwistAbsDeg = 0.f; + m_JointDescriptions[i].fSwingDeg = 5.f; + break; + case PLAYER_JOINT_ORDER::ORIGIN_TO_RUP_END: + case PLAYER_JOINT_ORDER::ORIGIN_TO_TUP_END: + case PLAYER_JOINT_ORDER::ORIGIN_TO_LUP_END: + m_JointDescriptions[i].iMotionTwist = 0; + m_JointDescriptions[i].iMotionSwing1 = 0; + m_JointDescriptions[i].iMotionSwing2 = 0; + m_JointDescriptions[i].fLinearLimit = 0.f; + m_JointDescriptions[i].fTwistAbsDeg = 0.f; + m_JointDescriptions[i].fSwingDeg = 5.f; + break; + + + /* From_Middle */ + case PLAYER_JOINT_ORDER::RUP_TO_RMIDDLE_START: + case PLAYER_JOINT_ORDER::TUP_TO_TMIDDLE_START: + case PLAYER_JOINT_ORDER::LUP_TO_LMIDDLE_START: + m_JointDescriptions[i].iMotionTwist = 0; + m_JointDescriptions[i].iMotionSwing1 = 0; + m_JointDescriptions[i].iMotionSwing2 = 0; + m_JointDescriptions[i].fLinearLimit = 0.f; + m_JointDescriptions[i].fTwistAbsDeg = 0.f; + m_JointDescriptions[i].fSwingDeg = 10.f; + break; + + case PLAYER_JOINT_ORDER::RUP_TO_RMIDDLE_END: + case PLAYER_JOINT_ORDER::TUP_TO_TMIDDLE_END: + case PLAYER_JOINT_ORDER::LUP_TO_LMIDDLE_END: + m_JointDescriptions[i].iMotionTwist = 1; + m_JointDescriptions[i].iMotionSwing1 = 1; + m_JointDescriptions[i].iMotionSwing2 = 1; + m_JointDescriptions[i].fLinearLimit = 0.f; + m_JointDescriptions[i].fSwingDeg = 0.f; + m_JointDescriptions[i].fTwistAbsDeg = 0.f; + + m_JointDescriptions[i].bEnableSlerpDrive = true; + m_JointDescriptions[i].fLinearStiffness = 10.f; + m_JointDescriptions[i].fSlerpDamping = 3.f; + m_JointDescriptions[i].fSlerpForceLimit = 40.f; + m_JointDescriptions[i].bSlerpAccel = true; + break; + + + /* From_Lower */ + case PLAYER_JOINT_ORDER::RMIDDLE_TO_RR_START: + case PLAYER_JOINT_ORDER::RMIDDLE_TO_R_START: + m_JointDescriptions[i].iMotionTwist = 1; + m_JointDescriptions[i].iMotionSwing1 = 1; + m_JointDescriptions[i].iMotionSwing2 = 1; + m_JointDescriptions[i].fLinearLimit = 0.f; + m_JointDescriptions[i].fTwistAbsDeg = 15.f; + m_JointDescriptions[i].fSwingDeg = 15.f; + break; + + case PLAYER_JOINT_ORDER::RMIDDLE_TO_R_END: + case PLAYER_JOINT_ORDER::RMIDDLE_TO_RR_END: + break; + case PLAYER_JOINT_ORDER::TMIDDLE_TO_TR_START: + case PLAYER_JOINT_ORDER::TMIDDLE_TO_TL_START: + m_JointDescriptions[i].iMotionTwist = 1; + m_JointDescriptions[i].iMotionSwing1 = 1; + m_JointDescriptions[i].iMotionSwing2 = 1; + m_JointDescriptions[i].fLinearLimit = 0.f; + m_JointDescriptions[i].fTwistAbsDeg = 15.f; + m_JointDescriptions[i].fSwingDeg = 15.f; + break; + + case PLAYER_JOINT_ORDER::TMIDDLE_TO_TR_END: + case PLAYER_JOINT_ORDER::TMIDDLE_TO_TL_END: + break; + case PLAYER_JOINT_ORDER::LMIDDLE_TO_L_START: + case PLAYER_JOINT_ORDER::LMIDDLE_TO_LL_START: + m_JointDescriptions[i].iMotionTwist = 1; + m_JointDescriptions[i].iMotionSwing1 = 1; + m_JointDescriptions[i].iMotionSwing2 = 1; + m_JointDescriptions[i].fLinearLimit = 0.f; + m_JointDescriptions[i].fTwistAbsDeg = 15.f; + m_JointDescriptions[i].fSwingDeg = 15.f; + break; + + case PLAYER_JOINT_ORDER::LMIDDLE_TO_L_END: + case PLAYER_JOINT_ORDER::LMIDDLE_TO_LL_END: + break; + default: + break; + } + m_JointDescriptions[i].ApplyToJoint(*m_pDynamicJoints[i]); + } + return S_OK; +} HRESULT CPlayerRobe::Render_BonePhysX() { _vector vColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0x00ff00, 1.f); @@ -246,6 +365,22 @@ HRESULT CPlayerRobe::Ready_Components() return E_FAIL; } } + { // + CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; + Desc.iSubKind = ENUM_CLASS(PXOBJECT::LEG); + Desc.bAutoOwnerTranslation = false; + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_Player_LowerBound"), (CComponent**)&m_pLower0Bound, &Desc))) { + return E_FAIL; + } + } + { // + CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; + Desc.iSubKind = ENUM_CLASS(PXOBJECT::LEG); + Desc.bAutoOwnerTranslation = false; + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_Player_LowerBound"), (CComponent**)&m_pLower1Bound, &Desc))) { + return E_FAIL; + } + } { // RobeSocket { // Fixed_MainAnchor CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; @@ -529,6 +664,14 @@ HRESULT CPlayerRobe::Initialize(void* pArg) if (FAILED(Ready_Components())) { return E_FAIL; } + + D6JOINTDESC JointDesc = D6JOINTDESC(); + for (_uint i = ENUM_CLASS(PLAYER_JOINT_ORDER::ORIGIN_TO_RUP_START); i < ENUM_CLASS(PLAYER_JOINT_ORDER::END); ++i) { + JointDesc.ApplyToJoint(*m_pDynamicJoints[i]); + m_JointDescriptions[i] = JointDesc; + } + Update_RobeJoints(); + #ifdef _DEBUG m_pSubShape = (GeometricPrimitive::CreateSphere(m_pContext, 0.05f, 22, false, false)); m_pMainShape = (GeometricPrimitive::CreateCylinder(m_pContext, 0.3f, 0.075f, 22, false)); @@ -579,6 +722,8 @@ void CPlayerRobe::Free() SAFE_RELEASE(m_pDepthStencilStateNone); #endif // _DEBUG SAFE_RELEASE(m_pRightLeg); + SAFE_RELEASE(m_pLower0Bound); + SAFE_RELEASE(m_pLower1Bound); SAFE_RELEASE(m_pLeftLeg); SAFE_RELEASE(m_pRobeMainAnchor); for (_uint i = 0; i < ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::END); ++i) { @@ -611,6 +756,8 @@ void CPlayerRobe::Describe_Entity() } } } + m_pLower0Bound->Describe_Entity(); + m_pLower1Bound->Describe_Entity(); } GUI::End(); } diff --git a/Jusin154_Team3D/Client/Private/Ranrok.cpp b/Jusin154_Team3D/Client/Private/Ranrok.cpp index 66f2913ea..55059b3a1 100644 --- a/Jusin154_Team3D/Client/Private/Ranrok.cpp +++ b/Jusin154_Team3D/Client/Private/Ranrok.cpp @@ -433,13 +433,13 @@ HRESULT CRanrok::Render_Nonblend() return E_FAIL; } -#ifdef _DEBUG -#ifdef 기무리 - if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) { - return E_FAIL; - } -#endif // 기무리 -#endif // _DEBUG +//#ifdef _DEBUG +//#ifdef 기무리 +// if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) { +// return E_FAIL; +// } +//#endif // 기무리 +//#endif // _DEBUG if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Public/PlayerRobe.h b/Jusin154_Team3D/Client/Public/PlayerRobe.h index b07d0f4dd..bd7a6af1e 100644 --- a/Jusin154_Team3D/Client/Public/PlayerRobe.h +++ b/Jusin154_Team3D/Client/Public/PlayerRobe.h @@ -50,10 +50,13 @@ class CPlayerRobe final : public CPartObject _int m_iBoneNum = -1; CRigidBody_Dynamic* m_pRightLeg = { nullptr }; CRigidBody_Dynamic* m_pLeftLeg = { nullptr }; + CRigidBody_Dynamic* m_pLower0Bound = { nullptr }; + CRigidBody_Dynamic* m_pLower1Bound = { nullptr }; CRigidBody_Dynamic* m_pRobeMainAnchor = { nullptr }; CRigidBody_Dynamic* m_pRobeJointRoute[ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::END)] = { nullptr }; CRigidBody_Dynamic* m_pRobeJointAnchor[ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::END)] = { nullptr }; PSX::PxD6Joint* m_pDynamicJoints[ENUM_CLASS(PLAYER_JOINT_ORDER::END)] = { nullptr }; + D6JOINTDESC m_JointDescriptions[ENUM_CLASS(PLAYER_JOINT_ORDER::END)] = { }; vector<_float4x4> m_PrevRobeBoneMatrices = { }; #ifdef _DEBUG @@ -74,6 +77,7 @@ class CPlayerRobe final : public CPartObject #ifdef _DEBUG HRESULT Render_BonePhysX(); HRESULT Render_Legs(); + HRESULT Update_RobeJoints(); #endif // _DEBUG public: static CPlayerRobe* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index 98a8c44f7..b19fbb64d 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -396,7 +396,7 @@ void CGameInstance::Compute_FrameCount() #endif // _DEBUG } -void CGameInstance::Present_TimeCost() const +void CGameInstance::Present_TimeCost() { #pragma region TimeCost #ifdef _DEBUG @@ -444,138 +444,148 @@ void CGameInstance::Present_TimeCost() const GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); GUI::Text("Level %d", int(m_fTimer_Level / fTotal * 100.f)); } - if (GUI::IsPopupOpen("Renderer_Timer")) + if (GUI::Button("Renderer_Timer")) { - if (GUI::BeginPopup("Renderer_Timer")) { - _float fRenderer_Total = m_fTimer_Render_Priority - + m_fTimer_Render_Shadow - + m_fTimer_Render_NonBlend - + m_fTimer_Render_SSAO - + m_fTimer_Render_SSAO_BLUR - + m_fTimer_Render_LightAcc - + m_fTimer_Render_Blur - + m_fTimer_Render_Combined - + m_fTimer_Render_Occlusion - + m_fTimer_Render_EnvironmentPostProcess - + m_fTimer_Render_Fog - + m_fTimer_Render_Effect - + m_fTimer_Render_NonLight - + m_fTimer_Render_Blend - + m_fTimer_Render_WeightBlend - + m_fTimer_Render_PostProcessing - + m_fTimer_Render_LastColor - + m_fTimer_Render_Tone_Mapping - + m_fTimer_Render_UI - + m_fTimer_Render_UI_Overley; + m_bRendererTimerOpen = !m_bRendererTimerOpen; + } + if (m_bRendererTimerOpen) + { + GUI::SetNextWindowSize(ImVec2(320.f, 0.f), ImGuiCond_FirstUseEver); + + if (GUI::Begin("Renderer_Timer", &m_bRendererTimerOpen, ImGuiWindowFlags_AlwaysAutoResize)) { - GUI::ProgressBar(m_fTimer_Render_Priority / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_Priority %d", int(m_fTimer_Render_Priority / fRenderer_Total * 100.f)); + _float fRenderer_Total = m_fTimer_Render_Priority + + m_fTimer_Render_Shadow + + m_fTimer_Render_NonBlend + + m_fTimer_Render_SSAO + + m_fTimer_Render_SSAO_BLUR + + m_fTimer_Render_LightAcc + + m_fTimer_Render_Blur + + m_fTimer_Render_Combined + + m_fTimer_Render_Occlusion + + m_fTimer_Render_EnvironmentPostProcess + + m_fTimer_Render_Fog + + m_fTimer_Render_Effect + + m_fTimer_Render_NonLight + + m_fTimer_Render_Blend + + m_fTimer_Render_WeightBlend + + m_fTimer_Render_PostProcessing + + m_fTimer_Render_LastColor + + m_fTimer_Render_Tone_Mapping + + m_fTimer_Render_UI + + m_fTimer_Render_UI_Overley; + + // 0으로 나눔 방지 + if (fRenderer_Total <= FLT_EPSILON) + fRenderer_Total = 1.f; + + { + GUI::ProgressBar(m_fTimer_Render_Priority / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_Priority %d", int(m_fTimer_Render_Priority / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_Shadow / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_Shadow %d", int(m_fTimer_Render_Shadow / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_NonBlend / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_NonBlend %d", int(m_fTimer_Render_NonBlend / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_SSAO / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_SSAO %d", int(m_fTimer_Render_SSAO / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_SSAO_BLUR / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_SSAO_BLUR %d", int(m_fTimer_Render_SSAO_BLUR / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_LightAcc / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_LightAcc %d", int(m_fTimer_Render_LightAcc / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_Blur / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_Blur %d", int(m_fTimer_Render_Blur / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_Combined / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_Combined %d", int(m_fTimer_Render_Combined / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_Occlusion / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_Occlusion %d", int(m_fTimer_Render_Occlusion / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_EnvironmentPostProcess / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_EnvironmentPostProcess %d", int(m_fTimer_Render_EnvironmentPostProcess / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_Fog / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_Fog %d", int(m_fTimer_Render_Fog / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_Effect / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_Effect %d", int(m_fTimer_Render_Effect / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_NonLight / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_NonLight %d", int(m_fTimer_Render_NonLight / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_Blend / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_Blend %d", int(m_fTimer_Render_Blend / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_WeightBlend / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_WeightBlend %d", int(m_fTimer_Render_WeightBlend / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_PostProcessing / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_PostProcessing %d", int(m_fTimer_Render_PostProcessing / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_LastColor / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_LastColor %d", int(m_fTimer_Render_LastColor / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_Tone_Mapping / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_Tone_Mapping %d", int(m_fTimer_Render_Tone_Mapping / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_UI / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_UI %d", int(m_fTimer_Render_UI / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_UI_Overley / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_UI_Overley %d", int(m_fTimer_Render_UI_Overley / fRenderer_Total * 100.f)); + } } - { - GUI::ProgressBar(m_fTimer_Render_Shadow / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_Shadow %d", int(m_fTimer_Render_Shadow / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_NonBlend / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_NonBlend %d", int(m_fTimer_Render_NonBlend / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_SSAO / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_SSAO %d", int(m_fTimer_Render_SSAO / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_SSAO_BLUR / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_SSAO_BLUR %d", int(m_fTimer_Render_SSAO_BLUR / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_LightAcc / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_LightAcc %d", int(m_fTimer_Render_LightAcc / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_Blur / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_Blur %d", int(m_fTimer_Render_Blur / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_Combined / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_Combined %d", int(m_fTimer_Render_Combined / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_Occlusion / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_Occlusion %d", int(m_fTimer_Render_Occlusion / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_EnvironmentPostProcess / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_EnvironmentPostProcess %d", int(m_fTimer_Render_EnvironmentPostProcess / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_Fog / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_Fog %d", int(m_fTimer_Render_Fog / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_Effect / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_Effect %d", int(m_fTimer_Render_Effect / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_NonLight / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_NonLight %d", int(m_fTimer_Render_NonLight / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_Blend / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_Blend %d", int(m_fTimer_Render_Blend / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_WeightBlend / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_WeightBlend %d", int(m_fTimer_Render_WeightBlend / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_PostProcessing / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_PostProcessing %d", int(m_fTimer_Render_PostProcessing / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_LastColor / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_LastColor %d", int(m_fTimer_Render_LastColor / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_Tone_Mapping / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_Tone_Mapping %d", int(m_fTimer_Render_Tone_Mapping / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_UI / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_UI %d", int(m_fTimer_Render_UI / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_UI_Overley / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_UI_Overley %d", int(m_fTimer_Render_UI_Overley / fRenderer_Total * 100.f)); - } - GUI::EndPopup(); - } + + GUI::End(); + } { GUI::ProgressBar(m_fTimer_DrawCall / fTotal, ImVec2(200.f, 0.f)); - GUI::SameLine(); - if (GUI::SmallButton("Renderer_Timer")) { - GUI::OpenPopup("Renderer_Timer"); - } GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); GUI::Text("DrawCall %d", int(m_fTimer_DrawCall / fTotal * 100.f)); } diff --git a/Jusin154_Team3D/Engine/Public/Engine_Struct.h b/Jusin154_Team3D/Engine/Public/Engine_Struct.h index e9528790d..a4c17238a 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Struct.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Struct.h @@ -390,9 +390,185 @@ typedef struct tagPHYSX_USERDATA { }PHYSX_USERDATA; -typedef struct tagD6JointDesc { +typedef struct tagD6JointDesc +{ // 0: Locked + // 1: Limited + // 2: Free + int iMotionX = 0; + int iMotionY = 0; + int iMotionZ = 0; + int iMotionTwist = 0; + int iMotionSwing1 = 0; + int iMotionSwing2 = 0; + + float fLinearLimit = 0.f; + float fSwingDeg = 0.f; + float fTwistAbsDeg = 0.f; + + bool bEnableSlerpDrive = false; + float fSlerpStiffness = 0.f; + float fSlerpDamping = 0.f; + float fSlerpForceLimit = 0.f; + bool bSlerpAccel = false; + + bool bEnableLinearDrive = false; + float fLinearStiffness = 0.f; + float fLinearDamping = 0.f; + float fLinearForceLimit = 0.f; + bool bLinearAccel = false; + + tagD6JointDesc() { + iMotionX = 0; + iMotionY = 0; + iMotionZ = 0; + iMotionTwist = 0; + iMotionSwing1 = 0; + iMotionSwing2 = 0; + fLinearLimit = 0.f; + fSwingDeg = 0.f; + fTwistAbsDeg = 0.f; + bEnableSlerpDrive = false; + fSlerpStiffness = 0.f; + fSlerpForceLimit = 0.f; + fSlerpDamping = 0.f; + bSlerpAccel = false; + bEnableLinearDrive = false; + fLinearStiffness = 0.f; + fLinearDamping = 0.f; + bLinearAccel = false; + } + + static int MotionToIndex(PSX::PxD6Motion::Enum motion) + { + if (motion == PSX::PxD6Motion::eLOCKED) return 0; + if (motion == PSX::PxD6Motion::eLIMITED) return 1; + return 2; // eFREE + } + + static PSX::PxD6Motion::Enum IndexToMotion(int index) + { + return (index == 0) ? PSX::PxD6Motion::eLOCKED : + (index == 1) ? PSX::PxD6Motion::eLIMITED : + PSX::PxD6Motion::eFREE; + } + + static bool HasAccelFlag(const PSX::PxD6JointDrive& drive) + { + return (drive.flags & PSX::PxD6JointDriveFlag::eACCELERATION) != 0; + } + + static PSX::PxD6JointDrive MakeDrive(float stiffness, float damping, float forceLimit, bool accel) + { + PSX::PxD6JointDrive drive(stiffness, damping, forceLimit, accel); + return drive; + } + + void InitFromJoint(const PSX::PxD6Joint& joint) + { + iMotionX = MotionToIndex(joint.getMotion(PSX::PxD6Axis::eX)); + iMotionY = MotionToIndex(joint.getMotion(PSX::PxD6Axis::eY)); + iMotionZ = MotionToIndex(joint.getMotion(PSX::PxD6Axis::eZ)); + iMotionTwist = MotionToIndex(joint.getMotion(PSX::PxD6Axis::eTWIST)); + iMotionSwing1 = MotionToIndex(joint.getMotion(PSX::PxD6Axis::eSWING1)); + iMotionSwing2 = MotionToIndex(joint.getMotion(PSX::PxD6Axis::eSWING2)); + + { + PSX::PxJointLinearLimit pxLimit = joint.getLinearLimit(); + fLinearLimit = pxLimit.value; + } + + { + PSX::PxJointLimitCone pxSwing = joint.getSwingLimit(); + fSwingDeg = XMConvertToDegrees(pxSwing.yAngle); // 대칭 cone 기준 + + PSX::PxJointAngularLimitPair pxTwist = joint.getTwistLimit(); + const float fAbsRad = PSX::PxMax(PSX::PxAbs(pxTwist.lower), PSX::PxAbs(pxTwist.upper)); + fTwistAbsDeg = XMConvertToDegrees(fAbsRad); + } + + { + PSX::PxD6JointDrive pxDrive = joint.getDrive(PSX::PxD6Drive::eSLERP); + bEnableSlerpDrive = (pxDrive.stiffness > 0.f) || (pxDrive.damping > 0.f) || (pxDrive.forceLimit > 0.f); + fSlerpStiffness = pxDrive.stiffness; + fSlerpDamping = pxDrive.damping; + fSlerpForceLimit = pxDrive.forceLimit; + bSlerpAccel = HasAccelFlag(pxDrive); + } + + { + PSX::PxD6JointDrive pxDriveX = joint.getDrive(PSX::PxD6Drive::eX); + bEnableLinearDrive = (pxDriveX.stiffness > 0.f) || (pxDriveX.damping > 0.f) || (pxDriveX.forceLimit > 0.f); + fLinearStiffness = pxDriveX.stiffness; + fLinearDamping = pxDriveX.damping; + fLinearForceLimit = pxDriveX.forceLimit; + bLinearAccel = HasAccelFlag(pxDriveX); + } + } + + void ApplyToJoint(PSX::PxD6Joint& joint) const + { + joint.setMotion(PSX::PxD6Axis::eX, IndexToMotion(iMotionX)); + joint.setMotion(PSX::PxD6Axis::eY, IndexToMotion(iMotionY)); + joint.setMotion(PSX::PxD6Axis::eZ, IndexToMotion(iMotionZ)); + joint.setMotion(PSX::PxD6Axis::eTWIST, IndexToMotion(iMotionTwist)); + joint.setMotion(PSX::PxD6Axis::eSWING1, IndexToMotion(iMotionSwing1)); + joint.setMotion(PSX::PxD6Axis::eSWING2, IndexToMotion(iMotionSwing2)); + + { + PSX::PxJointLinearLimit pxLimit = joint.getLinearLimit(); + pxLimit.value = PSX::PxMax(0.f, fLinearLimit); + joint.setLinearLimit(pxLimit); + } + + { + PSX::PxJointLimitCone pxSwing = joint.getSwingLimit(); + const float swingRad = XMConvertToRadians(PSX::PxClamp(fSwingDeg, 0.f, 180.f)); + pxSwing.yAngle = swingRad; + pxSwing.zAngle = swingRad; + joint.setSwingLimit(pxSwing); + } + { + PSX::PxJointAngularLimitPair pxTwist = joint.getTwistLimit(); + const float twistRad = XMConvertToRadians(PSX::PxClamp(fTwistAbsDeg, FLT_EPSILON, 180.f)); + pxTwist.lower = -twistRad; + pxTwist.upper = +twistRad; + + joint.setTwistLimit(pxTwist); + } + + if (!bEnableSlerpDrive) + { + joint.setDrive(PSX::PxD6Drive::eSLERP, MakeDrive(0.f, 0.f, 0.f, bSlerpAccel)); + } + else + { + joint.setDrive(PSX::PxD6Drive::eSLERP, MakeDrive(fSlerpStiffness, fSlerpDamping, fSlerpForceLimit, bSlerpAccel)); + } + + if (!bEnableLinearDrive) + { + const PSX::PxD6JointDrive off = MakeDrive(0.f, 0.f, 0.f, bLinearAccel); + joint.setDrive(PSX::PxD6Drive::eX, off); + joint.setDrive(PSX::PxD6Drive::eY, off); + joint.setDrive(PSX::PxD6Drive::eZ, off); + } + else + { + const PSX::PxD6JointDrive on = MakeDrive(fLinearStiffness, fLinearDamping, fLinearForceLimit, bLinearAccel); + joint.setDrive(PSX::PxD6Drive::eX, on); + joint.setDrive(PSX::PxD6Drive::eY, on); + joint.setDrive(PSX::PxD6Drive::eZ, on); + } + } +}D6JOINTDESC; + +static D6JOINTDESC MakeD6JointUIState(const PSX::PxD6Joint& joint) +{ + D6JOINTDESC state; + state.InitFromJoint(joint); + return state; +} -}PHYSX_JOINT_D6Desc; typedef struct tagOnCollsionInfo { diff --git a/Jusin154_Team3D/Engine/Public/GameInstance.h b/Jusin154_Team3D/Engine/Public/GameInstance.h index 515e0002f..748f6d6e3 100644 --- a/Jusin154_Team3D/Engine/Public/GameInstance.h +++ b/Jusin154_Team3D/Engine/Public/GameInstance.h @@ -41,7 +41,7 @@ class ENGINE_DLL CGameInstance final : public CBase HRESULT Add_Timer(const _wstring& strTimerTag); void Compute_TimeDelta(const _wstring& strTimerTag); void Compute_FrameCount(); - void Present_TimeCost() const; + void Present_TimeCost() ; #pragma endregion #pragma region LEVEL_MANAGER @@ -331,6 +331,8 @@ class ENGINE_DLL CGameInstance final : public CBase _float m_fSlowIntense = {}; #ifdef _DEBUG private: + _bool m_bRendererTimerOpen = false; + _float m_fTimer_PriorityUpdate = { 0.f }; _float m_fTimer_Update = { 0.f }; _float m_fTimer_LateUpdate = { 0.f }; @@ -362,6 +364,7 @@ class ENGINE_DLL CGameInstance final : public CBase _float m_fTimer_Render_UI = { 0.f }; _float m_fTimer_Render_UI_Overley = { 0.f }; + vector m_FilePaths = {}; map m_ModelMap;