[add] Joint RealTimeDebugger

[add] RendererTimer Begin
This commit is contained in:
kimnuri
2026-01-02 12:21:15 +09:00
parent ff23bf2e04
commit db8ec50066
7 changed files with 496 additions and 137 deletions
+19
View File
@@ -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;
@@ -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();
}
+7 -7
View File
@@ -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;
}
@@ -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);