[add] 플레이어 이동시 따라오는거까지 확인

This commit is contained in:
kimnuri
2025-12-27 19:04:17 +09:00
parent c6da7d680b
commit 7af4c0d495
36 changed files with 1043 additions and 477 deletions
@@ -166,6 +166,7 @@ call Update_Resources.bat
<ClInclude Include="..\Public\CallBack_NonPlayable_Behavior.h" />
<ClInclude Include="..\Public\CallBack_NonPlayable_HitReport.h" />
<ClInclude Include="..\Public\CallBack_Ranrok_HitReport.h" />
<ClInclude Include="..\Public\PlayerRobe.h" />
<ClInclude Include="..\Public\Player_ENUM.h" />
<ClInclude Include="..\Public\State_Fall.h" />
<ClInclude Include="..\Public\State_FireBall.h" />
@@ -401,6 +402,7 @@ call Update_Resources.bat
<ClCompile Include="..\Private\CallBack_NonPlayable_Behavior.cpp" />
<ClCompile Include="..\Private\CallBack_NonPlayable_HitReport.cpp" />
<ClCompile Include="..\Private\CallBack_Ranrok_HitReport.cpp" />
<ClCompile Include="..\Private\PlayerRobe.cpp" />
<ClCompile Include="..\Private\State_Fall.cpp" />
<ClCompile Include="..\Private\TransformationSide.cpp" />
<ClCompile Include="..\Private\Transformation.cpp" />
@@ -725,6 +725,9 @@
<ClInclude Include="..\Public\Player_ENUM.h">
<Filter>02.GameObjects\Player</Filter>
</ClInclude>
<ClInclude Include="..\Public\PlayerRobe.h">
<Filter>02.GameObjects\Player\Robe</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="Client.ico">
@@ -1506,6 +1509,9 @@
<Filter Include="02.GameObjects\PhysX\CallBack\HitReport\Monster\Ranrok">
<UniqueIdentifier>{93545681-c4c5-4a6a-9496-7b2e7b8a9302}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\Player\Robe">
<UniqueIdentifier>{f3c7cf8d-2b83-49d3-85da-fe135e376a11}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Client.cpp">
@@ -2175,6 +2181,9 @@
<ClCompile Include="..\Private\CallBack_Ranrok_HitReport.cpp">
<Filter>02.GameObjects\PhysX\CallBack\HitReport\Monster\Ranrok</Filter>
</ClCompile>
<ClCompile Include="..\Private\PlayerRobe.cpp">
<Filter>02.GameObjects\Player\Robe</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\Private\Goblin_States.cpp">
@@ -16,7 +16,7 @@ void CCamPosition_Socket::Priority_Update(_float fTimeDelta)
{
/*_matrix socketMatrix = {};
socketMatrix = XMLoadFloat4x4(m_pSocketMatrices);
socketMatrix = XMLoadFloat4x4(m_pSocketMatrix);
for (int i = 0; i < 3; ++i) {
socketMatrix.r[i] = XMVector3Normalize(socketMatrix.r[i]);
@@ -40,7 +40,7 @@ HRESULT CCamPosition_Socket::Initialize_Prototype()
HRESULT CCamPosition_Socket::Initialize(void* pArg)
{
CAMERAPOSITION_PLAYER_DESC* pDesc = static_cast<CAMERAPOSITION_PLAYER_DESC*> (pArg);
//m_pSocketMatrices = pDesc->pSocketMatrices;
//m_pSocketMatrix = pDesc->pSocketMatrix;
if (FAILED(__super::Initialize(pArg)))
{
return E_FAIL;
@@ -581,6 +581,8 @@ HRESULT CLevel_GamePlay::Ready_Layer_Player(const _wstring& strLayerTag)
return E_FAIL;
}
#ifdef 기무리
#else
{
CNPC_Ollivander::NPCDESC NPCDesc{};
NPCDesc.vPos = _float4(40.f, 4.f, 68.9f, 1.f);
@@ -597,6 +599,7 @@ HRESULT CLevel_GamePlay::Ready_Layer_Player(const _wstring& strLayerTag)
return E_FAIL;
}
}
#endif // !기무리
return S_OK;
}
@@ -666,13 +669,13 @@ HRESULT CLevel_GamePlay::Ready_Layer_Monster()
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CTroll>(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) {
return E_FAIL;
}
#endif
#if 진우
#else
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CRanrok>(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) {
return E_FAIL;
}
#endif
#endif
+42 -18
View File
@@ -26,6 +26,7 @@
#pragma region ACTOR
#include "Player.h"
#include "PlayerRobe.h"
#include "Goblin.h"
#include "Goblin_Mage.h"
#include "Goblin_Spector.h"
@@ -1426,9 +1427,8 @@ HRESULT CLoader::Loading_For_GamePlay()
return E_FAIL;
}
#pragma endregion
#endif
#pragma endregion
#pragma region TERRAIN_TEXTURE
/* Terrain_Diffuse */
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Terrain_Diffuse"),
@@ -1762,19 +1762,38 @@ HRESULT CLoader::Loading_For_GamePlay()
CVIBuffer_UI_Instance::Create(m_pDevice, m_pContext, &Quest_Slot_Desc)))) {
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.5f, 0.5f, 0.001f };
Desc.fContactOffset = { 0.001f };
Desc.vhalfGeometryInfo = { 0.025f, 0.025f, 0.025f };
Desc.fDensity = 100000.f;
Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY());
Desc.eLockFlag = {};
Desc.vAutoDamping = { 100.f, 100.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_JOINT_ANCHOR"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) {
return E_FAIL;
}
}
{
CRigidBody_Dynamic::RIGIDBODY_PROTOTYPE_DYNAMIC_DESC Desc{};
Desc.eType = ACTOR::CAPSULE;
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.5f, 0.5f, 0.6f };
Desc.fContactOffset = { 0.01f };
Desc.vhalfGeometryInfo = { 0.0025f, 0.15f, 0.f };
Desc.fDensity = 1.f;
Desc.vMatInfo = { 0.5f, 0.5f, 0.001f };
Desc.fContactOffset = { 0.001f };
Desc.vhalfGeometryInfo = { 0.006f, 0.035f, 0.f };
Desc.fDensity = 100000.f;
Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY());
Desc.eLockFlag = {};
Desc.vAutoDamping = { 1.f, 1.f };
Desc.vAutoDamping = { 100.f, 100.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_JOINT_ROUTE"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) {
@@ -1787,7 +1806,7 @@ HRESULT CLoader::Loading_For_GamePlay()
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.5f, 0.5f, 0.6f };
Desc.vMatInfo = { 0.5f, 0.5f, 0.01f };
Desc.fContactOffset = { 0.01f };
Desc.vhalfGeometryInfo = { 0.06f, 0.25f, 0.f };
Desc.fDensity = 1.f;
@@ -1801,7 +1820,7 @@ HRESULT CLoader::Loading_For_GamePlay()
}
}
{
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DynamicJoint"), CDynamic_Joint::Create(m_pDevice, m_pContext)))) {
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DynamicJoint"), CDynamic_D6Joint::Create(m_pDevice, m_pContext)))) {
return E_FAIL;
}
}
@@ -1850,15 +1869,15 @@ HRESULT CLoader::Loading_For_GamePlay()
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_SHIELD"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc1)))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), CCharacter_Controller::Create(m_pDevice, m_pContext)))) {
return E_FAIL;
}
Desc.ePxRigidBodyFlags = { PSX::PxRigidBodyFlag::eKINEMATIC };
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX_KIN"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) {
return E_FAIL;
}
}
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), CCharacter_Controller::Create(m_pDevice, m_pContext)))) {
return E_FAIL;
}
{ // DOOR PHYSX
CRigidBody_Dynamic::RIGIDBODY_PROTOTYPE_DYNAMIC_DESC Desc{};
{
@@ -1901,9 +1920,10 @@ HRESULT CLoader::Loading_For_GamePlay()
CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Human/PlayableCharacter/Playable.bin", XMMatrixRotationZ(XMConvertToRadians(180.f)) * XMMatrixIdentity())))){
return E_FAIL;
}
#ifdef 기무리
#else
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Goblin_Model"),
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/Goblin/Goblin.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))){
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/Goblin/Goblin.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) {
return E_FAIL;
}
@@ -1916,17 +1936,17 @@ HRESULT CLoader::Loading_For_GamePlay()
return E_FAIL;
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_GerboldOlivander_Model"),
CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Human/Npc/GerboldOllivander/GerboldOlivander.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixRotationZ(XMConvertToRadians(180.f)) * XMMatrixIdentity())))){
CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Human/Npc/GerboldOllivander/GerboldOlivander.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixRotationZ(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Professor_EleazarFig_Model"),
CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Human/Npc/EleazarFig/Professor_EleazarFig.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixRotationZ(XMConvertToRadians(180.f)) * XMMatrixIdentity())))){
CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Human/Npc/EleazarFig/Professor_EleazarFig.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixRotationZ(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Troll_Model"),
CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Monster/SubTroll/troll.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))){
CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Monster/SubTroll/troll.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) {
return E_FAIL;
}
@@ -1934,6 +1954,7 @@ HRESULT CLoader::Loading_For_GamePlay()
CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Monster/ConjuredDragon/ConjuredDragon.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixRotationZ(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) {
return E_FAIL;
}
#endif
#pragma endregion
@@ -1973,6 +1994,9 @@ HRESULT CLoader::Loading_For_GamePlay()
#pragma endregion
if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CPlayerRobe::Create(m_pDevice, m_pContext)))) {
return E_FAIL;
}
/* For.Prototype_Component_SkyboxModel */
@@ -56,7 +56,7 @@ HRESULT CMapElement_Chest::Initialize(void* pArg)
m_pActor = static_cast<PSX::PxRigidDynamic*>(m_pRigidBody->Get_Actor());
static_cast<CRigidBody_Dynamic*>(m_pRigidBody)->Set_HalfGeometryInfo(pDesc->vBoxSize);
static_cast<CRigidBody_Dynamic*>(m_pRigidBody)->Move_LocalPos(_float4(0.f, 0.f, 0.f, 0.f), pDesc->vBoxLocalPosition);
static_cast<CRigidBody_Dynamic*>(m_pRigidBody)->Move_LocalPos(XMVectorSet(0.f, 0.f, 0.f, 1.f), XMLoadFloat3(&pDesc->vBoxLocalPosition));
return S_OK;
}
@@ -58,7 +58,7 @@ HRESULT CMapElement_Interactable::Initialize(void* pArg)
m_pActor = static_cast<PSX::PxRigidDynamic*>(m_pRigidBody->Get_Actor());
static_cast<CRigidBody_Dynamic*>(m_pRigidBody)->Set_HalfGeometryInfo(pDesc->vBoxSize);
static_cast<CRigidBody_Dynamic*>(m_pRigidBody)->Move_LocalPos(_float4(0.f, 0.f, 0.f, 0.f), pDesc->vBoxLocalPosition);
static_cast<CRigidBody_Dynamic*>(m_pRigidBody)->Move_LocalPos(XMVectorSet(0.f, 0.f, 0.f, 1.f), XMLoadFloat3(&pDesc->vBoxLocalPosition));
//static_cast<CRigidBody_Dynamic*>(m_pRigidBody)->Set_Kinematic(false);
if (false == m_isPooled)
+13 -293
View File
@@ -15,6 +15,7 @@
#include "Monster.h"
#include "Broom.h"
#include "MapElement_Interactable.h"
#include "PlayerRobe.h"
#pragma region STATE
#include "State_Idle.h"
@@ -111,18 +112,6 @@ HRESULT CPlayer::Initialize(void* pArg)
m_BasicEffect->SetProjection(m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ));
m_Batch = make_unique<PrimitiveBatch<VertexPositionColor>>(m_pContext);
m_pBoneShape = (GeometricPrimitive::CreateSphere(m_pContext, 0.05f, 22, false, false));
m_pSubShape = (GeometricPrimitive::CreateSphere(m_pContext, 0.05f, 22, false, false));
m_pMainShape = (GeometricPrimitive::CreateCylinder(m_pContext, 0.3f, 0.075f, 22, false));
D3D11_DEPTH_STENCIL_DESC depthStencilDesc = {};
depthStencilDesc.DepthEnable = FALSE;
depthStencilDesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ZERO;
depthStencilDesc.DepthFunc = D3D11_COMPARISON_ALWAYS;
depthStencilDesc.StencilEnable = FALSE;
HRESULT result = m_pDevice->CreateDepthStencilState(&depthStencilDesc, &m_pDepthStencilStateNone);
if (FAILED(result))
return E_FAIL;
#endif // _DEBUG
// UI 연동 추가
@@ -172,8 +161,6 @@ __super::Update(fTimeDelta);
m_pCallBack_HitReport->Set_CurrentSlop();
}
Update_LegsPosition();
if (m_pGameInstance->Mouse_Down(DIM_RBUTTON)){
m_pInfoInstance->Mouse_Input(ENUM_CLASS(KEYINPUT::DIM_RBUTTON_DOWN));
}
@@ -257,7 +244,17 @@ void CPlayer::Late_Update(_float fTimeDelta)
m_pTransformCom->Set_State(STATE::LOOK, look);
////////////////////////////////////////////////////////////////////////////
if (nullptr == m_pRobePart) {
{
CPlayerRobe::PlayerRobe_DESC Desc{};
Desc.pModel = m_pModelCom;
Desc.pParentTransform = m_pTransformCom;
Desc.pSocketMatrix = m_pModelCom->Get_BoneMatrixPtr("Hips_Cloth");
if (FAILED(Add_PartObject<CPlayerRobe>("RobePart", g_iStaticLevel, &m_pRobePart, &Desc))) {
assert(false);
}
}
}
}
HRESULT CPlayer::Render()
@@ -304,13 +301,9 @@ HRESULT CPlayer::Render()
}
#ifdef _DEBUG
if (RENDER::NONLIGHT == eType) {
//for (_uint i = 0; i < ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::END); ++i) {
// m_pRobeJointRoute[i]->Render();
//}
//m_pCharacter_Controller->Render();
//m_pRigidBody->Render();
Render_CameraCoordinateSystem();
Render_BonePhysX();
}
#endif
@@ -391,7 +384,6 @@ void CPlayer::Start_CameraShake(_float fTime, _float fIntense)
m_fCameraShakeIntense = fIntense;
m_bCameraShake = true;
}
#ifdef _DEBUG
void CPlayer::Render_CameraCoordinateSystem()
{
@@ -443,143 +435,6 @@ void CPlayer::Render_CameraCoordinateSystem()
);
m_Batch->End();
}
HRESULT CPlayer::Update_LegsPosition()
{
_matrix WorldMatrix = m_pTransformCom->Get_XMWorldMatrix();
_matrix FootMatrix = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("LeftFoot")) * WorldMatrix;
_matrix LegMatrix = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("LeftLeg")) * WorldMatrix;
m_pLeftLeg->Set_CenterTransform(WorldMatrix, FootMatrix.r[3], LegMatrix.r[3]);
#ifdef _DEBUG
{
_vector vCenterWorldPos = (FootMatrix.r[3] + LegMatrix.r[3]) * 0.5f;
_vector vRotQ = XMQuaternionIdentity();
_vector vDir = XMVectorSetW(LegMatrix.r[3] - FootMatrix.r[3], 0.f);
_float vLength = XMVectorGetX(XMVector3Length(vDir));
if (vLength > FLT_EPSILON5) {
vDir = XMVector3Normalize(vDir);
vRotQ = CMyTools::MakeQuaternionFromTo(XMVectorSet(0.f, 1.f, 0.f, 0.f), vDir);
}
XMStoreFloat4x4(&m_LeftLegMatrix, XMMatrixRotationQuaternion(vRotQ) * XMMatrixTranslationFromVector(vCenterWorldPos));
}
#endif // _DEBUG
FootMatrix = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("RightFoot")) * WorldMatrix;
LegMatrix = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("RightLeg")) * WorldMatrix;
m_pRightLeg->Set_CenterTransform(WorldMatrix, FootMatrix.r[3], LegMatrix.r[3]);
#ifdef _DEBUG
{
_vector vCenterWorldPos = (FootMatrix.r[3] + LegMatrix.r[3]) * 0.5f;
_vector vRotQ = XMQuaternionIdentity();
_vector vDir = XMVectorSetW(LegMatrix.r[3] - FootMatrix.r[3], 0.f);
_float vLength = XMVectorGetX(XMVector3Length(vDir));
if (vLength > FLT_EPSILON5) {
vDir = XMVector3Normalize(vDir);
vRotQ = CMyTools::MakeQuaternionFromTo(XMVectorSet(0.f, 1.f, 0.f, 0.f), vDir);
}
XMStoreFloat4x4(&m_RightLegMatrix, XMMatrixRotationQuaternion(vRotQ) * XMMatrixTranslationFromVector(vCenterWorldPos));
}
#endif // _DEBUG
return S_OK;
}
HRESULT CPlayer::Render_Legs()
{
_float fHeight = 0.25f;
_matrix WorldMatrix = XMLoadFloat4x4(&m_LeftLegMatrix);
_matrix ViewMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW);
_matrix ProjMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ);
_vector vColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0xff0000, 1.f);
m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true,
[this]() {
m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
});
_matrix WorldUp = XMMatrixTranslationFromVector(WorldMatrix.r[1] * fHeight);
_matrix WorldDown = XMMatrixTranslationFromVector(WorldMatrix.r[1] * -fHeight);
m_pSubShape->Draw(WorldUp * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true,
[this]() {
m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
});
m_pSubShape->Draw(WorldDown * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true,
[this]() {
m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
});
WorldMatrix = XMLoadFloat4x4(&m_RightLegMatrix);
m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true,
[this]() {
m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
});
WorldUp = XMMatrixTranslationFromVector(WorldMatrix.r[1] * fHeight);
WorldDown = XMMatrixTranslationFromVector(WorldMatrix.r[1] * -fHeight);
m_pSubShape->Draw(WorldUp * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true,
[this]() {
m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
});
m_pSubShape->Draw(WorldDown * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true,
[this]() {
m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
});
return S_OK;
}
//HRESULT CPlayer::Helper_JointGenerater(CDynamic_Joint::DYNAMICJOINT_DESC& Desc, _uint iRoute0, _bool bUseHead0, _uint iRoute1, _bool bUseHead1, _uint iJoint)
//{
// Desc.pActor0 = m_pRobeJointRoute[iRoute0]->Get_Actor();
// if (true == bUseHead0) {
// Desc.pLocalFrame0 = m_pRobeJointRoute[iRoute0]->Get_HeadPositionPxTransform();
// }
// else {
// Desc.pLocalFrame0 = m_pRobeJointRoute[iRoute0]->Get_FootPositionPxTransform();
// }
//
// Desc.pActor1 = m_pRobeJointRoute[iRoute1]->Get_Actor();
// if (true == bUseHead1) {
// Desc.pLocalFrame1 = m_pRobeJointRoute[iRoute1]->Get_HeadPositionPxTransform();
// }
// else {
// Desc.pLocalFrame1 = m_pRobeJointRoute[iRoute1]->Get_FootPositionPxTransform();
// }
// if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DynamicJoint"), (CComponent**)&m_pDynamicJoints[iJoint], &Desc))) {
// return E_FAIL;
// }
// return S_OK;
//}
HRESULT CPlayer::Render_BonePhysX()
{
_vector vColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0x00ff00, 1.f);
_fmatrix OwnerMatrix = m_pTransformCom->Get_XMWorldMatrix();
_cmatrix ViewMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW);
_matrix ProjMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ);
ID3D11DepthStencilState* pPrevDSS = nullptr;
UINT iPrevStencilRef = 0;
m_pContext->OMGetDepthStencilState(&pPrevDSS, &iPrevStencilRef);
for (_uint iBoneIndex = 0; iBoneIndex < ENUM_CLASS(PLAYER_JOINT_ORDER::END); ++iBoneIndex)
{
_matrix WorldMatrix = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr(PLAYER_JOINT_BONE_NAMES[iBoneIndex])) * OwnerMatrix;
m_pBoneShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true,
[this]() {
m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
});
}
Render_Legs();
m_pContext->OMSetDepthStencilState(pPrevDSS, iPrevStencilRef);
if (pPrevDSS != nullptr){
pPrevDSS->Release();
}
return S_OK;
}
#endif // _DEBUG
HRESULT CPlayer::Ready_Components()
{
CTransform::TRANSFORM_DESC Desc = {};
@@ -652,128 +507,6 @@ HRESULT CPlayer::Ready_Components()
m_pGameInstance->Detach_Actor(*m_pRigidBody->Get_Actor(), NEXT_LEVEL);
}
{ //
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
Desc.iSubKind = ENUM_CLASS(PXOBJECT::LEG);
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_Player_Leg"), (CComponent**)&m_pLeftLeg, &Desc))) {
return E_FAIL;
}
}
{ //
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
Desc.iSubKind = ENUM_CLASS(PXOBJECT::LEG);
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_Player_Leg"), (CComponent**)&m_pRightLeg, &Desc))) {
return E_FAIL;
}
}
//{ // RobeSocket
// for (_uint i = 0; i < ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::END); ++i) {
// CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
// Desc.iSubKind = ENUM_CLASS(PXOBJECT::JOINT_ROUTE);
// if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_JOINT_ROUTE"), (CComponent**)&m_pRobeJointRoute[i], &Desc))) {
// return E_FAIL;
// }
// }
//}
//{
// CDynamic_Joint::DYNAMICJOINT_DESC Desc{}; // 조인트 실제 본이랑연결해야함
// Desc.eType = PHYSX_JOINT::D6;
// _uint iRoute0 = 0;
// _bool bHead0 = 0;
// _uint iRoute1 = 0;
// _bool bHead1 = 0;
// _uint iJoint = 0;
// {
// iJoint = ENUM_CLASS(PLAYER_JOINT_ORDER::RIGHTUP);
// iRoute0 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::UP_R_T);
// bHead0 = false;
// iRoute1 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::UP_MIDDLE_R);
// bHead1 = false;
// if (FAILED(Helper_JointGenerater(Desc, iRoute0, bHead0, iRoute1, bHead1, iJoint))) {
// return E_FAIL;
// }
// }
// {
// iJoint = ENUM_CLASS(PLAYER_JOINT_ORDER::LEFTUP);
// iRoute0 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::UP_T_L);
// bHead0 = false;
// iRoute1 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::UP_MIDDLE_L);
// bHead1 = false;
// if (FAILED(Helper_JointGenerater(Desc, iRoute0, bHead0, iRoute1, bHead1, iJoint))) {
// return E_FAIL;
// }
// }
// {
// iJoint = ENUM_CLASS(PLAYER_JOINT_ORDER::RIGHT);
// iRoute0 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::MIDDLE_R_T);
// bHead0 = false;
// iRoute1 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::MIDDLE_DOWN_TR);
// bHead1 = false;
// if (FAILED(Helper_JointGenerater(Desc, iRoute0, bHead0, iRoute1, bHead1, iJoint))) {
// return E_FAIL;
// }
// }
// {
// iJoint = ENUM_CLASS(PLAYER_JOINT_ORDER::LEFT);
// iRoute0 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::MIDDLE_T_L);
// bHead0 = false;
// iRoute1 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::MIDDLE_DOWN_TL);
// bHead1 = false;
// if (FAILED(Helper_JointGenerater(Desc, iRoute0, bHead0, iRoute1, bHead1, iJoint))) {
// return E_FAIL;
// }
// }
// {
// iJoint = ENUM_CLASS(PLAYER_JOINT_ORDER::TAIL);
// iRoute0 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::MIDDLE_DOWN_TR);
// bHead0 = false;
// iRoute1 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::MIDDLE_DOWN_TL);
// bHead1 = false;
// if (FAILED(Helper_JointGenerater(Desc, iRoute0, bHead0, iRoute1, bHead1, iJoint))) {
// return E_FAIL;
// }
// }
// {
// iJoint = ENUM_CLASS(PLAYER_JOINT_ORDER::RIGHTDOWNRIGHT);
// iRoute0 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::MIDDLE_DOWN_RR);
// bHead0 = true;
// iRoute1 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::DOWN_RR_TR);
// bHead1 = true;
// if (FAILED(Helper_JointGenerater(Desc, iRoute0, bHead0, iRoute1, bHead1, iJoint))) {
// return E_FAIL;
// }
// }
// {
// iJoint = ENUM_CLASS(PLAYER_JOINT_ORDER::LEFTDOWNLEFT);
// iRoute0 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::MIDDLE_DOWN_LL);
// bHead0 = true;
// iRoute1 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::DOWN_TL_L);
// bHead1 = true;
// if (FAILED(Helper_JointGenerater(Desc, iRoute0, bHead0, iRoute1, bHead1, iJoint))) {
// return E_FAIL;
// }
// }
// {
// iJoint = ENUM_CLASS(PLAYER_JOINT_ORDER::RIGHTDOWN);
// iRoute0 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::MIDDLE_DOWN_R);
// bHead0 = true;
// iRoute1 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::DOWN_R_RR);
// bHead1 = true;
// if (FAILED(Helper_JointGenerater(Desc, iRoute0, bHead0, iRoute1, bHead1, iJoint))) {
// return E_FAIL;
// }
// }
// {
// iJoint = ENUM_CLASS(PLAYER_JOINT_ORDER::LEFTDOWN);
// iRoute0 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::MIDDLE_DOWN_L);
// bHead0 = true;
// iRoute1 = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::DOWN_L_LL);
// bHead1 = true;
// if (FAILED(Helper_JointGenerater(Desc, iRoute0, bHead0, iRoute1, bHead1, iJoint))) {
// return E_FAIL;
// }
// }
//}
return S_OK;
}
@@ -813,8 +546,6 @@ HRESULT CPlayer::Ready_Parts()
return E_FAIL;
}
return S_OK;
}
@@ -982,18 +713,7 @@ void CPlayer::Free()
{
__super::Free();
#ifdef _DEBUG
SAFE_RELEASE(m_pDepthStencilStateNone);
#endif // _DEBUG
SAFE_RELEASE(m_pRightLeg);
SAFE_RELEASE(m_pLeftLeg);
//for (_uint i = 0; i < ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::END); ++i) {
// SAFE_RELEASE(m_pRobeJointRoute[i]);
//}
//for (_uint i = 0; i < ENUM_CLASS(PLAYER_JOINT_ORDER::END); ++i) {
// SAFE_RELEASE(m_pDynamicJoints[i]);
//}
SAFE_RELEASE(m_pRobePart);
SAFE_RELEASE(m_pGrapInteractive);
if (nullptr != m_pInfoInstance) {
CInfoInstance* pInfo = m_pInfoInstance;
@@ -0,0 +1,505 @@
#include "pch.h"
#include "PlayerRobe.h"
#include "GameInstance.h"
CPlayerRobe::CPlayerRobe(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
: CPartObject(pDevice, pContext)
{
}
CPlayerRobe::CPlayerRobe(const CPlayerRobe& Prototype)
: CPartObject(Prototype)
{
}
void CPlayerRobe::Priority_Update(_float fTimeDelta)
{
}
void CPlayerRobe::Update(_float fTimeDelta)
{
_matrix OwnerMatrix = XMLoadFloat4x4(m_pParentTransformCom->Get_WorldMatrixPtr());
m_pTransformCom->Set_WorldMatrix(OwnerMatrix);
m_pRobeMainAnchor->Set_Transform(XMLoadFloat4x4(m_pSocketMatrix) * OwnerMatrix);
Update_LegsPosition();
}
void CPlayerRobe::Late_Update(_float fTimeDelta)
{
Update_RobeSocketPosition();
#ifdef _DEBUG
m_pGameInstance->Add_RenderGroup(RENDER::NONLIGHT, this);
#endif // _DEBUG
}
HRESULT CPlayerRobe::Render()
{
Render_BonePhysX();
return S_OK;
}
HRESULT CPlayerRobe::Update_RobeSocketPosition()
{
return S_OK;
}
HRESULT CPlayerRobe::Helper_RouteJointGenerater(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;
}
m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Set_CenterTransform(xmAnchorMatricesWorld[Desc_Route.iStartBoneIndex].r[3], xmAnchorMatricesWorld[Desc_Route.iEndBoneIndex].r[3]);
{ // Joint
m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_PxD6Joint(m_pRobeJointAnchor[Desc_Route.iStartJointIndex]->Get_Actor(), m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_Actor(), m_pRobeJointAnchor[Desc_Route.iStartJointIndex]->Get_GlobalPosition());
m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_PxD6Joint(m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_Actor(), m_pRobeJointAnchor[Desc_Route.iEndJointIndex]->Get_Actor(), m_pRobeJointAnchor[Desc_Route.iEndJointIndex]->Get_GlobalPosition());
}
return S_OK;
}
HRESULT CPlayerRobe::Update_LegsPosition()
{
_matrix WorldMatrix = m_pParentTransformCom->Get_XMWorldMatrix();
{
_vector vFootPos = XMVector4Transform(XMLoadFloat4((_float4*)&m_pLeftFootLocalMatrix->m[3][0]), WorldMatrix);
_vector vLegPos = XMVector4Transform(XMLoadFloat4((_float4*)&m_pLeftLegLocalMatrix->m[3][0]), WorldMatrix);
m_pLeftLeg->Set_CenterTransform(vFootPos, vLegPos);
#ifdef _DEBUG
{
_vector vCenterWorldPos = (vFootPos + vLegPos ) * 0.5f;
_vector vRotQ = XMQuaternionIdentity();
_vector vDir = XMVectorSetW(vLegPos - vFootPos, 0.f);
_float vLength = XMVectorGetX(XMVector3Length(vDir));
if (vLength > FLT_EPSILON5) {
vDir = XMVector3Normalize(vDir);
vRotQ = CMyTools::MakeQuaternionFromTo(XMVectorSet(0.f, 1.f, 0.f, 0.f), vDir);
}
XMStoreFloat4x4(&m_LeftLegMatrix, XMMatrixRotationQuaternion(vRotQ) * XMMatrixTranslationFromVector(vCenterWorldPos));
}
#endif // _DEBUG
vFootPos = XMVector4Transform(XMLoadFloat4((_float4*)&m_pRightFootLocalMatrix->m[3][0]), WorldMatrix);
vLegPos = XMVector4Transform(XMLoadFloat4((_float4*)&m_pRightLegLocalMatrix->m[3][0]), WorldMatrix);
m_pRightLeg->Set_CenterTransform(vFootPos, vLegPos);
#ifdef _DEBUG
{
_vector vCenterWorldPos = (vFootPos + vLegPos) * 0.5f;
_vector vRotQ = XMQuaternionIdentity();
_vector vDir = XMVectorSetW(vLegPos - vFootPos, 0.f);
_float vLength = XMVectorGetX(XMVector3Length(vDir));
if (vLength > FLT_EPSILON5) {
vDir = XMVector3Normalize(vDir);
vRotQ = CMyTools::MakeQuaternionFromTo(XMVectorSet(0.f, 1.f, 0.f, 0.f), vDir);
}
XMStoreFloat4x4(&m_RightLegMatrix, XMMatrixRotationQuaternion(vRotQ) * XMMatrixTranslationFromVector(vCenterWorldPos));
}
#endif // _DEBUG
}
//_matrix PreTransformMatrix = XMLoadFloat4x4(&m_PreTransformMatrix);
//_matrix SocketMatrix = {};
//for (_uint i = ENUM_CLASS(PLAYER_JOINT_ANCHOR_ORDER::RUP_TO_RMIDDLE_START); i < ENUM_CLASS(PLAYER_JOINT_ANCHOR_ORDER::END); ++i) {
// SocketMatrix = XMLoadFloat4x4(m_RobeJointAnchorMatrices[(i - ENUM_CLASS(PLAYER_JOINT_ANCHOR_ORDER::RUP_TO_RMIDDLE_START)) /2]);
// m_pRobeJointAnchor[i]->Move_Kinematic((SocketMatrix * PreTransformMatrix * WorldMatrix));
//}
return S_OK;
}
#ifdef _DEBUG
HRESULT CPlayerRobe::Render_Legs()
{
_float fHeight = 0.25f;
_matrix WorldMatrix = XMLoadFloat4x4(&m_LeftLegMatrix);
_matrix ViewMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW);
_matrix ProjMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ);
_vector vColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0xff0000, 1.f);
m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true,
[this]() {
m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
});
_matrix WorldUp = XMMatrixTranslationFromVector(WorldMatrix.r[1] * fHeight);
_matrix WorldDown = XMMatrixTranslationFromVector(WorldMatrix.r[1] * -fHeight);
m_pSubShape->Draw(WorldUp * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true,
[this]() {
m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
});
m_pSubShape->Draw(WorldDown * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true,
[this]() {
m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
});
WorldMatrix = XMLoadFloat4x4(&m_RightLegMatrix);
m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true,
[this]() {
m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
});
WorldUp = XMMatrixTranslationFromVector(WorldMatrix.r[1] * fHeight);
WorldDown = XMMatrixTranslationFromVector(WorldMatrix.r[1] * -fHeight);
m_pSubShape->Draw(WorldUp * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true,
[this]() {
m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
});
m_pSubShape->Draw(WorldDown * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true,
[this]() {
m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
});
return S_OK;
}
HRESULT CPlayerRobe::Render_BonePhysX()
{
_vector vColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0x00ff00, 1.f);
_fmatrix OwnerMatrix = m_pParentTransformCom->Get_XMWorldMatrix();
_matrix PreTransformMatrix = XMLoadFloat4x4(&m_PreTransformMatrix);
_cmatrix ViewMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW);
_matrix ProjMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ);
ID3D11DepthStencilState* pPrevDSS = nullptr;
UINT iPrevStencilRef = 0;
m_pContext->OMGetDepthStencilState(&pPrevDSS, &iPrevStencilRef);
//for (_uint iBoneIndex = 0; iBoneIndex < ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::END); ++iBoneIndex)
//{
// _matrix WorldMatrix = XMLoadFloat4x4(m_RobeJointAnchorMatrices[iBoneIndex]) * PreTransformMatrix * OwnerMatrix;
// m_pSubShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true,
// [this]() {
// m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
// });
//}
_matrix MainAnchorMatrix = XMLoadFloat4x4(m_pSocketMatrix) * OwnerMatrix;
m_pSubShape->Draw(MainAnchorMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true,
[this]() {
m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
});
m_pRobeMainAnchor->Render([this]() {
m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
});
Render_Legs();
_vector vRouteColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0x0000ff, 1.f);
for (_uint i = 0; i < ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::END); ++i) {
if (nullptr != m_pRobeJointRoute[i]) {
m_pRobeJointRoute[i]->Render([this]() {
m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
});
}
}
for (_uint i = 0; i < ENUM_CLASS(PLAYER_JOINT_ANCHOR_ORDER::END); ++i) {
m_pRobeJointAnchor[i]->Render([this]() {
m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0);
});
}
m_pContext->OMSetDepthStencilState(pPrevDSS, iPrevStencilRef);
if (pPrevDSS != nullptr) {
pPrevDSS->Release();
}
return S_OK;
}
#endif // _DEBUG
HRESULT CPlayerRobe::Ready_Components()
{
__super::Ready_Components(nullptr);
_matrix PreTransformMatrix = XMLoadFloat4x4(&m_PreTransformMatrix);
_matrix parentWorld = m_pParentTransformCom->Get_XMWorldMatrix();
_matrix socketMatrix = XMLoadFloat4x4(m_pSocketMatrix);
_matrix socketWorld = socketMatrix * parentWorld;
_matrix xmAnchorMatricesWorld[ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::END)] = { };
for (_uint iBoneIndex = 0; iBoneIndex < ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::END); ++iBoneIndex) {
xmAnchorMatricesWorld[iBoneIndex] = XMLoadFloat4x4(m_RobeJointAnchorMatrices[iBoneIndex]) * PreTransformMatrix * parentWorld;
}
{ //
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_Leg"), (CComponent**)&m_pLeftLeg, &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_Leg"), (CComponent**)&m_pRightLeg, &Desc))) {
return E_FAIL;
}
}
{ // RobeSocket
{ // Fixed_MainAnchor
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
Desc.iSubKind = ENUM_CLASS(PXOBJECT::JOINT_ANCHOR);
Desc.bAutoOwnerTranslation = false;
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_JOINT_ANCHOR"), (CComponent**)&m_pRobeMainAnchor, &Desc))) {
return E_FAIL;
}
m_pRobeMainAnchor->Set_Kinematic(true);
m_pRobeMainAnchor->Set_Transform(socketWorld);
#ifdef _DEBUG
m_pRobeMainAnchor->Set_Name("MainAnchor");
#endif // _DEBUG
}
// SubAnchors
for (_int i = 0; i < ENUM_CLASS(PLAYER_JOINT_ANCHOR_ORDER::END); ++i) {
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{};
Desc.iSubKind = ENUM_CLASS(PXOBJECT::JOINT_ANCHOR);
Desc.bAutoOwnerTranslation = false;
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_JOINT_ANCHOR"), (CComponent**)&m_pRobeJointAnchor[i], &Desc))) {
return E_FAIL;
}
if (i < ENUM_CLASS(PLAYER_JOINT_ANCHOR_ORDER::RUP_TO_RMIDDLE_START)) {
m_pRobeJointAnchor[i]->Set_Transform(socketWorld);
#ifdef _DEBUG
m_pRobeJointAnchor[i]->Set_Name("SubAnchor");
#endif // _DEBUG
}
else {
m_pRobeJointAnchor[i]->Set_Transform(xmAnchorMatricesWorld[(i - ENUM_CLASS(PLAYER_JOINT_ANCHOR_ORDER::RUP_TO_RMIDDLE_START))/2]);
#ifdef _DEBUG
m_pRobeJointAnchor[i]->Set_Name(PLAYER_JOINT_BONE_NAMES[(i - ENUM_CLASS(PLAYER_JOINT_ANCHOR_ORDER::RUP_TO_RMIDDLE_START)) /2]);
#endif // _DEBUG
}
}
}
{ // RobeRoute
CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc_Body = {};
ROUTE_DESC Desc_Route = {};
Desc_Body.bAutoOwnerTranslation = false;
Desc_Body.iSubKind = ENUM_CLASS(PXOBJECT::JOINT_ROUTE);
/*Origin_Linked_Routes*/
{
{
Desc_Route.iTargetRouteIndex = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::ORIGIN_TO_RUP);
Desc_Route.iStartBoneIndex = -1;
Desc_Route.iEndBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::RIGHTUP);
Desc_Route.iStartJointIndex = ENUM_CLASS(PLAYER_JOINT_ANCHOR_ORDER::ORIGIN_TO_RUP_START);
Desc_Route.iEndJointIndex = ENUM_CLASS(PLAYER_JOINT_ANCHOR_ORDER::RUP_TO_RMIDDLE_END);
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_JOINT_ROUTE"), (CComponent**)&m_pRobeJointRoute[Desc_Route.iTargetRouteIndex], &Desc_Body))) {
return E_FAIL;
}
m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Set_CenterTransform(socketWorld.r[3], xmAnchorMatricesWorld[Desc_Route.iEndBoneIndex].r[3]);
#ifdef _DEBUG
m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Set_Name("Origin_Linked_Routes");
#endif // _DEBUG
{ // Joint
m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_PxD6Joint(m_pRobeMainAnchor->Get_Actor(), m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_Actor(), m_pRobeMainAnchor->Get_GlobalPosition());
m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_PxD6Joint(m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_Actor(), m_pRobeJointAnchor[Desc_Route.iEndJointIndex]->Get_Actor(), m_pRobeJointAnchor[Desc_Route.iEndJointIndex]->Get_GlobalPosition());
}
}
{
Desc_Route.iTargetRouteIndex = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::ORIGIN_TO_TUP);
Desc_Route.iStartBoneIndex = -1;
Desc_Route.iEndBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::TAILUP);
Desc_Route.iStartJointIndex = ENUM_CLASS(PLAYER_JOINT_ANCHOR_ORDER::ORIGIN_TO_TUP_START);
Desc_Route.iEndJointIndex = ENUM_CLASS(PLAYER_JOINT_ANCHOR_ORDER::TUP_TO_TMIDDLE_END);
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_JOINT_ROUTE"), (CComponent**)&m_pRobeJointRoute[Desc_Route.iTargetRouteIndex], &Desc_Body))) {
return E_FAIL;
}
m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Set_CenterTransform(socketWorld.r[3], xmAnchorMatricesWorld[Desc_Route.iEndBoneIndex].r[3]);
#ifdef _DEBUG
m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Set_Name("Origin_Linked_Routes");
#endif // _DEBUG
{ // Joint
m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_PxD6Joint(m_pRobeMainAnchor->Get_Actor(), m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_Actor(), m_pRobeMainAnchor->Get_GlobalPosition());
m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_PxD6Joint(m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_Actor(), m_pRobeJointAnchor[Desc_Route.iEndJointIndex]->Get_Actor(), m_pRobeJointAnchor[Desc_Route.iEndJointIndex]->Get_GlobalPosition());
}
}
{
Desc_Route.iTargetRouteIndex = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::ORIGIN_TO_LUP);
Desc_Route.iStartBoneIndex = -1;
Desc_Route.iEndBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::LEFTUP);
Desc_Route.iStartJointIndex = ENUM_CLASS(PLAYER_JOINT_ANCHOR_ORDER::ORIGIN_TO_LUP_START);
Desc_Route.iEndJointIndex = ENUM_CLASS(PLAYER_JOINT_ANCHOR_ORDER::LUP_TO_LMIDDLE_END);
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_JOINT_ROUTE"), (CComponent**)&m_pRobeJointRoute[Desc_Route.iTargetRouteIndex], &Desc_Body))) {
return E_FAIL;
}
m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Set_CenterTransform(socketWorld.r[3], xmAnchorMatricesWorld[Desc_Route.iEndBoneIndex].r[3]);
#ifdef _DEBUG
m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Set_Name("Origin_Linked_Routes");
#endif // _DEBUG
{ // Joint
m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_PxD6Joint(m_pRobeMainAnchor->Get_Actor(), m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_Actor(), m_pRobeMainAnchor->Get_GlobalPosition());
m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_PxD6Joint(m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_Actor(), m_pRobeJointAnchor[Desc_Route.iEndJointIndex]->Get_Actor(), m_pRobeJointAnchor[Desc_Route.iEndJointIndex]->Get_GlobalPosition());
}
}
}
/*UP_TO_MIDDLE*/
{
{
Desc_Route.iTargetRouteIndex = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::RUP_TO_RMIDDLE);
Desc_Route.iStartBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::RIGHTUP);
Desc_Route.iEndBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::RIGHT);
Desc_Route.iStartJointIndex = ENUM_CLASS(PLAYER_JOINT_ANCHOR_ORDER::RUP_TO_RMIDDLE_START);
Desc_Route.iEndJointIndex = Desc_Route.iStartJointIndex + 1;
Helper_RouteJointGenerater(Desc_Body, Desc_Route, xmAnchorMatricesWorld);
}
{
Desc_Route.iTargetRouteIndex = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::TUP_TO_TMIDDLE);
Desc_Route.iStartBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::TAILUP);
Desc_Route.iEndBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::TAIL);
Desc_Route.iStartJointIndex = ENUM_CLASS(PLAYER_JOINT_ANCHOR_ORDER::TUP_TO_TMIDDLE_START);
Desc_Route.iEndJointIndex = Desc_Route.iStartJointIndex + 1;
Helper_RouteJointGenerater(Desc_Body, Desc_Route, xmAnchorMatricesWorld);
}
{
Desc_Route.iTargetRouteIndex = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::LUP_TO_LMIDDLE);
Desc_Route.iStartBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::LEFTUP);
Desc_Route.iEndBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::LEFT);
Desc_Route.iStartJointIndex = ENUM_CLASS(PLAYER_JOINT_ANCHOR_ORDER::LUP_TO_LMIDDLE_START);
Desc_Route.iEndJointIndex = Desc_Route.iStartJointIndex + 1;
Helper_RouteJointGenerater(Desc_Body, Desc_Route, xmAnchorMatricesWorld);
}
}
/*MIDDLE_TO_DOWN*/
{
{
Desc_Route.iTargetRouteIndex = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::RMIDDLE_TO_RR);
Desc_Route.iStartBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::RIGHT);
Desc_Route.iEndBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::RIGHTDOWNRIGHT);
Desc_Route.iStartJointIndex = ENUM_CLASS(PLAYER_JOINT_ANCHOR_ORDER::RMIDDLE_TO_RR_START);
Desc_Route.iEndJointIndex = Desc_Route.iStartJointIndex + 1;
Helper_RouteJointGenerater(Desc_Body, Desc_Route, xmAnchorMatricesWorld);
}
{
Desc_Route.iTargetRouteIndex = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::RMIDDLE_TO_R);
Desc_Route.iStartBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::RIGHT);
Desc_Route.iEndBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::RIGHTDOWN);
Desc_Route.iStartJointIndex = ENUM_CLASS(PLAYER_JOINT_ANCHOR_ORDER::RMIDDLE_TO_R_START);
Desc_Route.iEndJointIndex = Desc_Route.iStartJointIndex + 1;
Helper_RouteJointGenerater(Desc_Body, Desc_Route, xmAnchorMatricesWorld);
}
{
Desc_Route.iTargetRouteIndex = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::TMIDDLE_TO_TR);
Desc_Route.iStartBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::TAIL);
Desc_Route.iEndBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::TAILRIGHTDOWN);
Desc_Route.iStartJointIndex = ENUM_CLASS(PLAYER_JOINT_ANCHOR_ORDER::TMIDDLE_TO_TR_START);
Desc_Route.iEndJointIndex = Desc_Route.iStartJointIndex + 1;
Helper_RouteJointGenerater(Desc_Body, Desc_Route, xmAnchorMatricesWorld);
}
{
Desc_Route.iTargetRouteIndex = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::TMIDDLE_TO_TL);
Desc_Route.iStartBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::TAIL);
Desc_Route.iEndBoneIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::TAILLEFTDOWN);
Desc_Route.iStartJointIndex = ENUM_CLASS(PLAYER_JOINT_ANCHOR_ORDER::TMIDDLE_TO_TL_START);
Desc_Route.iEndJointIndex = Desc_Route.iStartJointIndex + 1;
Helper_RouteJointGenerater(Desc_Body, Desc_Route, xmAnchorMatricesWorld);
}
{
Desc_Route.iTargetRouteIndex = ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::LMIDDLE_TO_L);
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_ANCHOR_ORDER::LMIDDLE_TO_L_START);
Desc_Route.iEndJointIndex = Desc_Route.iStartJointIndex + 1;
Helper_RouteJointGenerater(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::LEFTDOWNLEFT);
Desc_Route.iStartJointIndex = ENUM_CLASS(PLAYER_JOINT_ANCHOR_ORDER::LMIDDLE_TO_LL_START);
Desc_Route.iEndJointIndex = Desc_Route.iStartJointIndex + 1;
Helper_RouteJointGenerater(Desc_Body, Desc_Route, xmAnchorMatricesWorld);
}
}
}
return S_OK;
}
HRESULT CPlayerRobe::Initialize_Prototype()
{
return S_OK;
}
HRESULT CPlayerRobe::Initialize(void* pArg)
{
PlayerRobe_DESC* pDesc = static_cast<PlayerRobe_DESC*> (pArg);
m_pSocketMatrix = pDesc->pSocketMatrix;
m_pModelCom = pDesc->pModel;
m_pLeftFootLocalMatrix = m_pModelCom->Get_BoneMatrixPtr("LeftFoot");
m_pLeftLegLocalMatrix = m_pModelCom->Get_BoneMatrixPtr("LeftLeg");
m_pRightFootLocalMatrix = m_pModelCom->Get_BoneMatrixPtr("RightFoot");
m_pRightLegLocalMatrix = m_pModelCom->Get_BoneMatrixPtr("RightLeg");
m_PreTransformMatrix = *m_pModelCom->Get_PreTransformMatrixPtr();
for (_uint i = 0; i < ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::END); ++i) {
m_RobeJointAnchorMatrices[i] = m_pModelCom->Get_BoneLocalMatrixPtr(PLAYER_JOINT_BONE_NAMES[i]);
}
if (FAILED(__super::Initialize(pArg))) {
return E_FAIL;
}
if (FAILED(Ready_Components())) {
return E_FAIL;
}
#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));
D3D11_DEPTH_STENCIL_DESC depthStencilDesc = {};
depthStencilDesc.DepthEnable = FALSE;
depthStencilDesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ZERO;
depthStencilDesc.DepthFunc = D3D11_COMPARISON_ALWAYS;
depthStencilDesc.StencilEnable = FALSE;
HRESULT result = m_pDevice->CreateDepthStencilState(&depthStencilDesc, &m_pDepthStencilStateNone);
if (FAILED(result)){
return E_FAIL;
}
#endif // _DEBUG
return S_OK;
}
CPlayerRobe* CPlayerRobe::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
{
CPlayerRobe* pInstance = new CPlayerRobe(pDevice, pContext);
if (FAILED(pInstance->Initialize_Prototype()))
{
MSG_BOX("Failed to Created : CPlayerRobe");
SAFE_RELEASE(pInstance);
}
return pInstance;
}
CGameObject* CPlayerRobe::Clone(void* pArg, CGameObject* pOwner)
{
CPlayerRobe* pInstance = new CPlayerRobe(*this);
pInstance->m_pOwner = pOwner;
if (FAILED(pInstance->Initialize(pArg)))
{
MSG_BOX("Failed to Cloned : CPlayerRobe");
SAFE_RELEASE(pInstance);
}
return pInstance;
}
void CPlayerRobe::Free()
{
__super::Free();
#ifdef _DEBUG
SAFE_RELEASE(m_pDepthStencilStateNone);
#endif // _DEBUG
SAFE_RELEASE(m_pRightLeg);
SAFE_RELEASE(m_pLeftLeg);
for (_uint i = 0; i < ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::END); ++i) {
SAFE_RELEASE(m_pRobeJointRoute[i]);
}
}
#ifdef _DEBUG
void CPlayerRobe::Describe_Entity()
{
}
#endif // _DEBUG
+2 -17
View File
@@ -13,7 +13,6 @@ class CPlayer final : public CUnit
_float4 vPos;
_float4 vRotQ;
}PLAYERDESC;
private:
CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
CPlayer(const CPlayer& Prototype);
@@ -34,7 +33,6 @@ class CPlayer final : public CUnit
_int Get_UIState() { return m_eUIState; }
#ifdef _DEBUG
void Render_CameraCoordinateSystem();
HRESULT Render_BonePhysX();
#endif // _DEBUG
_bool Set_Sprint(_bool bSprint) { m_bSprintToggle = bSprint; }
_matrix Get_WandPos();
@@ -74,10 +72,8 @@ class CPlayer final : public CUnit
class CTransform* m_pBroomTransform = { nullptr };
class CBroom* m_pBroom = { nullptr };
CStat* m_pStat = { nullptr };
CRigidBody_Dynamic* m_pRightLeg = { nullptr };
CRigidBody_Dynamic* m_pLeftLeg = { nullptr };
//CRigidBody_Dynamic* m_pRobeJointRoute[ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::END)] = { nullptr };
//CDynamic_Joint* m_pDynamicJoints[ENUM_CLASS(PLAYER_JOINT_ORDER::END)] = { nullptr };
class CPlayerRobe* m_pRobePart = { nullptr };
private:
virtual HRESULT Initialize_Prototype() override;
virtual HRESULT Initialize(void* pArg) override;
@@ -90,21 +86,10 @@ class CPlayer final : public CUnit
void Add_SpellEvent(_uint AnimIndex, _float fRatio);
void Play_SpellHitAnim();
HRESULT Update_LegsPosition();
HRESULT Render_Legs();
//HRESULT Helper_JointGenerater(CDynamic_Joint::DYNAMICJOINT_DESC& Desc, _uint iRoute0, _bool bUseHead0, _uint iRoute1, _bool bUseHead1, _uint iJoint);
void Update_CameraCoordinateSystem(_float fTimeDelta);
#ifdef _DEBUG
unique_ptr<BasicEffect> m_BasicEffect;
unique_ptr<PrimitiveBatch<VertexPositionColor>> m_Batch;
unique_ptr<GeometricPrimitive> m_pBoneShape = { nullptr };
unique_ptr<GeometricPrimitive> m_pMainShape = { nullptr };
unique_ptr<GeometricPrimitive> m_pSubShape = { nullptr };
ID3D11DepthStencilState* m_pDepthStencilStateNone = { nullptr };
_float4x4 m_LeftLegMatrix = {};
_float4x4 m_RightLegMatrix = {};
#endif // _DEBUG
@@ -0,0 +1,81 @@
#pragma once
#include "Client_Define.h"
#include "PartObject.h"
#include "Player_ENUM.h"
NS_BEGIN(Client)
class CPlayerRobe final : public CPartObject
{
typedef struct tagRouteCreater {
_uint iTargetRouteIndex = UINT_MAX; // 만들려는 루트
_uint iStartBoneIndex = UINT_MAX; // 시작 앵커
_uint iEndBoneIndex = UINT_MAX; // 끝 앵커
_uint iStartJointIndex = UINT_MAX; // 시작 앵커가 할당받을 인덱스
_uint iEndJointIndex = UINT_MAX; // 끝 앵커가 할당받을 인덱스
}ROUTE_DESC;
public:
typedef struct tagPlayerRobe : public CPartObject::PARTOBJECT_DESC
{
const _float4x4* pSocketMatrix = { };
CModel* pModel = { nullptr };
}PlayerRobe_DESC;
private:
CPlayerRobe(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
CPlayerRobe(const CPlayerRobe& Prototype);
virtual ~CPlayerRobe() = default;
public:
virtual void Priority_Update(_float fTimeDelta) override;
virtual void Update(_float fTimeDelta) override;
virtual void Late_Update(_float fTimeDelta) override;
virtual HRESULT Render() override;
private:
_float4x4 m_PreTransformMatrix = { };
const _float4x4* m_pSocketMatrix = { nullptr };
const _float4x4* m_pLeftFootLocalMatrix = { nullptr };
const _float4x4* m_pLeftLegLocalMatrix = { nullptr };
const _float4x4* m_pRightFootLocalMatrix = { nullptr };
const _float4x4* m_pRightLegLocalMatrix = { nullptr };
const _float4x4* m_RobeJointAnchorMatrices[ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::END)] = { nullptr };
CModel* m_pModelCom = { nullptr };
CRigidBody_Dynamic* m_pRightLeg = { nullptr };
CRigidBody_Dynamic* m_pLeftLeg = { 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_ANCHOR_ORDER::END)] = { nullptr };
PSX::PxD6Joint* m_pDynamicJoints[ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::END)] = { nullptr };
#ifdef _DEBUG
unique_ptr<GeometricPrimitive> m_pMainShape = { nullptr };
unique_ptr<GeometricPrimitive> m_pSubShape = { nullptr };
ID3D11DepthStencilState* m_pDepthStencilStateNone = { nullptr };
_float4x4 m_LeftLegMatrix = {};
_float4x4 m_RightLegMatrix = {};
#endif // _DEBUG
private:
virtual HRESULT Initialize_Prototype() override;
virtual HRESULT Initialize(void* pArg) override;
HRESULT Ready_Components();
HRESULT Bind_ShaderResources() { return S_OK; }
HRESULT Update_LegsPosition();
HRESULT Update_RobeSocketPosition();
HRESULT Helper_RouteJointGenerater(CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC& Desc_Body, ROUTE_DESC& Desc_Route, _matrix* xmAnchorMatricesWorld);
#ifdef _DEBUG
HRESULT Render_BonePhysX();
HRESULT Render_Legs();
#endif // _DEBUG
public:
static CPlayerRobe* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr)override;
virtual void Free() override;
#ifdef _DEBUG
void Describe_Entity() override;
#endif // _DEBUG
};
NS_END
+75 -41
View File
@@ -23,25 +23,6 @@ enum class PLAYER_MESH_ORDER {
END
};
enum class PLAYER_JOINT_ORDER {
RIGHTUP
, TAILUP //
, LEFTUP
, RIGHT
, TAIL
, LEFT
, RIGHTDOWN
, RIGHTDOWNRIGHT
, TAILRIGHTDOWN //
, TAILLEFTDOWN //
, LEFTDOWNLEFT
, LEFTDOWN
, END
};
static const _char* PLAYER_JOINT_BONE_NAMES[12] = {
"RightUpLeg_Cloth"
, "TailUp_Cloth"
@@ -60,32 +41,85 @@ static const _char* PLAYER_JOINT_BONE_NAMES[12] = {
, "LeftDownLeg_Cloth"
};
enum class PLAYER_JOINT_ROUTE_ORDER {
UP_R_T
, UP_T_L
enum class PLAYER_JOINT_BONE_ORDER {
RIGHTUP
, TAILUP
, LEFTUP
, UP_MIDDLE_R
// , UP_MIDDLE_T //
, UP_MIDDLE_L
, RIGHT
, TAIL
, LEFT
, MIDDLE_R_T
, MIDDLE_T_L
, RIGHTDOWNRIGHT
, RIGHTDOWN
, TAILRIGHTDOWN
, MIDDLE_DOWN_R
, MIDDLE_DOWN_RR
, MIDDLE_DOWN_TR
, MIDDLE_DOWN_TL
, MIDDLE_DOWN_LL
, MIDDLE_DOWN_L
, DOWN_R_RR
, DOWN_RR_TR
// , DOWN_TR_TL //
, DOWN_TL_L
, DOWN_L_LL
, TAILLEFTDOWN
, LEFTDOWN
, LEFTDOWNLEFT
, END
};
enum class PLAYER_JOINT_ANCHOR_ORDER {
ORIGIN_TO_RUP_START
, ORIGIN_TO_RUP_END
, ORIGIN_TO_TUP_START
, ORIGIN_TO_TUP_END
, ORIGIN_TO_LUP_START
, ORIGIN_TO_LUP_END
, RUP_TO_RMIDDLE_START
, RUP_TO_RMIDDLE_END
, TUP_TO_TMIDDLE_START
, TUP_TO_TMIDDLE_END
, LUP_TO_LMIDDLE_START
, LUP_TO_LMIDDLE_END
, RMIDDLE_TO_RR_START
, RMIDDLE_TO_RR_END
, RMIDDLE_TO_R_START
, RMIDDLE_TO_R_END
, TMIDDLE_TO_TR_START
, TMIDDLE_TO_TR_END
, TMIDDLE_TO_TL_START
, TMIDDLE_TO_TL_END
, LMIDDLE_TO_L_START
, LMIDDLE_TO_L_END
, LMIDDLE_TO_LL_START
, LMIDDLE_TO_LL_END
, END
};
enum class PLAYER_JOINT_ROUTE_ORDER {
ORIGIN_TO_RUP
, ORIGIN_TO_TUP
, ORIGIN_TO_LUP
, RUP_TO_RMIDDLE
, TUP_TO_TMIDDLE
, LUP_TO_LMIDDLE
, RMIDDLE_TO_RR
, RMIDDLE_TO_R
, TMIDDLE_TO_TR
, TMIDDLE_TO_TL
, LMIDDLE_TO_L
, LMIDDLE_TO_LL
, END
};
NS_END