diff --git a/Jusin154_Team3D/Client/Private/PlayerRobe.cpp b/Jusin154_Team3D/Client/Private/PlayerRobe.cpp index 4503181d7..c5bc45195 100644 --- a/Jusin154_Team3D/Client/Private/PlayerRobe.cpp +++ b/Jusin154_Team3D/Client/Private/PlayerRobe.cpp @@ -333,6 +333,10 @@ HRESULT CPlayerRobe::Update_RobeJoints() default: break; } + + //m_JointDescriptions[i].iMotionTwist = 0; + //m_JointDescriptions[i].iMotionSwing1 = 0; + //m_JointDescriptions[i].iMotionSwing2 = 0; m_JointDescriptions[i].ApplyToJoint(*m_pDynamicJoints[i]); } return S_OK; diff --git a/Jusin154_Team3D/Client/Private/PlayerRobe_Initialize.cpp b/Jusin154_Team3D/Client/Private/PlayerRobe_Initialize.cpp index 75ed8a63a..3ae8fa796 100644 --- a/Jusin154_Team3D/Client/Private/PlayerRobe_Initialize.cpp +++ b/Jusin154_Team3D/Client/Private/PlayerRobe_Initialize.cpp @@ -4,7 +4,7 @@ CPlayerRobe::CPlayerRobe(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CPartObject(pDevice, pContext) { } CPlayerRobe::CPlayerRobe(const CPlayerRobe& Prototype) : CPartObject(Prototype) { } -HRESULT CPlayerRobe::Helper_RouteJointGenerater(CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC& Desc_Body, ROUTE_DESC& Desc_Route, _matrix* xmAnchorMatricesWorld) +HRESULT CPlayerRobe::Helper_RouteJointGenerater(PHYSX_JOINT eType, CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC& Desc_Body, ROUTE_DESC& Desc_Route, _matrix* xmAnchorMatricesWorld) { if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_JOINT_ROUTE"), (CComponent**)&m_pRobeJointRoute[Desc_Route.iTargetRouteIndex], &Desc_Body))) { return E_FAIL; @@ -18,8 +18,15 @@ HRESULT CPlayerRobe::Helper_RouteJointGenerater(CRigidBody_Dynamic::RIGIDBODY_DY PSX::PxTransform startJointWorldPose = CMyTools::Calc_JointPosFromRoute(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), false); // start y-- PSX::PxTransform endJointWorldPose = CMyTools::Calc_JointPosFromRoute(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), true); // end y++ - m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_BasicPxD6Joint(startAnchorRigidActor, routeRigidActor, startJointWorldPose); - m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_BasicPxD6Joint(routeRigidActor, endAnchorRigidActor, endJointWorldPose); + if (PHYSX_JOINT::D6 == eType) { + m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_BasicPxD6Joint(startAnchorRigidActor, routeRigidActor, startJointWorldPose); + m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_BasicPxD6Joint(routeRigidActor, endAnchorRigidActor, endJointWorldPose); + } + else if (PHYSX_JOINT::FIXED == eType) { + m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_BasicPxFixedJoint(startAnchorRigidActor, routeRigidActor, startJointWorldPose); + m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_BasicPxFixedJoint(routeRigidActor, endAnchorRigidActor, endJointWorldPose); + } + return S_OK; } @@ -241,7 +248,7 @@ HRESULT CPlayerRobe::Ready_Components() Desc_Route.iEndBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::RIGHT); Desc_Route.iStartJointIndex = ENUM_CLASS(PLAYER_JOINT_ORDER::RUP_TO_RMIDDLE_START); Desc_Route.iEndJointIndex = Desc_Route.iStartJointIndex + 1; - Helper_RouteJointGenerater(Desc_Body, Desc_Route, xmAnchorMatricesWorld); + Helper_RouteJointGenerater(PHYSX_JOINT::D6, Desc_Body, Desc_Route, xmAnchorMatricesWorld); } { Desc_Route.iTargetRouteIndex = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::TUP_TO_TMIDDLE); @@ -249,7 +256,7 @@ HRESULT CPlayerRobe::Ready_Components() Desc_Route.iEndBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::TAIL); Desc_Route.iStartJointIndex = ENUM_CLASS(PLAYER_JOINT_ORDER::TUP_TO_TMIDDLE_START); Desc_Route.iEndJointIndex = Desc_Route.iStartJointIndex + 1; - Helper_RouteJointGenerater(Desc_Body, Desc_Route, xmAnchorMatricesWorld); + Helper_RouteJointGenerater(PHYSX_JOINT::D6, Desc_Body, Desc_Route, xmAnchorMatricesWorld); } { Desc_Route.iTargetRouteIndex = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::LUP_TO_LMIDDLE); @@ -257,7 +264,7 @@ HRESULT CPlayerRobe::Ready_Components() Desc_Route.iEndBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::LEFT); Desc_Route.iStartJointIndex = ENUM_CLASS(PLAYER_JOINT_ORDER::LUP_TO_LMIDDLE_START); Desc_Route.iEndJointIndex = Desc_Route.iStartJointIndex + 1; - Helper_RouteJointGenerater(Desc_Body, Desc_Route, xmAnchorMatricesWorld); + Helper_RouteJointGenerater(PHYSX_JOINT::D6, Desc_Body, Desc_Route, xmAnchorMatricesWorld); } { Desc_Route.iTargetRouteIndex = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::RSIDEUP_TO_RSIDE); @@ -265,7 +272,7 @@ HRESULT CPlayerRobe::Ready_Components() Desc_Route.iEndBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::RIGHTSIDE); Desc_Route.iStartJointIndex = ENUM_CLASS(PLAYER_JOINT_ORDER::RSIDEUP_TO_RSIDE_START); Desc_Route.iEndJointIndex = Desc_Route.iStartJointIndex + 1; - Helper_RouteJointGenerater(Desc_Body, Desc_Route, xmAnchorMatricesWorld); + Helper_RouteJointGenerater(PHYSX_JOINT::D6, Desc_Body, Desc_Route, xmAnchorMatricesWorld); } { Desc_Route.iTargetRouteIndex = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::LSIDEUP_TO_LSIDE); @@ -273,7 +280,7 @@ HRESULT CPlayerRobe::Ready_Components() Desc_Route.iEndBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::LEFTSIDE); Desc_Route.iStartJointIndex = ENUM_CLASS(PLAYER_JOINT_ORDER::LSIDEUP_TO_LSIDE_START); Desc_Route.iEndJointIndex = Desc_Route.iStartJointIndex + 1; - Helper_RouteJointGenerater(Desc_Body, Desc_Route, xmAnchorMatricesWorld); + Helper_RouteJointGenerater(PHYSX_JOINT::D6, Desc_Body, Desc_Route, xmAnchorMatricesWorld); } } /*MIDDLE_TO_DOWN*/ @@ -284,7 +291,7 @@ HRESULT CPlayerRobe::Ready_Components() Desc_Route.iEndBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::RIGHTDOWN); Desc_Route.iStartJointIndex = ENUM_CLASS(PLAYER_JOINT_ORDER::RMIDDLE_TO_RR_START); Desc_Route.iEndJointIndex = Desc_Route.iStartJointIndex + 1; - Helper_RouteJointGenerater(Desc_Body, Desc_Route, xmAnchorMatricesWorld); + Helper_RouteJointGenerater(PHYSX_JOINT::D6, Desc_Body, Desc_Route, xmAnchorMatricesWorld); } { Desc_Route.iTargetRouteIndex = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::RSIDE_TO_R); @@ -292,7 +299,7 @@ HRESULT CPlayerRobe::Ready_Components() Desc_Route.iEndBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::RIGHTDOWNSIDE); Desc_Route.iStartJointIndex = ENUM_CLASS(PLAYER_JOINT_ORDER::RSIDE_TO_R_START); Desc_Route.iEndJointIndex = Desc_Route.iStartJointIndex + 1; - Helper_RouteJointGenerater(Desc_Body, Desc_Route, xmAnchorMatricesWorld); + Helper_RouteJointGenerater(PHYSX_JOINT::D6, Desc_Body, Desc_Route, xmAnchorMatricesWorld); } { Desc_Route.iTargetRouteIndex = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::TMIDDLE_TO_TR); @@ -300,7 +307,7 @@ HRESULT CPlayerRobe::Ready_Components() Desc_Route.iEndBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::TAILRIGHTDOWN); Desc_Route.iStartJointIndex = ENUM_CLASS(PLAYER_JOINT_ORDER::TMIDDLE_TO_TR_START); Desc_Route.iEndJointIndex = Desc_Route.iStartJointIndex + 1; - Helper_RouteJointGenerater(Desc_Body, Desc_Route, xmAnchorMatricesWorld); + Helper_RouteJointGenerater(PHYSX_JOINT::D6, Desc_Body, Desc_Route, xmAnchorMatricesWorld); } { Desc_Route.iTargetRouteIndex = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::TMIDDLE_TO_TL); @@ -308,7 +315,7 @@ HRESULT CPlayerRobe::Ready_Components() Desc_Route.iEndBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::TAILLEFTDOWN); Desc_Route.iStartJointIndex = ENUM_CLASS(PLAYER_JOINT_ORDER::TMIDDLE_TO_TL_START); Desc_Route.iEndJointIndex = Desc_Route.iStartJointIndex + 1; - Helper_RouteJointGenerater(Desc_Body, Desc_Route, xmAnchorMatricesWorld); + Helper_RouteJointGenerater(PHYSX_JOINT::D6, Desc_Body, Desc_Route, xmAnchorMatricesWorld); } { Desc_Route.iTargetRouteIndex = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::LSIDE_TO_L); @@ -316,7 +323,7 @@ HRESULT CPlayerRobe::Ready_Components() Desc_Route.iEndBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::LEFTDOWNSIDE); Desc_Route.iStartJointIndex = ENUM_CLASS(PLAYER_JOINT_ORDER::LSIDE_TO_L_START); Desc_Route.iEndJointIndex = Desc_Route.iStartJointIndex + 1; - Helper_RouteJointGenerater(Desc_Body, Desc_Route, xmAnchorMatricesWorld); + Helper_RouteJointGenerater(PHYSX_JOINT::D6, Desc_Body, Desc_Route, xmAnchorMatricesWorld); } { Desc_Route.iTargetRouteIndex = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::LMIDDLE_TO_LL); @@ -324,7 +331,15 @@ HRESULT CPlayerRobe::Ready_Components() Desc_Route.iEndBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::LEFTDOWN); Desc_Route.iStartJointIndex = ENUM_CLASS(PLAYER_JOINT_ORDER::LMIDDLE_TO_LL_START); Desc_Route.iEndJointIndex = Desc_Route.iStartJointIndex + 1; - Helper_RouteJointGenerater(Desc_Body, Desc_Route, xmAnchorMatricesWorld); + Helper_RouteJointGenerater(PHYSX_JOINT::D6, Desc_Body, Desc_Route, xmAnchorMatricesWorld); + } + { + Desc_Route.iTargetRouteIndex = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::LMIDDLE_TO_LL); + Desc_Route.iStartBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::LEFT); + Desc_Route.iEndBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::LEFTDOWN); + Desc_Route.iStartJointIndex = ENUM_CLASS(PLAYER_JOINT_ORDER::LMIDDLE_TO_LL_START); + Desc_Route.iEndJointIndex = Desc_Route.iStartJointIndex + 1; + Helper_RouteJointGenerater(PHYSX_JOINT::D6, Desc_Body, Desc_Route, xmAnchorMatricesWorld); } } } diff --git a/Jusin154_Team3D/Client/Public/PlayerRobe.h b/Jusin154_Team3D/Client/Public/PlayerRobe.h index 95749f8fa..4e848e756 100644 --- a/Jusin154_Team3D/Client/Public/PlayerRobe.h +++ b/Jusin154_Team3D/Client/Public/PlayerRobe.h @@ -61,7 +61,7 @@ class CPlayerRobe final : public CPartObject 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 }; + PSX::PxJoint* m_pDynamicJoints[ENUM_CLASS(PLAYER_JOINT_ORDER::END)] = { nullptr }; D6JOINTDESC m_JointDescriptions[ENUM_CLASS(PLAYER_JOINT_ORDER::END)] = { }; vector<_float4x4> m_PrevRobeBoneMatrices = { }; @@ -82,7 +82,7 @@ class CPlayerRobe final : public CPartObject HRESULT Bind_ShaderResources() { return S_OK; } HRESULT Update_LegsPosition(); - HRESULT Helper_RouteJointGenerater(CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC& Desc_Body, ROUTE_DESC& Desc_Route, _matrix* xmAnchorMatricesWorld); + HRESULT Helper_RouteJointGenerater(PHYSX_JOINT eType, CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC& Desc_Body, ROUTE_DESC& Desc_Route, _matrix* xmAnchorMatricesWorld); HRESULT Update_RobeJoints(); #ifdef _DEBUG HRESULT Render_BonePhysX(); diff --git a/Jusin154_Team3D/Client/Public/Player_ENUM.h b/Jusin154_Team3D/Client/Public/Player_ENUM.h index b7a757e03..4ad529593 100644 --- a/Jusin154_Team3D/Client/Public/Player_ENUM.h +++ b/Jusin154_Team3D/Client/Public/Player_ENUM.h @@ -123,13 +123,35 @@ enum class PLAYER_JOINT_ORDER { , LSIDE_TO_L_START , LSIDE_TO_L_END #pragma endregion -#pragma region ORIGIN_HORIZONTAL -#pragma endregion #pragma region UP_HORIZONTAL + , UP_R_RS_START + , UP_R_RS_END + , UP_RS_T_START + , UP_RS_T_END + , UP_T_LS_START + , UP_T_LS_END + , UP_LS_L_START + , UP_LS_L_END #pragma endregion #pragma region MIDDLE_HORIZONTAL + , MIDDLE_R_RS_START + , MIDDLE_R_RS_END + , MIDDLE_RS_T_START + , MIDDLE_RS_T_END + , MIDDLE_T_LS_START + , MIDDLE_T_LS_END + , MIDDLE_LS_L_START + , MIDDLE_LS_L_END #pragma endregion #pragma region DOWN_HORIZONTAL + , DOWN_R_RS_START + , DOWN_R_RS_END + , DOWN_RS_T_START + , DOWN_RS_T_END + , DOWN_T_LS_START + , DOWN_T_LS_END + , DOWN_LS_L_START + , DOWN_LS_L_END #pragma endregion , END };