diff --git a/Jusin154_Team3D/Client/Private/CallBack_Playable_HitReport.cpp b/Jusin154_Team3D/Client/Private/CallBack_Playable_HitReport.cpp index c8dad8188..77359c111 100644 --- a/Jusin154_Team3D/Client/Private/CallBack_Playable_HitReport.cpp +++ b/Jusin154_Team3D/Client/Private/CallBack_Playable_HitReport.cpp @@ -72,6 +72,17 @@ void CCallBack_Playable_HitReport::onShapeHit(const PSX::PxControllerShapeHit& h vCompressedDir.normalize(); pDynamic->addForce(vCompressedDir * fLength* 1000.f, PSX::PxForceMode::eFORCE); } break; + case PXOBJECT::DOOR: + { + PSX::PxRigidDynamic* pDynamic = static_cast(pActor); + _float fDot = vDir.dot(PSX::PxVec3(0.f, 1.f, 0.f)); + if (fDot > 0) { + pDynamic->addTorque(PSX::PxVec3(0.f, 1.f, 0.f) * fLength * 100.f, PSX::PxForceMode::eFORCE); + } + else { + pDynamic->addTorque(PSX::PxVec3(0.f, -1.f, 0.f) * fLength * 100.f, PSX::PxForceMode::eFORCE); + } + } break; default: { } break; diff --git a/Jusin154_Team3D/Client/Private/EffectPool.cpp b/Jusin154_Team3D/Client/Private/EffectPool.cpp index 09c1978b7..c88288733 100644 --- a/Jusin154_Team3D/Client/Private/EffectPool.cpp +++ b/Jusin154_Team3D/Client/Private/EffectPool.cpp @@ -73,8 +73,8 @@ HRESULT CEffectPool::Initialize(void* pArg) m_isActiveMonsterEffectCreate = true; #endif // #ifdef 기무리 - m_isActiveEffectCreate = true; - m_isActiveMonsterEffectCreate = true; + m_isActiveEffectCreate = false; + m_isActiveMonsterEffectCreate = false; #endif // #ifdef 인혁 m_isActiveEffectCreate = false; diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index 995765791..5d6cc2076 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -871,206 +871,206 @@ HRESULT CLoader::Loading_For_GamePlay() m_pGameInstance->Load_GlobalSRV(TEXT("GLOBAL_DISOLVE_BURN_VERTICAL"), "../Bin/Resources/Textures/Effect/Diffuse/drp_fire_Line_Vertical.png"); } #pragma endregion -#pragma region UI_ANI - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Altering_Spell"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Altering_Spell\\Altering_Spell%d.png"), 349)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Alohomora"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Alohomora\\Alohomora%d.png"), 394)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Ancient_Magic"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Ancient_Magic\\Ancient_Magic%d.png"), 152)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Ancient_Magic_Throw"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Ancient_Magic_Throw\\Ancient_Magic_Throw%d.png"), 89)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Arresto_Momentum"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Arresto_Momentum\\Arresto_Momentum%d.png"), 120)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Avada_Kedavra"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Avada_Kedavra\\Avada_Kedavra%d.png"), 208)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Basic_Cast"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Basic_Cast\\Basic_Cast%d.png"), 308)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Beast_Feed"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Beast_Feed\\Beast_Feed%d.png"), 378)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Beast_Petting_Brush"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Beast_Petting_Brush\\Beast_Petting_Brush%d.png"), 327)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Bombarda"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Bombarda\\Bombarda%d.png"), 262)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Confringo"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Confringo\\Confringo%d.png"), 157)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Conjuring_Spell"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Conjuring_Spell\\Conjuring_Spell%d.png"), 115)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Descendo"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Descendo\\Descendo%d.png"), 155)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Depulso"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Depulso\\Depulso%d.png"), 152)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Diffindo"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Diffindo\\Diffindo%d.png"), 150)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Disillusionment"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Disillusionment\\Disillusionment%d.png"), 260)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Evanesco"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Evanesco\\Evanesco%d.png"), 136)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Expelliarmus"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Expelliarmus\\Expelliarmus%d.png"), 146)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Flipendo"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Flipendo\\Flipendo%d.png"), 188)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Glacius"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Glacius\\Glacius%d.png"), 156)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Imperio"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Imperio\\Imperio%d.png"), 462)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Incendio"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Incendio\\Incendio%d.png"), 213)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Levioso"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Levioso\\Levioso%d.png"), 180)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Lumos"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Lumos\\Lumos%d.png"), 365)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Nab_Sack"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Nab_Sack\\Nab_Sack%d.png"), 235)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Petrificus_Totalus"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Petrificus_Totalus\\Petrificus_Totalus%d.png"), 275)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Protego"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Protego\\Protego%d.png"), 285)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Reparo"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Reparo\\Reparo%d.png"), 385)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Revelio"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Revelio\\Revelio%d.png"), 227)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Stupefy"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Stupefy\\Stupefy%d.png"), 222)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Transformation"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Transformation\\Transformation%d.png"), 146)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Wingardium_Leviosa"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Wingardium_Leviosa\\Wingardium_Leviosa%d.png"), 273)))) - { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Crucio"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Crucio\\Crucio%d.png"), 216)))) - { - return E_FAIL; - } - -#pragma endregion +//#pragma region UI_ANI +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Altering_Spell"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Altering_Spell\\Altering_Spell%d.png"), 349)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Alohomora"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Alohomora\\Alohomora%d.png"), 394)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Ancient_Magic"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Ancient_Magic\\Ancient_Magic%d.png"), 152)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Ancient_Magic_Throw"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Ancient_Magic_Throw\\Ancient_Magic_Throw%d.png"), 89)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Arresto_Momentum"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Arresto_Momentum\\Arresto_Momentum%d.png"), 120)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Avada_Kedavra"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Avada_Kedavra\\Avada_Kedavra%d.png"), 208)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Basic_Cast"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Basic_Cast\\Basic_Cast%d.png"), 308)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Beast_Feed"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Beast_Feed\\Beast_Feed%d.png"), 378)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Beast_Petting_Brush"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Beast_Petting_Brush\\Beast_Petting_Brush%d.png"), 327)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Bombarda"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Bombarda\\Bombarda%d.png"), 262)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Confringo"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Confringo\\Confringo%d.png"), 157)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Conjuring_Spell"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Conjuring_Spell\\Conjuring_Spell%d.png"), 115)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Descendo"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Descendo\\Descendo%d.png"), 155)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Depulso"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Depulso\\Depulso%d.png"), 152)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Diffindo"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Diffindo\\Diffindo%d.png"), 150)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Disillusionment"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Disillusionment\\Disillusionment%d.png"), 260)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Evanesco"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Evanesco\\Evanesco%d.png"), 136)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Expelliarmus"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Expelliarmus\\Expelliarmus%d.png"), 146)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Flipendo"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Flipendo\\Flipendo%d.png"), 188)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Glacius"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Glacius\\Glacius%d.png"), 156)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Imperio"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Imperio\\Imperio%d.png"), 462)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Incendio"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Incendio\\Incendio%d.png"), 213)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Levioso"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Levioso\\Levioso%d.png"), 180)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Lumos"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Lumos\\Lumos%d.png"), 365)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Nab_Sack"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Nab_Sack\\Nab_Sack%d.png"), 235)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Petrificus_Totalus"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Petrificus_Totalus\\Petrificus_Totalus%d.png"), 275)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Protego"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Protego\\Protego%d.png"), 285)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Reparo"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Reparo\\Reparo%d.png"), 385)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Revelio"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Revelio\\Revelio%d.png"), 227)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Stupefy"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Stupefy\\Stupefy%d.png"), 222)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Transformation"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Transformation\\Transformation%d.png"), 146)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Wingardium_Leviosa"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Wingardium_Leviosa\\Wingardium_Leviosa%d.png"), 273)))) +// { +// return E_FAIL; +// } +// +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Crucio"), +// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Crucio\\Crucio%d.png"), 216)))) +// { +// return E_FAIL; +// } +// +//#pragma endregion #pragma region TERRAIN_TEXTURE /* Terrain_Diffuse */ @@ -1392,37 +1392,69 @@ HRESULT CLoader::Loading_For_GamePlay() } - CRigidBody_Dynamic::RIGIDBODY_PROTOTYPE_DYNAMIC_DESC Desc{}; - { - Desc.eType = ACTOR::BOX; - 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.05f }; - Desc.vhalfGeometryInfo = { 0.5f, 0.5f, 0.5f }; - Desc.fDensity = 1.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 }; - } + { // LIGHT PHYSX DYNAMIC + CRigidBody_Dynamic::RIGIDBODY_PROTOTYPE_DYNAMIC_DESC Desc{}; + { + Desc.eType = ACTOR::BOX; + 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.05f }; + Desc.vhalfGeometryInfo = { 0.5f, 0.5f, 0.5f }; + Desc.fDensity = 1.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_DYNAMIC_HEAVY_WALL"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) { - return E_FAIL; - } + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_HEAVY_WALL"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) { + return E_FAIL; + } - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), 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; - } + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), 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; + } - //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; + //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; + } + } + { // DOOR PHYSX + CRigidBody_Dynamic::RIGIDBODY_PROTOTYPE_DYNAMIC_DESC Desc{}; + { + Desc.eType = ACTOR::BOX; + 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.05f }; + Desc.vhalfGeometryInfo = { 0.35f, 0.75f, 0.15f }; + Desc.fDensity = 10.f; + PSX::PxTransform pxPivotTransform = PSX::PxTransform(PSX::PxVec3(0.f, 0.f, 0.f)); + Desc.vLocalRotQ = { 0.f, 0.f, 0.f, 1.f }; + Desc.vLocalTranslation = { 0.5f, 0.f, 0.f }; + + Desc.pxMassCenter = pxPivotTransform; + Desc.eLockFlag = { + PSX::PxRigidDynamicLockFlag::eLOCK_ANGULAR_X | + //PSX::PxRigidDynamicLockFlag::eLOCK_ANGULAR_Y | + PSX::PxRigidDynamicLockFlag::eLOCK_ANGULAR_Z | + PSX::PxRigidDynamicLockFlag::eLOCK_LINEAR_Y | + PSX::PxRigidDynamicLockFlag::eLOCK_LINEAR_X | + PSX::PxRigidDynamicLockFlag::eLOCK_LINEAR_Z + }; + Desc.vAutoDamping = { 10.f, 10.f }; + } + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_DOOR"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) { + return E_FAIL; + } } if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Box"), diff --git a/Jusin154_Team3D/Client/Private/MapElement_Door.cpp b/Jusin154_Team3D/Client/Private/MapElement_Door.cpp index dd541d6ec..4d4a9138a 100644 --- a/Jusin154_Team3D/Client/Private/MapElement_Door.cpp +++ b/Jusin154_Team3D/Client/Private/MapElement_Door.cpp @@ -2,6 +2,7 @@ #include "MapElement_Door.h" #include "GameInstance.h" +#include "RigidBody_Dynamic.h" #include "Terrain.h" #include "Layer.h" #include "VIBuffer_Terrain.h" @@ -43,17 +44,39 @@ HRESULT CMapElement_Door::Initialize(void* pArg) m_pTransformCom->Set_Scale(pDesc->vScale); m_pTransformCom->Rotation(XMConvertToRadians(pDesc->vRotation.x), XMConvertToRadians(pDesc->vRotation.y), XMConvertToRadians(pDesc->vRotation.z)); - //m_vBoxSize = _float3(1.f, 1.f, 1.f); - //m_pActor = static_cast(m_pRigidBody->Get_Actor()); + XMStoreFloat4((_float4*)&m_pxStartQuat, m_pTransformCom->Get_QuarternionVector()); + XMStoreFloat4x4(&m_InitialMatrix, m_pTransformCom->Get_XMWorldMatrix()); - //static_cast(m_pRigidBody)->Set_HalfGeometryInfo(pDesc->vBoxSize); - //static_cast(m_pRigidBody)->Move_LocalPos(_float4(0.f, 0.f, 0.f, 0.f), pDesc->vBoxLocalPosition); + m_vRadianYAngle.y = pDesc->vRotation.z; + m_vRadianYAngle.x = m_vRadianYAngle.y + XMConvertToRadians(-70.f); + m_vRadianYAngle.z = m_vRadianYAngle.y + XMConvertToRadians(70.f); + + { // RIGID_BODY + CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; + Desc.iSubKind = ENUM_CLASS(PXOBJECT::DOOR); + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_DOOR"), (CComponent**)&m_pRigidBody, &Desc))) { + return E_FAIL; + } + } + m_pActor = (PSX::PxRigidDynamic*)m_pRigidBody->Get_Actor(); return S_OK; } void CMapElement_Door::Priority_Update(_float fTimeDelta) { + if (m_pActor->getRigidBodyFlags() & PSX::PxRigidBodyFlag::eKINEMATIC) { + m_vKinematicTimer.x += fTimeDelta; + if (m_vKinematicTimer.x < m_vKinematicTimer.z) { + // 행렬없이 럴프 버전 + _float fTime = max(0.f, ((m_vKinematicTimer.x - m_vKinematicTimer.y) / (m_vKinematicTimer.z - m_vKinematicTimer.y))); + Lerp_Matrix(fTime); + //Lerp_NonMatrix(fTime); + } + else { + m_pActor->setRigidBodyFlag(PSX::PxRigidBodyFlag::eKINEMATIC, false); + } + } } void CMapElement_Door::Update(_float fTimeDelta) @@ -63,6 +86,45 @@ void CMapElement_Door::Update(_float fTimeDelta) void CMapElement_Door::Late_Update(_float fTimeDelta) { + _vector vRPY = m_pTransformCom->Get_RollPitchYawVector(); + if (!(m_pActor->getRigidBodyFlags() & PSX::PxRigidBodyFlag::eKINEMATIC)) { + _float fPitch = XMVectorGetX(vRPY); + _float fYaw = XMVectorGetY(vRPY); + _float fRoll = XMVectorGetZ(vRPY); + + _float fClampedYaw = ClampRadian(fYaw); + if (fClampedYaw != fYaw) { + _vector vNewQuat = XMQuaternionRotationRollPitchYaw(fPitch, fClampedYaw, fRoll); + + PSX::PxTransform actorPose = m_pActor->getGlobalPose(); + PSX::PxTransform massLocalPose = m_pActor->getCMassLocalPose(); + + PSX::PxVec3 vpxMassLocal = massLocalPose.p; + PSX::PxVec3 vpxMassWorld = actorPose.transform(vpxMassLocal); + + _vector vMassLocal = XMVectorSet(vpxMassLocal.x, vpxMassLocal.y, vpxMassLocal.z, 0.f); + _vector vMassWorld = XMVectorSet(vpxMassWorld.x, vpxMassWorld.y, vpxMassWorld.z, 1.f); + + _float3 vScale = m_pTransformCom->Get_Scale(); + _matrix ScaleMatrix = XMMatrixScalingFromVector(XMLoadFloat3(&vScale)); + _matrix RotationMatrix = XMMatrixRotationQuaternion(vNewQuat); + + _matrix TranslationLocal = XMMatrixTranslationFromVector(-vMassLocal); + _matrix TranslationWorld = XMMatrixTranslationFromVector(vMassWorld); + + // 최종 월드 행렬 + _matrix world = TranslationLocal // 피벗중심으로 좌표계를 이동시킴 + * (ScaleMatrix * RotationMatrix * TranslationWorld); // 그 후 SRT 적용 + + m_pTransformCom->Set_WorldMatrix(world); + m_pActor->setGlobalPose(XMWorldToPx_NoScale(world)); + + m_pActor->setAngularVelocity(PSX::PxVec3(0)); + m_pActor->setLinearVelocity(PSX::PxVec3(0)); + m_pActor->setRigidBodyFlag(PSX::PxRigidBodyFlag::eKINEMATIC, true); + m_vKinematicTimer.x = 0.f; + } + } if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pModelComs[0]->Get_Radius())) { m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); } @@ -125,14 +187,6 @@ HRESULT CMapElement_Door::Ready_Components(void* pArg) ELEMENT_DOOR_DESC* pPhysXDummyDesc = static_cast(pArg); - //// RIGID_BODY - //CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; - //Desc.iSubKind = ENUM_CLASS(PXOBJECT::BOX);//pPhysXDummyDesc->iSubKind; - //if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), (CComponent**)&m_pRigidBody, &Desc))) { - // return E_FAIL; - //} - - return S_OK; } @@ -155,6 +209,67 @@ HRESULT CMapElement_Door::Bind_ShaderResources() return S_OK; } +void CMapElement_Door::Lerp_Matrix(_float fTime) +{ + { + _float4x4 OutMatrix = {}; + _float4x4 CurrentMatrix = {}; + XMStoreFloat4x4(&CurrentMatrix, m_pTransformCom->Get_XMWorldMatrix()); + CMyTools::MatrixLerp(&CurrentMatrix, &m_InitialMatrix, OutMatrix, fTime); + m_pTransformCom->Set_WorldMatrix(OutMatrix); + } +} + +void CMapElement_Door::Lerp_NonMatrix(_float fTime) +{ + { + _vector vCurrQ = m_pTransformCom->Get_QuarternionVector(); + _vector vInitialQ = XMLoadFloat4((_float4*)&m_pxStartQuat); + _vector vLerpQuat = XMVector4Normalize(XMVectorLerp(vCurrQ, vInitialQ, fTime)); + + PSX::PxTransform actorPose = m_pActor->getGlobalPose(); + PSX::PxTransform massLocalPose = m_pActor->getCMassLocalPose(); + + PSX::PxVec3 vpxMassLocal = massLocalPose.p; + PSX::PxVec3 vpxMassWorld = actorPose.transform(vpxMassLocal); + + _vector vMassLocal = XMVectorSet(vpxMassLocal.x, vpxMassLocal.y, vpxMassLocal.z, 0.f); + _vector vMassWorld = XMVectorSet(vpxMassWorld.x, vpxMassWorld.y, vpxMassWorld.z, 1.f); + + + _float3 vScale = m_pTransformCom->Get_Scale(); + _matrix ScaleMatrix = XMMatrixScalingFromVector(XMLoadFloat3(&vScale)); + _matrix RotationMatrix = XMMatrixRotationQuaternion(vLerpQuat); + + _matrix TranslationLocal = XMMatrixTranslationFromVector(-vMassLocal); + _matrix TranslationWorld = XMMatrixTranslationFromVector(vMassWorld); + + // 최종 월드 행렬 + _matrix world = TranslationLocal // 피벗중심으로 좌표계를 이동시킴 + * (ScaleMatrix * RotationMatrix * TranslationWorld); // 그 후 SRT 적용 + + m_pTransformCom->Set_WorldMatrix(world); + } +} + +_float CMapElement_Door::ClampRadian(_float fNewRadian) +{ + // [x, z] 사이로 잘라주는 단순한 클램프 + _float minYaw = m_vRadianYAngle.x; + _float maxYaw = m_vRadianYAngle.z; + + // 라디안 노멀라이즈 ([-pi, pi] 같은 범위로) + fNewRadian = CMyTools::NormalizeRadian(fNewRadian); + + if (fNewRadian < minYaw) { + fNewRadian = minYaw; + } + else if (fNewRadian > maxYaw) { + fNewRadian = maxYaw; + } + return fNewRadian; +} + CMapElement_Door* CMapElement_Door::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { CMapElement_Door* pInstance = new CMapElement_Door(pDevice, pContext); @@ -188,7 +303,7 @@ void CMapElement_Door::Free() } __super::Free(); - //SAFE_RELEASE(m_pRigidBody); + SAFE_RELEASE(m_pRigidBody); SAFE_RELEASE(m_pShaderCom); for (auto& pModel : m_pModelComs) diff --git a/Jusin154_Team3D/Client/Private/Troll.cpp b/Jusin154_Team3D/Client/Private/Troll.cpp index 5e4244183..bcfe77853 100644 --- a/Jusin154_Team3D/Client/Private/Troll.cpp +++ b/Jusin154_Team3D/Client/Private/Troll.cpp @@ -427,7 +427,7 @@ HRESULT CTroll::Ready_Components() Desc.fContactOffset = 0.001f; Desc.fMaterial = { 1.2f, 1.0f, 0.0f }; Desc.bAutoStepping = { false }; - Desc.fStepOffset = { 0.02f }; + Desc.fStepOffset = { 0.12f }; Desc.fRadius = 1.2f; Desc.fHeight = 1.5f; Desc.pCallback_HitReport = m_pCallBack_HitReport = CCallBack_Troll_HitReport::Create(); diff --git a/Jusin154_Team3D/Client/Public/MapElement_Door.h b/Jusin154_Team3D/Client/Public/MapElement_Door.h index a69c966d0..64fe81397 100644 --- a/Jusin154_Team3D/Client/Public/MapElement_Door.h +++ b/Jusin154_Team3D/Client/Public/MapElement_Door.h @@ -31,6 +31,11 @@ class CMapElement_Door final : public CMapElement CRigidBody* m_pRigidBody = { nullptr }; PSX::PxRigidDynamic* m_pActor = { nullptr }; + _float3 m_vRadianYAngle = {}; + _float3 m_vKinematicTimer = { 0.f, 2.f, 2.3f }; + PSX::PxQuat m_pxStartQuat = {}; + _float4x4 m_InitialMatrix = {}; + #ifdef _DEBUG _bool m_bUseSelectColor = { true }; @@ -45,6 +50,9 @@ class CMapElement_Door final : public CMapElement virtual HRESULT Initialize(void* pArg) override; virtual HRESULT Ready_Components(void* pArg) override; virtual HRESULT Bind_ShaderResources() override; + void Lerp_Matrix(_float fTime); + void Lerp_NonMatrix(_float fTime); + _float ClampRadian(_float fNewRadian); public: static CMapElement_Door* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);