|
|
|
@@ -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();
|
|
|
|
|
}
|
|
|
|
|