diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj b/Jusin154_Team3D/Client/Default/Client.vcxproj index 99311a1b3..d8db8284f 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj @@ -113,7 +113,7 @@ $(USERNAME);_DEBUG;_WINDOWS;%(PreprocessorDefinitions);%(PreprocessorDefinitions) true stdcpp17 - ../Public/;../../EngineSDK/Inc/;../../EngineSDK/Inc/DirectXTK/;../../EngineSDK/Inc/fMod/;../../EngineSDK/Inc/IMGUI/;../../EngineSDK/Inc/FX11/;%(AdditionalIncludeDirectories) + ../Public/;../../EngineSDK/Inc/;../../EngineSDK/Inc/DirectXTK/;../../EngineSDK/Inc/fMod/;../../EngineSDK/Inc/IMGUI/;../../EngineSDK/Inc/FX11/;../../EngineSDK/Inc/PhysX/;%(AdditionalIncludeDirectories) true true Use @@ -123,7 +123,7 @@ Windows true ../../EngineSDK/Lib/$(ConfigurationName);%(AdditionalLibraryDirectories) - Engine.lib;fmod_vc.lib;DirectXTKd.lib;%(AdditionalDependencies) + Engine.lib;fmod_vc.lib;PhysX_64.lib;PhysXCommon_64.lib;PhysXCooking_64.lib;PhysXExtensions_static_64.lib;PhysXFoundation_64.lib;DirectXTKd.lib;%(AdditionalDependencies);%(AdditionalDependencies) cd /d "$(SolutionDir)" @@ -140,7 +140,7 @@ call Update_Resources.bat $(USERNAME);NDEBUG;_WINDOWS;%(PreprocessorDefinitions);%(PreprocessorDefinitions) true stdcpp17 - ../Public/;../../EngineSDK/Inc/;../../EngineSDK/Inc/DirectXTK/;../../EngineSDK/Inc/fMod/;../../EngineSDK/Inc/IMGUI/;../../EngineSDK/Inc/FX11/;%(AdditionalIncludeDirectories) + ../Public/;../../EngineSDK/Inc/;../../EngineSDK/Inc/DirectXTK/;../../EngineSDK/Inc/fMod/;../../EngineSDK/Inc/IMGUI/;../../EngineSDK/Inc/FX11/;../../EngineSDK/Inc/PhysX/;%(AdditionalIncludeDirectories) true true Use @@ -150,7 +150,7 @@ call Update_Resources.bat Windows true ../../EngineSDK/Lib/$(ConfigurationName);%(AdditionalLibraryDirectories) - Engine.lib;fmod_vc.lib;%(AdditionalDependencies) + Engine.lib;fmod_vc.lib;PhysX_64.lib;PhysXCommon_64.lib;PhysXCooking_64.lib;PhysXExtensions_static_64.lib;PhysXFoundation_64.lib;%(AdditionalDependencies);%(AdditionalDependencies) cd /d "$(SolutionDir)" @@ -166,6 +166,10 @@ call Update_Resources.bat + + + + @@ -175,8 +179,12 @@ call Update_Resources.bat + + + + @@ -326,8 +334,6 @@ call Update_Resources.bat - - @@ -410,6 +416,11 @@ call Update_Resources.bat + + + + + @@ -419,7 +430,10 @@ call Update_Resources.bat + + + @@ -571,8 +585,6 @@ call Update_Resources.bat - - diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters index e9a5b824d..34cfb1e10 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters @@ -79,12 +79,6 @@ 02.GameObjects\Item\Broom - - 02.GameObjects\PhysX - - - 02.GameObjects\PhysX - 04.Mechanic\State @@ -338,7 +332,7 @@ 04.Mechanic\State\State_Combat\State_Swing - 04.Mechanic\State\State_Combat\State_Blink + 04.Mechanic\State\Movement\State_Blink 02.GameObjects\Item\Goblin_Dagger @@ -410,9 +404,6 @@ 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Spector - - 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Spector - 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Warrior @@ -751,6 +742,33 @@ 02.GameObjects\Effect\MonsterEffect\Ranrok\Ranrok_Point + + + 02.GameObjects\Player + + + 02.GameObjects\Player\Robe + + + 02.GameObjects\Cameras\Camera_Model + + + 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Assassin + + + 02.GameObjects\Item\Goblin_Sword + + + 04.Mechanic\State\State_Combat\State_Slash + + + 04.Mechanic\State\Movement\Dash + + + 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Spector\Goblin_Warrior_Spector + + + 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Spector\Goblin_Assassin_Spector @@ -1140,9 +1158,6 @@ {f109c973-c532-4549-9680-d0d6495b0fa8} - - {27251db2-19f2-4492-a3a4-32c11526f413} - {b8c7e12b-da04-4d49-bc61-104649975d0b} @@ -1562,6 +1577,33 @@ {a94e24d2-0f61-4263-b834-bfdf9f6c06ae} + + + {f3c7cf8d-2b83-49d3-85da-fe135e376a11} + + + {f8d55057-c0f8-4cac-8a6c-6f11345a83bb} + + + {af9f5cf6-151a-49bc-9af4-28ba0bde1d37} + + + {db12252c-8c0d-40bc-9466-e76ec60e2509} + + + {0736f27e-2722-483b-88b6-30471ad70835} + + + {27251db2-19f2-4492-a3a4-32c11526f413} + + + {6d1f0862-40a4-4c0b-9921-87fe6af2008b} + + + {0c62f4f7-a0e6-4ff2-a4dd-25e3dd79709e} + + + {bf7cf91b-742f-4913-8af2-39ed94d19e23} @@ -1628,12 +1670,6 @@ 02.GameObjects\Item\Broom - - 02.GameObjects\PhysX - - - 02.GameObjects\PhysX - 04.Mechanic\State @@ -1884,7 +1920,7 @@ 04.Mechanic\State\State_Combat\State_Swing - 04.Mechanic\State\State_Combat\State_Blink + 04.Mechanic\State\Movement\State_Blink 02.GameObjects\Item\Goblin_Dagger @@ -1967,9 +2003,6 @@ 02.GameObjects\UI\GamePlay_Canvas\Enemy_Penel - - 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Spector - 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Warrior @@ -2261,6 +2294,33 @@ 02.GameObjects\Effect\MonsterEffect\Ranrok\Ranrok_Point + + + 02.GameObjects\Cameras\Camera_Model + + + 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Assassin + + + 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Assassin + + + 02.GameObjects\Item\Goblin_Sword + + + 04.Mechanic\State\State_Combat\State_Slash + + + 04.Mechanic\State\Movement\Dash + + + 02.GameObjects\Player\Robe + + + 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Spector\Goblin_Warrior_Spector + + + 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Spector\Goblin_Assassin_Spector diff --git a/Jusin154_Team3D/Client/Private/Avadakedavra.cpp b/Jusin154_Team3D/Client/Private/Avadakedavra.cpp index 959c7d120..6296b3046 100644 --- a/Jusin154_Team3D/Client/Private/Avadakedavra.cpp +++ b/Jusin154_Team3D/Client/Private/Avadakedavra.cpp @@ -76,7 +76,9 @@ void CAvadakedavra::Late_Update(_float fTimeDelta) __super::Late_Update(fTimeDelta); - //XMStoreFloat4(&m_vEndPos, m_pStupefy_PJ_PT->Get_WorldPostion()); + if (m_Info.pUnit) { + XMStoreFloat4(&m_vEndPos, m_Info.pUnit->Get_LockOnPos()); + } _vector vDir = XMLoadFloat4(&m_vEndPos) - XMLoadFloat4(&m_vStartPos); @@ -84,7 +86,7 @@ void CAvadakedavra::Late_Update(_float fTimeDelta) if (false == m_bHit) { _vector vStartPos = XMLoadFloat4(&m_vStartPos); _vector vEndPos = XMLoadFloat4(&m_vEndPos); - ON_COLLISION_INFO CollisionInfo = SweepTarget(vStartPos, vEndPos, 0.002f); + ON_COLLISION_INFO CollisionInfo = SweepTarget(vStartPos, vEndPos, 0.2f); OnCollision(this, &CollisionInfo); } diff --git a/Jusin154_Team3D/Client/Private/BroomRaceManager.cpp b/Jusin154_Team3D/Client/Private/BroomRaceManager.cpp index 08a5d9a48..258b6a796 100644 --- a/Jusin154_Team3D/Client/Private/BroomRaceManager.cpp +++ b/Jusin154_Team3D/Client/Private/BroomRaceManager.cpp @@ -251,38 +251,33 @@ void CBroomRaceManager::Check_RingPassed() _vector prevPos = racer.prevPos; - _float d0 = XMVectorGetX( - XMVector3Dot(prevPos - ringPos, ringFwd)); - _float d1 = XMVectorGetX( - XMVector3Dot(currPos - ringPos, ringFwd)); + _float Prev = XMVectorGetX(XMVector3Dot(prevPos - ringPos, ringFwd)); + _float Curr = XMVectorGetX(XMVector3Dot(currPos - ringPos, ringFwd)); #ifdef _DEBUG GUI::Text("%s", racer.pAI ? "AI" : "Player"); GUI::SameLine(); GUI::Text("CurRing %d", racer.curRing); - GUI::Text("PrevSide %.2f", d0); - GUI::Text("CurrSide %.2f", d1); + GUI::Text("PrevSide %.2f", Prev); + GUI::Text("CurrSide %.2f", Curr); #endif // _DEBUG - if (d0 * d1 <= 0.f && fabs(d0 - d1) > 1e-4f) + if (Prev * Curr <= 0.f && fabs(Prev - Curr) > 1e-4f) { - _float t = d0 / (d0 - d1); - t = std::clamp(t, 0.f, 1.f); + _float t = Prev / (Prev - Curr); + t = clamp(t, 0.f, 1.f); - _vector hitPos = - prevPos + (currPos - prevPos) * t; + _vector hitPos = prevPos + (currPos - prevPos) * t; _vector v = hitPos - ringPos; _float side = XMVectorGetX(XMVector3Dot(v, ringFwd)); _vector proj = hitPos - ringFwd * side; - _float dist = - XMVectorGetX(XMVector3Length(proj - ringPos)); + _float dist = XMVectorGetX(XMVector3Length(proj - ringPos)); if (dist <= PASS_RADIUS) { if(racer.pRacer){ pRing->Set_Target(false); } - racer.curRing = (racer.curRing + 1) % m_pRaceRings.size(); diff --git a/Jusin154_Team3D/Client/Private/BroomRacerAI.cpp b/Jusin154_Team3D/Client/Private/BroomRacerAI.cpp index d2f1f3c84..68bcb4d7e 100644 --- a/Jusin154_Team3D/Client/Private/BroomRacerAI.cpp +++ b/Jusin154_Team3D/Client/Private/BroomRacerAI.cpp @@ -174,7 +174,7 @@ HRESULT CBroomRacerAI::Render() } if (m_pModelCom->Get_Type() == MODEL::PBR_ANIM) { - if (FAILED(m_pModelCom->Begin(i, m_pShaderCom, false))) { + if (FAILED(m_pModelCom->Begin(i, m_pShaderCom))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Private/CallBack_EffectHitBox_Behavior.cpp b/Jusin154_Team3D/Client/Private/CallBack_EffectHitBox_Behavior.cpp index 2e11f5720..d71b90b93 100644 --- a/Jusin154_Team3D/Client/Private/CallBack_EffectHitBox_Behavior.cpp +++ b/Jusin154_Team3D/Client/Private/CallBack_EffectHitBox_Behavior.cpp @@ -17,7 +17,7 @@ PSX::PxControllerBehaviorFlags CCallBack_EffectHitBox_Behavior::getBehaviorFlags return PSX::PxControllerBehaviorFlags(0); } PSX::PxControllerBehaviorFlags eResults = PSX::PxControllerBehaviorFlags(0); - PhsXUserData* pActorData = static_cast(actor.userData); + PHYSX_USERDATA* pActorData = static_cast(actor.userData); switch (pActorData->eKind) { case PHYSX_KIND::BODY_STATIC: diff --git a/Jusin154_Team3D/Client/Private/CallBack_EffectHitBox_HitReport.cpp b/Jusin154_Team3D/Client/Private/CallBack_EffectHitBox_HitReport.cpp index 7c3a1370d..e7058f463 100644 --- a/Jusin154_Team3D/Client/Private/CallBack_EffectHitBox_HitReport.cpp +++ b/Jusin154_Team3D/Client/Private/CallBack_EffectHitBox_HitReport.cpp @@ -34,8 +34,8 @@ void CCallBack_EffectHitBox_HitReport::onShapeHit(const PSX::PxControllerShapeHi ON_COLLISION_INFO CollisionDesc = {}; if (nullptr != pController && nullptr != pActor) { - PhsXUserData* pTargetActorData = static_cast(pActor->userData); - PhsXUserData* pOwnerActorData = static_cast(pController->getActor()->userData); + PHYSX_USERDATA* pTargetActorData = static_cast(pActor->userData); + PHYSX_USERDATA* pOwnerActorData = static_cast(pController->getActor()->userData); if (nullptr == pTargetActorData) { // missing user data return; } @@ -119,8 +119,8 @@ void CCallBack_EffectHitBox_HitReport::onControllerHit(const PSX::PxControllersH ON_COLLISION_INFO CollisionDesc = {}; if (nullptr != pController && nullptr != pOtherController) { - PhsXUserData* pTargetActorData = static_cast(pActor->userData); - PhsXUserData* pOwnerActorData = static_cast(pController->getActor()->userData); + PHYSX_USERDATA* pTargetActorData = static_cast(pActor->userData); + PHYSX_USERDATA* pOwnerActorData = static_cast(pController->getActor()->userData); assert(nullptr != pTargetActorData); // missing user data switch (pTargetActorData->eKind) diff --git a/Jusin154_Team3D/Client/Private/CallBack_Monster_Behavior.cpp b/Jusin154_Team3D/Client/Private/CallBack_Monster_Behavior.cpp index e4b961ca8..f27cdeb1b 100644 --- a/Jusin154_Team3D/Client/Private/CallBack_Monster_Behavior.cpp +++ b/Jusin154_Team3D/Client/Private/CallBack_Monster_Behavior.cpp @@ -17,7 +17,7 @@ PSX::PxControllerBehaviorFlags CCallBack_Monster_Behavior::getBehaviorFlags(cons return PSX::PxControllerBehaviorFlags(0); } PSX::PxControllerBehaviorFlags eResults = PSX::PxControllerBehaviorFlags(0); - PhsXUserData* pActorData = static_cast(actor.userData); + PHYSX_USERDATA* pActorData = static_cast(actor.userData); switch (pActorData->eKind) { case PHYSX_KIND::BODY_STATIC: diff --git a/Jusin154_Team3D/Client/Private/CallBack_Monster_HitReport.cpp b/Jusin154_Team3D/Client/Private/CallBack_Monster_HitReport.cpp index f01606d87..728bcf8e4 100644 --- a/Jusin154_Team3D/Client/Private/CallBack_Monster_HitReport.cpp +++ b/Jusin154_Team3D/Client/Private/CallBack_Monster_HitReport.cpp @@ -33,8 +33,8 @@ void CCallBack_Monster_HitReport::onShapeHit(const PSX::PxControllerShapeHit& hi PSX::PxRigidActor* pActor = hit.actor; if (nullptr != pController && nullptr != pActor) { - PhsXUserData* pTargetActorData = static_cast(pActor->userData); - PhsXUserData* pOwnerActorData = static_cast(pController->getActor()->userData); + PHYSX_USERDATA* pTargetActorData = static_cast(pActor->userData); + PHYSX_USERDATA* pOwnerActorData = static_cast(pController->getActor()->userData); if (nullptr == pTargetActorData) { // missing user data return; } @@ -105,8 +105,8 @@ void CCallBack_Monster_HitReport::onControllerHit(const PSX::PxControllersHit& h ON_COLLISION_INFO CollisionDesc = {}; if (nullptr != pController && nullptr != pOtherController) { - PhsXUserData* pTargetActorData = static_cast(pActor->userData); - PhsXUserData* pOwnerActorData = static_cast(pController->getActor()->userData); + PHYSX_USERDATA* pTargetActorData = static_cast(pActor->userData); + PHYSX_USERDATA* pOwnerActorData = static_cast(pController->getActor()->userData); assert(nullptr != pTargetActorData); // missing user data switch (pTargetActorData->eKind) diff --git a/Jusin154_Team3D/Client/Private/CallBack_NonPlayable_Behavior.cpp b/Jusin154_Team3D/Client/Private/CallBack_NonPlayable_Behavior.cpp index 90dce5274..ba7105ea8 100644 --- a/Jusin154_Team3D/Client/Private/CallBack_NonPlayable_Behavior.cpp +++ b/Jusin154_Team3D/Client/Private/CallBack_NonPlayable_Behavior.cpp @@ -17,7 +17,7 @@ PSX::PxControllerBehaviorFlags CCallBack_NonPlayable_Behavior::getBehaviorFlags( return PSX::PxControllerBehaviorFlags(0); } PSX::PxControllerBehaviorFlags eResults = PSX::PxControllerBehaviorFlags(0); - PhsXUserData* pActorData = static_cast(actor.userData); + PHYSX_USERDATA* pActorData = static_cast(actor.userData); switch (pActorData->eKind) { case PHYSX_KIND::BODY_STATIC: diff --git a/Jusin154_Team3D/Client/Private/CallBack_NonPlayable_HitReport.cpp b/Jusin154_Team3D/Client/Private/CallBack_NonPlayable_HitReport.cpp index fe36e9a90..1da0df324 100644 --- a/Jusin154_Team3D/Client/Private/CallBack_NonPlayable_HitReport.cpp +++ b/Jusin154_Team3D/Client/Private/CallBack_NonPlayable_HitReport.cpp @@ -31,8 +31,8 @@ void CCallBack_NonPlayable_HitReport::onShapeHit(const PSX::PxControllerShapeHit PSX::PxRigidActor* pActor = hit.actor; if (nullptr != pController && nullptr != pActor) { - PhsXUserData* pTargetActorData = static_cast(pActor->userData); - PhsXUserData* pOwnerActorData = static_cast(pController->getActor()->userData); + PHYSX_USERDATA* pTargetActorData = static_cast(pActor->userData); + PHYSX_USERDATA* pOwnerActorData = static_cast(pController->getActor()->userData); if (nullptr == pTargetActorData) { // missing user data return; } @@ -110,7 +110,7 @@ void CCallBack_NonPlayable_HitReport::onControllerHit(const PSX::PxControllersHi PSX::PxController* pOtherController = hit.other; // 다른 컨트롤러 if (nullptr != pController && nullptr != pOtherController) { - PhsXUserData* pActorData = static_cast(pOtherController->getActor()->userData); + PHYSX_USERDATA* pActorData = static_cast(pOtherController->getActor()->userData); assert(nullptr != pActorData); // missing user data switch (pActorData->eKind) diff --git a/Jusin154_Team3D/Client/Private/CallBack_Playable_Behavior.cpp b/Jusin154_Team3D/Client/Private/CallBack_Playable_Behavior.cpp index 28678a758..7b55633ab 100644 --- a/Jusin154_Team3D/Client/Private/CallBack_Playable_Behavior.cpp +++ b/Jusin154_Team3D/Client/Private/CallBack_Playable_Behavior.cpp @@ -17,7 +17,7 @@ PSX::PxControllerBehaviorFlags CCallBack_Playable_Behavior::getBehaviorFlags(con return PSX::PxControllerBehaviorFlags(0); } PSX::PxControllerBehaviorFlags eResults = PSX::PxControllerBehaviorFlags(0); - PhsXUserData* pActorData = static_cast(actor.userData); + PHYSX_USERDATA* pActorData = static_cast(actor.userData); switch (pActorData->eKind) { case PHYSX_KIND::BODY_STATIC: diff --git a/Jusin154_Team3D/Client/Private/CallBack_Playable_HitReport.cpp b/Jusin154_Team3D/Client/Private/CallBack_Playable_HitReport.cpp index 25d73a42d..a65b21501 100644 --- a/Jusin154_Team3D/Client/Private/CallBack_Playable_HitReport.cpp +++ b/Jusin154_Team3D/Client/Private/CallBack_Playable_HitReport.cpp @@ -31,8 +31,8 @@ void CCallBack_Playable_HitReport::onShapeHit(const PSX::PxControllerShapeHit& h PSX::PxRigidActor* pActor = hit.actor; if (nullptr != pController && nullptr != pActor) { - PhsXUserData* pTargetActorData = static_cast(pActor->userData); - PhsXUserData* pOwnerActorData = static_cast(pController->getActor()->userData); + PHYSX_USERDATA* pTargetActorData = static_cast(pActor->userData); + PHYSX_USERDATA* pOwnerActorData = static_cast(pController->getActor()->userData); if (nullptr == pTargetActorData) { // missing user data return; } @@ -110,7 +110,7 @@ void CCallBack_Playable_HitReport::onControllerHit(const PSX::PxControllersHit& PSX::PxController* pOtherController = hit.other; // 다른 컨트롤러 if (nullptr != pController && nullptr != pOtherController) { - PhsXUserData* pActorData = static_cast(pOtherController->getActor()->userData); + PHYSX_USERDATA* pActorData = static_cast(pOtherController->getActor()->userData); assert(nullptr != pActorData); // missing user data switch (pActorData->eKind) diff --git a/Jusin154_Team3D/Client/Private/CallBack_Ranrok_HitReport.cpp b/Jusin154_Team3D/Client/Private/CallBack_Ranrok_HitReport.cpp index 1d2fa2d99..d89f0b92a 100644 --- a/Jusin154_Team3D/Client/Private/CallBack_Ranrok_HitReport.cpp +++ b/Jusin154_Team3D/Client/Private/CallBack_Ranrok_HitReport.cpp @@ -34,8 +34,8 @@ void CCallBack_Ranrok_HitReport::onShapeHit(const PSX::PxControllerShapeHit& hit PSX::PxRigidActor* pActor = hit.actor; if (nullptr != pController && nullptr != pActor) { - PhsXUserData* pTargetActorData = static_cast(pActor->userData); - PhsXUserData* pOwnerActorData = static_cast(pController->getActor()->userData); + PHYSX_USERDATA* pTargetActorData = static_cast(pActor->userData); + PHYSX_USERDATA* pOwnerActorData = static_cast(pController->getActor()->userData); if (nullptr == pTargetActorData) { // missing user data return; } @@ -106,8 +106,8 @@ void CCallBack_Ranrok_HitReport::onControllerHit(const PSX::PxControllersHit& hi ON_COLLISION_INFO CollisionDesc = {}; if (nullptr != pController && nullptr != pOtherController) { - PhsXUserData* pTargetActorData = static_cast(pActor->userData); - PhsXUserData* pOwnerActorData = static_cast(pController->getActor()->userData); + PHYSX_USERDATA* pTargetActorData = static_cast(pActor->userData); + PHYSX_USERDATA* pOwnerActorData = static_cast(pController->getActor()->userData); assert(nullptr != pTargetActorData); // missing user data switch (pTargetActorData->eKind) diff --git a/Jusin154_Team3D/Client/Private/CallBack_Troll_HitReport.cpp b/Jusin154_Team3D/Client/Private/CallBack_Troll_HitReport.cpp index b7d81f51a..b973b2653 100644 --- a/Jusin154_Team3D/Client/Private/CallBack_Troll_HitReport.cpp +++ b/Jusin154_Team3D/Client/Private/CallBack_Troll_HitReport.cpp @@ -34,8 +34,8 @@ void CCallBack_Troll_HitReport::onShapeHit(const PSX::PxControllerShapeHit& hit) PSX::PxRigidActor* pActor = hit.actor; if (nullptr != pController && nullptr != pActor) { - PhsXUserData* pTargetActorData = static_cast(pActor->userData); - PhsXUserData* pOwnerActorData = static_cast(pController->getActor()->userData); + PHYSX_USERDATA* pTargetActorData = static_cast(pActor->userData); + PHYSX_USERDATA* pOwnerActorData = static_cast(pController->getActor()->userData); if (nullptr == pTargetActorData) { // missing user data return; } @@ -117,8 +117,8 @@ void CCallBack_Troll_HitReport::onControllerHit(const PSX::PxControllersHit& hit PSX::PxActor* pActor = pOtherController->getActor(); if (nullptr != pController && nullptr != pOtherController) { - PhsXUserData* pTargetActorData = static_cast(pActor->userData); - PhsXUserData* pOwnerActorData = static_cast(pController->getActor()->userData); + PHYSX_USERDATA* pTargetActorData = static_cast(pActor->userData); + PHYSX_USERDATA* pOwnerActorData = static_cast(pController->getActor()->userData); assert(nullptr != pTargetActorData); // missing user data diff --git a/Jusin154_Team3D/Client/Private/CamPosition_Socket.cpp b/Jusin154_Team3D/Client/Private/CamPosition_Socket.cpp index 14f9d07b9..afd31ccf9 100644 --- a/Jusin154_Team3D/Client/Private/CamPosition_Socket.cpp +++ b/Jusin154_Team3D/Client/Private/CamPosition_Socket.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 (pArg); - //m_pSocketMatrices = pDesc->pSocketMatrices; + //m_pSocketMatrix = pDesc->pSocketMatrix; if (FAILED(__super::Initialize(pArg))) { return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Camera_Model.cpp b/Jusin154_Team3D/Client/Private/Camera_Model.cpp new file mode 100644 index 000000000..2038d0675 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Camera_Model.cpp @@ -0,0 +1,246 @@ +#include "pch.h" +#include "Camera_Model.h" +#include "Shader.h" +#include "Layer.h" +#include "Player.h" + + +CCamera_Model::CCamera_Model(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CCamera(pDevice, pContext) +{ +} + +CCamera_Model::CCamera_Model(const CCamera_Model& rhs) + : CCamera(rhs) +{ +} + +void CCamera_Model::Priority_Update(_float fTimeDelta) +{ +#ifdef _DEBUG + m_pGameInstance->Bind_Camera(NEXT_LEVEL, CAMERA_MODEL, false); +#endif // _DEBUG + + if (FAILED(m_pGameInstance->IsBinded_Camera(CAMERA_MODEL))) { + return; + } + //Transition(fTimeDelta); + _float3 vCamPos = {}; + _float3 vSetPos = {}; + XMStoreFloat3(&vCamPos, m_pTransformCom->Get_State(STATE::POSITION)); +#ifdef _DEBUG + GUI::Text("Cam Coord %.2f, %.2f, %.2f", vCamPos.x, vCamPos.y, vCamPos.z); +#endif // _DEBUG + + if (m_pGameInstance->Key_Up(DIK_GRAVE)) { + m_bMovable = !m_bMovable; + } + if (m_pGameInstance->Mouse_Down(DIM_MBUTTON)) { + m_pGameInstance->Toggle_MouseCenter(); + } + + __super::Bind_Matrices(); +} + +void CCamera_Model::Update(_float fTimeDelta) +{ + m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); + + +#ifdef _DEBUG + Describe_Entity(); +#endif // _DEBUG +} + +void CCamera_Model::Late_Update(_float fTimeDelta) +{ + /*if (FAILED(m_pGameInstance->IsBinded_Camera(CAMERA_MODEL))) { + return; + }*/ + + auto M = m_pModelCom->Get_BoneMatrix("lookat_target"); + GUI::Text("Bone T: %.3f %.3f %.3f", M.r[3].m128_f32[0], M.r[3].m128_f32[1], M.r[3].m128_f32[2]); + + + _vector vTargetPos = m_pModelCom->Get_BoneMatrix("lookat_target").r[3]; + + m_pTransformCom->LookAt( + XMVectorSetW(vTargetPos, 1.f) + ); + +// m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); +} + +HRESULT CCamera_Model::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + + _uint iNumMeshes = m_pModelCom->Get_NumMeshes(); + + for (_uint i = 0; i < iNumMeshes; i++) + { + + if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_Matrices( + "g_OffsetMatrix", + m_pModelCom->Get_OffsetMatrix(i).data(), + (_int)m_pModelCom->Get_OffsetMatrix(i).size() + ))) + { + return E_FAIL; + } + + + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) { + return E_FAIL; + } + + m_pModelCom->Bind_OutPut_SRV_VS(31, 0); + m_pModelCom->Bind_OutPut_SRV_VS_Prev(32, 0); + + + if (FAILED(m_pModelCom->Render(i))) { + return E_FAIL; + } + } + + return S_OK; +} + +HRESULT CCamera_Model::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CCamera_Model::Initialize(void* pArg) +{ + CAMERA_MODEL_DESC* pDesc = static_cast(pArg); + + if (FAILED(__super::Initialize(pArg))) { + return E_FAIL; + } + + if (FAILED(Ready_Components(pArg))) { + return E_FAIL; + } + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vEye), 1.f)); + m_pTransformCom->LookAt(XMVectorSetW(XMLoadFloat3(&pDesc->vAt), 1.f)); + m_matInitial = *m_pTransformCom->Get_WorldMatrixPtr(); + m_bActive = true; + + + m_pModelCom->Set_Temp(true); + return S_OK; +} + +HRESULT CCamera_Model::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_CCL_CameraRig.001_Model"), + reinterpret_cast(&m_pModelCom)))) { + return E_FAIL; + } + + + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_ANIMMESH, + reinterpret_cast(&m_pShaderCom)))) { + return E_FAIL; + } + + + return S_OK; +} + +HRESULT CCamera_Model::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) { + return E_FAIL; + } +#ifdef 기무리 + if (FAILED(m_pShaderCom->Bind_Matrix("g_PrevWorldMatrix", m_pTransformCom->Get_PrevWorldMatrixPtr()))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevViewMatrix", D3DTS::VIEW))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevProjMatrix", D3DTS::PROJ))) { + return E_FAIL; + } +#endif // 기무리 + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { + return E_FAIL; + } + return S_OK; +} + +void CCamera_Model::Set_InitialPos() +{ + m_pTransformCom->Set_WorldMatrix(m_matInitial); +} + +CCamera_Model* CCamera_Model::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CCamera_Model* pInstance = new CCamera_Model(pDevice, pContext); + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CCamera_Model"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CCamera_Model::Clone(void* pArg, CGameObject* pOwner) +{ + CCamera_Model* pInstance = new CCamera_Model(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CCamera_Model"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CCamera_Model::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pModelCom); + SAFE_RELEASE(m_pShaderCom); +} +#ifdef _DEBUG + +void CCamera_Model::Describe_Entity() +{ + _float3 vPosition = {}; + GUI::Begin("CameraAnim List"); + for (_int i = 0; i < m_pModelCom->Get_AnimSize(); i++) + { + if (GUI::Button(m_pModelCom->Get_AnimList(i))) + { + m_pModelCom->Set_AnimationIndex(i); + } + } + + + GUI::End(); +} + +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Dummy_PhysXPlayable.cpp b/Jusin154_Team3D/Client/Private/Dummy_PhysXPlayable.cpp deleted file mode 100644 index 0e4bef5a7..000000000 --- a/Jusin154_Team3D/Client/Private/Dummy_PhysXPlayable.cpp +++ /dev/null @@ -1,232 +0,0 @@ -#include "pch.h" -#include "Dummy_PhysXPlayable.h" -#include "GameInstance.h" - -CDummy_PhysXPlayable::CDummy_PhysXPlayable(ID3D11Device* pDevice, ID3D11DeviceContext* pContext): - CGameObject(pDevice, pContext) -{ -} - -CDummy_PhysXPlayable::CDummy_PhysXPlayable(const CDummy_PhysXPlayable& rhs): - CGameObject(rhs) -{ -} - -void CDummy_PhysXPlayable::Priority_Update(_float fTimeDelta) -{ - m_pTransformCom->RewindMomentum(); - m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position()); -} - -void CDummy_PhysXPlayable::Update(_float fTimeDelta) -{ - if (m_pGameInstance->Key_Pressing(DIK_UPARROW)) { - m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 0.f, 1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); - } - if (m_pGameInstance->Key_Pressing(DIK_LEFT)) { - m_pTransformCom->AccumulateMomentum(XMVectorSet(-1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); - } - if (m_pGameInstance->Key_Pressing(DIK_DOWN)) { - m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 0.f, -1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); - } - if (m_pGameInstance->Key_Pressing(DIK_RIGHT)) { - m_pTransformCom->AccumulateMomentum(XMVectorSet(1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); - } - if (m_pGameInstance->Key_Pressing(DIK_LCONTROL)) { - if (m_pGameInstance->Key_Pressing(DIK_SPACE)) { - m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 10.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); - } - if (m_pGameInstance->Key_Pressing(DIK_C)) { - m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, -10.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); - } - if (m_pGameInstance->Key_Down(DIK_V)) { - m_pGameInstance->Detach_Actor(*m_pCharacter_Controller->Get_Actor(), m_pGameInstance->Get_CurrentLevelID()); - } - } - else { - if (m_pGameInstance->Key_Down(DIK_V)) { - m_pGameInstance->Attach_Actor(*m_pCharacter_Controller->Get_Actor(), m_pGameInstance->Get_CurrentLevelID()); - } - } - m_pCharacter_Controller->Move(fTimeDelta); -} - -void CDummy_PhysXPlayable::Late_Update(_float fTimeDelta) -{ -#ifdef _DEBUG - Describe_Entity(); -#endif // _DEBUG - - if (m_pGameInstance->IsIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) { - m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this); - } -} - -HRESULT CDummy_PhysXPlayable::Render() -{ - //if (FAILED(Bind_ShaderResources())) { - // return E_FAIL; - //} - - //if (FAILED(m_pModelCom->Bind_Material(0, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) { - // return E_FAIL; - //} - //if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) { - // return E_FAIL; - //} - - //if (FAILED(m_pModelCom->Render(0))) { - // return E_FAIL; - //} -#ifdef _DEBUG - if (FAILED(m_pCharacter_Controller->Render())) { - return E_FAIL; - } -#endif // _DEBUG - - return S_OK; -} - -HRESULT CDummy_PhysXPlayable::Initialize_Prototype() -{ - return S_OK; -} - -HRESULT CDummy_PhysXPlayable::Initialize(void* pArg) -{ - if (FAILED(__super::Initialize(pArg))) { - return E_FAIL; - } - - if (FAILED(Ready_Components(pArg))) { - return E_FAIL; - } - - m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody); - m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody); - - return S_OK; -} - -HRESULT CDummy_PhysXPlayable::Ready_Components(void* pArg) -{ - CTransform::TRANSFORM_DESC TransformDesc{}; - TransformDesc.fRadius = 100.f; - TransformDesc.fRotationPerSec = XMConvertToRadians(60.f); - TransformDesc.fSpeedPerSec = 15.f; - if (FAILED(__super::Ready_Components(&TransformDesc))) { - return E_FAIL; - } - PHYSXDUMMY_DESC* pDesc = static_cast(pArg); - m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vPos), 1.f)); - m_pTransformCom->Rotation(pDesc->vRotRPY.x, pDesc->vRotRPY.y, pDesc->vRotRPY.z); - { // CCT - CCharacter_Controller::Character_Controller_DESC Desc{}; - - Desc.iSubKind = pDesc->iSubKind; - Desc.pTransform = m_pTransformCom; - Desc.eBodyType = ACTOR::CAPSULE; - Desc.fContactOffset = 0.001f; - Desc.fMaterial = { 0.5f, 0.5f, 0.6f }; - Desc.bAutoStepping = { false }; - Desc.fStepOffset = { 0.02f }; - Desc.fRadius = 0.5f; - Desc.fHeight = 1.0f; - Desc.pCallback_HitReport = m_pCallBack_HitReport = CCallBack_Playable_HitReport::Create(); - Desc.pCallback_Behavior = m_pCallBack_Behavior = CCallBack_Playable_Behavior::Create(); - Desc.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY; - Desc.fWalkableSlope = 45.f; - if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), (CComponent**)&m_pCharacter_Controller, &Desc))) { - return E_FAIL; - } - } - m_pCharacter_Controller->Set_Position(m_pTransformCom->Get_State(STATE::POSITION)); - { // DO - CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; - Desc.iSubKind = pDesc->iSubKind; - if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), (CComponent**)&m_pRigidBody, &Desc))) { - return E_FAIL; - } - m_pGameInstance->Detach_Actor(*m_pRigidBody->Get_Actor(), NEXT_LEVEL); - } - /* Com_Shader */ - if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH, - reinterpret_cast(&m_pShaderCom)))){ - return E_FAIL; - } - - if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Box"), (CComponent**)&m_pModelCom))) { - return E_FAIL; - } - - - return S_OK; -} - -HRESULT CDummy_PhysXPlayable::Bind_ShaderResources() -{ - if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { - return E_FAIL; - } - if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) { - return E_FAIL; - } - if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) { - return E_FAIL; - } - if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { - return E_FAIL; - } - return S_OK; -} - -CDummy_PhysXPlayable* CDummy_PhysXPlayable::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) -{ - CDummy_PhysXPlayable* pInstance = new CDummy_PhysXPlayable(pDevice, pContext); - - if (FAILED(pInstance->Initialize_Prototype())) - { - MSG_BOX("Failed to Created : CDummy_PhysXPlayable"); - SAFE_RELEASE(pInstance); - } - - return pInstance; -} - -CGameObject* CDummy_PhysXPlayable::Clone(void* pArg, CGameObject* pOwner) -{ - CDummy_PhysXPlayable* pInstance = new CDummy_PhysXPlayable(*this); - pInstance->m_pOwner = pOwner; - if (FAILED(pInstance->Initialize(pArg))) - { - MSG_BOX("Failed to Cloned : CDummy_PhysXPlayable"); - SAFE_RELEASE(pInstance); - } - - return pInstance; -} - -void CDummy_PhysXPlayable::Free() -{ - __super::Free(); - if (nullptr != m_pCallBack_Behavior) { - m_pCallBack_Behavior->Finalize(); - } - if (nullptr != m_pCallBack_HitReport) { - m_pCallBack_HitReport->Finalize(); - } - SAFE_RELEASE(m_pCharacter_Controller); - SAFE_RELEASE(m_pRigidBody); - Safe_Delete(m_pCallBack_Behavior); - Safe_Delete(m_pCallBack_HitReport); - SAFE_RELEASE(m_pShaderCom); - SAFE_RELEASE(m_pModelCom); -} -#ifdef _DEBUG - -void CDummy_PhysXPlayable::Describe_Entity() -{ - m_pCharacter_Controller->Describe_Entity(); -} - -#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Dummy_PhysXWall.cpp b/Jusin154_Team3D/Client/Private/Dummy_PhysXWall.cpp deleted file mode 100644 index 9aa7c5bb8..000000000 --- a/Jusin154_Team3D/Client/Private/Dummy_PhysXWall.cpp +++ /dev/null @@ -1,170 +0,0 @@ -#include "pch.h" -#include "Dummy_PhysXWall.h" - -#include "GameInstance.h" - - -CDummy_PhysXWall::CDummy_PhysXWall(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) - : CGameObject{ pDevice, pContext } -{ -} - -CDummy_PhysXWall::CDummy_PhysXWall(const CDummy_PhysXWall& rhs) - : CGameObject(rhs) -{ -} - -HRESULT CDummy_PhysXWall::Initialize_Prototype() -{ - return S_OK; -} - -HRESULT CDummy_PhysXWall::Initialize(void* pArg) -{ - if (FAILED(__super::Initialize(pArg))) { - return E_FAIL; - } - - if (FAILED(Ready_Components(pArg))) { - return E_FAIL; - } - - return S_OK; -} - -void CDummy_PhysXWall::Priority_Update(_float fTimeDelta) -{ - -} - -void CDummy_PhysXWall::Update(_float fTimeDelta) -{ -} - -void CDummy_PhysXWall::Late_Update(_float fTimeDelta) -{ - m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this); -} - -HRESULT CDummy_PhysXWall::Render() -{ - //if (FAILED(Bind_ShaderResources())) { - // return E_FAIL; - //} - - //if (FAILED(m_pModelCom->Bind_Material(0, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) { - // return E_FAIL; - //} - //if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) { - // return E_FAIL; - //} - - //if (FAILED(m_pModelCom->Render(0))) { - // return E_FAIL; - //} -#ifdef _DEBUG - if (FAILED(m_pRigidBody->Render())) { - return E_FAIL; - } -#endif // _DEBUG - - - return S_OK; -} - -HRESULT CDummy_PhysXWall::Ready_Components(void* pArg) -{ - if (FAILED(__super::Ready_Components(pArg))) { - return E_FAIL; - } - PHYSXDUMMY_DESC* pPhysXDummyDesc = static_cast(pArg); - - m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pPhysXDummyDesc->vPos), 1.f)); - m_pTransformCom->Rotation(pPhysXDummyDesc->vRotRPY.x, pPhysXDummyDesc->vRotRPY.y, pPhysXDummyDesc->vRotRPY.z); - - - { // RIGID_BODY - CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; - Desc.iSubKind = pPhysXDummyDesc->iSubKind; - if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_HEAVY_WALL"), (CComponent**)&m_pRigidBody, &Desc))) { - return E_FAIL; - } - } - - /* Com_Shader */ - if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH, - reinterpret_cast(&m_pShaderCom)))) { - return E_FAIL; - } - - if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Box"), (CComponent**)&m_pModelCom))) { - return E_FAIL; - } - - - return S_OK; -} - -HRESULT CDummy_PhysXWall::Bind_ShaderResources() -{ - if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { - return E_FAIL; - } - if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) { - return E_FAIL; - } - if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) { - return E_FAIL; - } - - if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { - return E_FAIL; - } - return S_OK; -} - -CDummy_PhysXWall* CDummy_PhysXWall::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) -{ - CDummy_PhysXWall* pInstance = new CDummy_PhysXWall(pDevice, pContext); - - if (FAILED(pInstance->Initialize_Prototype())) - { - MSG_BOX("Failed to Created : CDummy_PhysXWall"); - SAFE_RELEASE(pInstance); - } - - return pInstance; -} - -CGameObject* CDummy_PhysXWall::Clone(void* pArg, CGameObject* pOwner) -{ - CDummy_PhysXWall* pInstance = new CDummy_PhysXWall(*this); - pInstance->m_pOwner = pOwner; - if (FAILED(pInstance->Initialize(pArg))) - { - MSG_BOX("Failed to Cloned : CDummy_PhysXWall"); - SAFE_RELEASE(pInstance); - } - - return pInstance; -} - -void CDummy_PhysXWall::Free() -{ - //if (nullptr != m_pRigidBody) { - // m_pGameInstance->Release_Actor(*m_pRigidBody->Get_Actor(), m_pGameInstance->Get_CurrentLevelID()); - //} - - __super::Free(); - - SAFE_RELEASE(m_pRigidBody); - SAFE_RELEASE(m_pShaderCom); - SAFE_RELEASE(m_pModelCom); -} -#ifdef _DEBUG - -void CDummy_PhysXWall::Describe_Entity() -{ -} - -#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Effect_Container.cpp b/Jusin154_Team3D/Client/Private/Effect_Container.cpp index cc936d3a9..e0588e643 100644 --- a/Jusin154_Team3D/Client/Private/Effect_Container.cpp +++ b/Jusin154_Team3D/Client/Private/Effect_Container.cpp @@ -652,7 +652,7 @@ _int CEffect_Container::CollisionCheck() if (nullptr != pActor && nullptr != pActor->userData) { - PhsXUserData* pUserData = static_cast(pActor->userData); + PHYSX_USERDATA* pUserData = static_cast(pActor->userData); if (pUserData->iSubKind >= UINT_MAX - 1) { continue; @@ -666,6 +666,7 @@ _int CEffect_Container::CollisionCheck() case PXOBJECT::GOBLIN_WARRIOR: case PXOBJECT::GOBLIN_MAGICIAN: case PXOBJECT::TROLL: + case PXOBJECT::RANROK: case PXOBJECT::WALL: { return i; @@ -725,11 +726,22 @@ ON_COLLISION_INFO CEffect_Container::SweepTarget(_vector StartPos, _vector EndPo if (nullptr != pActor && nullptr != pActor->userData) { - PhsXUserData* pUserData = static_cast(pActor->userData); + PHYSX_USERDATA* pUserData = static_cast(pActor->userData); tagCollInfo.pObject = pUserData->pOwner; switch (pUserData->eKind) { + case PHYSX_KIND::BODY_DYNAMIC: + switch (PXOBJECT(pUserData->iSubKind)) + { + case PXOBJECT::GOBLIN_PROTEGO: + { + pUserData->pOwner->OnCollision(this, &tagCollInfo); + m_bHit = true; + } + break; + } + break; case PHYSX_KIND::CCTActor: { switch (PXOBJECT(pUserData->iSubKind)) @@ -792,7 +804,7 @@ ON_COLLISION_INFO CEffect_Container::SweepTarget(_vector StartPos, _vector EndPo if (nullptr != pActor && nullptr != pActor->userData) { - PhsXUserData* pUserData = static_cast(pActor->userData); + PHYSX_USERDATA* pUserData = static_cast(pActor->userData); tagCollInfo.pObject = pUserData->pOwner; switch (PXOBJECT(pUserData->iSubKind)) @@ -844,11 +856,22 @@ ON_COLLISION_INFO CEffect_Container::MonsterSweepTarget(_vector StartPos, _vecto if (nullptr != pActor && nullptr != pActor->userData) { - PhsXUserData* pUserData = static_cast(pActor->userData); + PHYSX_USERDATA* pUserData = static_cast(pActor->userData); tagCollInfo.pObject = pUserData->pOwner; switch (pUserData->eKind) { + case PHYSX_KIND::BODY_DYNAMIC: + switch (PXOBJECT(pUserData->iSubKind)) + { + case PXOBJECT::SKILL_PROTEGO: + { + pUserData->pOwner->OnCollision(this, &tagCollInfo); + m_bHit = true; + } + break; + } + break; case PHYSX_KIND::CCTActor: { switch (PXOBJECT(pUserData->iSubKind)) @@ -860,11 +883,7 @@ ON_COLLISION_INFO CEffect_Container::MonsterSweepTarget(_vector StartPos, _vecto m_bHit = true; } break; - case PXOBJECT::SKILL_PROTEGO: - { - pUserData->pOwner->OnCollision(this, &tagCollInfo); - m_bHit = true; - } + } } } @@ -898,7 +917,7 @@ ON_COLLISION_INFO CEffect_Container::MonsterSweepTarget(_vector StartPos, _vecto if (nullptr != pActor && nullptr != pActor->userData) { - PhsXUserData* pUserData = static_cast(pActor->userData); + PHYSX_USERDATA* pUserData = static_cast(pActor->userData); tagCollInfo.pObject = pUserData->pOwner; switch (PXOBJECT(pUserData->iSubKind)) @@ -952,7 +971,7 @@ ON_COLLISION_INFO CEffect_Container::MonsterRayCast(_vector StartPos, _vector _v if (nullptr != pActor && nullptr != pActor->userData) { - PhsXUserData* pUserData = static_cast(pActor->userData); + PHYSX_USERDATA* pUserData = static_cast(pActor->userData); tagCollInfo.pObject = pUserData->pOwner; switch (pUserData->eKind) diff --git a/Jusin154_Team3D/Client/Private/Goblin.cpp b/Jusin154_Team3D/Client/Private/Goblin.cpp index 77e3a906f..bf67a4832 100644 --- a/Jusin154_Team3D/Client/Private/Goblin.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin.cpp @@ -340,6 +340,12 @@ void CGoblin::OnCollision(CGameObject* pOther, void* pDesc) case ENUM_CLASS(SKILL_TYPE::STUPEFY): m_eHitSpell = ENUM_CLASS(SKILL_TYPE::STUPEFY); break; + case ENUM_CLASS(SKILL_TYPE::AVADAKEDAVRA): + m_eHitSpell = ENUM_CLASS(SKILL_TYPE::AVADAKEDAVRA); + break; + case ENUM_CLASS(SKILL_TYPE::ANCIENT_MAGIC): + m_eHitSpell = ENUM_CLASS(SKILL_TYPE::ANCIENT_MAGIC); + break; } } else diff --git a/Jusin154_Team3D/Client/Private/Goblin_Assassin.cpp b/Jusin154_Team3D/Client/Private/Goblin_Assassin.cpp new file mode 100644 index 000000000..f5fe540ec --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Goblin_Assassin.cpp @@ -0,0 +1,687 @@ +#include "pch.h" +#include "Goblin_Assassin.h" + +#include "GameInstance.h" +#include "InfoInstance.h" +#include "Layer.h" +#include "Player.h" +#include "Goblin_Sword.h" +#include "Goblin_Assassin_Spector.h" +#include "Effect_Container.h" +#include "EffectPool.h" +#include "MapElement_Interactable.h" + +#include "EffectParts.h" + + +CGoblin_Assassin::CGoblin_Assassin(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CMonster(pDevice, pContext) +{ +} + +CGoblin_Assassin::CGoblin_Assassin(const CGoblin_Assassin& Prototype) + : CMonster(Prototype) +{ +} + +HRESULT CGoblin_Assassin::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CGoblin_Assassin::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components())) + return E_FAIL; + + if (FAILED(Ready_Parts())) + return E_FAIL; + + Add_FSM(); + + Set_Anim(); + + { + CFSM::FSM_DESC FSMDesc{}; + FSMDesc.pStates = &m_States; + FSMDesc.pStateMask = &m_iStateMask; + + m_pFSM->Bind_States(FSMDesc); + m_pFSM->Change_State(FSMSTATE::IDLE); + } + + m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody); + m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody); + + + m_pCharacter_Controller->Set_Position(XMVectorSet(-52.f, 0.f, -14.f, 1.f)); + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(-52.f, 0.f, -14.f, 1.f)); + + + m_pEffectPool = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_EffectPool"))->Get_Object(); + SAFE_ADDREF(m_pEffectPool); + + m_pModelCom->Set_Temp(true); + + return S_OK; +} + +void CGoblin_Assassin::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); +} + +void CGoblin_Assassin::Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + m_pFSM->Update_State(fTimeDelta); + + m_pModelCom->Play_Animation(fTimeDelta * m_fEasing, m_pTransformCom); + + __super::Update(fTimeDelta); + + Play_Event(); + + if (true == m_pCharacter_Controller->IsActive()) { + { // 세트 + m_pCallBack_HitReport->BeginFrame(); + m_pCharacter_Controller->Move(fTimeDelta); + m_pCallBack_HitReport->Set_CurrentSlop(); + } + m_vStunTimer.x = 0.f; + } + else if (true == m_pRigidBody->IsActive()) { + if (0.f == m_vStunTimer.x) { + PSX::PxExtendedVec3 pxControlllerPos = m_pCharacter_Controller->Get_Controller()->getPosition(); + PSX::PxTransform pxTransform((_float)pxControlllerPos.x, (_float)pxControlllerPos.y + 100.f, (_float)pxControlllerPos.z); + m_pCharacter_Controller->Set_Position(XMLoadFloat3((_float3*)&pxTransform.p)); + //m_pCharacter_Controller->Move(fTimeDelta); + } + m_vStunTimer.x += fTimeDelta; + m_pTransformCom->Set_WorldMatrix(m_pRigidBody->Get_Actor()->getGlobalPose()); + if (m_vStunTimer.y < m_vStunTimer.x) { + m_pRigidBody->ConvertToCCT(*m_pCharacter_Controller); + } + } +#ifdef _DEBUG + Describe_Entity(); +#endif // _DEBUG + + for (_uint i = 0; i < ENUM_CLASS(GOBLIN_ASSASSIN_SKILL::END); i++) + m_fSkillCoolTime[i] = max(0.f, m_fSkillCoolTime[i] - fTimeDelta); + + + //m_pDetection->Set_Active(m_bDetection); + + + if (m_bDisolve) { + m_fDisolveTime += fTimeDelta*0.8f; + if (m_fDisolveTime >= 1.f) + { + m_fDisolveTime = 0.f; + m_bDisolve = false; + } + } +} + +void CGoblin_Assassin::Late_Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Late_Update(fTimeDelta); + if (true == m_pCharacter_Controller->IsActive()) { + m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_FootPosition()); + } + else if (true == m_pRigidBody->IsActive()) { + m_pTransformCom->Set_WorldMatrix(m_pRigidBody->Get_FootPositionPxTransform()); + } + if (true == m_bLookAt) { + m_pTransformCom->LookAt_Horizontal_Lerp(XMLoadFloat4(&m_vTargetPos), fTimeDelta, 3.f); + } + + m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); + + Set_Shadow(m_pGameInstance->IsIn_ShadowViewFrustum(m_pTransformCom->Get_State(STATE::POSITION), m_pTransformCom->Get_Radius())); +} + +HRESULT CGoblin_Assassin::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + + if (FAILED(Render_DeadDisolve())) { + return E_FAIL; + } + _uint iNumMeshes = m_pModelCom->Get_NumMeshes(); + for (_uint i = 0; i < iNumMeshes; i++) + { + if (FAILED(m_pShaderCom->Bind_Matrices( + "g_OffsetMatrix", + m_pModelCom->Get_OffsetMatrix(i).data(), + (_int)m_pModelCom->Get_OffsetMatrix(i).size() + ))) + { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Begin(i, m_pShaderCom))) { + return E_FAIL; + } + + m_pModelCom->Bind_OutPut_SRV_VS(26, 0); + m_pModelCom->Bind_OutPut_SRV_VS_Prev(27, 0); + + if (true == m_bDrawOutLine) { + m_pGameInstance->Begin_OutLine_Write(2); + } + if (FAILED(m_pModelCom->Render(i))) { + return E_FAIL; + } + + if (true == m_bDrawOutLine) { + m_pGameInstance->End_OutLine_Write(); + } + } + + if (true == m_bDrawOutLine) { + Render_OutLine(); + } + +#ifdef _DEBUG + //if (true == m_pCharacter_Controller->IsActive()) { + // if (FAILED(m_pCharacter_Controller->Render())) { + // return E_FAIL; + // } + //} + //else { + // if (FAILED(m_pRigidBody->Render())) { + // return E_FAIL; + // } + //} +#endif + + if (0.f < m_fDeadRatio) { + _bool bDisolve = false; + if (FAILED(m_pShaderCom->Bind_RawValue("g_bDisolve", &bDisolve, sizeof(_bool)))) { + return E_FAIL; + } + } + + return S_OK; +} + +HRESULT CGoblin_Assassin::Render_OutLine() +{ + m_bDrawOutLine = false; + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + + Compute_Depth(); + _float fRatio = CMyTools::Saturate((m_fCamDepth / *m_pGameInstance->Get_CurrentCameraFar())); + m_fOutLineThickness = CMyTools::Lerp_f1D(0.01f, 0.1f, fRatio); + if (FAILED(m_pShaderCom->Bind_Matrix("g_PrevWorldMatrix", m_pTransformCom->Get_PrevWorldMatrixPtr()))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevViewMatrix", D3DTS::VIEW))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevProjMatrix", D3DTS::PROJ))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_vOutLineColor", &m_vOutLineColor, sizeof(_float3)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOutLineThickness", &m_fOutLineThickness, sizeof(_float)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOutLineScale", &m_fOutLineScale, sizeof(_float)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOutLinePower", &m_fOutLinePower, sizeof(_float)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_vCamPosition", m_pGameInstance->Get_CamPosition(), sizeof(_float4)))) { + return E_FAIL; + } + _uint iNumMeshes = m_pModelCom->Get_NumMeshes(); + + for (_uint i = 0; i < iNumMeshes; i++) + { + if (FAILED(m_pShaderCom->Bind_Matrices( + "g_OffsetMatrix", + m_pModelCom->Get_OffsetMatrix(i).data(), + (_int)m_pModelCom->Get_OffsetMatrix(i).size() + ))) + { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_NPC_PBR_ANIM::OUTLINE_READ)))) { + return E_FAIL; + } + + m_pModelCom->Bind_OutPut_SRV_VS(26, 0); + m_pModelCom->Bind_OutPut_SRV_VS_Prev(27, 0); + + if (FAILED(m_pModelCom->Render(i))) { + return E_FAIL; + } + } + return S_OK; +} + +HRESULT CGoblin_Assassin::Render_Shadow(SHADOW eType) +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_Shadow_Resource(m_pShaderCom, "g_ViewMatrix", D3DTS::VIEW, eType))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_Shadow_Resource(m_pShaderCom, "g_ProjMatrix", D3DTS::PROJ, eType))) { + return E_FAIL; + } + _uint iNumMeshes = m_pModelCom->Get_NumMeshes(); + for (_uint i = 0; i < iNumMeshes; i++) + { + if (FAILED(m_pShaderCom->Bind_Matrices( + "g_OffsetMatrix", + m_pModelCom->Get_OffsetMatrix(i).data(), + (_int)m_pModelCom->Get_OffsetMatrix(i).size() + ))) + { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Begin(i, m_pShaderCom))) { + return E_FAIL; + } + + m_pModelCom->Bind_OutPut_SRV_VS(26, 0); + + if (FAILED(m_pModelCom->Render(i))) { + return E_FAIL; + } + } + + return S_OK; +} + +_vector CGoblin_Assassin::Get_LockOnPos() +{ + if (nullptr != m_pCharacter_Controller && true == m_pCharacter_Controller->IsActive()) { + return m_pCharacter_Controller->Get_Position(); + } + else if (nullptr != m_pRigidBody) { + return m_pRigidBody->Get_Position(); + } + return Get_WorldPostion(); +} + +void CGoblin_Assassin::OnCollision(CGameObject* pOther, void* pDesc) +{ + if (true == m_bDead) { + return; + } + if (m_pFSM->IsEnable(FSMSTATE::BLINK)) { + return; + } + m_DamageInfo.vTarget_Pos = m_pCharacter_Controller->Get_HeadPosition(); + +// m_pGoblinSpector->Set_Visible(false); + ON_COLLISION_INFO* CollisionDesc = static_cast(pDesc); + + Check_HitAngle(XMLoadFloat4(&CollisionDesc->vHitDir)); + + m_fHitRadius = CMyTools::Get_Direction2D(m_pTransformCom->Get_State(STATE::LOOK), XMLoadFloat4(&CollisionDesc->vHitDir)); + + CEffect_Container* pEffect_Container = dynamic_cast(pOther); + + pair<_float, _float> damagePair = {}; + + if (pEffect_Container != nullptr) + { + _uint iSkillType = pEffect_Container->Get_SkillType(); + //damagePair = Get_Damage(m_pInfoInstance->Get_Spell_Damage(iSkillType)); + + switch (iSkillType) + { + case ENUM_CLASS(SKILL_TYPE::DESCENDO): + m_eHitSpell = ENUM_CLASS(SKILL_TYPE::DESCENDO); + break; + case ENUM_CLASS(SKILL_TYPE::BOMBARDA): + m_eHitSpell = ENUM_CLASS(SKILL_TYPE::BOMBARDA); + break; + case ENUM_CLASS(SKILL_TYPE::JAP): + m_eHitSpell = ENUM_CLASS(SKILL_TYPE::JAP); + m_fTumbleTimer = 0.f; + break; + case ENUM_CLASS(SKILL_TYPE::LEVIOSO): + m_eHitSpell = ENUM_CLASS(SKILL_TYPE::LEVIOSO); + m_eHitState = ENUM_CLASS(HIT_STATE::AIR_LEVIOSO); + break; + case ENUM_CLASS(SKILL_TYPE::ACCIO): + m_eHitSpell = ENUM_CLASS(SKILL_TYPE::ACCIO); + m_eHitState = ENUM_CLASS(HIT_STATE::AIR_LEVIOSO); + break; + case ENUM_CLASS(SKILL_TYPE::STUPEFY): + m_eHitSpell = ENUM_CLASS(SKILL_TYPE::STUPEFY); + break; + case ENUM_CLASS(SKILL_TYPE::AVADAKEDAVRA): + m_eHitSpell = ENUM_CLASS(SKILL_TYPE::AVADAKEDAVRA); + break; + case ENUM_CLASS(SKILL_TYPE::ANCIENT_MAGIC): + m_eHitSpell = ENUM_CLASS(SKILL_TYPE::ANCIENT_MAGIC); + break; + } + } + else + { + damagePair = Get_Damage(m_pInfoInstance->Get_Spell_Damage(ENUM_CLASS(SKILL_TYPE::ANCIENT_MAGIC_THROW))); + CMapElement_Interactable* pProps = dynamic_cast(pOther); + if (pProps != nullptr) + { + m_eHitSpell = ENUM_CLASS(SKILL_TYPE::ANCIENT_MAGIC_THROW); + } + } + + + //m_DamageInfo.fDamage = damagePair.first; + //m_pInfoInstance->Event_CallBack(TEXT("Monster_Hit"), &m_DamageInfo); + //if (0 == damagePair.second) { + // m_pFSM->Change_State(FSMSTATE::DEAD); + // _int ID = m_pStat->Get_Stat().iObjectID; + // m_pInfoInstance->Event_CallBack(TEXT("MonsterDead"), &ID); + // return; + //} + + + m_pFSM->Change_State(FSMSTATE::HIT); + + +} + +void CGoblin_Assassin::OnHit(CGameObject* pOther, CGameObject* pCaller) +{ +} + +void CGoblin_Assassin::Set_Detection(_bool bDetection) +{ + m_bDetection = bDetection; +} + +HRESULT CGoblin_Assassin::Ready_Components() +{ + CTransform::TRANSFORM_DESC Desc = {}; + + Desc.fSpeedPerSec = 10.f; + Desc.fRotationPerSec = XMConvertToRadians(180.0f); + Desc.fRadius = 10.f; + + if (FAILED(Add_Component(g_iStaticLevel, &m_pTransformCom, &Desc))) { + return E_FAIL; + } + if (FAILED(Add_Component(g_iStaticLevel, &m_pFSM))) { + return E_FAIL; + } + /* Com_Shader */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_NPC_PBR_ANIM, + reinterpret_cast(&m_pShaderCom)))) { + return E_FAIL; + } + + m_strModelPrototypeTag = TEXT("Prototype_Component_Goblin_Assassin_Model"); + + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag, + reinterpret_cast(&m_pModelCom)))) { + return E_FAIL; + } + + { // CCT + CCharacter_Controller::Character_Controller_DESC Desc{}; + + Desc.iSubKind = ENUM_CLASS(PXOBJECT::GOBLIN_WARRIOR); + Desc.pTransform = m_pTransformCom; + Desc.eBodyType = ACTOR::CAPSULE; + Desc.fContactOffset = 0.001f; + Desc.fMaterial = { 1.2f, 1.0f, 0.0f }; + Desc.bAutoStepping = { false }; + Desc.fStepOffset = { 0.02f }; + Desc.fRadius = 0.6f; + Desc.fHeight = 0.7f; + Desc.pCallback_HitReport = m_pCallBack_HitReport = CCallBack_Monster_HitReport::Create(); + Desc.pCallback_Behavior = m_pCallBack_Behavior = CCallBack_Monster_Behavior::Create(); + Desc.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY; + Desc.fWalkableSlope = 45.f; + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), (CComponent**)&m_pCharacter_Controller, &Desc))) { + return E_FAIL; + } + } + m_pCharacter_Controller->Set_Position(m_pTransformCom->Get_State(STATE::POSITION)); + { // DO + CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; + Desc.iSubKind = ENUM_CLASS(PXOBJECT::GOBLIN_WARRIOR); + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), (CComponent**)&m_pRigidBody, &Desc))) { + return E_FAIL; + } + m_pGameInstance->Detach_Actor(*m_pRigidBody->Get_Actor(), NEXT_LEVEL); + } + + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("STAT_GOBLIN"), (CComponent**)&m_pStat))) { + return E_FAIL; + } + return S_OK; +} + +HRESULT CGoblin_Assassin::Ready_Parts() +{ + { + CGoblin_Sword::GOBLIN_SWORD_DESC Goblin_SwordDesc{}; + + Goblin_SwordDesc.pParentTransform = m_pTransformCom; + Goblin_SwordDesc.pSocketMatrices = m_pModelCom->Get_BoneMatrixPtr("SKT_LeftHand"); + Goblin_SwordDesc.iIndex = 0; + + if (FAILED(Add_PartObject("Goblin_Sword_L", g_iStaticLevel, nullptr, &Goblin_SwordDesc))) + { + return E_FAIL; + } + } + + { + CGoblin_Sword::GOBLIN_SWORD_DESC Goblin_SwordDesc{}; + + Goblin_SwordDesc.pParentTransform = m_pTransformCom; + Goblin_SwordDesc.pSocketMatrices = m_pModelCom->Get_BoneMatrixPtr("SKT_RightHand"); + Goblin_SwordDesc.iIndex = 1; + + if (FAILED(Add_PartObject("Goblin_Sword_R", g_iStaticLevel, nullptr, &Goblin_SwordDesc))) + { + return E_FAIL; + } + } + + + CGoblin_Assassin_Spector::GOBLIN_SPECTOR_DESC Goblin_SpectorDesc{}; + + Goblin_SpectorDesc.pParentTransform = m_pTransformCom; + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER, &Goblin_SpectorDesc, this, &m_pGoblinSpector))) { + return E_FAIL; + } + +#pragma region EFFECT + /* EFFECT */ + + CPartObject::PARTOBJECT_DESC PartsDesc{}; + + PartsDesc.pParentTransform = m_pTransformCom; + + if (FAILED(Add_PartObject("Goblin_Particle", g_iStaticLevel, &m_pGoblin_Particle, &PartsDesc))) + { + return E_FAIL; + } + + m_pGoblin_Particle->Load("../Bin/Resources/Data/Effect/Goblin/GoblinSide/Goblin_Particle", static_cast(g_iStaticLevel)); + m_pGoblin_Particle->FollowParents(m_pModelCom->Get_BoneMatrixPtr("RightShoulder")); + + + + if (FAILED(Add_PartObject("Goblin_Particle2", g_iStaticLevel, &m_pGoblin_Particle2, &PartsDesc))) + { + return E_FAIL; + } + + m_pGoblin_Particle2->Load("../Bin/Resources/Data/Effect/Goblin/GoblinSide/Goblin_Particle2", static_cast(g_iStaticLevel)); + m_pGoblin_Particle2->FollowParents(m_pModelCom->Get_BoneMatrixPtr("RightShoulder")); + + + if (FAILED(Add_PartObject("Goblin_Smoke", g_iStaticLevel, &m_pSmoke, &PartsDesc))) + { + return E_FAIL; + } + + m_pSmoke->Load("../Bin/Resources/Data/Effect/Goblin/GoblinSide/Goblin_Smoke", static_cast(g_iStaticLevel)); + m_pSmoke->FollowParents(m_pModelCom->Get_BoneMatrixPtr("Spine2")); + + +#pragma endregion + + + //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER, &PartsDesc, this, &m_pDetection))) { + // return E_FAIL; + //} + + return S_OK; +} + +HRESULT CGoblin_Assassin::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_PrevWorldMatrix", m_pTransformCom->Get_PrevWorldMatrixPtr()))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevViewMatrix", D3DTS::VIEW))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevProjMatrix", D3DTS::PROJ))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { + return E_FAIL; + } + return S_OK; +} + +CGoblin_Assassin* CGoblin_Assassin::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CGoblin_Assassin* pInstance = new CGoblin_Assassin(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CGoblin_Assassin"); + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +CGameObject* CGoblin_Assassin::Clone(void* pArg, CGameObject* pOwner) +{ + CGoblin_Assassin* pInstance = new CGoblin_Assassin(*this); + + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CGoblin_Assassin"); + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CGoblin_Assassin::Free() +{ + __super::Free(); + + if (nullptr != m_pCallBack_Behavior) { + m_pCallBack_Behavior->Finalize(); + } + if (nullptr != m_pCallBack_HitReport) { + m_pCallBack_HitReport->Finalize(); + } + + SAFE_RELEASE(m_pCharacter_Controller); + SAFE_RELEASE(m_pRigidBody); + SAFE_RELEASE(m_pSmoke); + SAFE_RELEASE(m_pGoblin_Particle); + SAFE_RELEASE(m_pGoblin_Particle2); + SAFE_RELEASE(m_pEffectPool); + Safe_Delete(m_pCallBack_Behavior); + Safe_Delete(m_pCallBack_HitReport); +} +#ifdef _DEBUG + +void CGoblin_Assassin::Describe_Entity() +{ + GUI::Begin("UNIT", 0, IMGUI_GLOBAL_BEGIN_FLAG); + GUI::PushItemWidth(80); + if (GUI::CollapsingHeader("Goblin")) { + GUI::Checkbox("LookAt", &m_bLookAt); + + string AnimList = m_pModelCom->Get_AnimList(m_pModelCom->Get_AnimIndex()); + GUI::Text(AnimList.c_str()); + + GUI::Text("AnimTrack %.2f", m_pModelCom->Get_CurrentTrackPosition()); + GUI::Text("AnimRatio %.2f", m_pModelCom->Get_CurrentTrackProgressRatio()); + + _float4 vMomentum = {}; + XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum()); + GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w); + + _float3 Pos; + XMStoreFloat3(&Pos, Get_WorldPostion()); + + if (GUI::DragFloat3("Pos", (_float*)&Pos)) + { + m_pCharacter_Controller->Set_Position(XMLoadFloat3(&Pos)); + } + + XMFLOAT3 f3; + XMStoreFloat3(&f3, m_vOriginPos); + + GUI::Text("Origin: %.2f, %.2f, %.2f", f3.x, f3.y, f3.z); + + m_fLength = XMVectorGetX(XMVector2Length(m_pTransformCom->Get_State(STATE::POSITION) - m_vOriginPos)); + + GUI::Text("Length %.2f", m_fLength); + + GUI::TextColored(ImVec4(1.f, 0.f, 0.f, 1.f), "Distance %.2f", m_fTargetDistance); + } + GUI::End(); +} + +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Goblin_Assassin_Spector.cpp b/Jusin154_Team3D/Client/Private/Goblin_Assassin_Spector.cpp new file mode 100644 index 000000000..d8ff2fc24 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Goblin_Assassin_Spector.cpp @@ -0,0 +1,367 @@ +#include "pch.h" +#include "Goblin_Assassin_Spector.h" + +#include "GameInstance.h" +#include "InfoInstance.h" +#include "Goblin_Assassin.h" +#include "Effect_Container.h" +#include "Goblin_Sword.h" + +#include "EffectParts.h" +#include "TrailObject.h" + + +CGoblin_Assassin_Spector::CGoblin_Assassin_Spector(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CMonster(pDevice, pContext) +{ +} + +CGoblin_Assassin_Spector::CGoblin_Assassin_Spector(const CGoblin_Assassin_Spector& Prototype) + : CMonster(Prototype) +{ +} + +HRESULT CGoblin_Assassin_Spector::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CGoblin_Assassin_Spector::Initialize(void* pArg) +{ + GOBLIN_SPECTOR_DESC* pDesc = static_cast (pArg); + m_pParentTransformCom = pDesc->pParentTransform; + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components())) + return E_FAIL; + + if (FAILED(Ready_Parts())) + return E_FAIL; + + m_pInfoInstance->Deregist_ActiveMonster(this); + + m_pGoblin = dynamic_cast(m_pOwner); + SAFE_ADDREF(m_pGoblin); + + m_vOriginScale = m_pTransformCom->Get_Scale(); + + m_pLeftHand_BoneMat = m_pModelCom->Get_BoneMatrixPtr("SKT_LeftHand"); + m_pRightHand_BoneMat = m_pModelCom->Get_BoneMatrixPtr("SKT_RightHand"); + + m_pModelCom->Set_AnimationIndex(5); + m_pModelCom->Play_Animation(0, m_pTransformCom); + + + m_bVisible = false; + + return S_OK; +} + +void CGoblin_Assassin_Spector::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); +} + +void CGoblin_Assassin_Spector::Update(_float fTimeDelta) +{ + __super::Update(fTimeDelta); + + m_Offset = _float3(0.f, 0.3f, 0.f); + + _matrix Offset = XMMatrixTranslation(m_Offset.x, + m_Offset.y, m_Offset.z); + + m_pTransformCom->Set_WorldMatrix(Offset * XMLoadFloat4x4(m_pParentTransformCom->Get_WorldMatrixPtr())); + + if (m_bVisible) + { + if (m_vScale.x <= 2.f) + { + m_vScale.x += fTimeDelta; + m_vScale.y += fTimeDelta; + m_vScale.z += fTimeDelta; + } + m_pTransformCom->Set_Scale(m_vScale); + m_pModelCom->Set_AnimationIndex(m_pGoblin->Get_Component()->Get_AnimIndex()); + m_pModelCom->Set_CurrentTrackPosition(m_pGoblin->Get_Component()->Get_CurrentTrackPosition()); + Get_PartObject("Goblin_Sword_L")->Set_Visible(true); + Get_PartObject("Goblin_Sword_R")->Set_Visible(true); + m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); + } + else { + Get_PartObject("Goblin_Sword_L")->Set_Visible(false); + Get_PartObject("Goblin_Sword_R")->Set_Visible(false); + m_vScale = { 1.f,1.f,1.f }; + m_pTransformCom->Set_Scale(m_vOriginScale); + m_pModelCom->Set_AnimationIndex(5); + } + + if (m_bDisolve) { + Get_PartObject("Goblin_Sword_L")->Set_Disolve(true); + Get_PartObject("Goblin_Sword_R")->Set_Disolve(true); + m_fDisolveTime += fTimeDelta; + if (m_fDisolveTime >= 1.f) + { + m_fDisolveTime = 0.f; + m_bDisolve = false; + m_bVisible = false; + } + } + +#ifdef _DEBUG + Describe_Entity(); +#endif // _DEBUG + +#pragma region TRAIL_UPDATE + + _matrix WorldMat = m_pTransformCom->Get_XMWorldMatrix(); + + _matrix LeftHandMatrix = {}; + _matrix RightHandMatrix = {}; + _matrix WeaponMatrix = {}; + + LeftHandMatrix = XMLoadFloat4x4(m_pLeftHand_BoneMat); + RightHandMatrix = XMLoadFloat4x4(m_pRightHand_BoneMat); + + + for (int i = 0; i < 3; ++i) { + LeftHandMatrix.r[i] = XMVector3Normalize(LeftHandMatrix.r[i]); + RightHandMatrix.r[i] = XMVector3Normalize(RightHandMatrix.r[i]); + WeaponMatrix.r[i] = XMVector3Normalize(WeaponMatrix.r[i]); + } + + _matrix WeaponSoket = WeaponMatrix * Get_Component()->Get_XMWorldMatrix(); + + m_pLeft_Trail->Trail_Update(LeftHandMatrix * WorldMat, fTimeDelta); + m_pRight_Trail->Trail_Update(RightHandMatrix * WorldMat, fTimeDelta); + +#pragma endregion + +} + +void CGoblin_Assassin_Spector::Late_Update(_float fTimeDelta) +{ + __super::Late_Update(fTimeDelta); + + m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); +} + +HRESULT CGoblin_Assassin_Spector::Render() +{ + if (!m_bVisible) + return S_OK; + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + + _uint iNumMeshes = m_pModelCom->Get_NumMeshes(); + _uint iShaderPass = ENUM_CLASS(SHADER_PASS_ANIM::SPECTOR); + + if (FAILED(Render_Disolve())) { + return E_FAIL; + } + + for (_uint i = 0; i < iNumMeshes; i++) + { + if (FAILED(m_pShaderCom->Bind_Matrices( + "g_OffsetMatrix", + m_pModelCom->Get_OffsetMatrix(i).data(), + (_int)m_pModelCom->Get_OffsetMatrix(i).size() + ))) + { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Begin(iShaderPass))) { + return E_FAIL; + } + + m_pModelCom->Bind_OutPut_SRV_VS(31, 0); + m_pModelCom->Bind_OutPut_SRV_VS_Prev(32, 0); + + if (FAILED(m_pModelCom->Render(i))) { + return E_FAIL; + } + } + + { + _bool bDisolve = false; + _float zero = 0.f; + m_pShaderCom->Bind_RawValue("g_bDisolve", &bDisolve, sizeof(_bool)); + m_pShaderCom->Bind_RawValue("g_fDisolveRatio", &zero, sizeof(_float)); + } + + return S_OK; +} + +void CGoblin_Assassin_Spector::OnCollision(CGameObject* pOther, void* pDesc) +{ + +} + +void CGoblin_Assassin_Spector::OnHit(CGameObject* pOther, CGameObject* pCaller) +{ +} + +HRESULT CGoblin_Assassin_Spector::Ready_Components() +{ + CTransform::TRANSFORM_DESC Desc = {}; + + Desc.fSpeedPerSec = 10.f; + Desc.fRotationPerSec = XMConvertToRadians(180.0f); + Desc.fRadius = 10.f; + + __super::Ready_Components(&Desc); + + m_strModelPrototypeTag = TEXT("Prototype_Component_Goblin_Spector_Model"); + + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag, + reinterpret_cast(&m_pModelCom)))) { + return E_FAIL; + } + + + + + return S_OK; +} + +void CGoblin_Assassin_Spector::Spector_Trail_Visible(_bool isTrailVisible) +{ + m_pLeft_Trail->Set_Visible(isTrailVisible); + m_pRight_Trail->Set_Visible(isTrailVisible); + + m_pLeft_Trail->Get_Component()->Reset_Trail(); + m_pRight_Trail->Get_Component()->Reset_Trail(); +} + +HRESULT CGoblin_Assassin_Spector::Ready_Parts() +{ + + { + CGoblin_Sword::GOBLIN_SWORD_DESC Goblin_SwordDesc{}; + + Goblin_SwordDesc.pParentTransform = m_pTransformCom; + Goblin_SwordDesc.pSocketMatrices = m_pModelCom->Get_BoneMatrixPtr("SKT_LeftHand"); + Goblin_SwordDesc.iIndex = 0; + + if (FAILED(Add_PartObject("Goblin_Sword_L", g_iStaticLevel, nullptr, &Goblin_SwordDesc))) + { + return E_FAIL; + } + } + + { + CGoblin_Sword::GOBLIN_SWORD_DESC Goblin_SwordDesc{}; + + Goblin_SwordDesc.pParentTransform = m_pTransformCom; + Goblin_SwordDesc.pSocketMatrices = m_pModelCom->Get_BoneMatrixPtr("SKT_RightHand"); + Goblin_SwordDesc.iIndex = 1; + + if (FAILED(Add_PartObject("Goblin_Sword_R", g_iStaticLevel, nullptr, &Goblin_SwordDesc))) + { + return E_FAIL; + } + } + + CPartObject::PARTOBJECT_DESC PartsDesc{}; + + PartsDesc.pParentTransform = m_pTransformCom; + + if (FAILED(Add_PartObject("Left_Trail", g_iStaticLevel, &m_pLeft_Trail, &PartsDesc))) { + return E_FAIL; + } + + m_pLeft_Trail->Load_Trail("../Bin/Resources/Data/Effect/Goblin/GoblinSide/Goblin_Trail_R", static_cast(g_iStaticLevel)); + m_pLeft_Trail->Set_Visible(false); + + if (FAILED(Add_PartObject("Right_Trail", g_iStaticLevel, &m_pRight_Trail, &PartsDesc))) { + return E_FAIL; + } + + m_pRight_Trail->Load_Trail("../Bin/Resources/Data/Effect/Goblin/GoblinSide/Goblin_Trail_R", static_cast(g_iStaticLevel)); + m_pRight_Trail->Set_Visible(false); + + return S_OK; +} + +HRESULT CGoblin_Assassin_Spector::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_PrevWorldMatrix", m_pTransformCom->Get_PrevWorldMatrixPtr()))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevViewMatrix", D3DTS::VIEW))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevProjMatrix", D3DTS::PROJ))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { + return E_FAIL; + } + return S_OK; +} + +CGoblin_Assassin_Spector* CGoblin_Assassin_Spector::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CGoblin_Assassin_Spector* pInstance = new CGoblin_Assassin_Spector(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CGoblin_Assassin_Spector"); + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +CGameObject* CGoblin_Assassin_Spector::Clone(void* pArg, CGameObject* pOwner) +{ + CGoblin_Assassin_Spector* pInstance = new CGoblin_Assassin_Spector(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CGoblin_Assassin_Spector"); + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CGoblin_Assassin_Spector::Free() +{ + __super::Free(); + + + SAFE_RELEASE(m_pGoblin); + SAFE_RELEASE(m_pLeft_Trail); + SAFE_RELEASE(m_pRight_Trail); +} +#ifdef _DEBUG + +void CGoblin_Assassin_Spector::Describe_Entity() +{ + GUI::Begin("UNIT", 0, IMGUI_GLOBAL_BEGIN_FLAG); + GUI::PushItemWidth(80); + if (GUI::CollapsingHeader("GoblinSpector")) { + _float3 vScale = m_pTransformCom->Get_Scale(); + GUI::DragFloat3("Scale", (_float*)&vScale); + } + GUI::End(); +} + +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Goblin_Assassin_States.cpp b/Jusin154_Team3D/Client/Private/Goblin_Assassin_States.cpp new file mode 100644 index 000000000..0326fe5e3 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Goblin_Assassin_States.cpp @@ -0,0 +1,1079 @@ +#include "pch.h" +#include "Goblin_Assassin.h" +#include "InfoInstance.h" +#include "GameInstance.h" +#include "Player.h" +#include "Goblin_Assassin_Spector.h" +#include "EffectParts.h" + +#include "EffectPool.h" +#include "Goblin_Sword.h" + +#pragma region STATE +#include "State_Idle.h" +#include "State_IdleBreak.h" +#include "State_Dodge.h" +#include "State_Jump.h" +#include "State_Land.h" +#include "State_Move.h" +#include "State_Combat.h" +#include "State_Slash.h" +#include "State_Dash.h" +#include "State_Blink.h" +#include "State_Hit.h" +#include "State_Dead.h" +#include "State_Shuffle.h" +#pragma endregion + + +void CGoblin_Assassin::Behavior_IdleEnter() +{ + m_pFSM->Enable_State(FSMSTATE::IDLE); + +} + +HRESULT CGoblin_Assassin::Behavior_IdleExitCheck() +{ + if (m_fTargetDistance <= 20.f && m_fTargetDistance > 10.f) + { + m_bLookAt = false; + m_bDetection = true; + + pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::IDLE]; + + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + } + if ((m_fTargetDistance <= 10.f && m_fTargetDistance != 0.f) /*|| m_pDetection->Get_Step() == true*/) + { + m_vOriginPos = m_pTransformCom->Get_State(STATE::POSITION); + m_bLookAt = true; + m_pFSM->Change_State(FSMSTATE::MOVE); + return E_FAIL; + } + else if (m_fTargetDistance >= 25.f) + { + m_bDetection = false; + + m_pFSM->Change_State(FSMSTATE::IDLEBREAK); + return E_FAIL; + } + + return S_OK; +} + +void CGoblin_Assassin::Behavior_IdleExit() +{ + m_pFSM->Disable_State(FSMSTATE::IDLE); +} + +void CGoblin_Assassin::Behavior_IdleBreakEnter() +{ + m_pFSM->Enable_State(FSMSTATE::IDLEBREAK); + pair<_uint, _bool> pairAnimInfo; + m_bLookAt = false; + _int RandIndex = m_pGameInstance->Real_Random_Int(0, 6); + switch (RandIndex) + { + case 0: + pairAnimInfo = m_Animation[STATEANIM::IDLE_BREAK1]; + break; + case 1: + pairAnimInfo = m_Animation[STATEANIM::IDLE_BREAK2]; + break; + case 2: + pairAnimInfo = m_Animation[STATEANIM::IDLE_BREAK3]; + break; + case 3: + pairAnimInfo = m_Animation[STATEANIM::IDLE_BREAK4]; + break; + case 4: + pairAnimInfo = m_Animation[STATEANIM::IDLE_BREAK5]; + break; + case 5: + pairAnimInfo = m_Animation[STATEANIM::IDLE_BREAK6]; + break; + case 6: + pairAnimInfo = m_Animation[STATEANIM::IDLE_BREAK7]; + break; + } + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); +} + +HRESULT CGoblin_Assassin::Behavior_IdleBreakExitCheck() +{ + if (m_pModelCom->IsFinishedAnim()) { + m_pFSM->Change_State(FSMSTATE::IDLE); + return E_FAIL; + } + + return S_OK; +} + +void CGoblin_Assassin::Behavior_IdleBreakExit() +{ + m_pFSM->Disable_State(FSMSTATE::IDLEBREAK); +} + +void CGoblin_Assassin::Behavior_MoveEnter() +{ + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::MOVE); + m_bLookAt = true; + m_pFSM->Enable_State(FSMSTATE::JOG); + + if (!m_pFSM->IsEnable_Previous(FSMSTATE::COMBAT)) + { + m_bFirstMove = false; + } +} + +HRESULT CGoblin_Assassin::Behavior_MoveExitCheck(_float fTimeDelta) +{ + pair<_uint, _bool> pairAnimInfo = {}; + _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + + if (m_fTargetDistance >= 6.f) + { + pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + } + else { + if (!m_bFirstMove) + { + _uint Rand = m_pGameInstance->Real_Random_Int(0, 3); + + switch (Rand) + { + case 0: + pairAnimInfo = m_Animation[STATEANIM::JOG_112_L]; + break; + case 1: + pairAnimInfo = m_Animation[STATEANIM::JOG_112_R]; + break; + case 2: + if (iCurrAnimIndex == m_Animation[STATEANIM::JOG_90_R].first) { + pairAnimInfo = m_Animation[STATEANIM::JOG_112_R]; + } + else { + pairAnimInfo = m_Animation[STATEANIM::JOG_90_L]; + } + break; + case 3: + if (iCurrAnimIndex == m_Animation[STATEANIM::JOG_90_L].first) { + pairAnimInfo = m_Animation[STATEANIM::JOG_112_L]; + } + else { + pairAnimInfo = m_Animation[STATEANIM::JOG_90_R]; + } + break; + } + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 0.5f, true); + + m_bFirstMove = true; + m_fMoveTime = 0.f; + return S_OK; + } + m_fMoveTime += fTimeDelta; + + if (m_fMoveTime >= 2.f) + { + m_bFirstMove = false; + m_fMoveTime = 0.f; + } + } + + + if (m_fTargetDistance <= 15.f && m_fTargetDistance >= 4.f && m_fTargetDistance != 0.f) + { + m_pFSM->Change_State(FSMSTATE::COMBAT); + return E_FAIL; + } + + return S_OK; +} + +void CGoblin_Assassin::Behavior_MoveExit() +{ + m_pFSM->Disable_State(FSMSTATE::MOVE | FSMSTATE::SPRINT | FSMSTATE::JOG | FSMSTATE::WALK); +} + +void CGoblin_Assassin::Behavior_CombatEnter() +{ + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::COMBAT); + m_bLookAt = true; +} + +HRESULT CGoblin_Assassin::Behavior_CombatExitCheck(_float fTimeDelta) +{ + if (m_fTargetDistance > 25.f && m_fTargetDistance != 0.f) + { + m_pFSM->Change_State(FSMSTATE::IDLE); + return E_FAIL; + } + else if (m_fTargetDistance > 20.f && m_fTargetDistance != 0.f) + { + m_pFSM->Change_State(FSMSTATE::MOVE); + return E_FAIL; + } + + if (m_fTargetDistance <= 6.f && m_fSkillCoolTime[ENUM_CLASS(GOBLIN_ASSASSIN_SKILL::SLASH)] <= 0.f) + { + m_pFSM->Change_State(FSMSTATE::SLASH); + return E_FAIL; + } + else if (m_fTargetDistance <= 10.f && m_fSkillCoolTime[ENUM_CLASS(GOBLIN_ASSASSIN_SKILL::DASH)] <= 0.f) + { + m_pFSM->Change_State(FSMSTATE::DASH); + return E_FAIL; + } + else if (m_fTargetDistance <= 15.f && m_fSkillCoolTime[ENUM_CLASS(GOBLIN_ASSASSIN_SKILL::TP)] <= 0.f) + { + m_pFSM->Change_State(FSMSTATE::BLINK); + return E_FAIL; + } + else { + m_pFSM->Change_State(FSMSTATE::MOVE); + return E_FAIL; + } + + return S_OK; +} + +void CGoblin_Assassin::Behavior_CombatExit() +{ + m_pFSM->Disable_State(FSMSTATE::COMBAT); +} + +void CGoblin_Assassin::Behavior_SlashEnter() +{ + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::SLASH); + + pairAnimInfo = m_Animation[STATEANIM::SLASH]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second,1.5f); + m_fSkillCoolTime[ENUM_CLASS(GOBLIN_ASSASSIN_SKILL::SLASH)] = m_fMaxSkillCoolTime[ENUM_CLASS(GOBLIN_ASSASSIN_SKILL::SLASH)]; + + Add_Event(pairAnimInfo.first, + [this]() { + m_pGoblinSpector->Set_Visible(true); + m_pGoblinSpector->Spector_Trail_Visible(true); + + m_pEffectPool->Use_Skill(SKILL_TYPE::GOBLIN_ATTACK, m_pGoblinSpector->Get_PartObject(), (void*)&m_pGoblinSpector->Get_PartObject()->Get_SwordMatrix()); + }, + 0.05f); + + Add_Event(pairAnimInfo.first, + [this]() { + m_pGoblinSpector->Set_Disolve(true); }, + 0.28f); + + Add_Event(pairAnimInfo.first, + [this]() { + m_bLookAt = false; }, + 0.3f); + + Set_Easing(pairAnimInfo.first, 0.01f, 0.15f, 0.8f); + + Set_Easing(pairAnimInfo.first, 0.15f, 0.4f, 1.4f); +} + +HRESULT CGoblin_Assassin::Behavior_SlashExitCheck(_float fTimeDelta) +{ + if (m_pModelCom->IsFinishedAnim()) + { + m_pFSM->Change_State(FSMSTATE::COMBAT); + return E_FAIL; + } + + return S_OK; +} + +void CGoblin_Assassin::Behavior_SlashExit() +{ + m_pFSM->Disable_State(FSMSTATE::SLASH); + m_bLookAt = true; +} + +void CGoblin_Assassin::Behavior_DashEnter() +{ + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::DASH); + + pairAnimInfo = m_Animation[STATEANIM::DASH]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + m_fSkillCoolTime[ENUM_CLASS(GOBLIN_ASSASSIN_SKILL::DASH)] = m_fMaxSkillCoolTime[ENUM_CLASS(GOBLIN_ASSASSIN_SKILL::DASH)]; +} + +HRESULT CGoblin_Assassin::Behavior_DashExitCheck(_float fTimeDelta) +{ + if (m_pModelCom->IsFinishedAnim()) + { + m_pFSM->Change_State(FSMSTATE::SLASH); + return E_FAIL; + } + + return S_OK; +} + +void CGoblin_Assassin::Behavior_DashExit() +{ + m_pFSM->Disable_State(FSMSTATE::DASH); +} + +void CGoblin_Assassin::Behavior_BlinkEnter() +{ + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::BLINK); + + pairAnimInfo = m_Animation[STATEANIM::BLINK_START]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_bDisolve = true; + + Add_Event(pairAnimInfo.first, + [this]() { + m_pEffectPool->Use_Skill(SKILL_TYPE::GOBILN_TELEPORT, this); + }, 0.1f); +} + +HRESULT CGoblin_Assassin::Behavior_BlinkExitCheck(_float fTimeDelta) +{ + pair<_uint, _bool> pairAnimInfo = {}; + _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + if (!m_bDisolve && iCurrAnimIndex != m_Animation[STATEANIM::BLINK].first) + { + m_fSkillCoolTime[ENUM_CLASS(GOBLIN_ASSASSIN_SKILL::TP)] = m_fMaxSkillCoolTime[ENUM_CLASS(GOBLIN_ASSASSIN_SKILL::TP)]; + _vector vPlayerPos = XMLoadFloat4(&m_vTargetPos); + _vector vPlayerLook = m_pTarget->Get_Component()->Get_State(STATE::LOOK); + vPlayerLook = XMVectorSetY(vPlayerLook, 0.f); + vPlayerLook = XMVector3Normalize(vPlayerLook); + + _float randAngleDeg = m_pGameInstance->Real_Random_Float(-60.f, 60.f); + _float randAngleRad = XMConvertToRadians(randAngleDeg); + + _matrix rot = XMMatrixRotationY(randAngleRad); + _vector offsetDir = XMVector3TransformNormal(vPlayerLook, rot); + + _float randDist = m_pGameInstance->Real_Random_Float(3.f, 3.5f); + + _vector vFinalPos = vPlayerPos + offsetDir * randDist; + vFinalPos = XMVectorSetY(vFinalPos, XMVectorGetY(vPlayerPos) + 1.5f); + + m_pCharacter_Controller->Set_Position(vFinalPos); + + pairAnimInfo = m_Animation[STATEANIM::BLINK]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + } + + if (m_pModelCom->IsFinishedAnim() && iCurrAnimIndex == m_Animation[STATEANIM::BLINK].first) + { + m_bLookAt = true; + m_fTpTime = 0.f; + m_pFSM->Change_State(FSMSTATE::COMBAT); + return E_FAIL; + } + + return S_OK; +} + +void CGoblin_Assassin::Behavior_BlinkExit() +{ + m_pFSM->Disable_State(FSMSTATE::BLINK); +} + +void CGoblin_Assassin::Behavior_ShuffleEnter() +{ + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::SHUFFLE); + _uint iRand = m_pGameInstance->Real_Random_Int(0, 3); + switch (iRand) + { + case 0: + pairAnimInfo = m_Animation[STATEANIM::SHUFFLE1]; + break; + case 1: + pairAnimInfo = m_Animation[STATEANIM::SHUFFLE2]; + break; + case 2: + pairAnimInfo = m_Animation[STATEANIM::SHUFFLE3]; + break; + case 3: + pairAnimInfo = m_Animation[STATEANIM::SHUFFLE4]; + break; + } + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); +} + +HRESULT CGoblin_Assassin::Behavior_ShuffleExitCheck(_float fTimeDelta) +{ + _float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio(); + + if (fRatio >= 0.3f) + { + m_pFSM->Change_State(FSMSTATE::COMBAT); + return E_FAIL; + } + + return S_OK; +} + +void CGoblin_Assassin::Behavior_ShuffleExit() +{ + m_pFSM->Disable_State(FSMSTATE::SHUFFLE); +} + +void CGoblin_Assassin::Behavior_HitEnter() +{ + pair<_uint, _bool> pairAnimInfo = {}; + _int iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + m_pFSM->Enable_State(FSMSTATE::HIT); + + m_bLookAt = false; + + _float fAnimSpeed = 1.f; + switch (m_eHitSpell) + { + case ENUM_CLASS(SKILL_TYPE::DESCENDO): + pairAnimInfo = m_Animation[STATEANIM::KNOCKDOWN_BWD]; + fAnimSpeed = 2.f; + Add_Event(m_Animation[STATEANIM::KNOCKDOWN_BWD_SPLT].first, + [&]() { pairAnimInfo = m_Animation[STATEANIM::TUMBLE_FWD]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, false, 0.5f); + m_pCharacter_Controller->SetGravity(false); + m_bAir = true; + }, + 0.3f); + + Add_Event(m_Animation[STATEANIM::KNOCKDOWN_BWD_SPLT].first, + [this]() { + CameraShake(10.f, 1.f, 2.f, 0.3f); + }, + 0.27f); + + Add_Event(m_Animation[STATEANIM::TUMBLE_FWD].first, + [this]() {m_pModelCom->Set_AnimSpeed(1.5f); }, + 0.75f); + + Add_Event(m_Animation[STATEANIM::TUMBLE_FWD].first, + [&]() { pairAnimInfo = m_Animation[STATEANIM::KNOCKDOWN_BWD_SPLT]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + m_bAir = false; + m_pCharacter_Controller->SetGravity(true); + }, + 0.96f); + + Add_Event(m_Animation[STATEANIM::KNOCKDOWN_BWD_SPLT].first, + [&]() { pairAnimInfo = m_Animation[STATEANIM::GETUP_BWD]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f); }, + 0.95f); + + Add_Event(m_Animation[STATEANIM::GETUP_BWD].first, + [this]() {m_bLookAt = true; }, + 0.7f); + break; + case ENUM_CLASS(SKILL_TYPE::BOMBARDA): + pairAnimInfo = m_Animation[STATEANIM::STUMBLE_BWD_L]; + break; + case ENUM_CLASS(SKILL_TYPE::JAP): + { + if (m_fHitDegree >= 90.f) + { + _int iRandIndex = m_pGameInstance->Real_Random_Int(0, 3); + switch (iRandIndex) + { + case 0: + pairAnimInfo = m_Animation[STATEANIM::HIT_BWD]; + break; + case 1: + pairAnimInfo = m_Animation[STATEANIM::HIT_BWD2]; + break; + case 2: + pairAnimInfo = m_Animation[STATEANIM::HIT_BWD3]; + break; + case 3: + pairAnimInfo = m_Animation[STATEANIM::HIT_BWD4]; + break; + default: + break; + } + } + else if (m_fHitDegree >= 45.f) { + + if (m_fHitCross > 0.f) { + pairAnimInfo = m_Animation[STATEANIM::HIT_L]; + } + else { + pairAnimInfo = m_Animation[STATEANIM::HIT_R]; + } + } + else { + pairAnimInfo = m_Animation[STATEANIM::HIT_FWD]; + } + } + break; + case ENUM_CLASS(SKILL_TYPE::LEVIOSO): + pairAnimInfo = m_Animation[STATEANIM::HIT_LEVIOSO]; + break; + case ENUM_CLASS(SKILL_TYPE::ACCIO): + pairAnimInfo = m_Animation[STATEANIM::INCARCEROUS]; + break; + default: + _int iRand = m_pGameInstance->Real_Random_Int(0, 1); + if (iRand == 0) + pairAnimInfo = m_Animation[STATEANIM::STUMBLE_BWD_L]; + else + pairAnimInfo = m_Animation[STATEANIM::STUMBLE_BWD_R]; + break; + } + + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, false, fAnimSpeed); + +} + +HRESULT CGoblin_Assassin::Behavior_HitExitCheck(_float fTimeDelta) +{ + pair<_uint, _bool> pairAnimInfo = {}; + _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + _float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio(); + CTransform* pTransform = m_pTarget->Get_Component(); + + if (iCurrAnimIndex == m_Animation[STATEANIM::KNOCKDOWN_BWD].first) + { + if (fRatio >= 0.15f) + { + pairAnimInfo = m_Animation[STATEANIM::KNOCKDOWN_BWD_SPLT]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f,false,2.f); + } + } + if (m_bAir) + { + _vector vDir = m_pTransformCom->Get_State(STATE::UP); + vDir = XMVector4Normalize(vDir); + _vector vPos = m_pCharacter_Controller->Get_Position(); + _vector Force = vDir * fTimeDelta*0.6f; + m_pCharacter_Controller->Set_Position(vPos + Force); + } + + if (!m_bAir && iCurrAnimIndex == m_Animation[STATEANIM::KNOCKDOWN_BWD_SPLT].first) + { + m_fGravityAmount += fTimeDelta * fRatio* 20.f; + m_pCharacter_Controller->Set_GravityAmount(m_fGravityAmount); + } + + if (iCurrAnimIndex == m_Animation[STATEANIM::TUMBLE_FWD].first) + { + Add_Event(m_Animation[STATEANIM::KNOCKDOWN_BWD_SPLT].first, + [&]() {CameraShake(3.f, 0.8f, 1.f, 0.2f); }, + 0.17f); + } + + if (m_eHitSpell == ENUM_CLASS(SKILL_TYPE::ACCIO)) + { + if (!m_bPos) + { + m_pCharacter_Controller->SetGravity(false); + _vector vPlayerPos = pTransform->Get_State(STATE::POSITION); + vPlayerPos = XMVectorSetY(vPlayerPos, XMVectorGetY(vPlayerPos) + 2.5f); + _vector vMonsterPos = m_pCharacter_Controller->Get_Position(); + + _vector vDir = XMVector3Normalize(vPlayerPos - vMonsterPos); + _float fLength = XMVectorGetX(XMVector3Length(vPlayerPos - vMonsterPos)); + + m_fSpeed += (m_fTargetSpeed - m_fSpeed) * fTimeDelta * m_fAccel; + + if (fLength >= 4.f) + { + m_pCharacter_Controller->Set_Position( + vMonsterPos + vDir * m_fSpeed * fTimeDelta + ); + } + else { + m_bPos = true; + pairAnimInfo = m_Animation[STATEANIM::HIT_LEVIOSO]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f); + } + } + } + + if (m_eHitSpell == ENUM_CLASS(SKILL_TYPE::LEVIOSO)) + { + if (iCurrAnimIndex == m_Animation[STATEANIM::HIT_LEVIOSO].first) + { + _vector vDir = m_pTransformCom->Get_State(STATE::UP); + vDir = XMVector4Normalize(vDir); + _vector vPos = m_pCharacter_Controller->Get_Position(); + m_fAirTime += fTimeDelta; + _vector Force = vDir * fTimeDelta; + if (m_fAirTime < 1.3f) { + m_pCharacter_Controller->Set_Position(vPos + Force); + } + else { + m_pCharacter_Controller->Set_Position(vPos); + } + m_pCharacter_Controller->SetGravity(false); + } + } + + HitState_Behavior(fTimeDelta); + + + if (iCurrAnimIndex == m_Animation[STATEANIM::TUMBLE].first) + { + m_fTumbleTimer += fTimeDelta; + + if (m_fTumbleTimer >= 1.5f) + { + m_fTumbleTimer = 0.f; + pairAnimInfo = m_Animation[STATEANIM::KNOCKDOWN_BWD_SPLT]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + m_pCharacter_Controller->SetGravity(true); + + + Add_Event(m_Animation[STATEANIM::KNOCKDOWN_BWD_SPLT].first, + [&]() {CameraShake(3.f, 0.8f, 1.f, 0.2f); }, + 0.21f); + + Add_Event(m_Animation[STATEANIM::KNOCKDOWN_BWD_SPLT].first, + [&]() { pairAnimInfo = m_Animation[STATEANIM::GETUP_BWD]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f); + m_fAirTime = 0.f; }, + 0.95f); + } + return S_OK; + } + if (m_vStunTimer.y < m_vStunTimer.x) { + pairAnimInfo = m_Animation[STATEANIM::GETUP_FWD]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f); + } + + if (m_pModelCom->IsFinishedAnim()) + { + m_pFSM->Change_State(FSMSTATE::COMBAT); + return E_FAIL; + } + return S_OK; +} + +void CGoblin_Assassin::Behavior_HitExit() +{ + m_pFSM->Disable_State(FSMSTATE::HIT); + m_bPos = false; + m_bLookAt = true; + m_eHitState = ENUM_CLASS(HIT_STATE::END); + m_pCharacter_Controller->Reset_GravityAmount(); + m_fGravityAmount = 0.f; +} + +void CGoblin_Assassin::Behavior_DeadEnter() +{ + m_bLookAt = false; + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::DEAD); + m_pCharacter_Controller->SetGravity(true); + + _bool bStrongerKnockDown = { false }; + + _float fabsRadius = fabsf(m_fHitRadius); + _uint iState = { UINT_MAX }; + + if (fabsRadius > 135.f) { + iState = STATEANIM::DEAD_FWD; + } + else if (fabsRadius < 45.f) { + iState = STATEANIM::DEAD_BWD; + } + else { + if (m_fHitRadius < 0.f) { + iState = STATEANIM::DEAD_L; + } + else { + iState = STATEANIM::DEAD_R; + } + } + pairAnimInfo = m_Animation[iState + bStrongerKnockDown]; + + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); +} + +HRESULT CGoblin_Assassin::Behavior_DeadExitCheck(_float fTimeDelta) +{ + if (FLT_EPSILON > m_pModelCom->Get_CurrentTrackProgressRatio()) { + + return E_PENDING; + } + return S_OK; +} + +void CGoblin_Assassin::Behavior_DeadExit() +{ + m_bDead = true; +} + +void CGoblin_Assassin::HitState_Behavior(_float fTimeDelta) +{ + pair<_uint, _bool> pairAnimInfo = {}; + CTransform* pTransform = m_pTarget->Get_Component(); + _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + _float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio(); + + if (m_eHitState == ENUM_CLASS(HIT_STATE::AIR_LEVIOSO)) + { + switch (m_eHitSpell) + { + case ENUM_CLASS(SKILL_TYPE::DESCENDO): + { + m_eHitSpell = ENUM_CLASS(SKILL_TYPE::END); + m_pCharacter_Controller->SetGravity(true); + m_pCharacter_Controller->Set_GravityAmount(1.5f); + m_fAirTime = 0.f; + pairAnimInfo = m_Animation[STATEANIM::KNOCKDOWN_BWD]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, false, 2.f); + + Add_Event(m_Animation[STATEANIM::KNOCKDOWN_BWD_SPLT].first, + [&]() { pairAnimInfo = m_Animation[STATEANIM::TUMBLE_FWD]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, false, 0.5f); + m_pCharacter_Controller->SetGravity(false); + m_bAir = true; + }, + 0.3f); + + Add_Event(m_Animation[STATEANIM::KNOCKDOWN_BWD_SPLT].first, + [this]() { + CameraShake(10.f, 1.f, 2.f, 0.3f); + }, + 0.27f); + + Add_Event(m_Animation[STATEANIM::TUMBLE_FWD].first, + [this]() {m_pModelCom->Set_AnimSpeed(1.5f); }, + 0.75f); + + Add_Event(m_Animation[STATEANIM::TUMBLE_FWD].first, + [&]() { pairAnimInfo = m_Animation[STATEANIM::KNOCKDOWN_BWD_SPLT]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + m_bAir = false; + m_pCharacter_Controller->SetGravity(true); + }, + 0.96f); + + Add_Event(m_Animation[STATEANIM::KNOCKDOWN_BWD_SPLT].first, + [&]() { pairAnimInfo = m_Animation[STATEANIM::GETUP_BWD]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f); }, + 0.95f); + + Add_Event(m_Animation[STATEANIM::GETUP_BWD].first, + [this]() {m_bLookAt = true; }, + 0.7f); + } + break; + case ENUM_CLASS(SKILL_TYPE::BOMBARDA): + { + m_eHitSpell = ENUM_CLASS(SKILL_TYPE::END); + m_pCharacter_Controller->ConvertToDO(*m_pRigidBody); + _vector vCameraLook = m_pGameInstance->Get_CameraLook(); + vCameraLook = XMVector3Normalize(vCameraLook); + m_pRigidBody->Add_Force(vCameraLook * 60.f, PSX::PxForceMode::eIMPULSE); + m_fAirTime = 0.f; + } + break; + case ENUM_CLASS(SKILL_TYPE::JAP): + { + m_fHitTimer += fTimeDelta; + if (m_fHitTimer <= 0.4f) + { + _vector vPlayerLook = pTransform->Get_State(STATE::LOOK); + vPlayerLook = XMVector4Normalize(vPlayerLook); + _vector vPos = m_pCharacter_Controller->Get_Position(); + + _float t = clamp(m_fHitTimer, 0.f, 1.f); + _float ease = 1.f - (t * t); + _vector Force = vPlayerLook * fTimeDelta * 6.f * ease; + + m_pCharacter_Controller->Set_Position(vPos + Force); + pairAnimInfo = m_Animation[STATEANIM::TUMBLE]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, false, 0.8f); + } + else { + m_fHitTimer = 0.f; + m_eHitSpell = ENUM_CLASS(SKILL_TYPE::END); + } + } + break; + } + if (fRatio >= 0.31f && iCurrAnimIndex == m_Animation[STATEANIM::HIT_LEVIOSO].first) + { + m_fAirTime = 0.f; + m_pCharacter_Controller->SetGravity(true); + pairAnimInfo = m_Animation[STATEANIM::LAND]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f); + } + } + +} + + +void CGoblin_Assassin::Add_FSM() +{ +#pragma region Behavior_Movement_NotFocus + { + CState_Idle::STATE_IDLE_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_IdleEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_IdleExitCheck(); }; + Desc.funcExitEvent = [this]() { Behavior_IdleExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::IDLE, CState_Idle::Create(&Desc)); + } + + { + CState_IdleBreak::STATE_IDLEBREAK_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_IdleBreakEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_IdleBreakExitCheck(); }; + Desc.funcExitEvent = [this]() { Behavior_IdleBreakExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::IDLEBREAK, CState_IdleBreak::Create(&Desc)); + } + + { + CState_Move::STATE_MOVE_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_MoveEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(fTimedelta); }; + Desc.funcExitEvent = [this]() { Behavior_MoveExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::MOVE, CState_Move::Create(&Desc)); + } +#pragma endregion +#pragma region Behavior_Combat_NotFocus + { + CState_Combat::STATE_COMBAT_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_CombatEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_CombatExitCheck(fTimedelta); }; + Desc.funcExitEvent = [this]() { Behavior_CombatExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::COMBAT, CState_Combat::Create(&Desc)); + } + { + CState_Slash::STATE_SLASH_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_SlashEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_SlashExitCheck(fTimedelta); }; + Desc.funcExitEvent = [this]() { Behavior_SlashExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::SLASH, CState_Slash::Create(&Desc)); + } + { + CState_Dash::STATE_DASH_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_DashEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_DashExitCheck(fTimedelta); }; + Desc.funcExitEvent = [this]() { Behavior_DashExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::DASH, CState_Dash::Create(&Desc)); + } + { + CState_Blink::STATE_BLINK_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_BlinkEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_BlinkExitCheck(fTimedelta); }; + Desc.funcExitEvent = [this]() { Behavior_BlinkExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::BLINK, CState_Blink::Create(&Desc)); + } + + { + CState_Shuffle::STATE_SHUFFLE_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_ShuffleEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_ShuffleExitCheck(fTimedelta); }; + Desc.funcExitEvent = [this]() { Behavior_ShuffleExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::SHUFFLE, CState_Shuffle::Create(&Desc)); + } +#pragma endregion +#pragma region Behavior_Combat_Focus + { + CState_Dead::STATE_DEAD_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_DeadEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_DeadExitCheck(fTimedelta); }; + Desc.funcExitEvent = [this]() { Behavior_DeadExit(); }; + Desc.funcLateUpdate = [this](_float fDeadRatio) { + m_fDeadRatio = fDeadRatio; + if (m_fDeadRatio > 1.f) { + PSX::PxExtendedVec3 pxControlllerPos = m_pCharacter_Controller->Get_Controller()->getPosition(); + PSX::PxTransform pxTransform((_float)pxControlllerPos.x, (_float)pxControlllerPos.y + 100.f, (_float)pxControlllerPos.z); + m_pCharacter_Controller->Set_Position(XMLoadFloat3((_float3*)&pxTransform.p)); + m_pRigidBody->SetActive(false); + m_pCharacter_Controller->SetActive(false); + m_bDead = true; + } + }; + Desc.vDeadTimer.x = FLT_EPSILON5; + Desc.vDeadTimer.y = 2.f; + m_States.emplace(FSMSTATE::DEAD, CState_Dead::Create(&Desc)); + } +#pragma endregion + +#pragma region Hit + { + CState_Hit::STATE_HIT_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_HitEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_HitExitCheck(fTimedelta); }; + Desc.funcExitEvent = [this]() { Behavior_HitExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::HIT, CState_Hit::Create(&Desc)); + } + +#pragma endregion + + +} + +void CGoblin_Assassin::Set_Anim() +{ + m_Animation[STATEANIM::IDLE] = { 22,true }; + m_Animation[STATEANIM::IDLE_TURN_BWD] = { 24, false }; + m_Animation[STATEANIM::IDLE_TURN_L] = { 26, false }; + m_Animation[STATEANIM::IDLE_TURN_R] = { 30, false }; + + m_Animation[STATEANIM::IDLE_BREAK1] = { 137, false }; + m_Animation[STATEANIM::IDLE_BREAK2] = { 138, false }; + m_Animation[STATEANIM::IDLE_BREAK3] = { 139, false }; + m_Animation[STATEANIM::IDLE_BREAK4] = { 37, false }; + m_Animation[STATEANIM::IDLE_BREAK5] = { 38, false }; + m_Animation[STATEANIM::IDLE_BREAK6] = { 39, false }; + m_Animation[STATEANIM::IDLE_BREAK7] = { 41, false }; + + m_Animation[STATEANIM::WALK_FWD] = { 45,true }; + m_Animation[STATEANIM::WALK_START] = { 57,false }; + m_Animation[STATEANIM::WALK_STOP] = { 58,false }; + m_Animation[STATEANIM::WALK_BWD] = { 252, true }; + + m_Animation[STATEANIM::JOG_FWD] = { 147,true }; // 147 + m_Animation[STATEANIM::JOG_START] = { 157,false }; + m_Animation[STATEANIM::JOG_BWD] = { 146,false }; + m_Animation[STATEANIM::JOG_112_L] = { 148,true }; + m_Animation[STATEANIM::JOG_112_R] = { 152,true }; + m_Animation[STATEANIM::JOG_90_L] = { 151,true }; + m_Animation[STATEANIM::JOG_90_R] = { 155,true }; + + m_Animation[STATEANIM::SHUFFLE1] = { 203,false }; + m_Animation[STATEANIM::SHUFFLE2] = { 204,false }; + m_Animation[STATEANIM::SHUFFLE3] = { 205,false }; + m_Animation[STATEANIM::SHUFFLE4] = { 206,false }; + + m_Animation[STATEANIM::DODGE_LEFT] = { 125, false }; + m_Animation[STATEANIM::DODGE_RIGHT] = { 126, false }; + m_Animation[STATEANIM::SPRINT] = { 90, true }; + + m_Animation[STATEANIM::BLINK_START] = { 428,false }; // 텔레포트 + m_Animation[STATEANIM::BLINK] = { 426,false }; // 텔레포트 + m_Animation[STATEANIM::ATTACK_END] = { 76,false }; + m_Animation[STATEANIM::SLASH] = { 72,false }; + m_Animation[STATEANIM::DASH] = { 73,false }; + + m_Animation[STATEANIM::HIT_FWD] = { 353, false }; + m_Animation[STATEANIM::HIT_BWD] = { 352, false }; + m_Animation[STATEANIM::HIT_BWD2] = { 349, false }; + m_Animation[STATEANIM::HIT_BWD3] = { 350, false }; + m_Animation[STATEANIM::HIT_BWD4] = { 351, false }; + m_Animation[STATEANIM::HIT_L] = { 354, false }; + m_Animation[STATEANIM::HIT_R] = { 355, false }; + + m_Animation[STATEANIM::KNOCKDOWN_BWD] = { 374, false }; + m_Animation[STATEANIM::KNOCKDOWN_BWD_SPLT] = { 375, false }; + m_Animation[STATEANIM::KNOCKDOWN_BWD_SPLT_HOLD] = { 370, false }; + m_Animation[STATEANIM::KNOCKDOWN_FWD] = { 371, false }; + m_Animation[STATEANIM::KNOCKDOWN_FWD_SPLT] = { 372, false }; + m_Animation[STATEANIM::KNOCKDOWN_FWD_SPLT_HOLD] = { 373, false }; + + m_Animation[STATEANIM::GETUP_BWD] = { 330, false }; + m_Animation[STATEANIM::GETUP_FWD] = { 332, false }; + m_Animation[STATEANIM::GETUP_L] = { 334, false }; + m_Animation[STATEANIM::GETUP_L_FD] = { 336, false }; + m_Animation[STATEANIM::GETUP_L_FU] = { 338, false }; + m_Animation[STATEANIM::GETUP_R] = { 340, false }; + m_Animation[STATEANIM::GETUP_R_FD] = { 342, false }; + m_Animation[STATEANIM::GETUP_R_FU] = { 344, false }; + m_Animation[STATEANIM::GETUP_SLOUCH] = { 346, false }; + + m_Animation[STATEANIM::KNOCKBACK] = { 377, true }; + m_Animation[STATEANIM::KNOCKBACK2] = { 378, true }; + m_Animation[STATEANIM::TUMBLE] = { 379, true }; + m_Animation[STATEANIM::TUMBLE2] = { 380, true };// 원래 true 였음 + m_Animation[STATEANIM::TUMBLE_FWD] = { 429, true }; + m_Animation[STATEANIM::PETRIFICUSED_START] = { 383, false }; + + m_Animation[STATEANIM::LAND] = { 376, false }; + m_Animation[STATEANIM::HIT_LEVIOSO] = { 381, false }; + m_Animation[STATEANIM::INCARCEROUS] = { 382,false }; + + m_Animation[STATEANIM::STUMBLE_BWD_L] = { 394, false }; + m_Animation[STATEANIM::STUMBLE_BWD_R] = { 395, false }; + m_Animation[STATEANIM::STUMBLE_FWD] = { 396, false }; + + m_Animation[STATEANIM::DEAD_BWD] = { 317, false }; + m_Animation[STATEANIM::DEAD_BWD2] = { 318, false }; + m_Animation[STATEANIM::DEAD_FWD] = { 319, false }; + m_Animation[STATEANIM::DEAD_FWD2] = { 320, false }; + m_Animation[STATEANIM::DEAD_L] = { 321, false }; + m_Animation[STATEANIM::DEAD_L2] = { 322, false }; + m_Animation[STATEANIM::DEAD_R] = { 323, false }; + m_Animation[STATEANIM::DEAD_R2] = { 324, false }; + + //Tp 426 + // Tp Start 428 + // 76 공격끝 + + + + + + + + + // 걷기 시작 57 + // 걷기 루프 50 + // 뛰기 시작 157 + // 뛰기 루프 45 + // 나이프 던지기 85 + // 도끼 공격 444 + // 도끼 공격 후 76 + // 도끼 찍기 439 + // + + // 텀블링 히트 380 + // 디센도 찍기전 띄우기 371 + // 디센도 찍기 372 + + // 레비오소 피격 381 + // 착지 376 + // + + // Shuffle1 211 + // Shuffle2 215 + // Shuffle3 219 + // Shuffle4 223 + + //Jog 112도 L 148 + //Jog 112도 R 152 + // Jog 90 L 151 + // Jog 90 R 155 + + + // L 394 + // R 395 + // fwd 396 +} diff --git a/Jusin154_Team3D/Client/Private/Goblin_Attack.cpp b/Jusin154_Team3D/Client/Private/Goblin_Attack.cpp index a4e3e0eb7..b5ad316d3 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Attack.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Attack.cpp @@ -66,12 +66,8 @@ void CGoblin_Attack::Update(_float fTimeDelta) Update_Event(fTimeDelta); - CGoblin_BattleAxe* pAxe = static_cast(m_pOwner); - - _float4x4 AxeMat = pAxe->Get_AxeMatrix(); - - m_pPT1->Get_Component()->Set_WorldMatrix(XMLoadFloat4x4(&AxeMat)); - m_pPT2->Get_Component()->Set_WorldMatrix(XMLoadFloat4x4(&AxeMat)); + m_pPT1->Get_Component()->Set_WorldMatrix(XMLoadFloat4x4(&m_vMat)); + m_pPT2->Get_Component()->Set_WorldMatrix(XMLoadFloat4x4(&m_vMat)); } @@ -90,13 +86,18 @@ HRESULT CGoblin_Attack::Pre_Setting(CGameObject* pObject, void* pArg) { if (FAILED(__super::Pre_Setting(pObject, nullptr))) return E_FAIL; - - CGoblin_BattleAxe* pAxe = static_cast(m_pOwner); - - _float4x4 AxeMat = pAxe->Get_AxeMatrix(); + // + //CGoblin_BattleAxe* pAxe = static_cast(m_pOwner); + // + //_float4x4 AxeMat = pAxe->Get_AxeMatrix(); - m_pPT1->Get_Component()->Set_WorldMatrix(XMLoadFloat4x4(&AxeMat)); - m_pPT2->Get_Component()->Set_WorldMatrix(XMLoadFloat4x4(&AxeMat)); + m_vMat = *static_cast<_float4x4*>(pArg); + + //m_pPT1->Get_Component()->Set_WorldMatrix(XMLoadFloat4x4(&AxeMat)); + //m_pPT2->Get_Component()->Set_WorldMatrix(XMLoadFloat4x4(&AxeMat)); + + m_pPT1->Get_Component()->Set_WorldMatrix(XMLoadFloat4x4(&m_vMat)); + m_pPT2->Get_Component()->Set_WorldMatrix(XMLoadFloat4x4(&m_vMat)); m_pPT1->Set_Visible(true); m_pPT2->Set_Visible(true); diff --git a/Jusin154_Team3D/Client/Private/Goblin_BattleAxe.cpp b/Jusin154_Team3D/Client/Private/Goblin_BattleAxe.cpp index f46735c9f..db38f0cc6 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_BattleAxe.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_BattleAxe.cpp @@ -269,7 +269,7 @@ void CGoblin_BattleAxe::SwingHit(_bool& bPlayerHit) for (_uint i = 0; i < pxHits.size(); ++i) { PSX::PxActor* pxHitActor = pxHits[i].actor; if (nullptr != pxHitActor && nullptr != pxHitActor->userData) { - PhsXUserData* pUserData = (PhsXUserData*)pxHitActor->userData; + PHYSX_USERDATA* pUserData = (PHYSX_USERDATA*)pxHitActor->userData; ON_COLLISION_INFO tagCollInfo = {}; diff --git a/Jusin154_Team3D/Client/Private/Goblin_Dagger.cpp b/Jusin154_Team3D/Client/Private/Goblin_Dagger.cpp index 9873105ac..fa04c9144 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Dagger.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Dagger.cpp @@ -202,7 +202,7 @@ void CGoblin_Dagger::Dagger_Hit() XMStoreFloat4(&tagCollInfo.vHitDir, vDir); tagCollInfo.fLength = fLength; - PhsXUserData* pUserData = static_cast(pActor->userData); + PHYSX_USERDATA* pUserData = static_cast(pActor->userData); tagCollInfo.pObject = pUserData->pOwner; switch (PXOBJECT(pUserData->iSubKind)) { diff --git a/Jusin154_Team3D/Client/Private/Goblin_Mage.cpp b/Jusin154_Team3D/Client/Private/Goblin_Mage.cpp index 7c75e3eb8..91479b8ca 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Mage.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Mage.cpp @@ -82,9 +82,6 @@ void CGoblin_Mage::Priority_Update(_float fTimeDelta) void CGoblin_Mage::Update(_float fTimeDelta) { - if (m_bVisible == false) - return; - m_pFSM->Update_State(fTimeDelta); m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); @@ -285,7 +282,6 @@ _vector CGoblin_Mage::Get_LockOnPos() void CGoblin_Mage::OnCollision(CGameObject* pOther, void* pDesc) { - if (true == m_bDead) { return; } @@ -332,6 +328,12 @@ void CGoblin_Mage::OnCollision(CGameObject* pOther, void* pDesc) case ENUM_CLASS(SKILL_TYPE::STUPEFY): m_eHitSpell = ENUM_CLASS(SKILL_TYPE::STUPEFY); break; + case ENUM_CLASS(SKILL_TYPE::AVADAKEDAVRA): + m_eHitSpell = ENUM_CLASS(SKILL_TYPE::AVADAKEDAVRA); + break; + case ENUM_CLASS(SKILL_TYPE::ANCIENT_MAGIC): + m_eHitSpell = ENUM_CLASS(SKILL_TYPE::ANCIENT_MAGIC); + break; } } else diff --git a/Jusin154_Team3D/Client/Private/Goblin_Mage_States.cpp b/Jusin154_Team3D/Client/Private/Goblin_Mage_States.cpp index 4cc70cbc5..98eb7e5ff 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Mage_States.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Mage_States.cpp @@ -466,7 +466,11 @@ void CGoblin_Mage::Behavior_HitEnter() pairAnimInfo = m_Animation[STATEANIM::INCARCEROUS]; break; default: - pairAnimInfo = m_Animation[STATEANIM::STUMBLE_BWD_R]; + _int iRand = m_pGameInstance->Real_Random_Int(0, 1); + if(iRand == 0) + pairAnimInfo = m_Animation[STATEANIM::STUMBLE_BWD_L]; + else + pairAnimInfo = m_Animation[STATEANIM::STUMBLE_BWD_R]; break; } diff --git a/Jusin154_Team3D/Client/Private/Goblin_Protego.cpp b/Jusin154_Team3D/Client/Private/Goblin_Protego.cpp index 95dfce590..c1fab98b3 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Protego.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Protego.cpp @@ -73,6 +73,9 @@ void CGoblin_Protego::Update(_float fTimeDelta) Update_Event(fTimeDelta); + if (m_bVisible == false) { + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(0.f, 0.f, 0.f, 1.f)); + } /* 시작 사이즈 러프 */ @@ -92,10 +95,8 @@ void CGoblin_Protego::Late_Update(_float fTimeDelta) { if (m_bVisible == false) return; - + m_pTransformCom->Set_State(STATE::POSITION, m_pOwner->Get_Component()->Get_Position()); __super::Late_Update(fTimeDelta); - - } HRESULT CGoblin_Protego::Pre_Setting(CGameObject* pObject, void* pArg) @@ -127,6 +128,15 @@ HRESULT CGoblin_Protego::Ready_Components(void* pArg) return E_FAIL; } + { // DO + CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; + Desc.iSubKind = ENUM_CLASS(PXOBJECT::GOBLIN_PROTEGO); + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_SHIELD"), (CComponent**)&m_pRigidBody, &Desc))) { + return E_FAIL; + } + m_pGameInstance->Attach_Actor(*m_pRigidBody->Get_Actor(), NEXT_LEVEL); + } + return S_OK; } @@ -164,6 +174,8 @@ CGameObject* CGoblin_Protego::Clone(void* pArg, CGameObject* pOwner) void CGoblin_Protego::OnCollision(CGameObject* pOther, void* pDesc) { + if (!m_bVisible) + return; //CTransform* pOtherTransform = p ON_COLLISION_INFO* CollisionDesc = static_cast(pDesc); @@ -180,6 +192,7 @@ void CGoblin_Protego::Free() SAFE_RELEASE(m_pSphere); SAFE_RELEASE(m_pBottom); SAFE_RELEASE(m_pCircle); + SAFE_RELEASE(m_pRigidBody); } #ifdef _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Goblin_States.cpp b/Jusin154_Team3D/Client/Private/Goblin_States.cpp index 1eac9fdf9..93d98f143 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_States.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_States.cpp @@ -30,9 +30,7 @@ void CGoblin::Behavior_IdleEnter() { m_pFSM->Enable_State(FSMSTATE::IDLE); - pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::IDLE]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } HRESULT CGoblin::Behavior_IdleExitCheck() @@ -41,6 +39,10 @@ HRESULT CGoblin::Behavior_IdleExitCheck() { m_bLookAt = false; m_bDetection = true; + + pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::IDLE]; + + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } if ((m_fTargetDistance <= 10.f && m_fTargetDistance != 0.f) /*|| m_pDetection->Get_Step() == true*/) { @@ -131,8 +133,6 @@ HRESULT CGoblin::Behavior_MoveExitCheck(_float fTimeDelta) pair<_uint, _bool> pairAnimInfo = {}; _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); - - if (m_fTargetDistance >= 6.f) { pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; @@ -207,8 +207,6 @@ void CGoblin::Behavior_CombatEnter() HRESULT CGoblin::Behavior_CombatExitCheck(_float fTimeDelta) { - m_bLookAt = true; - if (m_fTargetDistance > 25.f && m_fTargetDistance != 0.f) { m_pFSM->Change_State(FSMSTATE::IDLE); @@ -267,7 +265,7 @@ void CGoblin::Behavior_SwingEnter() m_pGoblinSpector->Set_Visible(true); m_pGoblinSpector->Spector_Trail_Visible(true); - m_pEffectPool->Use_Skill(SKILL_TYPE::GOBLIN_ATTACK, m_pGoblinSpector->Get_PartObject()); + m_pEffectPool->Use_Skill(SKILL_TYPE::GOBLIN_ATTACK, m_pGoblinSpector->Get_PartObject(), (void*)&m_pGoblinSpector->Get_PartObject()->Get_AxeMatrix()); }, 0.05f); @@ -286,7 +284,7 @@ void CGoblin::Behavior_SwingEnter() Set_Easing(pairAnimInfo.first, 0.01f, 0.15f, 0.8f); - Set_Easing(pairAnimInfo.first, 0.2f, 0.4f, 1.4f); + Set_Easing(pairAnimInfo.first, 0.15f, 0.4f, 1.4f); } HRESULT CGoblin::Behavior_SwingExitCheck(_float fTimeDelta) @@ -549,7 +547,11 @@ void CGoblin::Behavior_HitEnter() pairAnimInfo = m_Animation[STATEANIM::INCARCEROUS]; break; default: - pairAnimInfo = m_Animation[STATEANIM::STUMBLE_BWD_R]; + _int iRand = m_pGameInstance->Real_Random_Int(0, 1); + if (iRand == 0) + pairAnimInfo = m_Animation[STATEANIM::STUMBLE_BWD_L]; + else + pairAnimInfo = m_Animation[STATEANIM::STUMBLE_BWD_R]; break; } @@ -798,7 +800,7 @@ void CGoblin::HitState_Behavior(_float fTimeDelta) m_pCharacter_Controller->ConvertToDO(*m_pRigidBody); _vector vCameraLook = m_pGameInstance->Get_CameraLook(); vCameraLook = XMVector3Normalize(vCameraLook); - m_pRigidBody->Add_Force(vCameraLook * 30.f, PSX::PxForceMode::eIMPULSE); + m_pRigidBody->Add_Force(vCameraLook * 60.f, PSX::PxForceMode::eIMPULSE); m_fAirTime = 0.f; } break; diff --git a/Jusin154_Team3D/Client/Private/Goblin_Sword.cpp b/Jusin154_Team3D/Client/Private/Goblin_Sword.cpp new file mode 100644 index 000000000..8ba90ac83 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Goblin_Sword.cpp @@ -0,0 +1,328 @@ +#include "pch.h" +#include "Goblin_Sword.h" + +#include "GameInstance.h" +#include "Goblin.h" + +CGoblin_Sword::CGoblin_Sword(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CPartObject(pDevice, pContext) +{ +} + +CGoblin_Sword::CGoblin_Sword(const CGoblin_Sword& Prototype) + : CPartObject(Prototype) +{ +} + +HRESULT CGoblin_Sword::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CGoblin_Sword::Initialize(void* pArg) +{ + GOBLIN_SWORD_DESC* pDesc = static_cast (pArg); + m_pSocketMatrices = pDesc->pSocketMatrices; + m_iIndex = pDesc->iIndex; + + if (FAILED(__super::Initialize(pArg))) { + return E_FAIL; + } + + + if (FAILED(Ready_Components())) { + return E_FAIL; + } + + return S_OK; +} + +void CGoblin_Sword::Priority_Update(_float fTimeDelta) +{ + + + +#ifdef _DEBUG + Describe_Entity(); + +#endif // _DEBUG +} + +void CGoblin_Sword::Update(_float fTimeDelta) +{ + if (m_bDisolve) { + m_fDisolveTime += fTimeDelta; + if (m_fDisolveTime >= 1.f) + { + m_fDisolveTime = 0.f; + m_bDisolve = false; + m_bVisible = false; + } + } +} + +void CGoblin_Sword::Late_Update(_float fTimeDelta) +{ + XMStoreFloat4(&m_vStartPos, m_pTransformCom->Get_State(STATE::POSITION)); + + _matrix socketMatrix = {}; + + socketMatrix = XMLoadFloat4x4(m_pSocketMatrices); + + for (int i = 0; i < 3; ++i) { + socketMatrix.r[i] = XMVector3Normalize(socketMatrix.r[i]); + } + + m_pTransformCom->Set_WorldMatrix(socketMatrix * XMLoadFloat4x4(m_pParentTransformCom->Get_WorldMatrixPtr())); + XMStoreFloat4x4(&m_vSwordMat, XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("Bone")) * m_pTransformCom->Get_XMWorldMatrix()); + if (m_bCanTakeDamage) + { + Sword_Hit(); + } + else { + m_bHit = false; + } + m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); +} + +HRESULT CGoblin_Sword::Render() +{ + if (!m_pModelCom) + return S_OK; + + if (!m_bVisible) + return S_OK; + + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + + if (FAILED(Render_Disolve())) { + return E_FAIL; + } + + _uint iNumMeshes = m_pModelCom->Get_NumMeshes(); + + for (_uint i = 0; i < iNumMeshes; i++) + { + if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::SPECTOR_WEAPON)))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Render(i))) { + return E_FAIL; + } + } + + { + _bool bDisolve = false; + _float zero = 0.f; + m_pShaderCom->Bind_RawValue("g_bDisolve", &bDisolve, sizeof(_bool)); + m_pShaderCom->Bind_RawValue("g_fDisolveRatio", &zero, sizeof(_float)); + } + + return S_OK; +} + +HRESULT CGoblin_Sword::Render_Disolve() +{ + if (FLT_EPSILON3 * 10 < m_fDisolveTime) + { + _bool bDisolve = true; + _float fDisolveAmount = 0.1f; + _float fDisolveEdgeWidth = 0.1f; + if (FAILED(m_pShaderCom->Bind_RawValue("g_bDisolve", &bDisolve, sizeof(_bool)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fDisolveRatio", &m_fDisolveTime, sizeof(_float)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fDisolveAmount", &fDisolveAmount, sizeof(_float)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fDisolveEdgeWidth", &fDisolveEdgeWidth, sizeof(_float)))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_GlobalSRV(m_pShaderCom, TEXT("GLOBAL_DISOLVE_NOISE_05"), "g_DeadDisolveTexture"))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_GlobalSRV(m_pShaderCom, TEXT("GLOBAL_DISOLVE_BURN_VERTICAL"), "g_DisolveTexture"))) { + return E_FAIL; + } + } + + return S_OK; +} + +HRESULT CGoblin_Sword::Ready_Components() +{ + + CTransform::TRANSFORM_DESC Desc = {}; + + Desc.fSpeedPerSec = 10.f; + Desc.fRotationPerSec = XMConvertToRadians(180.0f); + Desc.fRadius = 10.f; + + __super::Ready_Components(&Desc); + + + if (m_iIndex == 0) + { + m_strModelPrototypeTag = TEXT("Prototype_Component_Goblin_Sword_L_Model"); + } + else { + m_strModelPrototypeTag = TEXT("Prototype_Component_Goblin_Sword_R_Model"); + } + + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag, + reinterpret_cast(&m_pModelCom)))) + return E_FAIL; + + /* Com_Shader */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH, + reinterpret_cast(&m_pShaderCom)))) + return E_FAIL; + + return S_OK; +} + +HRESULT CGoblin_Sword::Bind_ShaderResources() +{ + if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", m_pTransformCom->Get_WorldMatrixPtr()))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_PrevWorldMatrix", m_pTransformCom->Get_PrevWorldMatrixPtr()))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevViewMatrix", D3DTS::VIEW))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevProjMatrix", D3DTS::PROJ))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { + return E_FAIL; + } + + return S_OK; +} + +void CGoblin_Sword::Sword_Hit() +{ + _vector vStartPos = XMLoadFloat4(&m_vStartPos); + _vector vEndPos = m_pTransformCom->Get_State(STATE::POSITION); + _vector vDir = vEndPos - vStartPos; + _float fLength = XMVectorGetX(XMVector4Length(vDir)); + vDir = XMVector4Normalize(vDir); + m_SweepBuffer = {}; + _bool bHit = m_pGameInstance->SphereCast(0.5f, vStartPos, vDir, fLength, PSX::PxHitFlag::eDEFAULT, PSX::PxQueryFlag::eDYNAMIC, m_SweepBuffer); + if (true == bHit) { + vector Hits; + _uint iHitCount = m_SweepBuffer.nbTouches; + if (true == m_SweepBuffer.hasBlock) { + iHitCount += 1; + Hits.reserve(iHitCount); + Hits.emplace_back(&m_SweepBuffer.block); + } + else { + Hits.reserve(iHitCount); + } + for (_uint i = 0; i < m_SweepBuffer.nbTouches; ++i) { + Hits.emplace_back(&m_SweepBuffer.touches[i]); + } + + for (_uint i = 0; i < Hits.size(); ++i) { + PSX::PxSweepHit* pHit = Hits[i]; + PSX::PxActor* pActor = pHit->actor; + if (nullptr != pActor && nullptr != pActor->userData) { + const PSX::PxSweepHit& hit = m_SweepBuffer.block; + PSX::PxShape* pShape = hit.shape; + ON_COLLISION_INFO tagCollInfo = {}; + + tagCollInfo.vWorldPos.w = 1.f; + + memcpy_s(&tagCollInfo.vWorldPos, sizeof(tagCollInfo.vWorldPos), &hit.position, sizeof(hit.position)); + + memcpy_s(&tagCollInfo.vWorldNomal, sizeof(tagCollInfo.vWorldNomal), &hit.normal, sizeof(hit.normal)); + XMStoreFloat4(&tagCollInfo.vHitDir, vDir); + tagCollInfo.fLength = fLength; + tagCollInfo.fDamage = 10.f; + tagCollInfo.eHitType = ENUM_CLASS(HIT_TYPE::HIT_MEDIUM); + + PHYSX_USERDATA* pUserData = static_cast(pActor->userData); + tagCollInfo.pObject = pUserData->pOwner; + switch (PXOBJECT(pUserData->iSubKind)) + { + case Engine::PXOBJECT::PLAYER: + { + pUserData->pOwner->OnCollision(this, &tagCollInfo); + m_bHit = true; + m_bCanTakeDamage = false; + } + break; + case Engine::PXOBJECT::ALLY_HITBOX: + break; + default: + break; + } + + + } + } + } +} + + +CGoblin_Sword* CGoblin_Sword::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CGoblin_Sword* pInstance = new CGoblin_Sword(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CGoblin_Sword"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CGoblin_Sword::Clone(void* pArg, CGameObject* pOwner) +{ + CGoblin_Sword* pInstance = new CGoblin_Sword(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CGoblin_Sword"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CGoblin_Sword::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pModelCom); + +} +#ifdef _DEBUG + +void CGoblin_Sword::Describe_Entity() +{ +} + +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Level_Field.cpp b/Jusin154_Team3D/Client/Private/Level_Field.cpp index 9c23705d7..70e9b924c 100644 --- a/Jusin154_Team3D/Client/Private/Level_Field.cpp +++ b/Jusin154_Team3D/Client/Private/Level_Field.cpp @@ -130,7 +130,22 @@ HRESULT CLevel_Field::Ready_Lights() { CLight_Main* pLight = { nullptr }; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_LIGHT,nullptr, nullptr, &pLight))) { + LIGHT_DESC Desc = {}; + if (m_isDay) + { + Desc.vDiffuse = _float4(0.6529f, 0.6157f, 0.7843f, 1.0f); + Desc.vAmbient = _float4(0.6275f, 0.6275f, 0.6275f, 0.0314f); + Desc.vSpecular = _float4(0.05f, 0.05f, 0.05f, 0.05f); + } + else + { + Desc.vDiffuse = _float4(0.0471f, 0.0745f, 0.1294f, 0.2549f); + Desc.vAmbient = _float4(0.1686f, 0.1765f, 0.1373f, 0.0f); + Desc.vSpecular = _float4(0.0f, 0.0f, 0.0f, 0.0f); + } + + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_LIGHT, &Desc, nullptr, &pLight))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index 2cca88c8f..84ebb9e3b 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -4,13 +4,12 @@ #include "Level_Loading.h" #include "Light_Main.h" #include "Camera_Debug.h" +#include "Camera_Model.h" #include "InfoInstance.h" #include "UI_Manager.h" #include "Layer.h" #include "SkyBox.h" #include "Broom.h" -#include "Dummy_PhysXWall.h" -#include "Dummy_PhysXPlayable.h" #include "Terrain.h" #include "EffectPool.h" #include "InstancedProp.h" @@ -25,6 +24,7 @@ #include "Troll.h" #include "Goblin.h" #include "Goblin_Mage.h" +#include "Goblin_Assassin.h" #include "Goblin_Spector.h" #include "NPC_Ollivander.h" #include "NPC_EleazarFig.h" @@ -42,10 +42,31 @@ CLevel_GamePlay::CLevel_GamePlay(ID3D11Device* pDevice, ID3D11DeviceContext* pCo HRESULT CLevel_GamePlay::Initialize(void* pArg) { + // 낮, 밤 설정 +#ifdef gimch + m_isDay = false; +#endif // gimch +#ifdef Bin + m_isDay = true; +#endif // +#ifdef 진우 + m_isDay = true; +#endif // +#ifdef 기무리 + m_isDay = true; +#endif // +#ifdef 인혁 + m_isDay = true; +#endif // + if (FAILED(Ready_Lights())) { return E_FAIL; } + if (FAILED(Ready_Volumetric())) { + return E_FAIL; + } + //플레이어 , 맵 보다 먼저 생성해야함 ! if (FAILED(Reday_Layer_EffectPool())) { return E_FAIL; @@ -164,13 +185,54 @@ HRESULT CLevel_GamePlay::Render() HRESULT CLevel_GamePlay::Ready_Lights() { - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_LIGHT))) { + + LIGHT_DESC Desc = {}; + if (m_isDay) + { + Desc.vDiffuse = _float4(0.6529f, 0.6157f, 0.7843f, 1.0f); + Desc.vAmbient = _float4(0.6275f, 0.6275f, 0.6275f, 0.0314f); + Desc.vSpecular = _float4(0.05f, 0.05f, 0.05f, 0.05f); + } + else + { + Desc.vDiffuse = _float4(0.0471f, 0.0745f, 0.1294f, 0.2549f); + Desc.vAmbient = _float4(0.1686f, 0.1765f, 0.1373f, 0.0f); + Desc.vSpecular = _float4(0.0f, 0.0f, 0.0f, 0.0f); + } + + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_LIGHT, &Desc))) { return E_FAIL; } return S_OK; } +HRESULT CLevel_GamePlay::Ready_Volumetric() +{ + // Volumetric 설정 + if(m_isDay) + { + m_pGameInstance->Setting_Volumetirc( + 1.251f, // 밀도 + 0.0253f, // 빛 강도 + 0.9f, // 산란 계수 + 1.78f // 깊이 분포 계수 + ); + } + else + { + m_pGameInstance->Setting_Volumetirc( + 0.626f, // 밀도 + 0.01f, // 빛 강도 + 0.11f, // 산란 계수 + 1.0f // 깊이 분포 계수 + ); + } + + return S_OK; +} + HRESULT CLevel_GamePlay::Ready_Background() { CTerrain::TERRAIN_DESC Terrain_Desc = {}; @@ -267,8 +329,8 @@ HRESULT CLevel_GamePlay::Ready_Background() #endif // #ifdef 기무리 isReady_Background = true; - isReady_Hogsmeade = true; - isReady_Hogwart = true; + isReady_Hogsmeade = false; + isReady_Hogwart = false; #endif // #ifdef 인혁 isReady_Background = false; @@ -582,33 +644,57 @@ HRESULT CLevel_GamePlay::Ready_Layer_Player(const _wstring& strLayerTag) return E_FAIL; } - { - CNPC_Ollivander::NPCDESC NPCDesc{}; - NPCDesc.vPos = _float4(40.f, 4.f, 68.9f, 1.f); - NPCDesc.vRotQ = _float4(0.f, 0.f, 0.f, 1.f); - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &NPCDesc))) { - return E_FAIL; - } - } - { - CNPC_EleazarFig::NPCDESC NPCDesc{}; - NPCDesc.vPos = _float4(101.f, 14.f, 100.f, 1.f); - NPCDesc.vRotQ = _float4(0.f, 0.f, 0.f, 1.f); - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &NPCDesc))) { - return E_FAIL; - } - } + _bool isLoad_NPC = { true }; +#ifdef _DEBUG +#ifdef gimch + +#endif // gimch +#ifdef 진우 + +#endif // +#ifdef 기무리 + isLoad_NPC = true; +#endif // +#ifdef 인혁 + +#endif // +#ifdef Bin + +#endif // Bin +#endif // _DEBUG + + if(true == isLoad_NPC) + { + { + CNPC_Ollivander::NPCDESC NPCDesc{}; + NPCDesc.vPos = _float4(40.f, 4.f, 68.9f, 1.f); + NPCDesc.vRotQ = _float4(0.f, 0.f, 0.f, 1.f); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &NPCDesc))) { + return E_FAIL; + } + } + { + CNPC_EleazarFig::NPCDESC NPCDesc{}; + NPCDesc.vPos = _float4(101.f, 14.f, 100.f, 1.f); + NPCDesc.vRotQ = _float4(0.f, 0.f, 0.f, 1.f); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &NPCDesc))) { + return E_FAIL; + } + } + } return S_OK; } HRESULT CLevel_GamePlay::Ready_Layer_BroomRacerAI(const _wstring& strLayerTag) { - for (_uint i = 0; i < 10; ++i) { +#ifdef Bin + for (_uint i = 0; i < 0; ++i) { if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, m_pBroomRaceManager))) { return E_FAIL; } } +#endif // Bin return S_OK; } @@ -619,15 +705,16 @@ HRESULT CLevel_GamePlay::Ready_Layer_Item(const _wstring& strLayerTag) HRESULT CLevel_GamePlay::Ready_Layer_RaceRing(const _wstring& strLayerTag) { - for (_uint i = 0; i < 10; ++i) { + for (_uint i = 0; i < 1; ++i) { - CRaceRing::RACERING_DESC RaceRingDesc {}; + CRaceRing::RACERING_DESC RaceRingDesc{}; RaceRingDesc.pBroomRaceManager = m_pBroomRaceManager; RaceRingDesc.iIndex = i; if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &RaceRingDesc))) { return E_FAIL; } } + return S_OK; } @@ -637,49 +724,65 @@ HRESULT CLevel_GamePlay::Ready_Layer_SkyBox(const _wstring& strLayerTag) return E_FAIL; } - CDummy_PhysXWall::PHYSXDUMMY_DESC Desc{}; - Desc.vPos = { 0.f, 0.f, 0.f }; - Desc.vRotRPY = { 0.f, m_pGameInstance->Random_Float(0.f, XM_2PI), 0.f }; - Desc.iSubKind = ENUM_CLASS(PXOBJECT::WALL); - - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) { - return E_FAIL; - } - return S_OK; } HRESULT CLevel_GamePlay::Ready_Layer_Monster() { - for (_uint i = 0; i <1; ++i) - { - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) { + _bool isLoad_Monster = { true }; +#ifdef _DEBUG +#ifdef gimch + +#endif // gimch +#ifdef 진우 + +#endif // +#ifdef 기무리 + isLoad_Monster = true; +#endif // +#ifdef 인혁 + +#endif // +#ifdef Bin + +#endif // Bin +#endif // _DEBUG + if (true == isLoad_Monster) { + for (_uint i = 0; i < 1; ++i) + { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) { + return E_FAIL; + } + } + + for (_uint i = 0; i < 1; ++i) + { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) { + return E_FAIL; + } + } + + for (_uint i = 0; i < 1; ++i) + { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) { + return E_FAIL; + } + } + + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) { return E_FAIL; } - } - for (_uint i = 0; i <1; ++i) - { - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) { return E_FAIL; } + } - - - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) { - return E_FAIL; - } - #if 진우 #else #endif - - return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Light_Main.cpp b/Jusin154_Team3D/Client/Private/Light_Main.cpp index 07378ca26..4a6a16f7a 100644 --- a/Jusin154_Team3D/Client/Private/Light_Main.cpp +++ b/Jusin154_Team3D/Client/Private/Light_Main.cpp @@ -23,10 +23,12 @@ HRESULT CLight_Main::Initialize(void* pArg) if (FAILED(__super::Initialize(pArg))){ return E_FAIL; } - if (FAILED(Ready_Components())){ + if (FAILED(Ready_Components(pArg))){ return E_FAIL; } + m_pTransformCom->Set_State(STATE::LOOK, XMVectorSet(-1.716f, 0.121f, 0.211f, 0.f)); + return S_OK; } @@ -88,23 +90,23 @@ HRESULT CLight_Main::Capture_PreShadow() _float4x4 ProjMatrix = {}; XMStoreFloat4x4(&ProjMatrix, Get_OffCenterProjMatrix(xmViewMatrix, vNeededPos)); m_pGameInstance->Render_PreShadow(ViewMatrix, ProjMatrix); + + m_pGameInstance->Update_Volumetric(); return S_OK; } -HRESULT CLight_Main::Ready_Components() +HRESULT CLight_Main::Ready_Components(void* pArg) { __super::Ready_Components(nullptr); - m_pTransformCom->LookAt(XMVectorSet(1.f, -4.f, 1.f, 1.f)); + LIGHT_DESC* pLightDescArg = static_cast(pArg); + LIGHT_DESC LightDesc{}; LightDesc.eType = LIGHT::DIRECTIONAL; - //LightDesc.vDiffuse = _float4(0.8f, 0.8f, 0.8f, 0.f); - //LightDesc.vAmbient = _float4(0.6f, 0.6f, 0.6f, 0.f); - //LightDesc.vSpecular = _float4(0.f, 0.f, 0.f, 0.f); - LightDesc.vDiffuse = _float4(0.3f, 0.3f, 0.1f, 0.f); - LightDesc.vAmbient = _float4(0.12f, 0.12f, 0.24f, 0.f); - LightDesc.vSpecular = _float4(0.f, 0.f, 0.f, 0.f); + LightDesc.vDiffuse = pLightDescArg->vDiffuse; + LightDesc.vAmbient = pLightDescArg->vAmbient; + LightDesc.vSpecular = pLightDescArg->vSpecular; LightDesc.pDirection = m_pTransformCom->Get_StatePtr(STATE::LOOK); LightDesc.iLevel = NEXT_LEVEL; diff --git a/Jusin154_Team3D/Client/Private/Lightning.cpp b/Jusin154_Team3D/Client/Private/Lightning.cpp index 975c21975..04c8df5ab 100644 --- a/Jusin154_Team3D/Client/Private/Lightning.cpp +++ b/Jusin154_Team3D/Client/Private/Lightning.cpp @@ -39,7 +39,7 @@ HRESULT CLightning::Initialize(void* pArg) if (FAILED(Create_Effect())) return E_FAIL; - m_iSkillType = ENUM_CLASS(SKILL_TYPE::LIGHTNING); + m_iSkillType = ENUM_CLASS(SKILL_TYPE::ANCIENT_MAGIC); m_wstrEffectName = L"Lightning"; @@ -82,14 +82,15 @@ void CLightning::Late_Update(_float fTimeDelta) __super::Late_Update(fTimeDelta); - //if (false == m_bHit) { - // _vector vStartPos = XMLoadFloat4(&m_vStartPos); - // _vector vEndPos = XMLoadFloat4(&m_vEndPos); - // ON_COLLISION_INFO CollisionInfo = SweepTarget(vStartPos, vEndPos, 0.002f , true); + if (false == m_bHit) { + _vector vTop = XMLoadFloat4(&m_vTargetPos) + XMVectorSet(0.f, 5.f, 0.f, 0.f); - // OnCollision(this, &CollisionInfo); - //} + _vector vBottom = XMLoadFloat4(&m_vTargetPos) - XMVectorSet(0.f, 5.f, 0.f, 0.f); + ON_COLLISION_INFO CollisionInfo = SweepTarget(vTop, vBottom, 0.02f, true); + + OnCollision(this, &CollisionInfo); + } } HRESULT CLightning::Pre_Setting(CGameObject* pObject, void* pArg) @@ -215,7 +216,7 @@ void CLightning::OnCollision(CGameObject* pOther, void* pDesc) pPair.second->Get_Component()->Set_State(STATE::POSITION, vPos); } - CWand* pWand = static_cast(m_pOwner)->Get_PartObject(); + CWand* pWand = static_cast(m_pOwner); if (pWand == nullptr) return; diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index b76bba824..1da230075 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -14,6 +14,7 @@ #include "CamPosition_Socket.h" #include "CamPosition_Target.h" #include "CamPosition_AI.h" +#include "Camera_Model.h" #include "SkyBox.h" #include "Troll_Weapon.h" #include "Troll_Rock.h" @@ -21,15 +22,19 @@ #include "Wand.h" #include "Item_Potion.h" #include "RaceRing.h" +#include "Goblin_Sword.h" #include "Goblin_BattleAxe.h" #include "BroomRaceManager.h" #pragma region ACTOR #include "Player.h" +#include "PlayerRobe.h" #include "Goblin.h" #include "Goblin_Mage.h" +#include "Goblin_Assassin.h" #include "Goblin_Spector.h" +#include "Goblin_Assassin_Spector.h" #include "Troll.h" #include "NPC_Ollivander.h" #include "NPC_EleazarFig.h" @@ -135,9 +140,6 @@ #pragma endregion #pragma region PHYSX - -#include "Dummy_PhysXWall.h" -#include "Dummy_PhysXPlayable.h" #include "PhysXEffectHitBox.h" #pragma endregion @@ -355,27 +357,39 @@ HRESULT CLoader::Loading_For_GamePlay() _bool isLoad_Background = { true }; _bool isLoad_Hogwart = { false }; + _bool isLoad_UI_SEQUANTIAL = { true }; + _bool isLoad_NPC = { true }; + _bool isLoad_Monster = { true }; +#ifdef _DEBUG #ifdef gimch isLoad_Background = true; isLoad_Hogwart = false; + isLoad_UI_SEQUANTIAL = false; #endif // gimch -#ifdef Bin - isLoad_Background = false; - isLoad_Hogwart = false; -#endif // #ifdef 진우 isLoad_Background = false; isLoad_Hogwart = false; + isLoad_UI_SEQUANTIAL = false; #endif // #ifdef 기무리 isLoad_Background = true; - isLoad_Hogwart = true; + isLoad_Hogwart = false; + isLoad_UI_SEQUANTIAL = false; + isLoad_NPC = true; + isLoad_Monster = true; #endif // #ifdef 인혁 isLoad_Background = false; isLoad_Hogwart = false; + isLoad_UI_SEQUANTIAL = false; #endif // +#ifdef Bin + isLoad_Background = false; + isLoad_Hogwart = false; + isLoad_UI_SEQUANTIAL = false; +#endif // Bin +#endif // _DEBUG #pragma region MAP_MODELS vector*>> jobMapModels; @@ -945,8 +959,6 @@ HRESULT CLoader::Loading_For_GamePlay() } #pragma endregion - - #pragma region UI Asset_FileLoad("../Bin/Resources/Textures/Keyboard", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) @@ -1225,106 +1237,103 @@ HRESULT CLoader::Loading_For_GamePlay() { return E_FAIL; } +#pragma region UI_ANI + if (true == isLoad_UI_SEQUANTIAL) { + + 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("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("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("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("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("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; + } + + } +#pragma endregion + +#pragma endregion #pragma region Global_SRV { m_pGameInstance->Load_GlobalSRV(TEXT("GLOBAL_DISOLVE_NOISE_05"), "../Bin/Resources/Textures/Effect/Noises/VFX_T_Noise05_D.png"); m_pGameInstance->Load_GlobalSRV(TEXT("GLOBAL_DISOLVE_BURN_VERTICAL"), "../Bin/Resources/Textures/Effect/Diffuse/drp_fire_Line_Vertical.png"); } #pragma endregion -#if 진우 -#elif 기무리 -#elif 인혁 -#elif Bin -#elif gimch -#else -#pragma region UI_ANI - 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("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("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("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("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("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; - } - -#pragma endregion -#endif - #pragma region TERRAIN_TEXTURE /* Terrain_Diffuse */ if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Terrain_Diffuse"), @@ -1373,7 +1382,6 @@ HRESULT CLoader::Loading_For_GamePlay() return E_FAIL; } #pragma endregion - #pragma region LAKE_TEXTURE /* For.Prototype_Component_Water_Noise_D */ if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("T_Noises_D"), @@ -1510,6 +1518,7 @@ HRESULT CLoader::Loading_For_GamePlay() #pragma endregion +#pragma region SHADER m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다."); @@ -1531,7 +1540,7 @@ HRESULT CLoader::Loading_For_GamePlay() return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_INSTANCE_PROP_MODEL, + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_INSTANCE_PROP_MODEL, CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxWorldModelInstance.hlsl"), VTX_MODEL_INSTANCE_MODEL::Elements, VTX_MODEL_INSTANCE_MODEL::iNumElements)))) { return E_FAIL; @@ -1572,6 +1581,7 @@ HRESULT CLoader::Loading_For_GamePlay() return E_FAIL; } +#pragma endregion m_strMessage = TEXT("모델를(을) 로딩 중 입니다."); CVIBuffer_UI_Instance::UI_INSTANCE_DESC SpellSlotUIDesc{}; @@ -1663,7 +1673,68 @@ 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.005f }; + Desc.vhalfGeometryInfo = { 0.025f, 0.025f, 0.025f }; + Desc.fDensity = 0.01f; + Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY()); + Desc.eLockFlag = {}; + Desc.vAutoDamping = { 12.f, 12.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.001f }; + Desc.fContactOffset = { 0.005f }; + Desc.vhalfGeometryInfo = { 0.025f, 0.085f, 0.f }; + Desc.fDensity = 0.01f; + Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY()); + Desc.eLockFlag = {}; + Desc.vAutoDamping = { 12.f, 12.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)))) { + 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.01f }; + Desc.fContactOffset = { 0.01f }; + Desc.vhalfGeometryInfo = { 0.12f, 0.25f, 0.f }; + Desc.fDensity = 122.f; + Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY()); + Desc.eLockFlag = {}; + Desc.vAutoDamping = { 1.f, 1.f }; + Desc.vLocalRotQ = { 0.f, 0.f, 0.f, 1.f }; + Desc.vLocalTranslation = { 0.f, 0.f, 0.f }; + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_Player_Leg"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) { + return E_FAIL; + } + } + { + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DynamicJoint"), CDynamic_D6Joint::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + } { // LIGHT PHYSX DYNAMIC CRigidBody_Dynamic::RIGIDBODY_PROTOTYPE_DYNAMIC_DESC Desc{}; { @@ -1690,7 +1761,7 @@ HRESULT CLoader::Loading_For_GamePlay() Desc1.ePxMaterialTypes = { PXMATERIAL::DEFAULT }; Desc1.vMatInfo = { 0.5f, 0.5f, 0.6f }; Desc1.fContactOffset = { 0.05f }; - Desc1.vhalfGeometryInfo = { 1.f, 1.f, 1.f }; + Desc1.vhalfGeometryInfo = { 2.f, 2.f, 2.f }; Desc1.fDensity = 1.f; Desc1.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY()); Desc1.eLockFlag = {}; @@ -1702,22 +1773,21 @@ HRESULT CLoader::Loading_For_GamePlay() 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_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{}; { @@ -1760,55 +1830,69 @@ 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; } + if (true == isLoad_NPC) { + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Npc_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Npc/Npc.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) { + 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())))) { + return E_FAIL; + } - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Npc_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Npc/Npc.bin",XMMatrixRotationY(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())))) { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_VictorRookWood_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Human/Npc/VictorRookWood/VictorRookWood.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) { + return E_FAIL; + } } + if (true == isLoad_Monster) { - 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())))){ - return E_FAIL; - } + 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())))) { + return E_FAIL; + } - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Goblin_Mage_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/Goblin_Mage/GoblinMage.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) - return E_FAIL; + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Goblin_Mage_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/Goblin_Mage/GoblinMage.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) + return E_FAIL; if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Goblin_Spector_Model"), CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/GoblinSpector/GoblinSpector.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) return E_FAIL; - + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Goblin_Assassin_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Monster/Goblin_Assassin/SK_GOB_M_Assassin_Master.bin", XMMatrixRotationZ(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) + 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_VictorRookWood_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Human/Npc/VictorRookWood/VictorRookWood.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) { - return E_FAIL; - } - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Ghost_Peeves_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Human/Npc/Ghost_Peeves/Ghost_Peeves.bin", XMMatrixScaling(0.1f, 0.1f, 0.1f) * XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) { - return E_FAIL; - } + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Ghost_Peeves_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Human/Npc/Ghost_Peeves/Ghost_Peeves.bin", XMMatrixScaling(0.1f, 0.1f, 0.1f) * XMMatrixRotationY(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())))){ - 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())))) { + return E_FAIL; + } - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Ranrok_Model"), - 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; + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Ranrok_Model"), + 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; + } } - #pragma endregion #pragma region ITEM @@ -1841,13 +1925,27 @@ HRESULT CLoader::Loading_For_GamePlay() CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Goblin_Dagger/SK_WPN_GOB_SmallSword.bin", XMMatrixIdentity())))) return E_FAIL; + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Goblin_Sword_L_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Goblin_Sword/SK_WPN_GOB_SmallSword_L.bin", XMMatrixIdentity())))) + return E_FAIL; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Goblin_Sword_R_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Goblin_Sword/SK_WPN_GOB_SmallSword_R.bin", XMMatrixIdentity())))) + return E_FAIL; + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Goblin_BattleAxe_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Goblin_BattleAxe/SK_WPN_GOB_BattleAxe01.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixRotationX(XMConvertToRadians(-90.f)) * XMMatrixIdentity())))) + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Goblin_BattleAxe/SK_WPN_GOB_BattleAxe01.bin", XMMatrixRotationX(XMConvertToRadians(-90.f)) * XMMatrixIdentity())))) return E_FAIL; #pragma endregion + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CPlayerRobe::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_CCL_CameraRig.001_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Camera/CCL_CameraRig.001.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixRotationZ(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) + return E_FAIL; /* For.Prototype_Component_SkyboxModel */ if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_SkyboxModel"), @@ -2721,10 +2819,18 @@ HRESULT CLoader::Loading_For_GamePlay() if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CGoblin_Mage::Create(m_pDevice, m_pContext)))) return E_FAIL; + /* For.Prototype_GameObject_Goblin_Assassin */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CGoblin_Assassin::Create(m_pDevice, m_pContext)))) + return E_FAIL; + /* For.Prototype_GameObject_Goblin_Spector */ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CGoblin_Spector::Create(m_pDevice, m_pContext)))) return E_FAIL; + /* For.Prototype_GameObject_Goblin_Assassin_Spector */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CGoblin_Assassin_Spector::Create(m_pDevice, m_pContext)))) + return E_FAIL; + /* For.Prototype_GameObject_Troll */ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CTroll::Create(m_pDevice, m_pContext)))) return E_FAIL; @@ -2775,6 +2881,10 @@ HRESULT CLoader::Loading_For_GamePlay() if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCamPosition_Arm::Create(m_pDevice, m_pContext)))) return E_FAIL; + /* For.Prototype_GameObject_Camera_Model */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCamera_Model::Create(m_pDevice, m_pContext)))) + return E_FAIL; + /* For.Prototype_GameObject_Wand */ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CWand::Create(m_pDevice, m_pContext)))) return E_FAIL; @@ -2799,6 +2909,10 @@ HRESULT CLoader::Loading_For_GamePlay() if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CGoblin_Dagger::Create(m_pDevice, m_pContext)))) return E_FAIL; + /* For.Prototype_GameObject_Goblin_Sword */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CGoblin_Sword::Create(m_pDevice, m_pContext)))) + return E_FAIL; + /* For.Prototype_GameObject_Goblin_BattleAxe */ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CGoblin_BattleAxe::Create(m_pDevice, m_pContext)))) return E_FAIL; @@ -2811,15 +2925,6 @@ HRESULT CLoader::Loading_For_GamePlay() if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CBroomRaceManager::Create(m_pDevice, m_pContext)))) return E_FAIL; - - if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummy_PhysXWall::Create(m_pDevice, m_pContext)))) { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummy_PhysXPlayable::Create(m_pDevice, m_pContext)))) { - return E_FAIL; - } - if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CPhysXEffectHitBox::Create(m_pDevice, m_pContext)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Private/MapElement_Chest.cpp b/Jusin154_Team3D/Client/Private/MapElement_Chest.cpp index e88df1c57..c0a2d1748 100644 --- a/Jusin154_Team3D/Client/Private/MapElement_Chest.cpp +++ b/Jusin154_Team3D/Client/Private/MapElement_Chest.cpp @@ -56,7 +56,7 @@ HRESULT CMapElement_Chest::Initialize(void* pArg) m_pActor = static_cast(m_pRigidBody->Get_Actor()); 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); + static_cast(m_pRigidBody)->Move_LocalPos(XMVectorSet(0.f, 0.f, 0.f, 1.f), XMLoadFloat3(&pDesc->vBoxLocalPosition)); return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/MapElement_Door.cpp b/Jusin154_Team3D/Client/Private/MapElement_Door.cpp index 3252956d8..5cfaea21f 100644 --- a/Jusin154_Team3D/Client/Private/MapElement_Door.cpp +++ b/Jusin154_Team3D/Client/Private/MapElement_Door.cpp @@ -117,7 +117,7 @@ void CMapElement_Door::Late_Update(_float fTimeDelta) * (ScaleMatrix * RotationMatrix * TranslationWorld); // 그 후 SRT 적용 m_pTransformCom->Set_WorldMatrix(world); - m_pActor->setGlobalPose(XMWorldToPx_NoScale(world)); + m_pActor->setGlobalPose(XMWorldToPx_NoScaleNoFlip(world)); m_pActor->setAngularVelocity(PSX::PxVec3(0)); m_pActor->setLinearVelocity(PSX::PxVec3(0)); diff --git a/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp b/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp index 025f96a04..b81314591 100644 --- a/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp +++ b/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp @@ -58,7 +58,7 @@ HRESULT CMapElement_Interactable::Initialize(void* pArg) m_pActor = static_cast(m_pRigidBody->Get_Actor()); 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); + static_cast(m_pRigidBody)->Move_LocalPos(XMVectorSet(0.f, 0.f, 0.f, 1.f), XMLoadFloat3(&pDesc->vBoxLocalPosition)); //static_cast(m_pRigidBody)->Set_Kinematic(false); if (false == m_isPooled) @@ -338,7 +338,7 @@ void CMapElement_Interactable::ActivateAt(_fvector vPos) m_pTransformCom->Set_State(STATE::POSITION, vPos); m_pInfoInstance->Regist_ActiveInteractive(this); m_pRigidBody->Set_Kinematic(false); - m_pRigidBody->Set_Position(vPos); + m_pRigidBody->Set_Position(vPos, true); } ON_COLLISION_INFO CMapElement_Interactable::CollisionCheck(_fvector StartPos, _fvector EndPos, _float fRadius) @@ -372,7 +372,7 @@ ON_COLLISION_INFO CMapElement_Interactable::CollisionCheck(_fvector StartPos, _f if (nullptr != pActor && nullptr != pActor->userData) { - PhsXUserData* pUserData = static_cast(pActor->userData); + PHYSX_USERDATA* pUserData = static_cast(pActor->userData); tagCollInfo.pObject = pUserData->pOwner; switch (pUserData->eKind) @@ -432,7 +432,7 @@ ON_COLLISION_INFO CMapElement_Interactable::CollisionCheck(_fvector StartPos, _f if (nullptr != pActor && nullptr != pActor->userData) { - PhsXUserData* pUserData = static_cast(pActor->userData); + PHYSX_USERDATA* pUserData = static_cast(pActor->userData); tagCollInfo.pObject = pUserData->pOwner; switch (PXOBJECT(pUserData->iSubKind)) diff --git a/Jusin154_Team3D/Client/Private/Monster.cpp b/Jusin154_Team3D/Client/Private/Monster.cpp index c7efd8cb7..953e311b3 100644 --- a/Jusin154_Team3D/Client/Private/Monster.cpp +++ b/Jusin154_Team3D/Client/Private/Monster.cpp @@ -28,7 +28,7 @@ HRESULT CMonster::Initialize(void* pArg) } m_pInfoInstance->Regist_ActiveMonster(this); - + return S_OK; } @@ -115,14 +115,8 @@ HRESULT CMonster::Render_OutLine() return E_FAIL; } Compute_Depth(); - _float fRatio = (m_fCamDepth / *m_pGameInstance->Get_CurrentCameraFar()); + _float fRatio = CMyTools::Saturate((m_fCamDepth / *m_pGameInstance->Get_CurrentCameraFar())); m_fOutLineThickness = CMyTools::Lerp_f1D(2.f, 6.f, fRatio); - if (m_fOutLineThickness > 6.f) { - m_fOutLineThickness = 6.f; - } - else if (m_fOutLineThickness < 2.f) { - m_fOutLineThickness = 2.f; - } if (FAILED(m_pShaderCom->Bind_RawValue("g_vOutLineColor", &m_vOutLineColor, sizeof(_float3)))) { return E_FAIL; } @@ -227,10 +221,10 @@ HRESULT CMonster::Render_Disolve() if (FLT_EPSILON3 * 10 < m_fDisolveTime) { m_bDrawOutLine = false; - _bool bDisolve = true; + _int bDisolve = 1; _float fDisolveAmount = 0.1f; _float fDisolveEdgeWidth = 0.1f; - if (FAILED(m_pShaderCom->Bind_RawValue("g_bDisolve", &bDisolve, sizeof(_bool)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_bDisolve", &bDisolve, sizeof(_int)))) { return E_FAIL; } if (FAILED(m_pShaderCom->Bind_RawValue("g_fDisolveRatio", &m_fDisolveTime, sizeof(_float)))) { diff --git a/Jusin154_Team3D/Client/Private/NPC_Ollivander.cpp b/Jusin154_Team3D/Client/Private/NPC_Ollivander.cpp index 8a9aff9a6..91c8304cd 100644 --- a/Jusin154_Team3D/Client/Private/NPC_Ollivander.cpp +++ b/Jusin154_Team3D/Client/Private/NPC_Ollivander.cpp @@ -311,7 +311,7 @@ HRESULT CNPC_Ollivander::Ready_Components(void* pArg) return E_FAIL; } - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER, nullptr, this, &m_pNPCInteraction))) { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &m_pNPCInteraction))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Private/NomalJap.cpp b/Jusin154_Team3D/Client/Private/NomalJap.cpp index 2f62d531b..c4f08c21d 100644 --- a/Jusin154_Team3D/Client/Private/NomalJap.cpp +++ b/Jusin154_Team3D/Client/Private/NomalJap.cpp @@ -6,6 +6,7 @@ #include "GameInstance.h" #include "EffectParts.h" #include "TrailObject.h" +#include "Player.h" CNomalJap::CNomalJap(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -112,7 +113,7 @@ void CNomalJap::Update(_float fTimeDelta) _vector vDir = XMLoadFloat4(&m_vEndPos) - XMLoadFloat4(&m_vStartPos); - if (true == m_pGameInstance->SphereCast(0.25, XMLoadFloat4(&m_vStartPos), XMVector3Normalize(vDir), XMVectorGetX(XMVector3Length(vDir)) + if (true == m_pGameInstance->SphereCast(0.25f, XMLoadFloat4(&m_vStartPos), XMVector3Normalize(vDir), XMVectorGetX(XMVector3Length(vDir)) , PSX::PxHitFlag::ePOSITION | PSX::PxHitFlag::eNORMAL, PSX::PxQueryFlag::eDYNAMIC | PSX::PxQueryFlag::eSTATIC, m_Hitbuffer)) { OnCollision(this); @@ -302,7 +303,7 @@ void CNomalJap::OnCollision(CGameObject* pOther, void* pDesc) Get_PartObject()->Set_Visible(false); Get_PartObject()->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(0.f, 0.f, 0.f, 1.f)); - + dynamic_cast(m_pOwner->Get_Owner())->Start_CameraShake(0.2f, 1.f); } void CNomalJap::Free() diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index c0ca9a43f..9a2eaae22 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -17,6 +17,7 @@ #include "MapElement_Interactable.h" #include "BroomRaceManager.h" #include "RaceRing.h" +#include "PlayerRobe.h" #pragma region STATE #include "State_Idle.h" @@ -177,6 +178,7 @@ __super::Update(fTimeDelta); m_pCharacter_Controller->Move(fTimeDelta); m_pCallBack_HitReport->Set_CurrentSlop(); } + if (m_pGameInstance->Mouse_Down(DIM_RBUTTON)){ m_pInfoInstance->Mouse_Input(ENUM_CLASS(KEYINPUT::DIM_RBUTTON_DOWN)); } @@ -187,6 +189,116 @@ __super::Update(fTimeDelta); } } +void CPlayer::Late_Update(_float fTimeDelta) +{ + m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_FootPosition()); + + m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); +#ifdef _DEBUG + m_pGameInstance->Add_RenderGroup(RENDER::NONLIGHT, this); +#endif // _DEBUG + + Set_Shadow(m_pGameInstance->IsIn_ShadowViewFrustum(m_pTransformCom->Get_State(STATE::POSITION), m_pTransformCom->Get_Radius())); + + __super::Late_Update(fTimeDelta); + + if (nullptr != m_LockOnInfo.pUnit) { + if (false == m_LockOnInfo.pUnit->isDead()) { + static_cast(m_LockOnInfo.pUnit)->Set_DrawOutLine(); + } + else { + m_LockOnInfo.pUnit = nullptr; + } + } + if (nullptr != m_LockOnInfo.pInteractive) { + static_cast(m_LockOnInfo.pInteractive)->Set_DrawOutLine(); + } + + if (m_bLookAt && m_LockOnInfo.pUnit) + { + m_pTransformCom->LookAt_Horizontal_Lerp(m_LockOnInfo.pUnit->Get_WorldPostion(), fTimeDelta, 5.f); + } + //////////////////////////////////////////////////////////////////////////// + _vector look = XMVector3Normalize(m_pTransformCom->Get_State(STATE::LOOK)); + + _vector worldUp = XMVectorSet(0.f, 1.f, 0.f, 0.f); + + _vector right = XMVector3Normalize(XMVector3Cross(worldUp, look)); + _vector up = XMVector3Normalize(XMVector3Cross(look, right)); + + m_pTransformCom->Set_State(STATE::RIGHT, right); + m_pTransformCom->Set_State(STATE::UP, up); + m_pTransformCom->Set_State(STATE::LOOK, look); + //////////////////////////////////////////////////////////////////////////// + +//#ifdef 기무리 +// 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("RobePart", g_iStaticLevel, &m_pRobePart, &Desc))) { +// assert(false); +// } +// } +// } +//#endif // 기무리 +} + + +HRESULT CPlayer::Render() +{ + if (!m_bVisible){ + return S_OK; + } + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + RENDER eType = m_pGameInstance->Get_CurrentRenderPass(); + if (RENDER::NONBLEND == eType) { + _uint iNumMeshes = m_pModelCom->Get_NumMeshes(); + + for (_uint i = 0; i < iNumMeshes; i++) + { + if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_Matrices( + "g_OffsetMatrix", + m_pModelCom->Get_OffsetMatrix(i).data(), + (_int)m_pModelCom->Get_OffsetMatrix(i).size() + ))) + { + return E_FAIL; + } + if (FAILED(m_pModelCom->Begin(i, m_pShaderCom))) { + return E_FAIL; + } + + + m_pModelCom->Bind_OutPut_SRV_VS(26, 0); + m_pModelCom->Bind_OutPut_SRV_VS_Prev(27, 0); + if (FAILED(Bind_ShaderParameters(i))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Render(i))) { + return E_FAIL; + } + } + Render_CameraCoordinateSystem(); + //m_pCharacter_Controller->Render(); + } +#ifdef _DEBUG + if (RENDER::NONLIGHT == eType) { + //m_pRigidBody->Render(); + } +#endif + + return S_OK; +} void CPlayer::UpdateGrapInteractive(_float fTimeDelta) { if (nullptr != m_pGrapInteractive) { @@ -217,98 +329,6 @@ void CPlayer::Update_CameraShake(_float fTimeDelta) } } } - -void CPlayer::Late_Update(_float fTimeDelta) -{ - m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_FootPosition()); - - m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); - - Set_Shadow(m_pGameInstance->IsIn_ShadowViewFrustum(m_pTransformCom->Get_State(STATE::POSITION), m_pTransformCom->Get_Radius())); - - __super::Late_Update(fTimeDelta); - - if (nullptr != m_LockOnInfo.pUnit) { - if (false == m_LockOnInfo.pUnit->isDead()) { - static_cast(m_LockOnInfo.pUnit)->Set_DrawOutLine(); - } - else { - m_LockOnInfo.pUnit = nullptr; - } - } - if (nullptr != m_LockOnInfo.pInteractive) { - static_cast(m_LockOnInfo.pInteractive)->Set_DrawOutLine(); - } - - if (m_bLookAt && m_LockOnInfo.pUnit) - { - m_pTransformCom->LookAt_Horizontal_Lerp(m_LockOnInfo.pUnit->Get_WorldPostion(), fTimeDelta, 10.f); - } - //////////////////////////////////////////////////////////////////////////// - _vector look = XMVector3Normalize(m_pTransformCom->Get_State(STATE::LOOK)); - - _vector worldUp = XMVectorSet(0.f, 1.f, 0.f, 0.f); - - _vector right = XMVector3Normalize(XMVector3Cross(worldUp, look)); - _vector up = XMVector3Normalize(XMVector3Cross(look, right)); - - m_pTransformCom->Set_State(STATE::RIGHT, right); - m_pTransformCom->Set_State(STATE::UP, up); - m_pTransformCom->Set_State(STATE::LOOK, look); - //////////////////////////////////////////////////////////////////////////// - - -} - -HRESULT CPlayer::Render() -{ - if (!m_bVisible){ - return S_OK; - } - if (FAILED(Bind_ShaderResources())) { - return E_FAIL; - } - - _uint iNumMeshes = m_pModelCom->Get_NumMeshes(); - - for (_uint i = 0; i < iNumMeshes; i++) - { - if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) { - return E_FAIL; - } - - if (FAILED(m_pShaderCom->Bind_Matrices( - "g_OffsetMatrix", - m_pModelCom->Get_OffsetMatrix(i).data(), - (_int)m_pModelCom->Get_OffsetMatrix(i).size() - ))) - { - return E_FAIL; - } - if (FAILED(m_pModelCom->Begin(i, m_pShaderCom, false))) { - return E_FAIL; - } - - - m_pModelCom->Bind_OutPut_SRV_VS(26, 0); - m_pModelCom->Bind_OutPut_SRV_VS_Prev(27, 0); - if (FAILED(Bind_ShaderParameters(i))) { - return E_FAIL; - } - - if (FAILED(m_pModelCom->Render(i))) { - return E_FAIL; - } - } - -#ifdef _DEBUG - m_pCharacter_Controller->Render(); - //m_pRigidBody->Render(); - Render_CameraCoordinateSystem(); -#endif - - return S_OK; -} HRESULT CPlayer::Render_Shadow(SHADOW eType) { if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", m_pTransformCom->Get_WorldMatrixPtr()))) { @@ -349,12 +369,11 @@ HRESULT CPlayer::Render_Shadow(SHADOW eType) } void CPlayer::OnCollision(CGameObject* pOther, void* pDesc) { - - if (m_pFSM->IsEnable(FSMSTATE::SHIELD)) - { - m_bShield = true; - } - if (m_pFSM->IsEnable(FSMSTATE::DODGE | FSMSTATE::BLINK) && m_bShield) + _int iCurrAnim = m_pModelCom->Get_AnimIndex(); + if (m_pFSM->IsEnable(FSMSTATE::DODGE | FSMSTATE::BLINK) || + m_bShield || + iCurrAnim == m_Animation[STATEANIM::AVADA_KEDAVRA].first|| + iCurrAnim == m_Animation[STATEANIM::ANCIENT_LIGHTNING].first) return; #ifdef _DEBUG @@ -372,7 +391,8 @@ void CPlayer::OnCollision(CGameObject* pOther, void* pDesc) m_fHitDegree = -1.f; } - m_pFSM->Change_State(FSMSTATE::HIT); + if(m_eHitType !=ENUM_CLASS(HIT_TYPE::HIT_NONE)) + m_pFSM->Change_State(FSMSTATE::HIT); } void CPlayer::OnHit(CGameObject* pOther, CGameObject* pCaller) { @@ -385,7 +405,6 @@ void CPlayer::Start_CameraShake(_float fTime, _float fIntense) m_fCameraShakeIntense = fIntense; m_bCameraShake = true; } -#ifdef _DEBUG void CPlayer::Render_CameraCoordinateSystem() { @@ -437,8 +456,6 @@ void CPlayer::Render_CameraCoordinateSystem() ); m_Batch->End(); } -#endif // _DEBUG - HRESULT CPlayer::Ready_Components() { CTransform::TRANSFORM_DESC Desc = {}; @@ -550,8 +567,6 @@ HRESULT CPlayer::Ready_Parts() return E_FAIL; } - - return S_OK; } @@ -719,7 +734,7 @@ void CPlayer::Free() { __super::Free(); - + SAFE_RELEASE(m_pRobePart); SAFE_RELEASE(m_pGrapInteractive); if (nullptr != m_pInfoInstance) { CInfoInstance* pInfo = m_pInfoInstance; diff --git a/Jusin154_Team3D/Client/Private/PlayerRobe.cpp b/Jusin154_Team3D/Client/Private/PlayerRobe.cpp new file mode 100644 index 000000000..45f614a02 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/PlayerRobe.cpp @@ -0,0 +1,638 @@ +#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 SocketMatrixFixed = (XMMatrixRotationZ(XM_PI) * XMLoadFloat4x4(m_pSocketMatrix)) * + XMLoadFloat4x4(m_pParentTransformCom->Get_WorldMatrixPtr()); + m_pRobeMainAnchor->Move_Kinematic(SocketMatrixFixed, false); + m_pRobeMainAnchor->Get_Actor()->wakeUp(); + Update_LegsPosition(); +} + +void CPlayerRobe::Late_Update(_float fTimeDelta) +{ + Update_RobeSocketPosition(); +#ifdef _DEBUG + for (_uint i = 0; i < ENUM_CLASS(PLAYER_JOINT_ORDER::END); ++i) { + PSX::PxConstraintFlags pxConstraintFlags = m_pDynamicJoints[i]->getConstraintFlags(); + const bool bBroken = (pxConstraintFlags.isSet(PSX::PxConstraintFlag::eBROKEN)); + if (true == bBroken) { + assert(false); + } + } + m_pGameInstance->Add_RenderGroup(RENDER::NONLIGHT, this); +#endif // _DEBUG +} + +HRESULT CPlayerRobe::Render() +{ + Render_BonePhysX(); + return S_OK; +} + +HRESULT CPlayerRobe::Update_RobeSocketPosition() +{ + { + PSX::PxTransform pxTransform = {}; + _matrix WorldMatrix = {}; + _matrix OwnerInvWorldMatrix = m_pParentTransformCom->Get_WorldMatrixInv(); + for (_uint i = 0; i < ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::END); ++i) { + pxTransform = m_pRobeJointAnchor[i]->Get_GlobalPosition(); + WorldMatrix = XMMatrixAffineTransformation(XMVectorSet(1.f, 1.f, 1.f, 0.f), XMVectorZero(), XMLoadFloat4((_float4*)&pxTransform.q), XMVectorSetW(XMLoadFloat3((_float3*)&pxTransform.p), 1.f)); + XMStoreFloat4x4(&m_ReconstructedJointAnchorMatirces[i], WorldMatrix * OwnerInvWorldMatrix); + } + } + { + D3D11_MAPPED_SUBRESOURCE SubResource{}; + if (FAILED(m_pContext->Map(m_pBoneCombinedMatrixBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &SubResource))) { + return E_FAIL; + } + memcpy_s(SubResource.pData, sizeof(_float4x4) * ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::END), m_ReconstructedJointAnchorMatirces, sizeof(_float4x4) * ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::END)); + m_pContext->Unmap(m_pBoneCombinedMatrixBuffer, 0); + } + m_pModelCom->ComputeInsertionBoneBuffer(m_BoneInsertionDesc, m_pBoneCombinedMatrixSRV); + 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], true); + + + PSX::PxRigidDynamic* startAnchorRigidActor = m_pRobeJointAnchor[Desc_Route.iStartBoneIndex]->Get_Actor(); + PSX::PxRigidDynamic* routeRigidActor = m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_Actor(); + PSX::PxRigidDynamic* endAnchorRigidActor = m_pRobeJointAnchor[Desc_Route.iEndBoneIndex]->Get_Actor(); + + PSX::PxTransform startJointWorldPose = CMyTools::MakeJointWorldPoseFromRouteEnd(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), false); // start y-- + PSX::PxTransform endJointWorldPose = CMyTools::MakeJointWorldPoseFromRouteEnd(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), true); // end y++ + + m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_PxD6Joint(startAnchorRigidActor, routeRigidActor, startJointWorldPose); + + m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_PxD6Joint(routeRigidActor, endAnchorRigidActor, endJointWorldPose); + + return S_OK; +} + +HRESULT CPlayerRobe::Create_BoneCombinedMatrixSRV() +{ + D3D11_BUFFER_DESC desc{}; + desc.Usage = D3D11_USAGE_DYNAMIC; + desc.ByteWidth = sizeof(_float4x4) * ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::END); + desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; + desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; + desc.StructureByteStride = sizeof(_float4x4); + desc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED; + + if (FAILED(m_pDevice->CreateBuffer(&desc, nullptr, &m_pBoneCombinedMatrixBuffer))) { + return E_FAIL; + } + + D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc = {}; + srvDesc.ViewDimension = D3D11_SRV_DIMENSION_BUFFER; + srvDesc.Format = DXGI_FORMAT_UNKNOWN; + srvDesc.Buffer.FirstElement = 0; + srvDesc.Buffer.NumElements = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::END); + + + if (FAILED(m_pDevice->CreateShaderResourceView(m_pBoneCombinedMatrixBuffer, &srvDesc, &m_pBoneCombinedMatrixSRV))){ + return E_FAIL; + } + + 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, false); + +#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, false); + +#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 + } + + 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(); + _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_pModelCom->Get_BoneMatrixPtr(PLAYER_JOINT_BONE_NAMES[iBoneIndex])) * OwnerMatrix; + + m_pSubShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true, + [this]() { + m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0); + }); + } + _matrix MainAnchorMatrix = /*XMMatrixRotationZ(XM_PIDIV2) * */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_BONE_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 socketWorld = /*XMMatrixRotationZ(XM_PIDIV2) * */XMLoadFloat4x4(m_pSocketMatrix) * m_pParentTransformCom->Get_XMWorldMatrix(); + _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_ReconstructedJointAnchorMatirces[iBoneIndex]) * socketWorld; + } + + { // + 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, true); +#ifdef _DEBUG + m_pRobeMainAnchor->Set_Name("MainAnchor"); +#endif // _DEBUG + } + // SubAnchors + for (_int i = 0; i < ENUM_CLASS(PLAYER_JOINT_BONE_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; + } + + m_pRobeJointAnchor[i]->Set_Transform(xmAnchorMatricesWorld[i], true); +#ifdef _DEBUG + m_pRobeJointAnchor[i]->Set_Name(PLAYER_JOINT_BONE_NAMES[i]); +#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_ORDER::ORIGIN_TO_RUP_START); + Desc_Route.iEndJointIndex = Desc_Route.iStartJointIndex + 1; + 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], true); +#ifdef _DEBUG + m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Set_Name("Origin_Linked_Routes"); +#endif // _DEBUG + { // Joint + PSX::PxRigidDynamic* startAnchorRigidActor = m_pRobeMainAnchor->Get_Actor(); + PSX::PxRigidDynamic* routeRigidActor = m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_Actor(); + PSX::PxRigidDynamic* endAnchorRigidActor = m_pRobeJointAnchor[Desc_Route.iEndBoneIndex]->Get_Actor(); + + PSX::PxTransform startJointWorldPose = CMyTools::MakeJointWorldPoseFromRouteEnd(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), false); // start y-- + PSX::PxTransform endJointWorldPose = CMyTools::MakeJointWorldPoseFromRouteEnd(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), true); // end y++ + + m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_PxD6Joint(startAnchorRigidActor, routeRigidActor, startJointWorldPose); + m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_PxD6Joint(routeRigidActor, endAnchorRigidActor, endJointWorldPose); + } + } + { + 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_ORDER::ORIGIN_TO_TUP_START); + Desc_Route.iEndJointIndex = Desc_Route.iStartJointIndex + 1; + 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], true); +#ifdef _DEBUG + m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Set_Name("Origin_Linked_Routes"); +#endif // _DEBUG + { // Joint + PSX::PxRigidDynamic* startAnchorRigidActor = m_pRobeMainAnchor->Get_Actor(); + PSX::PxRigidDynamic* routeRigidActor = m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_Actor(); + PSX::PxRigidDynamic* endAnchorRigidActor = m_pRobeJointAnchor[Desc_Route.iEndBoneIndex]->Get_Actor(); + + PSX::PxTransform startJointWorldPose = CMyTools::MakeJointWorldPoseFromRouteEnd(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), false); // start y-- + PSX::PxTransform endJointWorldPose = CMyTools::MakeJointWorldPoseFromRouteEnd(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), true); // end y++ + + m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_PxD6Joint(startAnchorRigidActor, routeRigidActor, startJointWorldPose); + m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_PxD6Joint(routeRigidActor, endAnchorRigidActor, endJointWorldPose); + } + } + { + 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_ORDER::ORIGIN_TO_LUP_START); + Desc_Route.iEndJointIndex = Desc_Route.iStartJointIndex + 1; + 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], true); +#ifdef _DEBUG + m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Set_Name("Origin_Linked_Routes"); +#endif // _DEBUG + { // Joint + PSX::PxRigidDynamic* startAnchorRigidActor = m_pRobeMainAnchor->Get_Actor(); + PSX::PxRigidDynamic* routeRigidActor = m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_Actor(); + PSX::PxRigidDynamic* endAnchorRigidActor = m_pRobeJointAnchor[Desc_Route.iEndBoneIndex]->Get_Actor(); + + PSX::PxTransform startJointWorldPose = CMyTools::MakeJointWorldPoseFromRouteEnd(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), false); // start y-- + PSX::PxTransform endJointWorldPose = CMyTools::MakeJointWorldPoseFromRouteEnd(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), true); // end y++ + + m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_PxD6Joint(startAnchorRigidActor, routeRigidActor, startJointWorldPose); + m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_PxD6Joint(routeRigidActor, endAnchorRigidActor, endJointWorldPose); + } + } + } + /*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_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_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_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_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_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_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_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_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_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 (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"); + + { + ZeroMemory(&m_BoneInsertionDesc, sizeof(m_BoneInsertionDesc)); + m_BoneInsertionDesc.iMatrixCount = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::END); + m_BoneInsertionDesc.iStartOffset = m_pModelCom->Get_BoneIndex(PLAYER_JOINT_BONE_NAMES[ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::RIGHTUP)]); + } + Create_BoneCombinedMatrixSRV(); + + XMStoreFloat4x4(&m_PreTransformMatrix, XMLoadFloat4x4(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]); + } + for (_uint i = 0; i < ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::END); ++i) + { + _uint iParentIndex = UINT_MAX; + _bool bCopyPreTransform = false; + + switch ((PLAYER_JOINT_BONE_ORDER)i) + { + case PLAYER_JOINT_BONE_ORDER::RIGHTUP: + case PLAYER_JOINT_BONE_ORDER::TAILUP: + case PLAYER_JOINT_BONE_ORDER::LEFTUP: + bCopyPreTransform = true; + break; + + case PLAYER_JOINT_BONE_ORDER::RIGHT: + iParentIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::RIGHTUP); + break; + case PLAYER_JOINT_BONE_ORDER::TAIL: + iParentIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::TAILUP); + break; + case PLAYER_JOINT_BONE_ORDER::LEFT: + iParentIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::LEFTUP); + break; + case PLAYER_JOINT_BONE_ORDER::RIGHTDOWNRIGHT: + case PLAYER_JOINT_BONE_ORDER::RIGHTDOWN: + iParentIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::RIGHT); + break; + case PLAYER_JOINT_BONE_ORDER::TAILRIGHTDOWN: + case PLAYER_JOINT_BONE_ORDER::TAILLEFTDOWN: + iParentIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::TAIL); + break; + case PLAYER_JOINT_BONE_ORDER::LEFTDOWN: + case PLAYER_JOINT_BONE_ORDER::LEFTDOWNLEFT: + iParentIndex = ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::LEFT); + break; + default: + assert(false); + break; + } + + if (true == bCopyPreTransform) + { + _matrix constructedMatrix = XMLoadFloat4x4(m_RobeJointAnchorMatrices[i]) * XMLoadFloat4x4(&m_PreTransformMatrix); + + XMStoreFloat4x4(&m_ReconstructedJointAnchorMatirces[i], constructedMatrix); + continue; + } + + _matrix constructedMatrix = XMLoadFloat4x4(m_RobeJointAnchorMatrices[i]) + * XMLoadFloat4x4(&m_ReconstructedJointAnchorMatirces[iParentIndex]); + + XMStoreFloat4x4(&m_ReconstructedJointAnchorMatirces[i], constructedMatrix); + } + + 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_pBoneCombinedMatrixSRV); + SAFE_RELEASE(m_pBoneCombinedMatrixBuffer); + SAFE_RELEASE(m_pRightLeg); + SAFE_RELEASE(m_pLeftLeg); + SAFE_RELEASE(m_pRobeMainAnchor); + 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_BONE_ORDER::END); ++i) { + SAFE_RELEASE(m_pRobeJointAnchor[i]); + } +} +#ifdef _DEBUG + +void CPlayerRobe::Describe_Entity() +{ +} + +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Player_States.cpp b/Jusin154_Team3D/Client/Private/Player_States.cpp index e2bc1b266..85b936d59 100644 --- a/Jusin154_Team3D/Client/Private/Player_States.cpp +++ b/Jusin154_Team3D/Client/Private/Player_States.cpp @@ -186,24 +186,6 @@ HRESULT CPlayer::InputBroom() void CPlayer::Behavior_IdleEnter() { m_pFSM->Enable_State(FSMSTATE::IDLE); - pair<_uint, _bool> pairAnimInfo; - - if (SUCCEEDED(InputAim())) - { - if (m_pGameInstance->Mouse_Pressing(DIM_LBUTTON)) { - pairAnimInfo = m_Animation[STATEANIM::IDLE_AIM]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); - } - else - pairAnimInfo = m_Animation[STATEANIM::IDLE]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true,1.f,false); - } - else - { - pairAnimInfo = m_Animation[STATEANIM::IDLE]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); - } - m_bSprintToggle = false; m_bWalkToggle = false; @@ -258,6 +240,23 @@ HRESULT CPlayer::Behavior_IdleExitCheck(_float fTimeDelta) } return E_FAIL; } + else { + if (SUCCEEDED(InputAim())) + { + if (m_pGameInstance->Mouse_Pressing(DIM_LBUTTON)) { + pairAnimInfo = m_Animation[STATEANIM::IDLE_AIM]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + } + else + pairAnimInfo = m_Animation[STATEANIM::IDLE]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); + } + else + { + pairAnimInfo = m_Animation[STATEANIM::IDLE]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); + } + } if (SUCCEEDED(InputMove())) { @@ -1126,6 +1125,7 @@ void CPlayer::Behavior_CombatEnter() HRESULT CPlayer::Behavior_CombatExitCheck() { pair<_uint, _bool> pairAnimInfo; + _int iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); _float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio(); if (SUCCEEDED(InputAction()) || SUCCEEDED(InputSpell())) { @@ -1183,7 +1183,8 @@ HRESULT CPlayer::Behavior_CombatExitCheck() } else { - if (SUCCEEDED(InputMove()) && fRatio >= 0.3f) { + if (SUCCEEDED(InputMove()) && fRatio >= 0.3f && + iCurrAnimIndex != m_Animation[STATEANIM::ANCIENT_LIGHTNING].first) { m_pFSM->Change_State(FSMSTATE::MOVE); m_bLookAt = false; return E_FAIL; @@ -1426,7 +1427,7 @@ void CPlayer::Behavior_SpellEnter() pairAnimInfo = m_Animation[STATEANIM::SPELL]; fRatio = 0.2f; } - else if (Degree <= 135.f) + else if (Degree <= 85.f) { if (Cross < 0.f) { @@ -1577,7 +1578,8 @@ HRESULT CPlayer::Behavior_SpellExitCheck() Play_SpellHitAnim(); - if (SUCCEEDED(InputMove()) && iIndex != m_Animation[STATEANIM::AVADA_KEDAVRA].first) { + if (SUCCEEDED(InputMove()) && + iIndex != m_Animation[STATEANIM::AVADA_KEDAVRA].first) { if (fRatio >= 0.4f) { m_pFSM->Change_State(FSMSTATE::MOVE); return E_FAIL; @@ -1704,10 +1706,15 @@ HRESULT CPlayer::Behavior_ShieldExitCheck() _vector vCross = XMVector3Cross(vLook, vCameraLook); _float Cross = XMVectorGetY(vCross); - if (Degree <= 60.f) + if (Degree <= 30.f) { pairAnimInfo = m_Animation[STATEANIM::PARRY4]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); + } + else if (Degree <= 60.f) + { + pairAnimInfo = m_Animation[STATEANIM::PARRY4]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); Add_Event(pairAnimInfo.first, [this]() {m_bLookAt = true; }, @@ -1718,22 +1725,26 @@ HRESULT CPlayer::Behavior_ShieldExitCheck() if (Cross < 0.f) { pairAnimInfo = m_Animation[STATEANIM::PARRY2]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second,1.f,true,1.f,false); } else { pairAnimInfo = m_Animation[STATEANIM::PARRY3]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); } Add_Event(pairAnimInfo.first, [this]() {m_bLookAt = true; }, - 0.8f); + 0.11f); } else { pairAnimInfo = m_Animation[STATEANIM::PARRY_180]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } + } + else { + pairAnimInfo = m_Animation[STATEANIM::PARRY4]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); } Add_Event(pairAnimInfo.first, diff --git a/Jusin154_Team3D/Client/Private/Protego.cpp b/Jusin154_Team3D/Client/Private/Protego.cpp index f71361785..ab48ec95b 100644 --- a/Jusin154_Team3D/Client/Private/Protego.cpp +++ b/Jusin154_Team3D/Client/Private/Protego.cpp @@ -97,7 +97,6 @@ void CProtego::Late_Update(_float fTimeDelta) m_pTransformCom->Set_State(STATE::POSITION, m_pOwner->Get_Component()->Get_Position()); __super::Late_Update(fTimeDelta); - } HRESULT CProtego::Pre_Setting(CGameObject* pObject, void* pArg) @@ -129,14 +128,14 @@ HRESULT CProtego::Ready_Components(void* pArg) } - //{ // DO - // CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; - // Desc.iSubKind = ENUM_CLASS(PXOBJECT::SKILL_PROTEGO); - // if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_SHIELD"), (CComponent**)&m_pRigidBody, &Desc))) { - // return E_FAIL; - // } - // m_pGameInstance->Attach_Actor(*m_pRigidBody->Get_Actor()); - //} + { // DO + CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; + Desc.iSubKind = ENUM_CLASS(PXOBJECT::SKILL_PROTEGO); + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_SHIELD"), (CComponent**)&m_pRigidBody, &Desc))) { + return E_FAIL; + } + m_pGameInstance->Attach_Actor(*m_pRigidBody->Get_Actor(), NEXT_LEVEL); + } return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Ranrok.cpp b/Jusin154_Team3D/Client/Private/Ranrok.cpp index 02a268856..9999d1883 100644 --- a/Jusin154_Team3D/Client/Private/Ranrok.cpp +++ b/Jusin154_Team3D/Client/Private/Ranrok.cpp @@ -72,8 +72,8 @@ HRESULT CRanrok::Initialize(void* pArg) } else { - m_pCharacter_Controller->Set_Position(XMVectorSet(-44.704f, -2.860f, 16.071f, 1.f)); - m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(-44.704f, -2.860f, 16.071f, 1.f)); + m_pCharacter_Controller->Set_Position(XMVectorSet(-44.704f, 6.860f, 16.071f, 1.f)); + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(-44.704f, 6.860f, 16.071f, 1.f)); } Load_RanrokPos("../Bin/Resources/Data/RanrokPos/RanrokPos.xml"); @@ -162,7 +162,9 @@ void CRanrok::Late_Update(_float fTimeDelta) { if (true == m_bLookAt) { m_pTransformCom->LookAt_Horizontal_Lerp(XMLoadFloat4(&m_vTargetPos), fTimeDelta, 3.f); + } + m_pModelCom->Set_TargetPos((XMLoadFloat4(&m_vTargetPos))); } m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); @@ -279,6 +281,12 @@ void CRanrok::OnCollision(CGameObject* pOther, void* pDesc) case ENUM_CLASS(SKILL_TYPE::STUPEFY): m_eHitSpell = ENUM_CLASS(SKILL_TYPE::STUPEFY); break; + case ENUM_CLASS(SKILL_TYPE::AVADAKEDAVRA): + m_eHitSpell = ENUM_CLASS(SKILL_TYPE::AVADAKEDAVRA); + break; + case ENUM_CLASS(SKILL_TYPE::ANCIENT_MAGIC): + m_eHitSpell = ENUM_CLASS(SKILL_TYPE::ANCIENT_MAGIC); + break; } } else @@ -428,16 +436,23 @@ HRESULT CRanrok::Render_Nonblend() if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) { return E_FAIL; } - if (FAILED(m_pModelCom->Begin(i, m_pShaderCom, m_bDrawOutLine))) { + if (FAILED(m_pModelCom->Begin(i, m_pShaderCom))) { return E_FAIL; } m_pModelCom->Bind_OutPut_SRV_VS(26, 0); m_pModelCom->Bind_OutPut_SRV_VS_Prev(27, 0); + if (true == m_bDrawOutLine) { + m_pGameInstance->Begin_OutLine_Write(2); + } if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; } + + if (true == m_bDrawOutLine) { + m_pGameInstance->End_OutLine_Write(); + } } if (m_bDrawOutLine) { @@ -490,7 +505,82 @@ HRESULT CRanrok::Render_Blend() if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) { return E_FAIL; } - if (FAILED(m_pModelCom->Begin(i, m_pShaderCom, m_bDrawOutLine))) { + if (FAILED(m_pModelCom->Begin(i, m_pShaderCom))) { + return E_FAIL; + } + + m_pModelCom->Bind_OutPut_SRV_VS(26, 0); + m_pModelCom->Bind_OutPut_SRV_VS_Prev(27, 0); + + if (true == m_bDrawOutLine) { + m_pGameInstance->Begin_OutLine_Write(2); + } + if (FAILED(m_pModelCom->Render(i))) { + return E_FAIL; + } + + if (true == m_bDrawOutLine) { + m_pGameInstance->End_OutLine_Write(); + } + } + + if (true == m_bDrawOutLine) { + Render_OutLine(); + } + return S_OK; +} +HRESULT CRanrok::Render_OutLine() +{ + m_bDrawOutLine = false; + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + + Compute_Depth(); + _float fRatio = CMyTools::Saturate((m_fCamDepth / *m_pGameInstance->Get_CurrentCameraFar())); + m_fOutLineThickness = CMyTools::Lerp_f1D(2.f, 6.f, fRatio); + if (FAILED(m_pShaderCom->Bind_Matrix("g_PrevWorldMatrix", m_pTransformCom->Get_PrevWorldMatrixPtr()))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevViewMatrix", D3DTS::VIEW))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevProjMatrix", D3DTS::PROJ))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_vOutLineColor", &m_vOutLineColor, sizeof(_float3)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOutLineThickness", &m_fOutLineThickness, sizeof(_float)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOutLineScale", &m_fOutLineScale, sizeof(_float)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOutLinePower", &m_fOutLinePower, sizeof(_float)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_vCamPosition", m_pGameInstance->Get_CamPosition(), sizeof(_float4)))) { + return E_FAIL; + } + _uint iNumMeshes = m_pModelCom->Get_NumMeshes(); + + for (_uint i = 0; i < iNumMeshes; i++) + { + if (FAILED(m_pShaderCom->Bind_Matrices( + "g_OffsetMatrix", + m_pModelCom->Get_OffsetMatrix(i).data(), + (_int)m_pModelCom->Get_OffsetMatrix(i).size() + ))) + { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_NPC_PBR_ANIM::OUTLINE_READ)))) { return E_FAIL; } @@ -501,7 +591,6 @@ HRESULT CRanrok::Render_Blend() return E_FAIL; } } - return S_OK; } @@ -523,7 +612,6 @@ void CRanrok::MoveTo(_float fTimeDelta) _vector vLook = XMVector3Normalize(m_pTransformCom->Get_State(STATE::LOOK)); - _vector toTarget = Target - CurPos; _float fDist = XMVectorGetX(XMVector3Length(toTarget)); diff --git a/Jusin154_Team3D/Client/Private/Ranrok_FireBall.cpp b/Jusin154_Team3D/Client/Private/Ranrok_FireBall.cpp index 4eec50dab..f9a7976fb 100644 --- a/Jusin154_Team3D/Client/Private/Ranrok_FireBall.cpp +++ b/Jusin154_Team3D/Client/Private/Ranrok_FireBall.cpp @@ -85,7 +85,6 @@ void CRanrok_FireBall::Update(_float fTimeDelta) _vector vStartPos = XMLoadFloat4(&m_vStartPos); _vector vEndPos = m_pFireBall->Get_WorldPostion(); ON_COLLISION_INFO CollisionInfo = MonsterSweepTarget(vStartPos, vEndPos, 0.2f, true); - OnCollision(this, &CollisionInfo); } @@ -134,7 +133,7 @@ HRESULT CRanrok_FireBall::Pre_Setting(CGameObject* pObject, void* pArg) XMStoreFloat4(&m_vStartPos, vStartPos); /* 플레이어 위치 받기 */ - CUnit* pPlayer = m_pInfoInstance->Get_NearestPlayerAlly(m_pOwner->Get_WorldPostion()).first; + CUnit* pPlayer = m_pInfoInstance->Get_NearestPlayerAlly(m_pOwner->Get_WorldPostion()).first; if (pPlayer == nullptr) return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Ranrok_States.cpp b/Jusin154_Team3D/Client/Private/Ranrok_States.cpp index 0147b33b2..fe01b71b4 100644 --- a/Jusin154_Team3D/Client/Private/Ranrok_States.cpp +++ b/Jusin154_Team3D/Client/Private/Ranrok_States.cpp @@ -32,7 +32,7 @@ void CRanrok::Behavior_IdleEnter() { m_pFSM->Enable_State(FSMSTATE::IDLE); pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::HOVER_LOOP]; - + m_bLookAt = true; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } @@ -49,12 +49,14 @@ HRESULT CRanrok::Behavior_IdleExitCheck() void CRanrok::Behavior_IdleExit() { m_pFSM->Disable_State(FSMSTATE::IDLE); + m_bLookAt = false; } void CRanrok::Behavior_IdleBreakEnter() { m_pFSM->Enable_State(FSMSTATE::IDLEBREAK); pair<_uint, _bool> pairAnimInfo; + m_bLookAt = true; pairAnimInfo = m_Animation[STATEANIM::IDLE_BREAK2]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } @@ -71,6 +73,7 @@ HRESULT CRanrok::Behavior_IdleBreakExitCheck() void CRanrok::Behavior_IdleBreakExit() { m_pFSM->Disable_State(FSMSTATE::IDLEBREAK); + m_bLookAt = false; } void CRanrok::Behavior_MoveEnter() @@ -283,31 +286,29 @@ void CRanrok::Behavior_FlyExit() void CRanrok::Behavior_FireBreathEnter() { pair<_uint, _bool> pairAnimInfo = {}; + m_bLookAt = true; m_pFSM->Enable_State(FSMSTATE::FIREBREATH); if (m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_AIR)) { pairAnimInfo = m_Animation[STATEANIM::FIREBREATH_WINDUP_A]; Add_Event(pairAnimInfo.first, - [&]() { - pairAnimInfo = m_Animation[STATEANIM::FIREBREATH_A]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); - m_fSkillCoolTime[ENUM_CLASS(RANROK_SKILL::FIREBREATH)] = m_fMaxSkillCoolTime[ENUM_CLASS(RANROK_SKILL::FIREBREATH)]; - m_bLookAt = false; - }, 0.95f); + [&]() { pairAnimInfo = m_Animation[STATEANIM::FIREBREATH_A]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + m_fSkillCoolTime[ENUM_CLASS(RANROK_SKILL::FIREBREATH)] = m_fMaxSkillCoolTime[ENUM_CLASS(RANROK_SKILL::FIREBREATH)]; + m_pModelCom->Play_HeadBone(true); + m_bLookAt = false; }, + 0.95f); Add_Event(m_Animation[STATEANIM::FIREBREATH_A].first, - [&]() { - pairAnimInfo = m_Animation[STATEANIM::FIREBREATH_COOLDOWN_A]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); - m_bLookAt = true; - }, 0.95f); + [&]() { pairAnimInfo = m_Animation[STATEANIM::FIREBREATH_COOLDOWN_A]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); }, + 0.95f); Add_Event(m_Animation[STATEANIM::FIREBREATH_A].first, [this]() { m_pEffectPool->Use_Skill(SKILL_TYPE::RANROK_BREATH, this); }, 0.1f); - } else if (m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_GROUND)) { @@ -321,9 +322,25 @@ HRESULT CRanrok::Behavior_FireBreathExitCheck(_float fTimeDelta) { pair<_uint, _bool> pairAnimInfo = {}; _int iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + if (m_pModelCom->Get_PlayHeadBone()) + { + m_fHeadAimWeight += fTimeDelta; + if (m_fHeadAimWeight >= 1.f) + { + m_fHeadAimWeight = 1.f; + } + m_pModelCom->Set_HeadAimWeight(m_fHeadAimWeight); + } + + if (iCurrAnimIndex == m_Animation[STATEANIM::FIREBREATH_COOLDOWN_A].first) + { + m_fHeadAimWeight -= fTimeDelta * 2.f; + m_pModelCom->Set_HeadAimWeight(m_fHeadAimWeight); + } if (m_pModelCom->IsFinishedAnim()) { + m_pModelCom->Play_HeadBone(false); if (m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_AIR)) { m_pFSM->Change_State(FSMSTATE::IDLEBREAK); @@ -341,11 +358,13 @@ HRESULT CRanrok::Behavior_FireBreathExitCheck(_float fTimeDelta) void CRanrok::Behavior_FireBreathExit() { m_pFSM->Disable_State(FSMSTATE::FIREBREATH); + m_fHeadAimWeight = 0.f; } void CRanrok::Behavior_FireSweepEnter() { pair<_uint, _bool> pairAnimInfo = {}; + m_bLookAt = true; m_pFSM->Enable_State(FSMSTATE::FIRESWEEP); if (m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_AIR)) { @@ -355,15 +374,15 @@ void CRanrok::Behavior_FireSweepEnter() [&]() { pairAnimInfo = m_Animation[STATEANIM::FIRESWEEP_A]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); m_fSkillCoolTime[ENUM_CLASS(RANROK_SKILL::FIRESWEEP)] = m_fMaxSkillCoolTime[ENUM_CLASS(RANROK_SKILL::FIRESWEEP)]; - m_bLookAt = false; - }, 0.95f); + m_pModelCom->Play_HeadBone(true); + m_bLookAt = false; }, + 0.95f); Add_Event(m_Animation[STATEANIM::FIRESWEEP_A].first, [&]() { pairAnimInfo = m_Animation[STATEANIM::FIRESWEEP_COOLDOWN_A]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); - m_bLookAt = true; }, - 0.94f); + 0.95f); Add_Event(m_Animation[STATEANIM::FIRESWEEP_A].first, @@ -389,8 +408,25 @@ HRESULT CRanrok::Behavior_FireSweepExitCheck(_float fTimeDelta) pair<_uint, _bool> pairAnimInfo = {}; _int iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + if (m_pModelCom->Get_PlayHeadBone()) + { + m_fHeadAimWeight += fTimeDelta; + if (m_fHeadAimWeight >= 1.f) + { + m_fHeadAimWeight = 1.f; + } + m_pModelCom->Set_HeadAimWeight(m_fHeadAimWeight); + } + + if (iCurrAnimIndex == m_Animation[STATEANIM::FIRESWEEP_COOLDOWN_A].first) + { + m_fHeadAimWeight -= fTimeDelta * 2.f; + m_pModelCom->Set_HeadAimWeight(m_fHeadAimWeight); + } + if (m_pModelCom->IsFinishedAnim()) { + m_pModelCom->Play_HeadBone(false); if (m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_AIR)) { m_pFSM->Change_State(FSMSTATE::IDLEBREAK); @@ -408,6 +444,7 @@ HRESULT CRanrok::Behavior_FireSweepExitCheck(_float fTimeDelta) void CRanrok::Behavior_FireSweepExit() { m_pFSM->Disable_State(FSMSTATE::FIRESWEEP); + m_fHeadAimWeight = 0.f; } void CRanrok::Behavior_FireBallEnter() @@ -465,9 +502,6 @@ void CRanrok::Behavior_FireBallEnter() }, 0.45f); break; } - - - } m_fSkillCoolTime[ENUM_CLASS(RANROK_SKILL::FIREBALL)] = m_fMaxSkillCoolTime[ENUM_CLASS(RANROK_SKILL::FIREBALL)]; @@ -620,9 +654,9 @@ void CRanrok::Behavior_PulseEnter() m_fSkillCoolTime[ENUM_CLASS(RANROK_SKILL::PULSE)] = m_fMaxSkillCoolTime[ENUM_CLASS(RANROK_SKILL::PULSE)]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); - /*Add_Event(pairAnimInfo.first, + Add_Event(pairAnimInfo.first, [this]() { CameraShake(10.f, 2.f, 5.f, 1.2f); }, - 0.39f);*/ + 0.39f); } HRESULT CRanrok::Behavior_PulseExitCheck(_float fTimeDelta) diff --git a/Jusin154_Team3D/Client/Private/Skill_Data.cpp b/Jusin154_Team3D/Client/Private/Skill_Data.cpp index 87a66ea56..d42db2959 100644 --- a/Jusin154_Team3D/Client/Private/Skill_Data.cpp +++ b/Jusin154_Team3D/Client/Private/Skill_Data.cpp @@ -57,7 +57,7 @@ void CSkill_Data::Update_Damage(_float Damage) { for (_int i = 0; i < m_iSpell_Count; ++i) { - m_fSpell_Damage[i] = SpellInfo->fSpell_Damage + Damage; + m_fSpell_Damage[i] = SpellInfo[i].fSpell_Damage + Damage; } } diff --git a/Jusin154_Team3D/Client/Private/State_Dash.cpp b/Jusin154_Team3D/Client/Private/State_Dash.cpp new file mode 100644 index 000000000..4ab7f691e --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Dash.cpp @@ -0,0 +1,64 @@ +#include "pch.h" +#include "State_Dash.h" +#include "Unit.h" + + +CState_Dash::CState_Dash() + :CState_Root() +{ +} + +void CState_Dash::Enter() +{ + __super::Enter(); +} + +HRESULT CState_Dash::Update(_float fTimeDelta) +{ + if (nullptr != m_funcPriorityUpdate) { + m_funcPriorityUpdate(fTimeDelta); + } + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + if (nullptr != m_funcLateUpdate) { + m_funcLateUpdate(fTimeDelta); + } + return S_OK; +} + +void CState_Dash::Exit() +{ + __super::Exit(); +} + +HRESULT CState_Dash::Initialize(STATE_DASH_DESC* pDesc) +{ + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_funcPriorityUpdate = pDesc->funcPriorityUpdate; + m_funcLateUpdate = pDesc->funcLateUpdate; + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + + return S_OK; +} + +CState_Dash* CState_Dash::Create(STATE_DASH_DESC* pDesc) +{ + CState_Dash* pInstance = new CState_Dash; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CState_Dash::Free() +{ + __super::Free(); +} + +void CState_Dash::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Slash.cpp b/Jusin154_Team3D/Client/Private/State_Slash.cpp new file mode 100644 index 000000000..d0c51f682 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Slash.cpp @@ -0,0 +1,64 @@ +#include "pch.h" +#include "State_Slash.h" +#include "Unit.h" + + +CState_Slash::CState_Slash() + :CState_Root() +{ +} + +void CState_Slash::Enter() +{ + __super::Enter(); +} + +HRESULT CState_Slash::Update(_float fTimeDelta) +{ + if (nullptr != m_funcPriorityUpdate) { + m_funcPriorityUpdate(fTimeDelta); + } + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + if (nullptr != m_funcLateUpdate) { + m_funcLateUpdate(fTimeDelta); + } + return S_OK; +} + +void CState_Slash::Exit() +{ + __super::Exit(); +} + +HRESULT CState_Slash::Initialize(STATE_SLASH_DESC* pDesc) +{ + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_funcPriorityUpdate = pDesc->funcPriorityUpdate; + m_funcLateUpdate = pDesc->funcLateUpdate; + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + + return S_OK; +} + +CState_Slash* CState_Slash::Create(STATE_SLASH_DESC* pDesc) +{ + CState_Slash* pInstance = new CState_Slash; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CState_Slash::Free() +{ + __super::Free(); +} + +void CState_Slash::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/Transformation.cpp b/Jusin154_Team3D/Client/Private/Transformation.cpp index d2d0fd2c8..e36f77300 100644 --- a/Jusin154_Team3D/Client/Private/Transformation.cpp +++ b/Jusin154_Team3D/Client/Private/Transformation.cpp @@ -216,7 +216,7 @@ void CTransformation::OnCollision(CGameObject* pOther, void* pDesc) //m_pCharacter_Controller->Move(fTimeDelta); - PhsXUserData* pUserData = static_cast(pCCT->Get_Actor()->userData); + PHYSX_USERDATA* pUserData = static_cast(pCCT->Get_Actor()->userData); switch (pUserData->eKind) { case PHYSX_KIND::CCTActor: diff --git a/Jusin154_Team3D/Client/Private/Troll.cpp b/Jusin154_Team3D/Client/Private/Troll.cpp index 3befbaa81..2b2a8d415 100644 --- a/Jusin154_Team3D/Client/Private/Troll.cpp +++ b/Jusin154_Team3D/Client/Private/Troll.cpp @@ -197,16 +197,24 @@ HRESULT CTroll::Render() return E_FAIL; } - if (FAILED(m_pModelCom->Begin(i, m_pShaderCom, m_bDrawOutLine))) { + if (FAILED(m_pModelCom->Begin(i, m_pShaderCom))) { return E_FAIL; } m_pModelCom->Bind_OutPut_SRV_VS(26, 0); m_pModelCom->Bind_OutPut_SRV_VS_Prev(27, 0); + + if (true == m_bDrawOutLine) { + m_pGameInstance->Begin_OutLine_Write(2); + } if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; } + + if (true == m_bDrawOutLine) { + m_pGameInstance->End_OutLine_Write(); + } } if (true == m_bDrawOutLine) { @@ -252,6 +260,15 @@ HRESULT CTroll::Render_OutLine() else if (m_fOutLineThickness < 2.f) { m_fOutLineThickness = 2.f; } + if (FAILED(m_pShaderCom->Bind_Matrix("g_PrevWorldMatrix", m_pTransformCom->Get_PrevWorldMatrixPtr()))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevViewMatrix", D3DTS::VIEW))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevProjMatrix", D3DTS::PROJ))) { + return E_FAIL; + } if (FAILED(m_pShaderCom->Bind_RawValue("g_vOutLineColor", &m_vOutLineColor, sizeof(_float3)))) { return E_FAIL; } @@ -388,6 +405,12 @@ void CTroll::OnCollision(CGameObject* pOther, void* pDesc) case ENUM_CLASS(SKILL_TYPE::STUPEFY): m_eHitSpell = ENUM_CLASS(SKILL_TYPE::STUPEFY); break; + case ENUM_CLASS(SKILL_TYPE::AVADAKEDAVRA): + m_eHitSpell = ENUM_CLASS(SKILL_TYPE::AVADAKEDAVRA); + break; + case ENUM_CLASS(SKILL_TYPE::ANCIENT_MAGIC): + m_eHitSpell = ENUM_CLASS(SKILL_TYPE::ANCIENT_MAGIC); + break; } } else diff --git a/Jusin154_Team3D/Client/Private/Troll_Rock.cpp b/Jusin154_Team3D/Client/Private/Troll_Rock.cpp index 982105e77..8d47fc8a6 100644 --- a/Jusin154_Team3D/Client/Private/Troll_Rock.cpp +++ b/Jusin154_Team3D/Client/Private/Troll_Rock.cpp @@ -122,7 +122,7 @@ void CTroll_Rock::RockHit() memcpy_s(&tagCollInfo.vWorldNomal, sizeof(tagCollInfo.vWorldNomal), &hit.normal, sizeof(hit.normal)); XMStoreFloat4(&tagCollInfo.vHitDir, vDir); tagCollInfo.fLength = fLength; - PhsXUserData* pUserData = static_cast(pActor->userData); + PHYSX_USERDATA* pUserData = static_cast(pActor->userData); tagCollInfo.pObject = pUserData->pOwner; tagCollInfo.eHitType = ENUM_CLASS(HIT_TYPE::HIT_HEAVY); tagCollInfo.fDamage = 10.f; diff --git a/Jusin154_Team3D/Client/Private/Troll_States.cpp b/Jusin154_Team3D/Client/Private/Troll_States.cpp index 4a25fa58b..663388a19 100644 --- a/Jusin154_Team3D/Client/Private/Troll_States.cpp +++ b/Jusin154_Team3D/Client/Private/Troll_States.cpp @@ -883,7 +883,7 @@ void CTroll::SwingHit(_bool& bPlayerHit) for (_uint i = 0; i < pxHits.size(); ++i) { PSX::PxActor* pxHitActor = pxHits[i].actor; if (nullptr != pxHitActor && nullptr != pxHitActor->userData) { - PhsXUserData* pUserData = (PhsXUserData*)pxHitActor->userData; + PHYSX_USERDATA* pUserData = (PHYSX_USERDATA*)pxHitActor->userData; ON_COLLISION_INFO tagCollInfo = {}; tagCollInfo.vWorldPos.w = 1.f; @@ -934,7 +934,7 @@ void CTroll::SlamHit(_bool& bPlayerHit) for (_uint i = 0; i < pxHits.size(); ++i) { PSX::PxActor* pxHitActor = pxHits[i].actor; if (nullptr != pxHitActor && nullptr != pxHitActor->userData) { - PhsXUserData* pUserData = (PhsXUserData*)pxHitActor->userData; + PHYSX_USERDATA* pUserData = (PHYSX_USERDATA*)pxHitActor->userData; ON_COLLISION_INFO tagCollInfo = {}; diff --git a/Jusin154_Team3D/Client/Public/Camera_Model.h b/Jusin154_Team3D/Client/Public/Camera_Model.h new file mode 100644 index 000000000..eee7bdcfc --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Camera_Model.h @@ -0,0 +1,50 @@ +#pragma once + +#include "Client_Define.h" +#include "Camera.h" + +NS_BEGIN(Client) + +class CCamera_Model final : public CCamera +{ +public: + typedef struct tagCamera_Model : public CCamera::CAMERA_DESC + { + _float3 vEye{}, vAt{}; + _float fMouseSensor{}; + }CAMERA_MODEL_DESC; +private: + CCamera_Model(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CCamera_Model(const CCamera_Model& rhs); + virtual ~CCamera_Model() = 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: + class CModel* m_pModelCom = { nullptr }; + class CShader* m_pShaderCom = { nullptr }; + _bool m_bMovable = true; + _float4x4 m_matInitial = {}; + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + HRESULT Bind_ShaderResources() override; + void Set_InitialPos(); + +public: + static CCamera_Model* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, CGameObject* pOwner) override; + virtual void Free() override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUG + +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Client_Enum.h b/Jusin154_Team3D/Client/Public/Client_Enum.h index 032b07f62..0b55e9391 100644 --- a/Jusin154_Team3D/Client/Public/Client_Enum.h +++ b/Jusin154_Team3D/Client/Public/Client_Enum.h @@ -25,7 +25,7 @@ namespace Client enum class SHADER_PASS_NPC_PBR_ANIM { EYELASH_DAOTHV_ToSRO, TEETH_SRXO_ToSRO, EYE_DN_ToSRO, EYE_OCC, FACIAL_HAIR_DAOTHV_ToSRO, HEAD_HAIR_DAOTHV_ToSRO, HEADwtHAND_DSRXON_ToSRO, LOWER_DSRON_ToSRO, UPPER_DMRON_ToMRO, GLASSES_DMRON_ToMRO, EmissiveMetalness_DENMRO_ToMRO, MI_ClothSim_DSEN_ToSRO, MI_Troll_Club_DAENMROSRXO_To - , OUTLINE_READ, TEETH_SRXO_ToSRO__OUTLINE_WRITE, EYE_DN_ToSRO__OUTLINE_WRITE, HEADwtHAND_DSRXON_ToSRO__OUTLINE_WRITE, UPPER_DMRON_ToMRO__OUTLINE_WRITE, EmissiveMetalness_DENMRO_ToMRO__OUTLINE_WRITE, MI_ClothSim_DSEN_ToSRO__OUTLINE_WRITE + , OUTLINE_READ , END }; enum class UI_STATE { GAMEPLAYER, SPELL, QUEST, INVENTORY, SPELLLNEARN, END }; diff --git a/Jusin154_Team3D/Client/Public/Client_Macro.h b/Jusin154_Team3D/Client/Public/Client_Macro.h index a1a9fddb0..9e18c3844 100644 --- a/Jusin154_Team3D/Client/Public/Client_Macro.h +++ b/Jusin154_Team3D/Client/Public/Client_Macro.h @@ -34,6 +34,7 @@ namespace Client { #define CAMERA_DEBUG TEXT("CAMERA_DEBUG") #define CAMERA_SHOULDER TEXT("CAMERA_SHOULDER") #define CAMERA_AI TEXT("CAMERA_AI") +#define CAMERA_MODEL TEXT("CAMERA_MODEL") #pragma endregion #pragma region COMPONENT diff --git a/Jusin154_Team3D/Client/Public/Dummy_PhysXPlayable.h b/Jusin154_Team3D/Client/Public/Dummy_PhysXPlayable.h deleted file mode 100644 index 6c2583d33..000000000 --- a/Jusin154_Team3D/Client/Public/Dummy_PhysXPlayable.h +++ /dev/null @@ -1,54 +0,0 @@ -#pragma once - -#include "Client_Define.h" -#include "GameObject.h" -#include "CallBack_Playable_Behavior.h" -#include "CallBack_Playable_HitReport.h" - -NS_BEGIN(Client) - -class CDummy_PhysXPlayable final : public CGameObject -{ -public: - typedef struct tagPhysXDummyDesc - { - _float3 vPos = { }; - _float3 vRotRPY = { }; - _uint iSubKind = { }; - }PHYSXDUMMY_DESC; -private: - CDummy_PhysXPlayable(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); - CDummy_PhysXPlayable(const CDummy_PhysXPlayable& rhs); - virtual ~CDummy_PhysXPlayable() = 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: - CCharacter_Controller* m_pCharacter_Controller = { nullptr }; - CRigidBody_Dynamic* m_pRigidBody = { nullptr }; - CModel* m_pModelCom = { nullptr }; - CShader* m_pShaderCom = { nullptr }; - - CCallBack_Playable_Behavior* m_pCallBack_Behavior = { nullptr }; - CCallBack_Playable_HitReport* m_pCallBack_HitReport = { nullptr }; - -private: - virtual HRESULT Initialize_Prototype() override; - virtual HRESULT Initialize(void* pArg) override; - virtual HRESULT Ready_Components(void* pArg) override; - virtual HRESULT Bind_ShaderResources() override; - -public: - static CDummy_PhysXPlayable* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); - virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; - virtual void Free() override; -#ifdef _DEBUG - void Describe_Entity() override; -#endif // _DEBUG -}; - -NS_END diff --git a/Jusin154_Team3D/Client/Public/Dummy_PhysXWall.h b/Jusin154_Team3D/Client/Public/Dummy_PhysXWall.h deleted file mode 100644 index a51fb0305..000000000 --- a/Jusin154_Team3D/Client/Public/Dummy_PhysXWall.h +++ /dev/null @@ -1,51 +0,0 @@ -#pragma once - -#include "Client_Define.h" -#include "GameObject.h" - -NS_BEGIN(Client) - -class CDummy_PhysXWall final : public CGameObject -{ -public: - typedef struct tagPhysXDummyDesc - { - _float3 vPos = { }; - _float3 vRotRPY = { }; - _uint iSubKind = { }; - }PHYSXDUMMY_DESC; -private: - CDummy_PhysXWall(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); - CDummy_PhysXWall(const CDummy_PhysXWall& rhs); - virtual ~CDummy_PhysXWall() = 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: - CRigidBody* m_pRigidBody = { nullptr }; - const PSX::PxRigidDynamic* m_pActor = { nullptr }; - CModel* m_pModelCom = { nullptr }; - CShader* m_pShaderCom = { nullptr }; - - -private: - virtual HRESULT Initialize_Prototype() override; - virtual HRESULT Initialize(void* pArg) override; - virtual HRESULT Ready_Components(void* pArg) override; - virtual HRESULT Bind_ShaderResources() override; - -public: - static CDummy_PhysXWall* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); - virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; - virtual void Free() override; -#ifdef _DEBUG - void Describe_Entity() override; -#endif // _DEBUG - -}; - -NS_END diff --git a/Jusin154_Team3D/Client/Public/Goblin_Assassin.h b/Jusin154_Team3D/Client/Public/Goblin_Assassin.h new file mode 100644 index 000000000..3dfaa013c --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Goblin_Assassin.h @@ -0,0 +1,138 @@ +#pragma once + +#include "Client_Define.h" +#include "Monster.h" +#include "CallBack_Monster_Behavior.h" +#include "CallBack_Monster_HitReport.h" +#include "Enemy_Detection.h" + +NS_BEGIN(Client) + +class CGoblin_Assassin final : public CMonster +{ + enum class GOBLIN_ASSASSIN_SKILL + { + SLASH, + DASH, + TP, + END + }; +private: + CGoblin_Assassin(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CGoblin_Assassin(const CGoblin_Assassin& Prototype); + virtual ~CGoblin_Assassin() = 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; + virtual HRESULT Render_OutLine(); + virtual HRESULT Render_Shadow(SHADOW eType) override; + virtual _vector Get_LockOnPos() override; + virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr)override; + virtual void OnHit(CGameObject* pOther, CGameObject* pCaller = nullptr)override; + + void Set_Detection(_bool bDetection); +private: + CCallBack_Monster_Behavior* m_pCallBack_Behavior = { nullptr }; + CCallBack_Monster_HitReport* m_pCallBack_HitReport = { nullptr }; + CEnemy_Detection* m_pDetection = { nullptr }; + + CCharacter_Controller* m_pCharacter_Controller = { nullptr }; + CRigidBody_Dynamic* m_pRigidBody = { nullptr }; + _float2 m_vStunTimer = { 0.f, 4.f }; + _uint iIndex; +private: + class CEffectPool* m_pEffectPool = nullptr; + DAMAGE_INFO m_DamageInfo; + + _bool m_bDetection = { false }; + + + class CEffectParts* m_pSmoke = { nullptr }; + class CEffectParts* m_pGoblin_Particle = { nullptr }; + class CEffectParts* m_pGoblin_Particle2 = { nullptr }; + class CGoblin_Assassin_Spector* m_pGoblinSpector = { nullptr }; +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + HRESULT Ready_Components(); + HRESULT Ready_Parts(); + HRESULT Bind_ShaderResources(); + void HitState_Behavior(_float fTimeDelta); + +public: + static CGoblin_Assassin* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override; + virtual void Free() override; +#ifdef _DEBUG + virtual void Describe_Entity() override; + +#endif // _DEBUG + +private: + virtual void Add_FSM(); + virtual void Set_Anim(); + + _float m_fSkillCoolTime[ENUM_CLASS(GOBLIN_ASSASSIN_SKILL::END)] = {}; + _float m_fMaxSkillCoolTime[ENUM_CLASS(GOBLIN_ASSASSIN_SKILL::END)] = { 5.f,2.f,15.f }; + + _bool m_bStep = { true }; + _float m_fTpTime = {}; + _float m_fAirTime = {}; + _vector m_vOriginPos = {}; + _float m_fLength = {}; + _float m_fMoveTime = {}; + _bool m_bFirstMove = {}; + _bool m_bPos = {}; + _float m_fAccel = { 3.f}; + _float m_fTargetSpeed = {60.f}; + _float m_fSpeed = {}; + _bool m_bAir = {}; + _float m_fGravityAmount = {}; + _float m_fHitTimer = {}; + _float m_fTumbleTimer = {}; + + void Behavior_IdleEnter(); + HRESULT Behavior_IdleExitCheck(); + void Behavior_IdleExit(); + + void Behavior_IdleBreakEnter(); + HRESULT Behavior_IdleBreakExitCheck(); + void Behavior_IdleBreakExit(); + + void Behavior_MoveEnter(); + HRESULT Behavior_MoveExitCheck(_float fTimeDelta); + void Behavior_MoveExit(); + + void Behavior_CombatEnter(); + HRESULT Behavior_CombatExitCheck(_float fTimeDelta); + void Behavior_CombatExit(); + + void Behavior_SlashEnter(); + HRESULT Behavior_SlashExitCheck(_float fTimeDelta); + void Behavior_SlashExit(); + + void Behavior_DashEnter(); + HRESULT Behavior_DashExitCheck(_float fTimeDelta); + void Behavior_DashExit(); + + void Behavior_BlinkEnter(); + HRESULT Behavior_BlinkExitCheck(_float fTimeDelta); + void Behavior_BlinkExit(); + + void Behavior_ShuffleEnter(); + HRESULT Behavior_ShuffleExitCheck(_float fTimeDelta); + void Behavior_ShuffleExit(); + + void Behavior_HitEnter(); + HRESULT Behavior_HitExitCheck(_float fTimeDelta); + void Behavior_HitExit(); + + void Behavior_DeadEnter(); + HRESULT Behavior_DeadExitCheck(_float fTimeDelta); + void Behavior_DeadExit(); +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Goblin_Assassin_Spector.h b/Jusin154_Team3D/Client/Public/Goblin_Assassin_Spector.h new file mode 100644 index 000000000..079a9de14 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Goblin_Assassin_Spector.h @@ -0,0 +1,79 @@ +#pragma once + +#include "Client_Define.h" +#include "Monster.h" +#include "CallBack_Monster_Behavior.h" +#include "CallBack_Monster_HitReport.h" + +NS_BEGIN(Engine) +class CTransform; +NS_END + +NS_BEGIN(Client) + +class CGoblin_Assassin_Spector final : public CMonster +{ +public: + typedef struct tagSpector + { + CTransform* pParentTransform = { nullptr }; + }GOBLIN_SPECTOR_DESC; +private: + CGoblin_Assassin_Spector(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CGoblin_Assassin_Spector(const CGoblin_Assassin_Spector& Prototype); + virtual ~CGoblin_Assassin_Spector() = 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; + virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr)override; + virtual void OnHit(CGameObject* pOther, CGameObject* pCaller = nullptr)override; + +public: + void Spector_Trail_Visible(_bool isTrailVisible); + void Set_Disolve(_bool bDisolve) { m_bDisolve = bDisolve; } + + +private: + class CGoblin_Assassin* m_pGoblin = { nullptr }; + CTransform* m_pParentTransformCom = { nullptr }; + _uint iIndex; + _float3 m_Offset = {}; + _float3 m_vOriginScale = {}; + _float3 m_vScale = { 1.f, 1.f, 1.f }; + + + class CTrailObject* m_pLeft_Trail = { nullptr }; + class CTrailObject* m_pRight_Trail = { nullptr }; + + const _float4x4* m_pLeftHand_BoneMat = { nullptr }; + const _float4x4* m_pRightHand_BoneMat = { nullptr }; + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + HRESULT Ready_Components(); + HRESULT Ready_Parts(); + HRESULT Bind_ShaderResources(); + +public: + static CGoblin_Assassin_Spector* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override; + virtual void Free() override; +#ifdef _DEBUG + virtual void Describe_Entity() override; + +#endif // _DEBUG + + + _bool m_bStep = { false }; + _float m_fTpTime = {}; + _float m_fAirTime = {}; + _vector m_vOriginPos = {}; + _float m_fLength = {}; + +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Goblin_Attack.h b/Jusin154_Team3D/Client/Public/Goblin_Attack.h index ad6aee3bf..aa9a247c7 100644 --- a/Jusin154_Team3D/Client/Public/Goblin_Attack.h +++ b/Jusin154_Team3D/Client/Public/Goblin_Attack.h @@ -34,6 +34,7 @@ class CGoblin_Attack final : public CEffect_Container _wstring m_wstrEffectName = {}; class CEffectParts* m_pPT1 = { nullptr }; class CEffectParts* m_pPT2 = { nullptr }; + _float4x4 m_vMat = {}; public: static CGoblin_Attack* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual void Free() override; diff --git a/Jusin154_Team3D/Client/Public/Goblin_BattleAxe.h b/Jusin154_Team3D/Client/Public/Goblin_BattleAxe.h index 97263633d..37064e7e1 100644 --- a/Jusin154_Team3D/Client/Public/Goblin_BattleAxe.h +++ b/Jusin154_Team3D/Client/Public/Goblin_BattleAxe.h @@ -24,7 +24,7 @@ class CGoblin_BattleAxe final : public CPartObject virtual HRESULT Render() override; HRESULT Render_Disolve(); void Set_Disolve(_bool bDisolve) { m_bDisolve = bDisolve; } - const _float4x4 Get_AxeMatrix() { return m_vAxeMat; }; + const _float4x4& Get_AxeMatrix() { return m_vAxeMat; }; private: const _float4x4* m_pSocketMatrices = { }; diff --git a/Jusin154_Team3D/Client/Public/Goblin_Protego.h b/Jusin154_Team3D/Client/Public/Goblin_Protego.h index 284adbc40..9de274855 100644 --- a/Jusin154_Team3D/Client/Public/Goblin_Protego.h +++ b/Jusin154_Team3D/Client/Public/Goblin_Protego.h @@ -32,7 +32,7 @@ class CGoblin_Protego final : public CEffect_Container virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; private: _wstring m_wstrEffectName = {}; - + CRigidBody_Dynamic* m_pRigidBody = { nullptr }; class CEffectParts* m_pSphere = { nullptr }; class CEffectParts* m_pBottom = { nullptr }; class CEffectParts* m_pCircle = { nullptr }; diff --git a/Jusin154_Team3D/Client/Public/Goblin_Sword.h b/Jusin154_Team3D/Client/Public/Goblin_Sword.h new file mode 100644 index 000000000..7fd12ca13 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Goblin_Sword.h @@ -0,0 +1,64 @@ +#pragma once + +#include "Client_Define.h" +#include "PartObject.h" + +NS_BEGIN(Client) + +class CGoblin_Sword final : public CPartObject +{ +public: + typedef struct tagSword : public CPartObject::PARTOBJECT_DESC + { + const _float4x4* pSocketMatrices = { }; + _int iIndex = {}; + }GOBLIN_SWORD_DESC; +private: + CGoblin_Sword(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CGoblin_Sword(const CGoblin_Sword& Prototype); + virtual ~CGoblin_Sword() = default; + +public: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + HRESULT Render_Disolve(); + void Set_Disolve(_bool bDisolve) { m_bDisolve = bDisolve; } + void Set_CanTakeDamage(_bool bCanTake) { m_bCanTakeDamage = bCanTake; } + const _float4x4& Get_SwordMatrix() { return m_vSwordMat; }; +public: + +private: + const _float4x4* m_pSocketMatrices = { }; + CShader* m_pShaderCom = { nullptr }; + CModel* m_pModelCom = { nullptr }; + _int m_iIndex = {}; + _wstring m_strModelPrototypeTag; + _bool m_bCanTakeDamage = { false }; + _bool m_bHit = { false }; + _bool m_bDisolve = { false }; + _float m_fDisolveTime = { 0.f }; + _float4x4 m_vSwordMat = {}; + + _float4 m_vStartPos = {}; + PSX::PxSweepBufferN<12> m_SweepBuffer = {}; + +private: + HRESULT Ready_Components(); + HRESULT Bind_ShaderResources(); + void Sword_Hit(); + +public: + static CGoblin_Sword* 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 diff --git a/Jusin154_Team3D/Client/Public/Level_Field.h b/Jusin154_Team3D/Client/Public/Level_Field.h index 880a29d7d..4c875dd93 100644 --- a/Jusin154_Team3D/Client/Public/Level_Field.h +++ b/Jusin154_Team3D/Client/Public/Level_Field.h @@ -15,6 +15,7 @@ class CLevel_Field final : public CLevel virtual void Update(_float fTimeDelta) override; virtual HRESULT Render() override; + _bool m_isDay = { true }; private: class CInfoInstance* m_pInfoInstance = { nullptr }; diff --git a/Jusin154_Team3D/Client/Public/Level_GamePlay.h b/Jusin154_Team3D/Client/Public/Level_GamePlay.h index 42385a209..c5bd6bcd8 100644 --- a/Jusin154_Team3D/Client/Public/Level_GamePlay.h +++ b/Jusin154_Team3D/Client/Public/Level_GamePlay.h @@ -19,10 +19,13 @@ class CLevel_GamePlay final : public CLevel private: class CInfoInstance* m_pInfoInstance = { nullptr }; class CBroomRaceManager* m_pBroomRaceManager = { nullptr }; + + _bool m_isDay = { true }; private: virtual HRESULT Initialize() override; HRESULT Initialize(void* pArg); HRESULT Ready_Lights(); + HRESULT Ready_Volumetric(); HRESULT Ready_Background(); HRESULT Ready_Layer_Hogsmeade(); HRESULT Ready_Layer_Hogwart(); diff --git a/Jusin154_Team3D/Client/Public/Light_Main.h b/Jusin154_Team3D/Client/Public/Light_Main.h index a56ac9081..e030c53cd 100644 --- a/Jusin154_Team3D/Client/Public/Light_Main.h +++ b/Jusin154_Team3D/Client/Public/Light_Main.h @@ -20,13 +20,13 @@ class CLight_Main final : public CGameObject virtual HRESULT Capture_PreShadow(); private: - CLight* m_pLightCom = { nullptr }; + CLight* m_pLightCom = { nullptr }; private: virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; - HRESULT Ready_Components(); + HRESULT Ready_Components(void* pArg); HRESULT Bind_ShaderResources(); _matrix Get_OffCenterProjMatrix(_fmatrix ViewMatrix, vector<_float3>& WorldPositions); diff --git a/Jusin154_Team3D/Client/Public/Player.h b/Jusin154_Team3D/Client/Public/Player.h index 51da992ec..874aaf0aa 100644 --- a/Jusin154_Team3D/Client/Public/Player.h +++ b/Jusin154_Team3D/Client/Public/Player.h @@ -2,30 +2,12 @@ #include "Client_Define.h" #include "Unit.h" +#include "Player_ENUM.h" NS_BEGIN(Client) class CPlayer final : public CUnit { - enum class PLAYER_MESH_ORDER { - HEAD_EYE_OCC, - HEAD_FACE, - HEAD_TEETH, - HEAD_EYELASH, - HEAD_EYES, - BODY_ARMS, - HAIR_MAIN, - HAIR_MAIN_CLOTH, - LOWER, - SHOES, - UPPER, - HAIR_SUB, - HAIR_SUB_CLOTH, - ROBE_SKIRT, - ROBE_FUR, - ROBE_CLOTH, - END - }; public: typedef struct tagPlayerInitDesc { _float4 vPos; @@ -92,6 +74,8 @@ class CPlayer final : public CUnit class CTransform* m_pBroomTransform = { nullptr }; class CBroom* m_pBroom = { nullptr }; CStat* m_pStat = { nullptr }; + class CPlayerRobe* m_pRobePart = { nullptr }; + class CBroomRaceManager* m_pBroomRaceManager = { nullptr }; class CRaceRing* m_pRaceRing = { nullptr }; diff --git a/Jusin154_Team3D/Client/Public/PlayerRobe.h b/Jusin154_Team3D/Client/Public/PlayerRobe.h new file mode 100644 index 000000000..b5ab2c13a --- /dev/null +++ b/Jusin154_Team3D/Client/Public/PlayerRobe.h @@ -0,0 +1,88 @@ +#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 }; + _float4x4 m_ReconstructedJointAnchorMatirces[ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::END)] = { }; + + 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_BONE_ORDER::END)] = { nullptr }; + PSX::PxD6Joint* m_pDynamicJoints[ENUM_CLASS(PLAYER_JOINT_ORDER::END)] = { nullptr }; + + ID3D11Buffer* m_pBoneCombinedMatrixBuffer = { nullptr }; + ID3D11ShaderResourceView* m_pBoneCombinedMatrixSRV = { nullptr }; + + CModel::BONEINSERTION_DESC m_BoneInsertionDesc = {}; +#ifdef _DEBUG + unique_ptr m_pMainShape = { nullptr }; + unique_ptr 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); + HRESULT Create_BoneCombinedMatrixSRV(); +#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 diff --git a/Jusin154_Team3D/Client/Public/Player_ENUM.h b/Jusin154_Team3D/Client/Public/Player_ENUM.h new file mode 100644 index 000000000..41b9bfd7f --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Player_ENUM.h @@ -0,0 +1,125 @@ +#pragma once +#include "Client_Define.h" + +NS_BEGIN(Client) + +enum class PLAYER_MESH_ORDER { + HEAD_EYE_OCC, + HEAD_FACE, + HEAD_TEETH, + HEAD_EYELASH, + HEAD_EYES, + BODY_ARMS, + HAIR_MAIN, + HAIR_MAIN_CLOTH, + LOWER, + SHOES, + UPPER, + HAIR_SUB, + HAIR_SUB_CLOTH, + ROBE_SKIRT, + ROBE_FUR, + ROBE_CLOTH, + END +}; + +static const _char* PLAYER_JOINT_BONE_NAMES[12] = { + "RightUpLeg_Cloth" + , "TailUp_Cloth" + , "LeftUpLeg_Cloth" + + , "RightLeg_Cloth" + , "Tail_Cloth" + , "LeftLeg_Cloth" + + , "RightDownLeg_Cloth" + , "RightDownRightLeg_Cloth" + , "TailRightDown_Cloth" + + , "TailLeftDown_Cloth" + , "LeftDownLeftLeg_Cloth" + , "LeftDownLeg_Cloth" +}; + +enum class PLAYER_JOINT_BONE_ORDER { + RIGHTUP + , RIGHT + , RIGHTDOWN + , RIGHTDOWNRIGHT + + , LEFTUP + , LEFT + , LEFTDOWN + , LEFTDOWNLEFT + + , TAILUP + , TAIL + , TAILLEFTDOWN + , TAILRIGHTDOWN + + , END +}; + +enum class PLAYER_JOINT_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 diff --git a/Jusin154_Team3D/Client/Public/Ranrok.h b/Jusin154_Team3D/Client/Public/Ranrok.h index 2f3c723e9..1edc6ef52 100644 --- a/Jusin154_Team3D/Client/Public/Ranrok.h +++ b/Jusin154_Team3D/Client/Public/Ranrok.h @@ -48,6 +48,7 @@ class CRanrok final : public CMonster virtual void Update(_float fTimeDelta) override; virtual void Late_Update(_float fTimeDelta) override; virtual HRESULT Render() override; + virtual HRESULT Render_OutLine() override; virtual HRESULT Render_Shadow(SHADOW eType) override; virtual _vector Get_LockOnPos() override; virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr)override; @@ -93,7 +94,7 @@ class CRanrok final : public CMonster _int m_ePhase = ENUM_CLASS(RANROK_PHASE::PHASE_AIR); _float m_fSkillCoolTime[ENUM_CLASS(RANROK_SKILL::END)] = {}; - _float m_fMaxSkillCoolTime[ENUM_CLASS(RANROK_SKILL::END)] = { 40.f,40.f ,15.f,40.f,40.f,40.f}; + _float m_fMaxSkillCoolTime[ENUM_CLASS(RANROK_SKILL::END)] = { 40.f,40.f ,8.f,40.f,40.f,40.f}; _float m_fTuckedTime = {}; _bool m_bFireBurst = { false }; @@ -112,6 +113,7 @@ class CRanrok final : public CMonster _float m_fAroundRadius = 40.f; _float m_fAroundTime = {}; _float m_fRushTime = {}; + _float m_fHeadAimWeight = {}; class CEffect_Container* m_pRanrok_Point = { nullptr }; _float m_fTuckedSpeed = { 75.f }; diff --git a/Jusin154_Team3D/Client/Public/State_Dash.h b/Jusin154_Team3D/Client/Public/State_Dash.h new file mode 100644 index 000000000..61387d619 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Dash.h @@ -0,0 +1,36 @@ +#pragma once +#include "Client_Define.h" +#include "State_Root.h" + +NS_BEGIN(Client) + +class CState_Dash final : public CState_Root +{ +public: + typedef struct tagDash : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }STATE_DASH_DESC; +private: + CState_Dash(); + virtual ~CState_Dash() = default; + +public: + virtual void Enter(); + virtual HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +private: + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + +private: + HRESULT Initialize(STATE_DASH_DESC* pDesc); + +public: + static CState_Dash* Create(STATE_DASH_DESC* pDesc); + virtual void Free() override; + virtual void Describe_Entity(); +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/State_Slash.h b/Jusin154_Team3D/Client/Public/State_Slash.h new file mode 100644 index 000000000..cbfc28c0f --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Slash.h @@ -0,0 +1,36 @@ +#pragma once +#include "Client_Define.h" +#include "State_Root.h" + +NS_BEGIN(Client) + +class CState_Slash final : public CState_Root +{ +public: + typedef struct tagSlash : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }STATE_SLASH_DESC; +private: + CState_Slash(); + virtual ~CState_Slash() = default; + +public: + virtual void Enter(); + virtual HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +private: + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + +private: + HRESULT Initialize(STATE_SLASH_DESC* pDesc); + +public: + static CState_Slash* Create(STATE_SLASH_DESC* pDesc); + virtual void Free() override; + virtual void Describe_Entity(); +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Stat/Stat.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/Stat/Stat.xml index a18e49aa2..a9bf5fcb8 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Stat/Stat.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Stat/Stat.xml @@ -1,5 +1,5 @@  - + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Spell/SpellInfo.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Spell/SpellInfo.xml index a5487a058..2f4d236b3 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Spell/SpellInfo.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Spell/SpellInfo.xml @@ -109,7 +109,7 @@ 반환됩니다." Spell_Lock="0" Equip_Spell="0" Use_Skill="1" Preview="0" Vidio="0" /> - + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/EleazarFig/Professor_EleazarFig_Anim.xml b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/EleazarFig/Professor_EleazarFig_Anim.xml index 63a17c1c2..ca2a1c2a6 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/EleazarFig/Professor_EleazarFig_Anim.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/EleazarFig/Professor_EleazarFig_Anim.xml @@ -173,7 +173,7 @@ - + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable.bin index 403e0054c..401c670b0 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e6ecd489ba85df6cb5c61fba767fdff0bc202c8b36b0459b5195c1bd8322a43f -size 10290646 +oid sha256:19fe722384b732f55bddc9ac5d09f0d50c2a81c76bd7b8c580378f6fa077ca92 +size 10364804 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable.fbx index 6442fd9fb..bb404edba 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable.fbx +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable.fbx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:aa133b47cdbc06afb3c3ad6a86f1983d7bc977a9d87dc4381316776bbcd1ae6f -size 5616188 +oid sha256:32213c93d4cc6a61dd1bfcdb4193bfa76ddb1df6446e1ab1dfeab4d5ff522efd +size 5730924 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable.xml b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable.xml index 837220a11..9bf7fcb9c 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable.xml @@ -86,7 +86,7 @@ - + @@ -115,7 +115,7 @@ - + @@ -173,7 +173,7 @@ - + @@ -231,7 +231,7 @@ - + @@ -260,7 +260,7 @@ - + @@ -289,7 +289,7 @@ - + @@ -318,7 +318,7 @@ - + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_AvadaKedavra.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_AvadaKedavra.bin new file mode 100644 index 000000000..84a67412b --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_AvadaKedavra.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5de12debaa365a050c382275f3f5ea6f0d1837fb91455f97ec7ed6664ca0a125 +size 10647812 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_AvadaKedavra.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_AvadaKedavra.fbx new file mode 100644 index 000000000..421a1ac9e --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_AvadaKedavra.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78fb82fcf96c82e6150fcbb64add88abc6bc7c622c4b3eee282fe75c3aaf438e +size 6313116 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_AvadaKedavran.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_AvadaKedavran.bin deleted file mode 100644 index 6d491ba80..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_AvadaKedavran.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:552a7e673dd5b90f308bc17e429ce5871b8b69c407800fba7c01deee8a4d0fd1 -size 10570937 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_AvadaKedavran.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_AvadaKedavran.fbx deleted file mode 100644 index ac69afac8..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_AvadaKedavran.fbx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3e2e58a126c01b12f8a6e7f16fd1bff734f2cfac8a2a781c27616db44d07e6be -size 6158620 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Bm.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Bm.bin index 82d20f449..87e386e1e 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Bm.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Bm.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:45d37a80efc01abf16883a6386324f9180775c227c6ac3be54351330d43c56d1 -size 170896473 +oid sha256:d6603be4f8c20ac9d35068a179b14d328d2e3ed8606cbbe4ff485ee20860c0e8 +size 171707390 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Bm.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Bm.fbx index b89f32cd1..a9917c355 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Bm.fbx +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Bm.fbx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8f471396193ee00ab3f6e5cfb05671521ce2ec5f2f7658ad01034d075fcbf25d -size 457150268 +oid sha256:a4b060e3740116655157dcef4e1c24be46ef19e135bee51f1f226c8e67f92553 +size 483257372 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Broom.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Broom.bin index dcf9cec67..d0c17e284 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Broom.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Broom.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:65bd1b7aba444dad6e52c4189b668a5b3ac388f2c92d8dbacde6f79552581f90 -size 22917444 +oid sha256:1d7c2c35f74162db556b2ffc41430330758f2663ff74789a9df08228ed384de7 +size 23075473 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Broom.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Broom.fbx index 6ba2d37e2..16f03d476 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Broom.fbx +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Broom.fbx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d68ebc089dc66df34e3258a490420e26257a78ea22c4938eb77460e390c2560c -size 53888796 +oid sha256:0ad3ae0879799efcc14fb85e27aadb253deb42262d583646d59e96e0e4971891 +size 56931356 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Cmbt.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Cmbt.bin index 1e4b15edd..4cfeee79b 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Cmbt.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Cmbt.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:99855947403e10ea088248ca45a3dab3933b22678cc20ca09d1352c6a4bd0df4 -size 68983780 +oid sha256:d11392338e9b08f59daf4a89c6314c909324db9b8cd12eed44b9d54f0f38024a +size 69331867 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Cmbt.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Cmbt.fbx index a918a2c86..a6552e63f 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Cmbt.fbx +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Cmbt.fbx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:efe0d8710e5d25ebe687b5d0d5f341757da9ec7e2fc2b3202c6316bbeee1b367 -size 172856076 +oid sha256:3852584ae91ce78b9c3299e91ea1639afa69ce3fddb78fa301aec277ecdfd796 +size 182598812 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Lightning.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Lightning.bin index e076bc073..04d63a307 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Lightning.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Lightning.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ce6c582a267476b868bdb2d2ab121ee8fc66de14c193d61816b9fd7e026f6fc0 -size 10730733 +oid sha256:5530b986c6bd101b5e3eda8eb5631594b07a071886f7708b69494730193fd8de +size 10807972 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Lightning.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Lightning.fbx index b7d866ccc..f087a226a 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Lightning.fbx +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Lightning.fbx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:00bf25ba5abdcce10d0ab1afd50f62b5667300a499850c133499e8563e4b3d91 -size 6247020 +oid sha256:8a95ec0fd1c0b1991083fd21c0fb2a87d6126400acde22ef97a6df438b1c5d3c +size 6401564 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Protego.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Protego.bin index a5f036d71..d005baddb 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Protego.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Protego.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0596ec615a1f3ab2dc03e0875e7b6a2840c8df3e75326893afaf220b73eb1d00 -size 11478642 +oid sha256:cf4c2fc354b8fe220a85cf2a4766aca198966d2afe06b99ea15b60520b3d600d +size 11563567 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Protego.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Protego.fbx index 7c1a1471b..17ee917fe 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Protego.fbx +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Protego.fbx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e14fce3cf9cdcdc0fab741dc5417ce453057cf19594d4ad56fc5461ba825164b -size 10536764 +oid sha256:9344cd73993ca5a9979005e4a2d6602afd495ce1a665b6693807ffc8288891bb +size 10960124 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Rct.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Rct.bin index 1b3fa3e3a..d3c6afa9c 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Rct.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Rct.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0c69e1ec83a75f80f797e8a2970c912ed8c54b7c7e484afe7d6bbcb97c44010c -size 60341885 +oid sha256:fed83d790ce5ec13ed5cf7acd245ac38b3a86658e52c72d7c8d3424d86d500f7 +size 60651350 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Rct.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Rct.fbx index eff18e350..e8fc6d273 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Rct.fbx +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Rct.fbx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e7bf8861475ec0eff44cdf88ae9795e5b13b7dc6c341e057e80feceb3ea384e1 -size 149327452 +oid sha256:c15071ebf86e8c4688d6f252de7b50487cb1454bc5e7ca5231334ac0d5546d64 +size 157682572 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Sneak.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Sneak.bin index 400887a4c..3f55b79df 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Sneak.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Sneak.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cef8d8458de71ab0bd5cd4344879ab5402d36074bab926262cd496a7939f9304 -size 19356151 +oid sha256:1d369879ae3846d1bb1779818b025a714b9412cb4a7faaa238c6b862f7bdd0ec +size 19489076 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Sneak.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Sneak.fbx index 211971f2d..8e0194c1e 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Sneak.fbx +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Sneak.fbx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c041565fa7b147ce6fdfb89cd3d34e410f5bb971e2f569b91ebdd2972bfea380 -size 38994124 +oid sha256:068105d25b85bbd235d0be09005cfa7d4a2938571965019ad3459dcaa3133360 +size 41111868 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Spawn.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Spawn.bin index a96583e9c..8173f74c8 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Spawn.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Spawn.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:13f56a745a91c3c7054387613b0aed0fe7299e157b8570ba3ae9b0844923b3a0 -size 15410052 +oid sha256:97a3468fa1372811a36391ffece957b786dcf633ec84b6bb1ded222e89bca6d9 +size 15496127 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Spawn.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Spawn.fbx index 316f5b897..4f53e5320 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Spawn.fbx +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Spawn.fbx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1b4a14778bc770f934c888c6dae7377228f1032d584ca318795577557d6a0e66 -size 12808700 +oid sha256:7c57f4192cd1cc660c7975d3d0c2e73680f55257a48c3d6ef6965e3290b19c0e +size 13271484 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Spell_Learning.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Spell_Learning.bin index d2949a371..f3654b2ae 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Spell_Learning.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Spell_Learning.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ab8b4150a5940dccab76789aa47f07401e0e0ae4f93d0fc3447faa421d5e563f -size 12127590 +oid sha256:e6cdba1d2a122702abe7704d60fe38a1fed7d33020713ad0478ca5374681651d +size 12209325 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Spell_Learning.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Spell_Learning.fbx index be2dc4bac..a2146657d 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Spell_Learning.fbx +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/Playable_Spell_Learning.fbx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:27f8e609b42eb9ad7c32c8d59d67d538f64eac901bc1852b15893ffcf9e37ad9 -size 9075324 +oid sha256:dfdb7b6f61c64274ea30443d94497b20db204a7c9e82154980154b16af194e6d +size 9383916 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/ConjuredDragon/ConjuredDragon.xml b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/ConjuredDragon/ConjuredDragon.xml index b82a6a608..52cde6bca 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/ConjuredDragon/ConjuredDragon.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/ConjuredDragon/ConjuredDragon.xml @@ -1,5 +1,5 @@ - + @@ -28,7 +28,7 @@ - + @@ -57,7 +57,7 @@ - + @@ -86,7 +86,7 @@ - + @@ -115,7 +115,7 @@ - + @@ -144,7 +144,7 @@ - + @@ -173,7 +173,7 @@ - + @@ -202,7 +202,7 @@ - + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/BaseFlattenNormalMap.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/BaseFlattenNormalMap.png new file mode 100644 index 000000000..d8e1fd944 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/BaseFlattenNormalMap.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/SK_GOB_M_Assassin_Master.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/SK_GOB_M_Assassin_Master.bin new file mode 100644 index 000000000..8c5a78cca --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/SK_GOB_M_Assassin_Master.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1d0ce3e6476d9637d26dbff6df00873b28d976705f6cb4e29b2f02a8314f768b +size 91768265 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/SK_GOB_M_Assassin_Master.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/SK_GOB_M_Assassin_Master.fbx new file mode 100644 index 000000000..5ae3c0756 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/SK_GOB_M_Assassin_Master.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe9ce29a95c8d054c9a5bb2b17201db5ada8d704ddfd97d9c368d3e271e4fb18 +size 333007932 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/SK_GOB_M_Assassin_Master.xml b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/SK_GOB_M_Assassin_Master.xml new file mode 100644 index 000000000..e1905d26d --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/SK_GOB_M_Assassin_Master.xml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_DefaultGrey_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_DefaultGrey_D.png new file mode 100644 index 000000000..b414d5691 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_DefaultGrey_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_Eye_Iris_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_Eye_Iris_D.png new file mode 100644 index 000000000..4bf9d62f9 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_Eye_Iris_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_Eye_Sclera_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_Eye_Sclera_D.png new file mode 100644 index 000000000..6e082532d Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_Eye_Sclera_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_Hair_Banker_DAO_MSK.dds b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_Hair_Banker_DAO_MSK.dds new file mode 100644 index 000000000..8642b0c88 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_Hair_Banker_DAO_MSK.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_Hair_Banker_THV_MSK.dds b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_Hair_Banker_THV_MSK.dds new file mode 100644 index 000000000..8acf10a3d Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_Hair_Banker_THV_MSK.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_Head_Banker_N.dds b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_Head_Banker_N.dds new file mode 100644 index 000000000..76246d5a0 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_Head_Banker_N.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_M_Assassin_D.dds b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_M_Assassin_D.dds new file mode 100644 index 000000000..d81b678c2 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_M_Assassin_D.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_M_Assassin_MRO.dds b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_M_Assassin_MRO.dds new file mode 100644 index 000000000..814317c8f Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_M_Assassin_MRO.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_M_Assassin_N.dds b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_M_Assassin_N.dds new file mode 100644 index 000000000..2c7789adb Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_M_Assassin_N.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_M_Head_Banker_SRXO.dds b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_M_Head_Banker_SRXO.dds new file mode 100644 index 000000000..a37d8d7fc Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_M_Head_Banker_SRXO.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_M_Head_Teeth_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_M_Head_Teeth_D.png new file mode 100644 index 000000000..eec5a1f7c Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_M_Head_Teeth_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_M_Head_Teeth_N.dds b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_M_Head_Teeth_N.dds new file mode 100644 index 000000000..c3fc70ad7 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_M_Head_Teeth_N.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_M_Head_Teeth_SR.dds b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_M_Head_Teeth_SR.dds new file mode 100644 index 000000000..70bd10254 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_M_Head_Teeth_SR.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_M_Melee_Head_Banker_D.dds b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_M_Melee_Head_Banker_D.dds new file mode 100644 index 000000000..0f7e04c9c Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_GOB_M_Melee_Head_Banker_D.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_Goblin_Banker_D.dds b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_Goblin_Banker_D.dds new file mode 100644 index 000000000..085070615 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_Goblin_Banker_D.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_Goblin_Banker_MRO.dds b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_Goblin_Banker_MRO.dds new file mode 100644 index 000000000..4be2c4bbe Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_Goblin_Banker_MRO.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_Goblin_Banker_N.dds b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_Goblin_Banker_N.dds new file mode 100644 index 000000000..7c1a33f12 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/T_Goblin_Banker_N.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Camera/CCL_CameraRig.001.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Camera/CCL_CameraRig.001.bin new file mode 100644 index 000000000..380521f4d --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Camera/CCL_CameraRig.001.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68c43f1841c58a234fbd5176f722501c140b04a21ee2bdaad46fc3f838b96f21 +size 150944 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Camera/CCL_CameraRig.001.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Camera/CCL_CameraRig.001.fbx new file mode 100644 index 000000000..274080f38 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Camera/CCL_CameraRig.001.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2796feec259cd37ae881572dc61f33b67e07fc233666fb7037789c2699c81b9f +size 818412 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Camera/T_Seasons_Fall_Grass_Top_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Camera/T_Seasons_Fall_Grass_Top_D.png new file mode 100644 index 000000000..53319dfb7 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Camera/T_Seasons_Fall_Grass_Top_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Goblin_Sword/SK_WPN_GOB_SmallSword.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Goblin_Sword/SK_WPN_GOB_SmallSword.fbx new file mode 100644 index 000000000..2fea614f3 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Goblin_Sword/SK_WPN_GOB_SmallSword.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:47912d072d8c80ecbcfcb6caf1898a8f913e1522516a6ec108fcf4cd120d81c4 +size 48172 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Goblin_Sword/SK_WPN_GOB_SmallSword_L.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Goblin_Sword/SK_WPN_GOB_SmallSword_L.bin new file mode 100644 index 000000000..90a712b18 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Goblin_Sword/SK_WPN_GOB_SmallSword_L.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f78616fb05ddc450509283e4e44efb4c105b2b83553f56a3e09df34234d750c +size 86383 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Goblin_Sword/SK_WPN_GOB_SmallSword_R.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Goblin_Sword/SK_WPN_GOB_SmallSword_R.bin new file mode 100644 index 000000000..32b594a3a --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Goblin_Sword/SK_WPN_GOB_SmallSword_R.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2aa8174b67ce90443cd46bff27915a7b938c1beace5c07f74b68ae99eef57dac +size 86383 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli index 6d94261a3..00c07a790 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli @@ -557,23 +557,23 @@ float2 CalcVelocityUV(float4 vCurrentProjPos, float4 vPreviousProjPos, float fIn float3 DownSampleFast(Texture2D SrcTexture2D, float2 vCenterTexcoord, float2 vSrcTexelSize, float2 vResolution) { float2 uv = float2(0.f, 0.f); - float3 vCenterColor = SrcTexture2D.SampleLevel(BorderZeroSampler, vCenterTexcoord, 0); + float3 vCenterColor = SrcTexture2D.SampleLevel(BorderZeroSampler, vCenterTexcoord, 0).rgb; uv = vCenterTexcoord + vSrcTexelSize * float2(-1.0, -1.0); - float3 fLTColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroSampler); + float3 fLTColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroSampler).rgb; uv = vCenterTexcoord + vSrcTexelSize * float2(0.0, -1.0); - float3 fTColor = SrcTexture2D.SampleLevel(BorderZeroSampler, uv, 0); + float3 fTColor = SrcTexture2D.SampleLevel(BorderZeroSampler, uv, 0).rgb; uv = vCenterTexcoord + vSrcTexelSize * float2(+1.0, -1.0); - float3 fRTColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroSampler); + float3 fRTColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroSampler).rgb; uv = vCenterTexcoord + vSrcTexelSize * float2(-1.0, 0.0); - float3 fLColor = SrcTexture2D.SampleLevel(BorderZeroSampler, uv, 0); + float3 fLColor = SrcTexture2D.SampleLevel(BorderZeroSampler, uv, 0).rgb; uv = vCenterTexcoord + vSrcTexelSize * float2(1.0, 0.0); - float3 fRColor = SrcTexture2D.SampleLevel(BorderZeroSampler, uv, 0); + float3 fRColor = SrcTexture2D.SampleLevel(BorderZeroSampler, uv, 0).rgb; uv = vCenterTexcoord + vSrcTexelSize * float2(-1.0, +1.0); - float3 fLBColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroSampler); + float3 fLBColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroSampler).rgb; uv = vCenterTexcoord + vSrcTexelSize * float2(0.0, 1.0); - float3 fBColor = SrcTexture2D.SampleLevel(BorderZeroSampler, uv, 0); + float3 fBColor = SrcTexture2D.SampleLevel(BorderZeroSampler, uv, 0).rgb; uv = vCenterTexcoord + vSrcTexelSize * float2(+1.0, +1.0); - float3 fRBColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroSampler); + float3 fRBColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroSampler).rgb; return vCenterColor * 0.25f + (fLTColor + fRTColor + fLBColor + fRBColor) * 0.0625f + (fTColor + fLColor + fRColor + fBColor) * 0.125f; } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_BoneCombinedInsertion_Compute.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_BoneCombinedInsertion_Compute.hlsl new file mode 100644 index 000000000..ee1d7a957 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_BoneCombinedInsertion_Compute.hlsl @@ -0,0 +1,40 @@ +struct LocalPos +{ + row_major float4x4 Combined; + row_major float4x4 Local; + row_major float4x4 LocalCombined; +}; + +struct BoneCombined +{ + row_major float4x4 BoneCombinedTransformation; +}; + +StructuredBuffer g_CombinedMatIn : register(t0); + +RWStructuredBuffer g_LocalPosOutput : register(u0); + +cbuffer BoneInsertionCB : register(b0) +{ + uint iStartOffset; + uint iMatrixCount; + uint iPad0; + uint iPad1; +}; + +[numthreads(256, 1, 1)] +void CS_MAIN(uint3 DTid : SV_DispatchThreadID) +{ + uint iBoneIndex = DTid.x; + + if (iBoneIndex >= iMatrixCount) + { + return; + } + + float4x4 CombinedMatrix = g_CombinedMatIn[iBoneIndex].BoneCombinedTransformation; + + g_LocalPosOutput[iBoneIndex+iStartOffset].LocalCombined = CombinedMatrix; + g_LocalPosOutput[iBoneIndex+iStartOffset].Combined = CombinedMatrix; + +} diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Local_Compute.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Local_Compute.hlsl index a8ac33933..3d233fe57 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Local_Compute.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Local_Compute.hlsl @@ -25,6 +25,7 @@ StructuredBuffer g_PrevChannelBuffer : register(t3); StructuredBuffer g_ParentBuffer : register(t4); StructuredBuffer g_BoneLocalBuffer : register(t5); StructuredBuffer g_BoneRemap : register(t6); +StructuredBuffer g_SkipBone : register(t7); RWStructuredBuffer g_LocalMatrixOut : register(u0); @@ -42,7 +43,17 @@ cbuffer AnimCB : register(b0) float BlendRatio; int RootBoneIndex; - float3 _pad0; + int PlayHeadBone; + int HeadBoneIndex; + float HeadAimWeight; + + int SkipCount; + int _pad0; + int _pad1; + int _pad2; + + float3 TargetDir_Local; + float padding3; row_major float4x4 PreTransformMatrix; float4 RootInitRot; @@ -163,6 +174,37 @@ void DecomposeAffine_RowMajor(row_major float4x4 M, out float3 S, out float4 R, R = QuatNormalize(q); } +row_major float4x4 ApplyHeadAim(uint bone, row_major float4x4 M) +{ + if (PlayHeadBone != 1) + return M; + if (bone != HeadBoneIndex) + return M; + if (HeadAimWeight <= 0.f) + return M; + + float3 curFwd = normalize(float3(M._31, M._32, M._33)); + float3 target = normalize(TargetDir_Local); + + float d = dot(curFwd, target); + + float3 axis = cross(curFwd, target); + float axisLen = length(axis); + if (axisLen <= EPS) + return M; + + axis /= axisLen; + + float angle = acos(saturate(d)); + angle *= saturate(HeadAimWeight); + + float4 qAim = float4(axis * sin(angle * 0.5f), cos(angle * 0.5f)); + qAim = QuatNormalize(qAim); + + row_major float4x4 AimM = MakeAffine(float3(1, 1, 1), qAim, float3(0, 0, 0)); + return mul(AimM, M); +} + uint FindKeyIndexCur(uint start, uint count, float t) { @@ -274,55 +316,36 @@ void SampleLocalTRS_Prev(uint bone, float t, out float3 S, out float4 R, out flo row_major float4x4 SampleBlendedLocal(uint bone) { - if (PrevAnimIndex == -1) + float3 S; + float4 R; + float3 T; + + if (PrevAnimIndex == -1 || CurrentAnimIndex == PrevAnimIndex) { - float3 S; - float4 R; - float3 T; SampleLocalTRS_Cur(bone, CurrentTime, S, R, T); if (bone == RootBoneIndex) { T = 0; R = RootInitRot; } - return MakeAffine(S, R, T); - } - if (CurrentAnimIndex == PrevAnimIndex) - { - float3 S; - float4 R; - float3 T; - SampleLocalTRS_Cur(bone, CurrentTime, S, R, T); - - if (bone == RootBoneIndex) - { - T = 0; - R = RootInitRot; - } - return MakeAffine(S, R, T); + row_major float4x4 M = MakeAffine(S, R, T); + return ApplyHeadAim(bone, M); } float br = saturate(BlendRatio); float3 sA, sB, tA, tB; float4 rA, rB; - - float prevT = PrevTime; - - if (BlendRatio < 1e-4f) - { - prevT = CurrentTime; - } - + float prevT = (BlendRatio < 1e-4f) ? CurrentTime : PrevTime; SampleLocalTRS_Prev(bone, prevT, sA, rA, tA); SampleLocalTRS_Cur(bone, CurrentTime, sB, rB, tB); - float3 S = lerp(sA, sB, br); - float3 T = lerp(tA, tB, br); - float4 R = QuatSlerp(rA, rB, br); + S = lerp(sA, sB, br); + T = lerp(tA, tB, br); + R = QuatSlerp(rA, rB, br); if (bone == RootBoneIndex) { @@ -330,15 +353,31 @@ row_major float4x4 SampleBlendedLocal(uint bone) R = RootInitRot; } - return MakeAffine(S, R, T); + row_major float4x4 M = MakeAffine(S, R, T); + return ApplyHeadAim(bone, M); } + [numthreads(256, 1, 1)] void CS_LOCAL(uint3 DTid : SV_DispatchThreadID) { uint bone = DTid.x; + if (bone >= BoneCount) return; + + if (SkipCount != 0) + { + for (int i = 0; i < SkipCount; i++) + { + if (bone == g_SkipBone[i]) + { + g_LocalMatrixOut[bone] = g_BoneLocalBuffer[bone].BoneLocal; + return; + } + } + } + g_LocalMatrixOut[bone] = SampleBlendedLocal(bone); } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl index e87c7476e..6e54e5656 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl @@ -24,7 +24,17 @@ cbuffer AnimCB : register(b0) float BlendRatio; int RootBoneIndex; - float3 _pad0; + int PlayHeadBone; + int HeadBoneIndex; + float HeadAimWeight; + + int SkipCount; + int _pad0; + int _pad1; + int _pad2; + + float3 TargetDir_Local; + float padding3; row_major float4x4 PreTransformMatrix; float4 RootInitRot; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_NPC_PBR_Anim.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_NPC_PBR_Anim.hlsl index 737b5e082..431cda257 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_NPC_PBR_Anim.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_NPC_PBR_Anim.hlsl @@ -28,6 +28,9 @@ float g_fUsingSurfaceParams; float g_fEtherealRatio; float g_fMixerFactor; float g_fMBIntensity = 1.f; +float g_fDisolveEdgeWidth; +float g_fDisolveAmount; +float g_fDisolveRatio; @@ -65,6 +68,8 @@ StructuredBuffer g_PrevBoneBuffer : register(t27); Texture2D g_SurfaceParamsTexture; +Texture2D g_DeadDisolveTexture; +Texture2D g_DeadDisolveBurnTexture; int g_iBinded_Texture[27]; matrix g_BoneMatrices[512]; @@ -301,10 +306,12 @@ struct PS_OUT_BLEND }; struct PS_OUT_OUTLINE { - float4 vOutLine : SV_TARGET0; + float4 vAlbedo : SV_TARGET0; float4 vNormal : SV_TARGET1; float4 vDepth : SV_TARGET2; - float2 vVelocityUV : SV_TARGET3; + float4 vColor : SV_Target3; + float4 vSurface : SV_Target4; + float2 vVelocityUV : SV_TARGET5; }; PS_OUT_OUTLINE PS_MAIN_OUTLINE_READ(PS_IN In) @@ -322,12 +329,14 @@ PS_OUT_OUTLINE PS_MAIN_OUTLINE_READ(PS_IN In) float fRim = saturate((1.0f - fNdotV) * g_fOutLineScale); fRim = pow(fRim, g_fOutLinePower); - Out.vOutLine = float4(g_vOutLineColor.rgb, fRim); + Out.vAlbedo = float4(g_vOutLineColor.rgb, fRim); Out.vNormal = float4(vNormal * 0.5f + 0.5f, 0.f); Out.vDepth = float4((In.vProjPos.z / In.vProjPos.w), // NDC 源딆씠 ( 0~ 1) (In.vProjPos.w / g_fFar), // 酉??ㅽ럹?댁뒪 Z (float) AI_TEXTURE_TYPE_METALNESS / (float) AI_TEXTURE_TYPE_MAX, // ?쒗럹?댁뒪 ?뚮씪誘명꽣 1.f); + Out.vColor = float4(0.f, 0.f, 0.f, 0.f); + Out.vSurface = float4(0.5f, 1.f, 1.f, 0.f); Out.vVelocityUV = CalcVelocityUV(In.vProjPos, In.vPrevProjPos, g_fMBIntensity); return Out; @@ -338,7 +347,11 @@ PS_OUT PS_EYELASH_DAOTHV_ToSRO(PS_IN In) PS_OUT Out; float4 vDAO_Mask = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); - + if (true == g_bDisolve) + { + float4 vBurnColor = g_DeadDisolveBurnTexture.Sample(DefaultSampler, In.vTexcoord); + vDAO_Mask = ApplyDissolve(g_DeadDisolveTexture, g_fDisolveRatio, g_fDisolveAmount, g_fDisolveEdgeWidth, vBurnColor, vDAO_Mask, In.vTexcoord); + } float fDiffuseMask = vDAO_Mask.r; float AlphaMask = vDAO_Mask.g; float AoMask_Dao = vDAO_Mask.b; @@ -378,7 +391,11 @@ PS_OUT PS_TEETH_SRXO_ToSRO(PS_IN In) PS_OUT Out; float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); - + if (true == g_bDisolve) + { + float4 vBurnColor = g_DeadDisolveBurnTexture.Sample(DefaultSampler, In.vTexcoord); + vDiffuse = ApplyDissolve(g_DeadDisolveTexture, g_fDisolveRatio, g_fDisolveAmount, g_fDisolveEdgeWidth, vBurnColor, vDiffuse, In.vTexcoord); + } if (vDiffuse.a < 0.2f) { discard; } @@ -407,7 +424,11 @@ PS_OUT PS_EYE_DN_SRO(PS_IN In) PS_OUT Out; float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); - + if (true == g_bDisolve) + { + float4 vBurnColor = g_DeadDisolveBurnTexture.Sample(DefaultSampler, In.vTexcoord); + vDiffuse = ApplyDissolve(g_DeadDisolveTexture, g_fDisolveRatio, g_fDisolveAmount, g_fDisolveEdgeWidth, vBurnColor, vDiffuse, In.vTexcoord); + } if (vDiffuse.a < 0.2f) { discard; } @@ -442,7 +463,11 @@ PS_OUT PS_FACIAL_HAIR_DAOTHV_ToSRO(PS_IN In) PS_OUT Out; float4 vDAO_Mask = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); - + if (true == g_bDisolve) + { + float4 vBurnColor = g_DeadDisolveBurnTexture.Sample(DefaultSampler, In.vTexcoord); + vDAO_Mask = ApplyDissolve(g_DeadDisolveTexture, g_fDisolveRatio, g_fDisolveAmount, g_fDisolveEdgeWidth, vBurnColor, vDAO_Mask, In.vTexcoord); + } float fDiffuseMask = vDAO_Mask.r; float AlphaMask = vDAO_Mask.g; float AoMask_Dao = vDAO_Mask.b; @@ -484,7 +509,11 @@ PS_OUT PS_HEAD_HAIR_DAOTHV_ToSRO(PS_IN In) PS_OUT Out; float4 vDAO_Mask = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); - + if (true == g_bDisolve) + { + float4 vBurnColor = g_DeadDisolveBurnTexture.Sample(DefaultSampler, In.vTexcoord); + vDAO_Mask = ApplyDissolve(g_DeadDisolveTexture, g_fDisolveRatio, g_fDisolveAmount, g_fDisolveEdgeWidth, vBurnColor, vDAO_Mask, In.vTexcoord); + } float fDiffuseMask = vDAO_Mask.r; float AlphaMask = vDAO_Mask.g; float AoMask_Dao = vDAO_Mask.b; @@ -525,7 +554,11 @@ PS_OUT PS_HEADwtHAND_DSRXON_ToSRO(PS_IN In) PS_OUT Out; float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); - + if (true == g_bDisolve) + { + float4 vBurnColor = g_DeadDisolveBurnTexture.Sample(DefaultSampler, In.vTexcoord); + vDiffuse = ApplyDissolve(g_DeadDisolveTexture, g_fDisolveRatio, g_fDisolveAmount, g_fDisolveEdgeWidth, vBurnColor, vDiffuse, In.vTexcoord); + } if (vDiffuse.a < 0.2f) { discard; } @@ -553,7 +586,11 @@ PS_OUT PS_LOWER_DSRON_ToSRO(PS_IN In) PS_OUT Out; float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); - + if (true == g_bDisolve) + { + float4 vBurnColor = g_DeadDisolveBurnTexture.Sample(DefaultSampler, In.vTexcoord); + vDiffuse = ApplyDissolve(g_DeadDisolveTexture, g_fDisolveRatio, g_fDisolveAmount, g_fDisolveEdgeWidth, vBurnColor, vDiffuse, In.vTexcoord); + } if (vDiffuse.a < 0.2f) { discard; } @@ -581,7 +618,11 @@ PS_OUT PS_UPPER_DMRON_ToMRO(PS_IN In) PS_OUT Out; float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); - + if (true == g_bDisolve) + { + float4 vBurnColor = g_DeadDisolveBurnTexture.Sample(DefaultSampler, In.vTexcoord); + vDiffuse = ApplyDissolve(g_DeadDisolveTexture, g_fDisolveRatio, g_fDisolveAmount, g_fDisolveEdgeWidth, vBurnColor, vDiffuse, In.vTexcoord); + } if (vDiffuse.a < 0.2f) { discard; } @@ -609,7 +650,11 @@ PS_OUT PS_GLASSES_DMRON_ToMRO(PS_IN In) PS_OUT Out; float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); - + if (true == g_bDisolve) + { + float4 vBurnColor = g_DeadDisolveBurnTexture.Sample(DefaultSampler, In.vTexcoord); + vDiffuse = ApplyDissolve(g_DeadDisolveTexture, g_fDisolveRatio, g_fDisolveAmount, g_fDisolveEdgeWidth, vBurnColor, vDiffuse, In.vTexcoord); + } if (vDiffuse.a < 0.2f) { discard; } @@ -638,7 +683,12 @@ PS_OUT PS_EmissiveMetalness_DENMRO_ToMRO(PS_IN In) float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); float4 vEmissive = g_EmissiveTexture.Sample(DefaultSampler, In.vTexcoord); - vDiffuse.rgb += vEmissive.rgb; + if (true == g_bDisolve) + { + float4 vBurnColor = g_DeadDisolveBurnTexture.Sample(DefaultSampler, In.vTexcoord); + vDiffuse = ApplyDissolve(g_DeadDisolveTexture, g_fDisolveRatio, g_fDisolveAmount, g_fDisolveEdgeWidth, vBurnColor, vDiffuse, In.vTexcoord); + } + vDiffuse.rgb += vEmissive.rgb * 3.f; if (vDiffuse.a < 0.2f) { discard; } @@ -667,7 +717,12 @@ PS_OUT PS_DNMRO_ToMRO(PS_IN In) float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); float4 vEmissive = g_EmissiveTexture.Sample(DefaultSampler, In.vTexcoord); - vDiffuse.rgb += vEmissive.rgb; + if (true == g_bDisolve) + { + float4 vBurnColor = g_DeadDisolveBurnTexture.Sample(DefaultSampler, In.vTexcoord); + vDiffuse = ApplyDissolve(g_DeadDisolveTexture, g_fDisolveRatio, g_fDisolveAmount, g_fDisolveEdgeWidth, vBurnColor, vDiffuse, In.vTexcoord); + } + vDiffuse.rgb += vEmissive.rgb * 3.f; if (vDiffuse.a < 0.2f) { discard; } @@ -695,6 +750,11 @@ PS_OUT PS_MI_ClothSim_DSEN_ToSRO(PS_IN In) PS_OUT Out; float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); + if (true == g_bDisolve) + { + float4 vBurnColor = g_DeadDisolveBurnTexture.Sample(DefaultSampler, In.vTexcoord); + vDiffuse = ApplyDissolve(g_DeadDisolveTexture, g_fDisolveRatio, g_fDisolveAmount, g_fDisolveEdgeWidth, vBurnColor, vDiffuse, In.vTexcoord); + } float4 vEmissive = g_EmissiveTexture.Sample(DefaultSampler, In.vTexcoord); vDiffuse.rgb += vEmissive.rgb; if (vDiffuse.a < 0.2f) { @@ -724,6 +784,11 @@ PS_OUT PS_MI_DANSROMRO_ToSRO(PS_IN In) PS_OUT Out; float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); + if (true == g_bDisolve) + { + float4 vBurnColor = g_DeadDisolveBurnTexture.Sample(DefaultSampler, In.vTexcoord); + vDiffuse = ApplyDissolve(g_DeadDisolveTexture, g_fDisolveRatio, g_fDisolveAmount, g_fDisolveEdgeWidth, vBurnColor, vDiffuse, In.vTexcoord); + } float4 vAlpha = g_TransmissionTexture.Sample(DefaultSampler, In.vTexcoord); if (vAlpha.r < 0.2f) { @@ -759,6 +824,11 @@ PS_OUT PS_Troll_Club_DAENMROSRXO_ToMROX(PS_IN In) PS_OUT Out; float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord); + if (true == g_bDisolve) + { + float4 vBurnColor = g_DeadDisolveBurnTexture.Sample(DefaultSampler, In.vTexcoord); + vDiffuse = ApplyDissolve(g_DeadDisolveTexture, g_fDisolveRatio, g_fDisolveAmount, g_fDisolveEdgeWidth, vBurnColor, vDiffuse, In.vTexcoord); + } float4 vEmissive = g_EmissiveTexture.Sample(DefaultSampler, In.vTexcoord); float4 vAmbient = g_AmbientTexture.Sample(DefaultSampler, In.vTexcoord); vDiffuse.rgb += vEmissive.rgb; @@ -797,6 +867,11 @@ PS_OUT PS_Player_EyeLash_DAOTHV_ToSRO(PS_IN In) float2 p = uv - center; float2 uvRot90 = frac(float2(p.x, p.y) + center); float4 vDAOColor = g_DiffuseTexture.Sample(DefaultSampler, uv); + if (true == g_bDisolve) + { + float4 vBurnColor = g_DeadDisolveBurnTexture.Sample(DefaultSampler, In.vTexcoord); + vDAOColor = ApplyDissolve(g_DeadDisolveTexture, g_fDisolveRatio, g_fDisolveAmount, g_fDisolveEdgeWidth, vBurnColor, vDAOColor, In.vTexcoord); + } float4 vTHVColor = g_DiffuseBlend.Sample(DefaultSampler, uv); float4 vNormalColor = g_NormalTexture.Sample(DefaultSampler, uv); float fAlpha = g_NormalBlendTexture.Sample(DefaultSampler, uvRot90).r; @@ -836,6 +911,11 @@ PS_OUT PS_Player_Eye_ToMRO(PS_IN In) PS_OUT Out; float2 uv = In.vTexcoord; float4 vDiffuseColor = g_DiffuseTexture.Sample(DefaultSampler, uv); + if (true == g_bDisolve) + { + float4 vBurnColor = g_DeadDisolveBurnTexture.Sample(DefaultSampler, In.vTexcoord); + vDiffuseColor = ApplyDissolve(g_DeadDisolveTexture, g_fDisolveRatio, g_fDisolveAmount, g_fDisolveEdgeWidth, vBurnColor, vDiffuseColor, In.vTexcoord); + } float4 vSubSurfaceColor = g_ReflectionTexture.Sample(DefaultSampler, uv); float4 vNormalColor = g_NormalTexture.Sample(DefaultSampler, uv); float4 vMROColor = g_MetalnessTexture.Sample(DefaultSampler, uv); @@ -861,6 +941,11 @@ PS_OUT PS_Player_Robe_ToMRO(PS_IN In) PS_OUT Out; float2 uv = In.vTexcoord; float4 vDiffuseColor = g_DiffuseTexture.Sample(DefaultSampler, uv); + if (true == g_bDisolve) + { + float4 vBurnColor = g_DeadDisolveBurnTexture.Sample(DefaultSampler, In.vTexcoord); + vDiffuseColor = ApplyDissolve(g_DeadDisolveTexture, g_fDisolveRatio, g_fDisolveAmount, g_fDisolveEdgeWidth, vBurnColor, vDiffuseColor, In.vTexcoord); + } float4 vEmissive = g_EmissiveTexture.Sample(DefaultSampler, uv); vDiffuseColor.rgb += vEmissive.r * vEmissive.g; @@ -888,6 +973,11 @@ PS_OUT PS_Player_Suit_DSRON_ToSRO(PS_IN In) PS_OUT Out; float2 uv = In.vTexcoord; float4 vDiffuseColor = g_DiffuseTexture.Sample(DefaultSampler, uv); + if (true == g_bDisolve) + { + float4 vBurnColor = g_DeadDisolveBurnTexture.Sample(DefaultSampler, In.vTexcoord); + vDiffuseColor = ApplyDissolve(g_DeadDisolveTexture, g_fDisolveRatio, g_fDisolveAmount, g_fDisolveEdgeWidth, vBurnColor, vDiffuseColor, In.vTexcoord); + } float4 vSROColor = g_SpecularTexture.Sample(DefaultSampler, uv); float4 vNormalColor = g_NormalTexture.Sample(DefaultSampler, uv); @@ -912,7 +1002,12 @@ PS_OUT PS_Player_HairDAOTHV_ToSRO(PS_IN In) { PS_OUT Out; float2 uv = In.vTexcoord; - float4 vDAOColor = g_DiffuseTexture.Sample(DefaultSampler, uv); + float4 vDAOColor = g_DiffuseTexture.Sample(DefaultSampler, uv); + if (true == g_bDisolve) + { + float4 vBurnColor = g_DeadDisolveBurnTexture.Sample(DefaultSampler, In.vTexcoord); + vDAOColor = ApplyDissolve(g_DeadDisolveTexture, g_fDisolveRatio, g_fDisolveAmount, g_fDisolveEdgeWidth, vBurnColor, vDAOColor, In.vTexcoord); + } float3 vHairBaseColor = g_NormalBlendTexture.Sample(DefaultSampler, uv).rrr; float4 vNormalColor = g_NormalTexture.Sample(DefaultSampler, uv); float4 vTHVColor = g_DiffuseBlend.Sample(DefaultSampler, uv); @@ -997,6 +1092,11 @@ PS_OUT PS_Dragon_Body(PS_IN In) PS_OUT Out; float2 uv = In.vTexcoord; float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, uv); + if (true == g_bDisolve) + { + float4 vBurnColor = g_DeadDisolveBurnTexture.Sample(DefaultSampler, In.vTexcoord); + vDiffuse = ApplyDissolve(g_DeadDisolveTexture, g_fDisolveRatio, g_fDisolveAmount, g_fDisolveEdgeWidth, vBurnColor, vDiffuse, In.vTexcoord); + } float fOppacity = g_NormalBlendTexture.Sample(DefaultSampler, uv).r; vDiffuse.a = fOppacity; if (vDiffuse.a < 0.2f) @@ -1029,6 +1129,11 @@ PS_OUT PS_Dragon_Wings(PS_IN In) PS_OUT Out; float2 uv = In.vTexcoord; float4 vDiffuse = g_DiffuseTexture.Sample(DefaultSampler, uv); + if (true == g_bDisolve) + { + float4 vBurnColor = g_DeadDisolveBurnTexture.Sample(DefaultSampler, In.vTexcoord); + vDiffuse = ApplyDissolve(g_DeadDisolveTexture, g_fDisolveRatio, g_fDisolveAmount, g_fDisolveEdgeWidth, vBurnColor, vDiffuse, In.vTexcoord); + } float4 vEmissive = g_EmissiveTexture.Sample(DefaultSampler, uv); vDiffuse += vEmissive; @@ -1233,62 +1338,7 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_MAIN_OUTLINE_READ(); } - pass TEETH_SRXO_ToSRO__OUTLINE_WRITE // 14 - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default_OutLine_SWrite, 2); - SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_TEETH_SRXO_ToSRO(); - } - pass EYE_DN_ToSRO__OUTLINE_WRITE // 15 - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default_OutLine_SWrite, 2); - SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_EYE_DN_SRO(); - } - pass HEADwtHAND_DSRXON_ToSRO__OUTLINE_WRITE // 16 - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default_OutLine_SWrite, 2); - SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_HEADwtHAND_DSRXON_ToSRO(); - } - pass UPPER_DMRON_ToMRO__OUTLINE_WRITE // 17 - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default_OutLine_SWrite, 2); - SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_UPPER_DMRON_ToMRO(); - } - pass EmissiveMetalness_DENMRO_ToMRO__OUTLINE_WRITE // 18 - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default_OutLine_SWrite, 2); - SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_EmissiveMetalness_DENMRO_ToMRO(); - } - pass MI_ClothSim_DSEN_ToSRO__OUTLINE_WRITE // 19 - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default_OutLine_SWrite, 2); - SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_MI_ClothSim_DSEN_ToSRO(); - } -/////// - pass MI_DANSROMRO_ToSRO // 20 + pass MI_DANSROMRO_ToSRO // 14 { SetRasterizerState(RS_Default); SetDepthStencilState(DSS_Default, 0); @@ -1297,26 +1347,8 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_MI_DANSROMRO_ToSRO(); } - pass MI_DANSROMRO_ToSRO_OUTLINE_WRITE // 21 - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default_OutLine_SWrite, 2); - SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_MI_DANSROMRO_ToSRO(); - } - pass DNMRO_ToMRO__OUTLINE_WRITE // 22 - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default_OutLine_SWrite, 2); - SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_DNMRO_ToMRO(); - } //// DRAGON - pass DragonAuraPass // 23 + pass DragonAuraPass // 15 { SetRasterizerState(RS_Default); SetDepthStencilState(DSS_Default, 0); @@ -1325,7 +1357,7 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_Dragon_Aura(); } - pass DragonEtherealEyesPass // 24 + pass DragonEtherealEyesPass // 16 { SetRasterizerState(RS_Default); SetDepthStencilState(DSS_Default, 0); @@ -1334,16 +1366,7 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_Dragon_EtherealEyes(); } - pass DragonEtherealEyes_OUTLINE_WRITEPass // 25 - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default_OutLine_SWrite, 2); - SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_Dragon_EtherealEyes(); - } - pass DragonEtherealWingsPass // 26 + pass DragonEtherealWingsPass // 17 { SetRasterizerState(RS_Default); SetDepthStencilState(DSS_Default, 0); @@ -1352,7 +1375,7 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_Dragon_EtherealWings(); } - pass DragonWingsPass // 27 + pass DragonWingsPass // 18 { SetRasterizerState(RS_Default); SetDepthStencilState(DSS_Default, 0); @@ -1361,16 +1384,7 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_Dragon_Wings(); } - pass DragonWings_OUTLINE_WRITEPass // 28 - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default_OutLine_SWrite, 2); - SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_Dragon_Wings(); - } - pass DragonBodyPass // 29 + pass DragonBodyPass // 19 { SetRasterizerState(RS_Default); SetDepthStencilState(DSS_Default, 0); @@ -1379,16 +1393,7 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_Dragon_Body(); } - pass DragonBody_OUTLINE_WRITEPass // 30 - { - SetRasterizerState(RS_Default); - SetDepthStencilState(DSS_Default_OutLine_SWrite, 2); - SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_MAIN(); - GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_Dragon_Body(); - } - pass DragonRedHotPass // 31 + pass DragonRedHotPass // 20 { SetRasterizerState(RS_Default); SetDepthStencilState(DSS_Default, 0); @@ -1397,7 +1402,7 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_Dragon_RedHot(); } - pass DragonPinkHotPass // 32 + pass DragonPinkHotPass // 21 { SetRasterizerState(RS_Default); SetDepthStencilState(DSS_Default, 0); @@ -1406,7 +1411,7 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_Dragon_PinkHot(); } - pass DragonYellowHotPass // 33 + pass DragonYellowHotPass // 22 { SetRasterizerState(RS_Default); SetDepthStencilState(DSS_Default, 0); @@ -1416,7 +1421,7 @@ technique11 DefaultTechnique PixelShader = compile ps_5_0 PS_Dragon_YellowHot(); } //// PLAYER_ - pass PLAYER_HAIR_DAOTHV_ToSRO // 34 + pass PLAYER_HAIR_DAOTHV_ToSRO // 23 { SetRasterizerState(RS_Default); SetDepthStencilState(DSS_Default, 0); @@ -1425,7 +1430,7 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_Player_HairDAOTHV_ToSRO(); } - pass PLAYER_Suit_DSRON_ToSRO // 35 + pass PLAYER_Suit_DSRON_ToSRO // 24 { SetRasterizerState(RS_Default); SetDepthStencilState(DSS_Default, 0); @@ -1434,7 +1439,7 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_Player_Suit_DSRON_ToSRO(); } - pass PLAYER_EyeLash_DAOTHV_ToSRO // 36 + pass PLAYER_EyeLash_DAOTHV_ToSRO // 25 { SetRasterizerState(RS_Default); SetDepthStencilState(DSS_Default, 0); @@ -1443,7 +1448,7 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_Player_EyeLash_DAOTHV_ToSRO(); } - pass PLAYER_Eye_ToSRO // 37 + pass PLAYER_Eye_ToSRO // 26 { SetRasterizerState(RS_Default); SetDepthStencilState(DSS_Default, 0); @@ -1452,7 +1457,7 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_Player_Eye_ToMRO(); } - pass PLAYER_Robe_ToMRO // 38 + pass PLAYER_Robe_ToMRO // 27 { SetRasterizerState(RS_Default); SetDepthStencilState(DSS_Default, 0); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Volumetric_Accumulate.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Volumetric_Accumulate.hlsl index aa5694dfa..37f3b0529 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Volumetric_Accumulate.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Volumetric_Accumulate.hlsl @@ -28,11 +28,14 @@ cbuffer g_ConstantBuffer : register(b0) // b0 << 이 숫자와 컨스턴트 쉐 row_major matrix InvProjMatrix; row_major matrix InvViewMatrix; + row_major matrix ShadowViewMatrix; + row_major matrix ShadowViewProjMatrix; + float fAsymmetryParameter; - float padding0; - float padding1; - float padding2; -} + uint iNumLight; + float fHeightOffset; + float fBaseHeight; +}; float ConvertNdcZToDepth(float ndcZ); float SliceTickness(float ndcZ, uint dimZ); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Volumetric_Compute.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Volumetric_Compute.hlsl index b602fc1e4..b732abfe0 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Volumetric_Compute.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Volumetric_Compute.hlsl @@ -5,16 +5,17 @@ static const float EPSILON = 1e-6f; struct LightData { - uint itype; - float3 vDirection; - - float3 vPosition; - float fRange; - - float4 vColor; + float3 vDirection; + float fRange; + float4 vPosition; + float4 vDiffuse; }; -//StructuredBuffer g_LightBuffer : register(t1); +StructuredBuffer g_LightBuffer : register(t0); +Texture2D g_ShadowMap : register(t1); +Texture2D NoiseTexture : register(t2); + +SamplerState g_Sampler : register(s0); RWTexture3D g_VolumeUAV : register(u0); @@ -39,18 +40,22 @@ cbuffer g_ConstantBuffer : register(b0) // b0 << 이 숫자와 컨스턴트 쉐 row_major matrix InvProjMatrix; row_major matrix InvViewMatrix; + row_major matrix ShadowViewMatrix; + row_major matrix ShadowViewProjMatrix; + float fAsymmetryParameter; - float padding0; - float padding1; - float padding2; -} + uint iNumLight; + float fHeightOffset; + float fBaseHeight; +}; float3 ConvertThreadIdToNdc(uint3 id, uint3 dims); float ConvertNdcZToDepth(float ndcZ); float3 ConvertToWorldPosition(float3 ndc, float depth); float3 ConvertThreadIdToWorldPosition(uint3 id, uint3 dims); float HenyeyGreensteinPhaseFunction(float3 vInputDir, float3 vOutputDir, float fAnisotropy); - +float ComputePointLightVisible(float3 vLightDir, float fRange); +float ComputeShadowVisibility(float3 vWorldPosition); // 볼륨 텍스쳐 밀도, 산란 계산 [numthreads(8, 8, 4)] void CS_MAIN( uint3 DispatchThreadID : SV_DispatchThreadID) @@ -60,18 +65,40 @@ void CS_MAIN( uint3 DispatchThreadID : SV_DispatchThreadID) if (!all(DispatchThreadID < dims)) return; - float3 worldPosition = ConvertThreadIdToWorldPosition(DispatchThreadID, dims); - float3 toCamera = normalize(vCameraPosition - worldPosition); + float3 vWorldPosition = ConvertThreadIdToWorldPosition(DispatchThreadID, dims); + float3 toCamera = normalize(vCameraPosition - vWorldPosition); - float3 lighting = vLightColor.rgb * vLightColor.a; - float3 lightDir = normalize(vLightDirection); - float3 toLight = -lightDir; + float3 lighting = float3(0.1f, 0.1f, 0.1f); //vLightColor.rgb * vLightColor.a; - float phase = HenyeyGreensteinPhaseFunction(lightDir, toCamera, fAsymmetryParameter); + float3 lightDir = float3(0.f, 0.f, 0.f); - lighting += vLightColor.rgb * vLightColor.rgb * phase; + [loop] + for (uint i = 0; i < iNumLight; ++i) + { + float visibility = 1.f; + + if (0.f < length(g_LightBuffer[i].vDirection)) + { + lightDir = normalize(g_LightBuffer[i].vDirection); + visibility = ComputeShadowVisibility(vWorldPosition); - g_VolumeUAV[DispatchThreadID] = float4(lighting * fLightIntensity * fDensity, fDensity); + } + else + { + lightDir = vWorldPosition - g_LightBuffer[i].vPosition.xyz; + visibility = ComputePointLightVisible(lightDir, g_LightBuffer[i].fRange); + lightDir = normalize(lightDir); + } + + float3 toLight = -lightDir; + float phase = HenyeyGreensteinPhaseFunction(lightDir, toCamera, fAsymmetryParameter); + + lighting += g_LightBuffer[i].vDiffuse.rgb * g_LightBuffer[i].vDiffuse.a * phase * visibility; + } + + float fHeightDensity = max(0.1f, exp(-(vWorldPosition.y - fBaseHeight) * fHeightOffset)) * fDensity; + + g_VolumeUAV[DispatchThreadID] = float4(lighting * fLightIntensity * fHeightDensity, fHeightDensity); } float3 ConvertThreadIdToNdc(uint3 id, uint3 dims) @@ -109,3 +136,26 @@ float HenyeyGreensteinPhaseFunction(float3 vInputDir, float3 vOutputDir, float f float denom = pow(1.f + (fAsymmetryParameter * fAsymmetryParameter) - 2.f * fAsymmetryParameter * cosTheta, 3.f / 2.f); return (1.f / (4.f * PI)) * ((1.f - (fAsymmetryParameter * fAsymmetryParameter)) / max(denom, EPSILON)); } + +float ComputePointLightVisible(float3 vLightDir, float fRange) +{ + float fDistance = length(vLightDir); + + if (fDistance < fRange) + return 1.f; + else + return 0.f; +} + +float ComputeShadowVisibility(float3 vWorldPosition) +{ + float4 vShadowCoord = mul(float4(vWorldPosition, 1.f), ShadowViewProjMatrix); + float3 DepthUV = vShadowCoord.xyz / vShadowCoord.w; + + DepthUV.x = DepthUV.x * 0.5f + 0.5f; + DepthUV.y = DepthUV.y * -0.5f + 0.5f; + + //float fNoise = NoiseTexture.SampleLevel(g_Sampler, DepthUV.xy, 4).r; + + return 1.f; +} diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl index d52149768..b9dae5791 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl @@ -88,10 +88,6 @@ float g_fUsingSurfaceParams; matrix g_BoneMatrices[512]; - - - - struct VS_IN { float3 vPosition : POSITION; @@ -454,10 +450,12 @@ struct PS_IN_OUTLINE }; struct PS_OUT_OUTLINE { - float4 vOutLine : SV_TARGET0; + float4 vAlbedo : SV_TARGET0; float4 vNormal : SV_TARGET1; float4 vDepth : SV_TARGET2; - float2 vVelocityUV : SV_TARGET3; + float4 vColor : SV_Target3; + float4 vSurface : SV_Target4; + float2 vVelocityUV : SV_TARGET5; }; PS_OUT_OUTLINE PS_MAIN_OUTLINE(PS_IN_OUTLINE In) @@ -474,13 +472,15 @@ PS_OUT_OUTLINE PS_MAIN_OUTLINE(PS_IN_OUTLINE In) float fNdotV = saturate(dot(vNormal, vToView)); float fRim = saturate((1.0f - fNdotV) * g_fOutLineScale); fRim = pow(fRim, g_fOutLinePower); - - Out.vOutLine = float4(g_vOutLineColor.rgb, fRim); + + Out.vAlbedo = float4(g_vOutLineColor.rgb, fRim); Out.vNormal = float4(vNormal * 0.5f + 0.5f, 0.f); Out.vDepth = float4((In.vProjPos.z / In.vProjPos.w), // NDC 깊이 ( 0~ 1) (In.vProjPos.w / g_fFar), // 뷰 스페이스 Z (float) AI_TEXTURE_TYPE_METALNESS / (float) AI_TEXTURE_TYPE_MAX, // 서페이스 파라미터 1.f); + Out.vColor = float4(0.f, 0.f, 0.f, 0.f); + Out.vSurface = float4(0.5f, 1.f, 1.f, 0.f); Out.vVelocityUV = CalcVelocityUV(In.vProjPos, In.vPrevProjPos, g_fMBIntensity); return Out; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl index 4c8eb51df..7711c5cd8 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl @@ -672,10 +672,12 @@ struct PS_IN_OUTLINE }; struct PS_OUT_OUTLINE { - float4 vOutLine : SV_TARGET0; + float4 vAlbedo : SV_TARGET0; float4 vNormal : SV_TARGET1; float4 vDepth : SV_TARGET2; - float2 vVelocityUV : SV_TARGET3; + float4 vColor : SV_Target3; + float4 vSurface : SV_Target4; + float2 vVelocityUV : SV_TARGET5; }; PS_OUT_OUTLINE PS_MAIN_OUTLINE(PS_IN_OUTLINE In) @@ -684,6 +686,7 @@ PS_OUT_OUTLINE PS_MAIN_OUTLINE(PS_IN_OUTLINE In) float3 vNormalDecoded = DecodeNormalFromRG(g_NormalTexture, DefaultSampler, In.vTexcoord); float3x3 WorldMatrix = float3x3(In.vTangent, In.vBinormal * -1.f, In.vNormal); + float3 vNormal = normalize(mul(vNormalDecoded, WorldMatrix)); float3 vToView = normalize(g_vCamPosition.xyz - In.vWorldPos.xyz); @@ -691,15 +694,17 @@ PS_OUT_OUTLINE PS_MAIN_OUTLINE(PS_IN_OUTLINE In) float fNdotV = saturate(dot(vNormal, vToView)); float fRim = saturate((1.0f - fNdotV) * g_fOutLineScale); fRim = pow(fRim, g_fOutLinePower); - - Out.vOutLine = float4(g_vOutLineColor.rgb, fRim); + + Out.vAlbedo = float4(g_vOutLineColor.rgb, fRim); Out.vNormal = float4(vNormal * 0.5f + 0.5f, 0.f); - Out.vDepth = float4((In.vProjPos.z / In.vProjPos.w), // NDC 깊이 ( 0~ 1) - (In.vProjPos.w / g_fFar), // 뷰 스페이스 Z - AI_TEXTURE_TYPE_METALNESS, // 서페이스 파라미터 - 1.f); + Out.vDepth = float4((In.vProjPos.z / In.vProjPos.w), // NDC 源딆씠 ( 0~ 1) + (In.vProjPos.w / g_fFar), // 酉??ㅽ럹?댁뒪 Z + (float) AI_TEXTURE_TYPE_METALNESS / (float) AI_TEXTURE_TYPE_MAX, // ?쒗럹?댁뒪 ?뚮씪誘명꽣 + 1.f); + Out.vColor = float4(0.f, 0.f, 0.f, 0.f); + Out.vSurface = float4(0.5f, 1.f, 1.f, 0.f); Out.vVelocityUV = CalcVelocityUV(In.vProjPos, In.vPrevProjPos, g_fMBIntensity); - + return Out; } diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index c2ea7da1f..cd06486e0 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -113,7 +113,7 @@ EDITOR_PROJECT;$(USERNAME);_DEBUG;_WINDOWS;%(PreprocessorDefinitions);%(PreprocessorDefinitions) true stdcpp17 - ../../EngineSDK/Inc/;../Public/;../../EngineSDK/Inc/DirectXTK/;../../EngineSDK/Inc/fMod/;../../EngineSDK/Inc/IMGUI/;../../EngineSDK/Inc/FX11/;%(AdditionalIncludeDirectories) + ../../EngineSDK/Inc/;../../EngineSDK/Inc/PhysX/;../Public/;../../EngineSDK/Inc/DirectXTK/;../../EngineSDK/Inc/fMod/;../../EngineSDK/Inc/IMGUI/;../../EngineSDK/Inc/FX11/;%(AdditionalIncludeDirectories) true true Use @@ -123,7 +123,7 @@ Windows true ../../EngineSDK/Lib/$(ConfigurationName)/;../ThirdPartyLib/ZLib/$(ConfigurationName)/;%(AdditionalLibraryDirectories) - Engine.lib;fmod_vc.lib;Crypt32.lib;assimp-vc145-mtd.lib;DirectXTKd.lib;%(AdditionalDependencies) + Engine.lib;fmod_vc.lib;Crypt32.lib;PhysX_64.lib;PhysXCommon_64.lib;PhysXCooking_64.lib;PhysXExtensions_static_64.lib;PhysXFoundation_64.lib;assimp-vc145-mtd.lib;DirectXTKd.lib;%(AdditionalDependencies);%(AdditionalDependencies) @@ -150,7 +150,7 @@ call Update_Shaders.bat EDITOR_PROJECT;$(USERNAME);NDEBUG;_WINDOWS;%(PreprocessorDefinitions);%(PreprocessorDefinitions) true stdcpp17 - ../../EngineSDK/Inc/;../Public/;../../EngineSDK/Inc/DirectXTK/;../../EngineSDK/Inc/fMod/;../../EngineSDK/Inc/IMGUI/;../../EngineSDK/Inc/FX11/;%(AdditionalIncludeDirectories) + ../../EngineSDK/Inc/;../../EngineSDK/Inc/PhysX/;../Public/;../../EngineSDK/Inc/DirectXTK/;../../EngineSDK/Inc/fMod/;../../EngineSDK/Inc/IMGUI/;../../EngineSDK/Inc/FX11/;%(AdditionalIncludeDirectories) true true Use @@ -160,7 +160,7 @@ call Update_Shaders.bat Windows true ../../EngineSDK/Lib/$(ConfigurationName)/;../ThirdPartyLib/ZLib/$(ConfigurationName)/;%(AdditionalLibraryDirectories) - Engine.lib;fmod_vc.lib;Crypt32.lib;assimp-vc145-mt.lib;%(AdditionalDependencies) + Engine.lib;fmod_vc.lib;Crypt32.lib;PhysX_64.lib;PhysXCommon_64.lib;PhysXCooking_64.lib;PhysXExtensions_static_64.lib;PhysXFoundation_64.lib;assimp-vc145-mt.lib;%(AdditionalDependencies);%(AdditionalDependencies) @@ -269,13 +269,13 @@ call Update_Shaders.bat true - true - true + false + false - true - true + false + false true @@ -520,13 +520,13 @@ call Update_Shaders.bat true - true - true + false + false - true - true + false + false true diff --git a/Jusin154_Team3D/Editor/Private/CallBack_EffectHitBox_Behavior.cpp b/Jusin154_Team3D/Editor/Private/CallBack_EffectHitBox_Behavior.cpp index 140eb3454..8c718c220 100644 --- a/Jusin154_Team3D/Editor/Private/CallBack_EffectHitBox_Behavior.cpp +++ b/Jusin154_Team3D/Editor/Private/CallBack_EffectHitBox_Behavior.cpp @@ -17,7 +17,7 @@ PSX::PxControllerBehaviorFlags CCallBack_EffectHitBox_Behavior::getBehaviorFlags return PSX::PxControllerBehaviorFlags(0); } PSX::PxControllerBehaviorFlags eResults = PSX::PxControllerBehaviorFlags(0); - PhsXUserData* pActorData = static_cast(actor.userData); + PHYSX_USERDATA* pActorData = static_cast(actor.userData); switch (pActorData->eKind) { case PHYSX_KIND::BODY_STATIC: diff --git a/Jusin154_Team3D/Editor/Private/CallBack_EffectHitBox_HitReport.cpp b/Jusin154_Team3D/Editor/Private/CallBack_EffectHitBox_HitReport.cpp index 0a66d2d34..aa5589e64 100644 --- a/Jusin154_Team3D/Editor/Private/CallBack_EffectHitBox_HitReport.cpp +++ b/Jusin154_Team3D/Editor/Private/CallBack_EffectHitBox_HitReport.cpp @@ -26,8 +26,8 @@ void CCallBack_EffectHitBox_HitReport::onShapeHit(const PSX::PxControllerShapeHi ON_COLLISION_INFO CollisionDesc = {}; if (nullptr != pController && nullptr != pActor) { - PhsXUserData* pTargetActorData = static_cast(pActor->userData); - PhsXUserData* pOwnerActorData = static_cast(pController->getActor()->userData); + PHYSX_USERDATA* pTargetActorData = static_cast(pActor->userData); + PHYSX_USERDATA* pOwnerActorData = static_cast(pController->getActor()->userData); if (nullptr == pTargetActorData) { // missing user data return; } @@ -83,7 +83,7 @@ void CCallBack_EffectHitBox_HitReport::onControllerHit(const PSX::PxControllersH PSX::PxController* pOtherController = hit.other; // 다른 컨트롤러 if (nullptr != pController && nullptr != pOtherController) { - PhsXUserData* pActorData = static_cast(pOtherController->getActor()->userData); + PHYSX_USERDATA* pActorData = static_cast(pOtherController->getActor()->userData); assert(nullptr != pActorData); // missing user data switch (pActorData->eKind) diff --git a/Jusin154_Team3D/Editor/Private/CallBack_Monster_Behavior.cpp b/Jusin154_Team3D/Editor/Private/CallBack_Monster_Behavior.cpp index 699647c82..ccfcc848d 100644 --- a/Jusin154_Team3D/Editor/Private/CallBack_Monster_Behavior.cpp +++ b/Jusin154_Team3D/Editor/Private/CallBack_Monster_Behavior.cpp @@ -17,7 +17,7 @@ PSX::PxControllerBehaviorFlags CCallBack_Monster_Behavior::getBehaviorFlags(cons return PSX::PxControllerBehaviorFlags(0); } PSX::PxControllerBehaviorFlags eResults = PSX::PxControllerBehaviorFlags(0); - PhsXUserData* pActorData = static_cast(actor.userData); + PHYSX_USERDATA* pActorData = static_cast(actor.userData); switch (pActorData->eKind) { case PHYSX_KIND::BODY_STATIC: diff --git a/Jusin154_Team3D/Editor/Private/CallBack_Monster_HitReport.cpp b/Jusin154_Team3D/Editor/Private/CallBack_Monster_HitReport.cpp index 348ab72db..bf6f80bfa 100644 --- a/Jusin154_Team3D/Editor/Private/CallBack_Monster_HitReport.cpp +++ b/Jusin154_Team3D/Editor/Private/CallBack_Monster_HitReport.cpp @@ -25,8 +25,8 @@ void CCallBack_Monster_HitReport::onShapeHit(const PSX::PxControllerShapeHit& hi PSX::PxRigidActor* pActor = hit.actor; if (nullptr != pController && nullptr != pActor) { - PhsXUserData* pTargetActorData = static_cast(pActor->userData); - PhsXUserData* pOwnerActorData = static_cast(pController->getActor()->userData); + PHYSX_USERDATA* pTargetActorData = static_cast(pActor->userData); + PHYSX_USERDATA* pOwnerActorData = static_cast(pController->getActor()->userData); if (nullptr == pTargetActorData) { // missing user data return; } @@ -72,7 +72,7 @@ void CCallBack_Monster_HitReport::onControllerHit(const PSX::PxControllersHit& h PSX::PxController* pOtherController = hit.other; // 다른 컨트롤러 if (nullptr != pController && nullptr != pOtherController) { - PhsXUserData* pActorData = static_cast(pOtherController->getActor()->userData); + PHYSX_USERDATA* pActorData = static_cast(pOtherController->getActor()->userData); assert(nullptr != pActorData); // missing user data switch (pActorData->eKind) diff --git a/Jusin154_Team3D/Editor/Private/CallBack_Playable_Behavior.cpp b/Jusin154_Team3D/Editor/Private/CallBack_Playable_Behavior.cpp index b74143b2f..b9749f54c 100644 --- a/Jusin154_Team3D/Editor/Private/CallBack_Playable_Behavior.cpp +++ b/Jusin154_Team3D/Editor/Private/CallBack_Playable_Behavior.cpp @@ -17,7 +17,7 @@ PSX::PxControllerBehaviorFlags CCallBack_Playable_Behavior::getBehaviorFlags(con return PSX::PxControllerBehaviorFlags(0); } PSX::PxControllerBehaviorFlags eResults = PSX::PxControllerBehaviorFlags(0); - PhsXUserData* pActorData = static_cast(actor.userData); + PHYSX_USERDATA* pActorData = static_cast(actor.userData); switch (pActorData->eKind) { case PHYSX_KIND::BODY_STATIC: diff --git a/Jusin154_Team3D/Editor/Private/CallBack_Playable_HitReport.cpp b/Jusin154_Team3D/Editor/Private/CallBack_Playable_HitReport.cpp index 60808b2c7..1c6946b17 100644 --- a/Jusin154_Team3D/Editor/Private/CallBack_Playable_HitReport.cpp +++ b/Jusin154_Team3D/Editor/Private/CallBack_Playable_HitReport.cpp @@ -23,8 +23,8 @@ void CCallBack_Playable_HitReport::onShapeHit(const PSX::PxControllerShapeHit& h PSX::PxRigidActor* pActor = hit.actor; if (nullptr != pController && nullptr != pActor) { - PhsXUserData* pTargetActorData = static_cast(pActor->userData); - PhsXUserData* pOwnerActorData = static_cast(pController->getActor()->userData); + PHYSX_USERDATA* pTargetActorData = static_cast(pActor->userData); + PHYSX_USERDATA* pOwnerActorData = static_cast(pController->getActor()->userData); if (nullptr == pTargetActorData) { // missing user data return; } @@ -99,7 +99,7 @@ void CCallBack_Playable_HitReport::onControllerHit(const PSX::PxControllersHit& PSX::PxController* pOtherController = hit.other; // 다른 컨트롤러 if (nullptr != pController && nullptr != pOtherController) { - PhsXUserData* pActorData = static_cast(pOtherController->getActor()->userData); + PHYSX_USERDATA* pActorData = static_cast(pOtherController->getActor()->userData); assert(nullptr != pActorData); // missing user data switch (pActorData->eKind) diff --git a/Jusin154_Team3D/Editor/Private/CallBack_Ranrok_HitReport.cpp b/Jusin154_Team3D/Editor/Private/CallBack_Ranrok_HitReport.cpp index 1d2fa2d99..d89f0b92a 100644 --- a/Jusin154_Team3D/Editor/Private/CallBack_Ranrok_HitReport.cpp +++ b/Jusin154_Team3D/Editor/Private/CallBack_Ranrok_HitReport.cpp @@ -34,8 +34,8 @@ void CCallBack_Ranrok_HitReport::onShapeHit(const PSX::PxControllerShapeHit& hit PSX::PxRigidActor* pActor = hit.actor; if (nullptr != pController && nullptr != pActor) { - PhsXUserData* pTargetActorData = static_cast(pActor->userData); - PhsXUserData* pOwnerActorData = static_cast(pController->getActor()->userData); + PHYSX_USERDATA* pTargetActorData = static_cast(pActor->userData); + PHYSX_USERDATA* pOwnerActorData = static_cast(pController->getActor()->userData); if (nullptr == pTargetActorData) { // missing user data return; } @@ -106,8 +106,8 @@ void CCallBack_Ranrok_HitReport::onControllerHit(const PSX::PxControllersHit& hi ON_COLLISION_INFO CollisionDesc = {}; if (nullptr != pController && nullptr != pOtherController) { - PhsXUserData* pTargetActorData = static_cast(pActor->userData); - PhsXUserData* pOwnerActorData = static_cast(pController->getActor()->userData); + PHYSX_USERDATA* pTargetActorData = static_cast(pActor->userData); + PHYSX_USERDATA* pOwnerActorData = static_cast(pController->getActor()->userData); assert(nullptr != pTargetActorData); // missing user data switch (pTargetActorData->eKind) diff --git a/Jusin154_Team3D/Editor/Private/CamPosition_Socket.cpp b/Jusin154_Team3D/Editor/Private/CamPosition_Socket.cpp index 7fc1bd947..c0f063ba7 100644 --- a/Jusin154_Team3D/Editor/Private/CamPosition_Socket.cpp +++ b/Jusin154_Team3D/Editor/Private/CamPosition_Socket.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 (pArg); - //m_pSocketMatrices = pDesc->pSocketMatrices; + //m_pSocketMatrix = pDesc->pSocketMatrix; if (FAILED(__super::Initialize(pArg))) { return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Private/DummyObject.cpp b/Jusin154_Team3D/Editor/Private/DummyObject.cpp index 41616f309..5924e3c82 100644 --- a/Jusin154_Team3D/Editor/Private/DummyObject.cpp +++ b/Jusin154_Team3D/Editor/Private/DummyObject.cpp @@ -84,7 +84,7 @@ HRESULT CDummyObject::Render() if (m_pModelCom->Get_Type() == MODEL::PBR_ANIM) { - if (FAILED(m_pModelCom->Begin(i, m_pShaderCom, false))) { + if (FAILED(m_pModelCom->Begin(i, m_pShaderCom))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/Dummy_PhysXDoorSet.cpp b/Jusin154_Team3D/Editor/Private/Dummy_PhysXDoorSet.cpp index f1c49cb69..4dc34dd71 100644 --- a/Jusin154_Team3D/Editor/Private/Dummy_PhysXDoorSet.cpp +++ b/Jusin154_Team3D/Editor/Private/Dummy_PhysXDoorSet.cpp @@ -1,7 +1,6 @@ #include "pch.h" #include "Dummy_PhysXDoorSet.h" #include "Dummy_PhysXFixedDoor.h" -#include "Dummy_PhysXDoorFrame.h" #include "GameInstance.h" @@ -32,22 +31,41 @@ HRESULT CDummy_PhysXDoorSet::Initialize(void* pArg) if (FAILED(Ready_PartObject(pArg))) { return E_FAIL; } + PSX::PxRigidDynamic* doorRigidDynamicActor = m_pDoorPart->Get_Actor(); + PSX::PxTransform doorGlobalPose = doorRigidDynamicActor->getGlobalPose(); - PSX::PxTransform pxFrameTransform = {}; - PSX::PxTransform pxDoorTransform = {}; - PSX::PxRigidDynamic* pFrameBody = m_pFramePart->Get_Actor(); - PSX::PxRigidDynamic* pDoorBody = m_pDoorPart->Get_Actor(); + PSX::PxVec3 hingeLocalPositionInDoor = PSX::PxVec3(-1.5f, 0.0f, 0.0f); - _vector vPos = m_pTransformCom->Get_State(STATE::POSITION) + XMVectorSet(0.f, 1.f, 0.f, 0.f); - PSX::PxVec3 vHingeLocalPos = {}; - XMStoreFloat3((_float3*)&vHingeLocalPos, vPos); - pxFrameTransform.p = pFrameBody->getGlobalPose().transformInv(vHingeLocalPos); - pxDoorTransform.p = pDoorBody->getGlobalPose().transformInv(vHingeLocalPos); - - pxDoorTransform.q = pxFrameTransform.q = PSX::PxQuat(XM_PIDIV2, PSX::PxVec3(0.f, 0.f, 1.f)); + // 2) 힌지 월드 위치 = 도어 글로벌 포즈로 로컬 점 변환 + PSX::PxVec3 hingeWorldPosition = doorGlobalPose.transform(hingeLocalPositionInDoor); + + // 3) 힌지 회전축(월드 Y) + PSX::PxVec3 hingeWorldAxis = PSX::PxVec3(0.f, 1.f, 0.f); + + // 4) Revolute는 프레임 X축이 회전축이므로 X->힌지축 회전 + PSX::PxQuat jointWorldOrientation = PSX::PxShortestRotation(PSX::PxVec3(1.f, 0.f, 0.f), hingeWorldAxis); + + // 5) 월드 프레임 구성 + PSX::PxTransform jointWorldFrame = PSX::PxTransform(hingeWorldPosition, jointWorldOrientation); + + // 6) 도어 로컬 프레임(도어 기준) + PSX::PxTransform jointLocalFrameInDoor = doorGlobalPose.transformInv(jointWorldFrame); + + // 7) 조인트 생성 + m_pPSXJoint = (PSX::PxRevoluteJoint*)m_pGameInstance->Create_PxJoint( + PHYSX_JOINT::REVOLUTE, + doorRigidDynamicActor, + jointLocalFrameInDoor, + nullptr, + jointWorldFrame + ); + m_pPSXJoint->setRevoluteJointFlag(PSX::PxRevoluteJointFlag::eDRIVE_ENABLED, true); + m_pPSXJoint->setDriveVelocity(2.f); + m_pPSXJoint->setDriveForceLimit(5000.f); + //m_pPSXJoint->setLimit(PSX::PxJointAngularLimitPair(XMConvertToRadians(-70.f), XMConvertToRadians(70.f))); + //m_pPSXJoint->setRevoluteJointFlag(PSX::PxRevoluteJointFlag::eLIMIT_ENABLED, true); + //m_pPSXJoint->setRevoluteJointFlag(PSX::PxRevoluteJointFlag::eLIMIT_ENABLED, false); - m_pPSXJoint = m_pGameInstance->Create_PxRevoluteJoint(pFrameBody, pxFrameTransform, pDoorBody ,pxDoorTransform); - return S_OK; } @@ -89,15 +107,6 @@ HRESULT CDummy_PhysXDoorSet::Ready_Components(void* pArg) HRESULT CDummy_PhysXDoorSet::Ready_PartObject(void* pArg) { - { - CDummy_PhysXDoorFrame::PHYSXDUMMY_DESC Desc{}; - Desc.pParentTransform = m_pTransformCom; - Desc.vPos = { -10.f, 3.f, -10.f }; - Desc.iSubKind = 23; - if (FAILED(Add_PartObject("DoorFrame", g_iStaticLevel, &m_pFramePart, &Desc))) { - return E_FAIL; - } - } { CDummy_PhysXFixedDoor::PHYSXDUMMY_DESC Desc{}; Desc.pParentTransform = m_pTransformCom; @@ -146,7 +155,6 @@ void CDummy_PhysXDoorSet::Free() __super::Free(); SAFE_RELEASE(m_pDoorPart); - SAFE_RELEASE(m_pFramePart); } void CDummy_PhysXDoorSet::Describe_Entity() diff --git a/Jusin154_Team3D/Editor/Private/Dummy_PhysXFixedDoor.cpp b/Jusin154_Team3D/Editor/Private/Dummy_PhysXFixedDoor.cpp index 1eb6b7e93..d3fe15090 100644 --- a/Jusin154_Team3D/Editor/Private/Dummy_PhysXFixedDoor.cpp +++ b/Jusin154_Team3D/Editor/Private/Dummy_PhysXFixedDoor.cpp @@ -45,21 +45,12 @@ void CDummy_PhysXFixedDoor::Update(_float fTimeDelta) void CDummy_PhysXFixedDoor::Late_Update(_float fTimeDelta) { - if (m_pGameInstance->IsIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) { - m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this); - } + m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this); } HRESULT CDummy_PhysXFixedDoor::Render() { _vector vRPY = m_pTransformCom->Get_RollPitchYawVector(); - - //GUI::Begin("FixedDoor"); - //m_pTransformCom->Describe_Entity(); - //GUI::Text("Current Roll : %f", XMConvertToDegrees(XMVectorGetX(vRPY))); - //GUI::Text("Current Pitch : %f", XMConvertToDegrees(XMVectorGetY(vRPY))); - //GUI::Text("Current Yaw : %f", XMConvertToDegrees(XMVectorGetZ(vRPY))); - //GUI::End(); #ifdef _DEBUG if (FAILED(m_pRigidBody->Render())) { return E_FAIL; @@ -89,7 +80,7 @@ HRESULT CDummy_PhysXFixedDoor::Ready_Components(void* pArg) { // RIGID_BODY CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; Desc.iSubKind = pPhysXDummyDesc->iSubKind; - if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_DOOR"), (CComponent**)&m_pRigidBody, &Desc))) { + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_FIXED_DOOR"), (CComponent**)&m_pRigidBody, &Desc))) { return E_FAIL; } } diff --git a/Jusin154_Team3D/Editor/Private/Dummy_PhysXFreeDoor.cpp b/Jusin154_Team3D/Editor/Private/Dummy_PhysXFreeDoor.cpp index 7e72f8f41..57c3c8343 100644 --- a/Jusin154_Team3D/Editor/Private/Dummy_PhysXFreeDoor.cpp +++ b/Jusin154_Team3D/Editor/Private/Dummy_PhysXFreeDoor.cpp @@ -140,7 +140,7 @@ HRESULT CDummy_PhysXFreeDoor::Render() * (ScaleMatrix * RotationMatrix * TranslationWorld); // 그 후 SRT 적용 m_pTransformCom->Set_WorldMatrix(world); - m_pActor->setGlobalPose(XMWorldToPx_NoScale(world)); + m_pActor->setGlobalPose(XMWorldToPx_NoScaleNoFlip(world)); m_pActor->setAngularVelocity(PSX::PxVec3(0)); m_pActor->setLinearVelocity(PSX::PxVec3(0)); diff --git a/Jusin154_Team3D/Editor/Private/Effect_Container.cpp b/Jusin154_Team3D/Editor/Private/Effect_Container.cpp index 80fc85300..7a34d07c9 100644 --- a/Jusin154_Team3D/Editor/Private/Effect_Container.cpp +++ b/Jusin154_Team3D/Editor/Private/Effect_Container.cpp @@ -488,7 +488,7 @@ ON_COLLISION_INFO CEffect_Container::SweepTarget(_vector StartPos, _vector EndPo if (nullptr != pActor && nullptr != pActor->userData) { - PhsXUserData* pUserData = static_cast(pActor->userData); + PHYSX_USERDATA* pUserData = static_cast(pActor->userData); tagCollInfo.pObject = pUserData->pOwner; switch (pUserData->eKind) @@ -532,7 +532,7 @@ ON_COLLISION_INFO CEffect_Container::SweepTarget(_vector StartPos, _vector EndPo bHit = m_pGameInstance->SphereCast(fRadius, vStartPos, vDir, fDistance, PSX::PxHitFlag::ePOSITION | PSX::PxHitFlag::eNORMAL, PSX::PxQueryFlag::eSTATIC, pxBuffer); - PhsXUserData* pUserData = static_cast(pActor->userData); + PHYSX_USERDATA* pUserData = static_cast(pActor->userData); tagCollInfo.pObject = pUserData->pOwner; switch (pUserData->eKind) @@ -586,7 +586,7 @@ ON_COLLISION_INFO CEffect_Container::MonsterSweepTarget(_vector StartPos, _vecto if (nullptr != pActor && nullptr != pActor->userData) { - PhsXUserData* pUserData = static_cast(pActor->userData); + PHYSX_USERDATA* pUserData = static_cast(pActor->userData); tagCollInfo.pObject = pUserData->pOwner; switch (pUserData->eKind) @@ -640,7 +640,7 @@ ON_COLLISION_INFO CEffect_Container::MonsterSweepTarget(_vector StartPos, _vecto if (nullptr != pActor && nullptr != pActor->userData) { - PhsXUserData* pUserData = static_cast(pActor->userData); + PHYSX_USERDATA* pUserData = static_cast(pActor->userData); tagCollInfo.pObject = pUserData->pOwner; switch (PXOBJECT(pUserData->iSubKind)) @@ -694,7 +694,7 @@ ON_COLLISION_INFO CEffect_Container::MonsterRayCast(_vector StartPos, _vector _v if (nullptr != pActor && nullptr != pActor->userData) { - PhsXUserData* pUserData = static_cast(pActor->userData); + PHYSX_USERDATA* pUserData = static_cast(pActor->userData); tagCollInfo.pObject = pUserData->pOwner; switch (pUserData->eKind) @@ -754,7 +754,7 @@ _int CEffect_Container::CollisionCheck() if (nullptr != pActor && nullptr != pActor->userData) { - PhsXUserData* pUserData = static_cast(pActor->userData); + PHYSX_USERDATA* pUserData = static_cast(pActor->userData); if (pUserData->iSubKind >= UINT_MAX - 1) { continue; diff --git a/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp index 035887306..4eaf4d891 100644 --- a/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp @@ -12,6 +12,7 @@ #include "Land.h" #include "InstancedProp.h" #include "Player.h" +#include "Ranrok.h" #include "Unified.h" #include "MapElement_Lake.h" #include "MapElement_Door.h" @@ -48,6 +49,12 @@ HRESULT CLevel_MapViewer::Initialize() return E_FAIL; } + if (FAILED(Ready_Layer_Player_And_Ranrok())) { + return E_FAIL; + } + + + //if (FAILED(Ready_Layer_Terrain(TEXT("Layer_Terrain")))) { // return E_FAIL; //} @@ -524,6 +531,19 @@ HRESULT CLevel_MapViewer::Ready_Layer_MapObjectManager(const _wstring& strLayerT return S_OK; } +HRESULT CLevel_MapViewer::Ready_Layer_Player_And_Ranrok() +{ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_PLAYER))) { + return E_FAIL; + } + + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Monster")))) + return E_FAIL; + + return S_OK; +} + CLevel_MapViewer* CLevel_MapViewer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) { CLevel_MapViewer* pInstance = new CLevel_MapViewer(pDevice, pContext, eLevelID); diff --git a/Jusin154_Team3D/Editor/Private/Level_PhysXLab.cpp b/Jusin154_Team3D/Editor/Private/Level_PhysXLab.cpp index aa5db8b3c..6f6680d83 100644 --- a/Jusin154_Team3D/Editor/Private/Level_PhysXLab.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_PhysXLab.cpp @@ -109,14 +109,14 @@ HRESULT CLevel_PhysXLab::Ready_Layer_PhysXObjects(const _wstring& strLayerTag) return E_FAIL; } } - //{ - // CDummy_PhysXDoorSet::PHYSXDUMMY_DESC Desc{}; - // Desc.vPos = { -15.f, 3.f, -15.f }; - // Desc.vRotRPY = { 0.f, m_pGameInstance->Random_Float(0.f, XM_2PI), 0.f }; - // if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) { - // return E_FAIL; - // } - //} + { + CDummy_PhysXDoorSet::PHYSXDUMMY_DESC Desc{}; + Desc.vPos = { -15.f, 3.f, -15.f }; + Desc.vRotRPY = { 0.f, m_pGameInstance->Random_Float(0.f, XM_2PI), 0.f }; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE, &Desc))) { + return E_FAIL; + } + } { CDummy_PhysXPlatform::PHYSXDUMMY_DESC Desc{}; Desc.vPos = { -3.f, 2.f, 10.f }; @@ -181,6 +181,7 @@ HRESULT CLevel_PhysXLab::Ready_Layer_PhysXObjects(const _wstring& strLayerTag) // return E_FAIL; // } //} + return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 042caaa39..b93fe1572 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -209,8 +209,8 @@ #include "Dummy_PhysXWall.h" #include "Dummy_PhysXEffectHitBox.h" //#include "Dummy_PhysXDoorFrame.h" -//#include "Dummy_PhysXFixedDoor.h" -//#include "Dummy_PhysXDoorSet.h" +#include "Dummy_PhysXFixedDoor.h" +#include "Dummy_PhysXDoorSet.h" #pragma endregion @@ -1961,19 +1961,19 @@ HRESULT CLoader::Loading_For_PhysXLevel() 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.1f }; Desc.fContactOffset = { 0.05f }; Desc.vhalfGeometryInfo = { 1.5f, 1.5f, 0.25f }; Desc.fDensity = 10.f; - PSX::PxTransform pxPivotTransform = PSX::PxTransform(PSX::PxVec3(1.5f, 1.5f, 0.f)); + PSX::PxTransform pxPivotTransform = PSX::PxTransform(PSX::PxVec3(1.5f, 0.75f, 0.125f)); Desc.pxMassCenter = pxPivotTransform; Desc.eLockFlag = { }; - Desc.vAutoDamping = { 10.f, 10.f }; + Desc.vAutoDamping = { 0.f, 0.2f }; 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_DOOR"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) { + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_FIXED_DOOR"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) { return E_FAIL; } } @@ -2070,15 +2070,15 @@ HRESULT CLoader::Loading_For_PhysXLevel() if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummy_PhysXFreeDoor::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - //if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummy_PhysXDoorSet::Create(m_pDevice, m_pContext)))) { - // return E_FAIL; - //} + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummy_PhysXDoorSet::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } //if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummy_PhysXDoorFrame::Create(m_pDevice, m_pContext)))) { // return E_FAIL; //} - //if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummy_PhysXFixedDoor::Create(m_pDevice, m_pContext)))) { - // return E_FAIL; - //} + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummy_PhysXFixedDoor::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummy_PhysXPlayable::Create(m_pDevice, m_pContext)))) { return E_FAIL; } @@ -2389,11 +2389,10 @@ HRESULT CLoader::Loading_For_ObjectViewer() } vector*>> futures = {}; - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_SK_ConjuredDragon_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM_LOCAL, "C:/MeshTable\\Game\\Environment\\BroomFlight\\Meshes\\SM_BRR_RaceRing_01.fbx", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity())))) { + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_GoblinSpector_Anim_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM_LOCAL, "C:/MeshTable\\Game\\RiggedObjects\\Props\\Weapons\\Goblins\\SK_WPN_GOB_SmallSword.fbx", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) return E_FAIL; - } + #pragma region MONSTER @@ -2407,10 +2406,19 @@ HRESULT CLoader::Loading_For_ObjectViewer() TEXT("Prototype_Component_GoblinMage_Model") )); - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_GoblinSpector_Anim_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/GoblinSpector/GoblinSpector_Anim.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) + futures.emplace_back(Deferred_ModelLoad( + MODEL::PBR_ANIM, "../Bin/Resources/Models/Monster/Goblin_Assassin/SK_GOB_M_Assassin_Master.bin", XMMatrixRotationZ(XMConvertToRadians(180.f)) * XMMatrixIdentity(), + TEXT("Prototype_Component_SK_GOB_M_Assassin_Master_Model") + )); + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_GoblinSpector_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/GoblinSpector/GoblinSpector.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) return E_FAIL; + //if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Playable_Model"), + // CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Human/PlayableCharacter/Playable.bin", XMMatrixRotationZ(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) + // return E_FAIL; + futures.emplace_back(Deferred_ModelLoad( MODEL::ANIM, "../Bin/Resources/Models/Monster/TombProtector/TombProtector.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), TEXT("Prototype_Component_TombProtector_Model") @@ -2499,6 +2507,15 @@ HRESULT CLoader::Loading_For_ObjectViewer() TEXT("Prototype_Component_Playable_Model") )); + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_CCL_CameraRig.001_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Camera/CCL_CameraRig.001.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixRotationZ(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) + return E_FAIL; + + //futures.emplace_back(Deferred_ModelLoad( + // MODEL::ANIM, "../Bin/Resources/Models/Human/PlayableCharacter/Playable_Rct.fbx", XMMatrixIdentity(), + // TEXT("Prototype_Component_Student_Cmbt_Model") + //)); + //futures.emplace_back(Deferred_ModelLoad( // MODEL::ANIM, "../Bin/Resources/Models/Human/PlayableCharacter/Playable_Rct.fbx", XMMatrixIdentity(), // TEXT("Prototype_Component_Student_Cmbt_Model") @@ -2540,7 +2557,7 @@ HRESULT CLoader::Loading_For_ObjectViewer() //)); //futures.emplace_back(Deferred_ModelLoad( - // MODEL::ANIM, "../Bin/Resources/Models/Human/PlayableCharacter/Playable_AvadaKedavran.fbx", XMMatrixIdentity(), + // MODEL::ANIM, "../Bin/Resources/Models/Human/PlayableCharacter/Playable_AvadaKedavra.fbx", XMMatrixIdentity(), // TEXT("Prototype_Component_Student_Cmbt_Model") //)); @@ -2656,6 +2673,31 @@ HRESULT CLoader::Loading_For_ObjectViewer() HRESULT CLoader::Loading_For_MapViewer() { +#pragma region PLAYER_AND_RANROK + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Ranrok_Model"), + 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; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Playable_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Human/PlayableCharacter/Playable.bin", XMMatrixRotationZ(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CRanrok::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CFSM::Create(m_pDevice, m_pContext)))) + return E_FAIL; + + /* For.Prototype_GameObject_Player */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CPlayer::Create(m_pDevice, m_pContext)))) + return E_FAIL; +#pragma endregion + + + m_strMessage = TEXT("텍스쳐를(을) 로딩 중 입니다."); #pragma region TEXTURES if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("TerrainTest"), @@ -2846,6 +2888,8 @@ HRESULT CLoader::Loading_For_MapViewer() if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_Hogsmead_NorthLakeShallow"), CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/River/NorthLake/HDA_SM_LakeA_Collision_Shallow.bin", XMMatrixIdentity())))) return E_FAIL; + + #pragma endregion vector<_wstring> ModelPrototypeTags = {}; diff --git a/Jusin154_Team3D/Editor/Private/MainLight.cpp b/Jusin154_Team3D/Editor/Private/MainLight.cpp index ffe8a2598..18e0ffc3a 100644 --- a/Jusin154_Team3D/Editor/Private/MainLight.cpp +++ b/Jusin154_Team3D/Editor/Private/MainLight.cpp @@ -29,7 +29,7 @@ HRESULT CMainLight::Initialize(void* pArg) if (FAILED(Ready_Components())) return E_FAIL; - m_pTransformCom->Set_State(STATE::LOOK, XMVectorSet(1.f, -1.f, 1.f, 0.f)); + m_pTransformCom->Set_State(STATE::LOOK, XMVectorSet(-1.716f, 0.121f, 0.211f, 0.f)); m_pGameTime = CGameTime::Create(); @@ -118,6 +118,7 @@ void CMainLight::Update(_float fTimeDelta) void CMainLight::Late_Update(_float fTimeDelta) { + } HRESULT CMainLight::Render() @@ -134,17 +135,14 @@ HRESULT CMainLight::Ready_Components() LIGHT_DESC LightDesc{}; LightDesc.eType = LIGHT::DIRECTIONAL; - LightDesc.vDiffuse = _float4(0.3f, 0.3f, 0.1f, 0.f); - LightDesc.vAmbient = _float4(0.3f, 0.3f, 0.5f, 0.f); + LightDesc.vDiffuse = _float4(0.3294f, 0.4824f, 0.4824f, 0.0314f); + LightDesc.vAmbient = _float4(0.1608f, 0.1608f, 0.1608f, 0.0f); LightDesc.vSpecular = _float4(0.05f, 0.05f, 0.05f, 0.f); + m_pTransformCom->Rotation(XMConvertToRadians(-4.f), XMConvertToRadians(271.f), 0.f); LightDesc.pDirection = m_pTransformCom->Get_StatePtr(STATE::LOOK); LightDesc.iLevel = NEXT_LEVEL; -#ifdef gimch - LightDesc.vDiffuse = _float4(0.745f, 0.797f, 0.8f, 0.f); - LightDesc.vAmbient = _float4(0.417f, 0.533f, 0.544f, 0.f); -#endif // gimch - + /* Com_Light*/ if (FAILED(Add_Component(g_iStaticLevel, &m_pLightCom, &LightDesc))) diff --git a/Jusin154_Team3D/Editor/Private/MapElement_Chest.cpp b/Jusin154_Team3D/Editor/Private/MapElement_Chest.cpp index f738d0e23..4277a92c1 100644 --- a/Jusin154_Team3D/Editor/Private/MapElement_Chest.cpp +++ b/Jusin154_Team3D/Editor/Private/MapElement_Chest.cpp @@ -60,7 +60,7 @@ HRESULT CMapElement_Chest::Initialize(void* pArg) m_pActor = static_cast(m_pRigidBody->Get_Actor()); 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); + static_cast(m_pRigidBody)->Move_LocalPos(XMVectorSet(0.f, 0.f, 0.f, 1.f), XMLoadFloat3(&pDesc->vBoxLocalPosition)); return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/MapElement_Interactable.cpp b/Jusin154_Team3D/Editor/Private/MapElement_Interactable.cpp index 89277aade..5dff6347c 100644 --- a/Jusin154_Team3D/Editor/Private/MapElement_Interactable.cpp +++ b/Jusin154_Team3D/Editor/Private/MapElement_Interactable.cpp @@ -54,7 +54,7 @@ HRESULT CMapElement_Interactable::Initialize(void* pArg) m_pActor = static_cast(m_pRigidBody->Get_Actor()); 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); + static_cast(m_pRigidBody)->Move_LocalPos(XMVectorSet(0.f, 0.f, 0.f, 1.f), XMLoadFloat3(&pDesc->vBoxLocalPosition)); return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Ranrok.cpp b/Jusin154_Team3D/Editor/Private/Ranrok.cpp index 19c50ba46..814857bff 100644 --- a/Jusin154_Team3D/Editor/Private/Ranrok.cpp +++ b/Jusin154_Team3D/Editor/Private/Ranrok.cpp @@ -424,16 +424,23 @@ HRESULT CRanrok::Render_Nonblend() if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) { return E_FAIL; } - if (FAILED(m_pModelCom->Begin(i, m_pShaderCom, m_bDrawOutLine))) { + if (FAILED(m_pModelCom->Begin(i, m_pShaderCom))) { return E_FAIL; } m_pModelCom->Bind_OutPut_SRV_VS(26, 0); m_pModelCom->Bind_OutPut_SRV_VS_Prev(27, 0); + if (true == m_bDrawOutLine) { + m_pGameInstance->Begin_OutLine_Write(2); + } if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; } + + if (true == m_bDrawOutLine) { + m_pGameInstance->End_OutLine_Write(); + } } if (m_bDrawOutLine) { @@ -486,16 +493,23 @@ HRESULT CRanrok::Render_Blend() if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) { return E_FAIL; } - if (FAILED(m_pModelCom->Begin(i, m_pShaderCom, m_bDrawOutLine))) { + if (FAILED(m_pModelCom->Begin(i, m_pShaderCom))) { return E_FAIL; } m_pModelCom->Bind_OutPut_SRV_VS(26, 0); m_pModelCom->Bind_OutPut_SRV_VS_Prev(27, 0); + if (true == m_bDrawOutLine) { + m_pGameInstance->Begin_OutLine_Write(2); + } if (FAILED(m_pModelCom->Render(i))) { return E_FAIL; } + + if (true == m_bDrawOutLine) { + m_pGameInstance->End_OutLine_Write(); + } } return S_OK; diff --git a/Jusin154_Team3D/Editor/Public/Dummy_PhysXDoorSet.h b/Jusin154_Team3D/Editor/Public/Dummy_PhysXDoorSet.h index a707c20eb..085077006 100644 --- a/Jusin154_Team3D/Editor/Public/Dummy_PhysXDoorSet.h +++ b/Jusin154_Team3D/Editor/Public/Dummy_PhysXDoorSet.h @@ -33,7 +33,6 @@ class CDummy_PhysXDoorSet final : public CContainerObject private: class CDummy_PhysXFixedDoor* m_pDoorPart = { nullptr }; - class CDummy_PhysXDoorFrame* m_pFramePart = { nullptr }; PSX::PxRevoluteJoint* m_pPSXJoint = { nullptr }; _float3 m_vRadianYAngle = {}; diff --git a/Jusin154_Team3D/Editor/Public/Editor_Define.h b/Jusin154_Team3D/Editor/Public/Editor_Define.h index d0e604bee..1a60ce849 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Define.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Define.h @@ -20,7 +20,7 @@ namespace Editor enum class SHADER_PASS_ANIM { DEFAULT, SHADOW, CAPTURE, BLUR, HAIR, EYELASH, OUTLINE_WRITE, OUTLINE_READ, SPECTOR, END }; enum class SHADER_PASS_NPC_PBR_ANIM { EYELASH_DAOTHV_ToSRO, TEETH_SRXO_ToSRO, EYE_DN_ToSRO, EYE_OCC, FACIAL_HAIR_DAOTHV_ToSRO, HEAD_HAIR_DAOTHV_ToSRO, HEADwtHAND_DSRXON_ToSRO, LOWER_DSRON_ToSRO, UPPER_DMRON_ToMRO, GLASSES_DMRON_ToMRO, EmissiveMetalness_DENMRO_ToMRO, MI_ClothSim_DSEN_ToSRO, MI_Troll_Club_DAENMROSRXO_To - , OUTLINE_READ, TEETH_SRXO_ToSRO__OUTLINE_WRITE, EYE_DN_ToSRO__OUTLINE_WRITE, HEADwtHAND_DSRXON_ToSRO__OUTLINE_WRITE, UPPER_DMRON_ToMRO__OUTLINE_WRITE, EmissiveMetalness_DENMRO_ToMRO__OUTLINE_WRITE, MI_ClothSim_DSEN_ToSRO__OUTLINE_WRITE + , OUTLINE_READ , END}; enum class SHADER_PASS_MESH { DEFAULT, SHADOW, SKYBOX, ALPHABLEND, EFFECT_ALPHABLEND, EFFECT_BLEND, EFFECT_ALPHABLEND_CULL, EFFECT_BLEND_CULL, CAPTURE, BLUR, EFFECT_ALPHABLEND_UVMOVE, MAPTOOL, GLASS, OUTLINE_WRITE, OUTLINE_READ, BLOOM, LAKE, END }; enum class SHADER_PASS_NORTEX { DEFAULT, TERRAIN, ENV_TERRAIN_ANISO, SHADOW, END }; diff --git a/Jusin154_Team3D/Editor/Public/Level_EffectViewer.h b/Jusin154_Team3D/Editor/Public/Level_EffectViewer.h index 612bd22ac..7e411a32e 100644 --- a/Jusin154_Team3D/Editor/Public/Level_EffectViewer.h +++ b/Jusin154_Team3D/Editor/Public/Level_EffectViewer.h @@ -25,7 +25,7 @@ class CLevel_EffectViewer final : public CLevel HRESULT Ready_Layer_PhysX(const _wstring& strLayerTag); HRESULT Ready_Layer_BackGround(const _wstring& strLayerTag); - PhsXUserData m_PlaneData = {}; + PHYSX_USERDATA m_PlaneData = {}; class CInfoInstance* m_pInfoInstance = { nullptr }; public: static CLevel_EffectViewer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID); diff --git a/Jusin154_Team3D/Editor/Public/Level_MapViewer.h b/Jusin154_Team3D/Editor/Public/Level_MapViewer.h index b45917775..5f70680e4 100644 --- a/Jusin154_Team3D/Editor/Public/Level_MapViewer.h +++ b/Jusin154_Team3D/Editor/Public/Level_MapViewer.h @@ -28,6 +28,7 @@ class CLevel_MapViewer final : public CLevel HRESULT Ready_Layer_Door(const _wstring& strLayerTag); HRESULT Ready_Layer_Chest(const _wstring& strLayerTag); HRESULT Ready_Layer_MapObjectManager(const _wstring& strLayerTag); + HRESULT Ready_Layer_Player_And_Ranrok(); diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli index 6d94261a3..00c07a790 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli @@ -557,23 +557,23 @@ float2 CalcVelocityUV(float4 vCurrentProjPos, float4 vPreviousProjPos, float fIn float3 DownSampleFast(Texture2D SrcTexture2D, float2 vCenterTexcoord, float2 vSrcTexelSize, float2 vResolution) { float2 uv = float2(0.f, 0.f); - float3 vCenterColor = SrcTexture2D.SampleLevel(BorderZeroSampler, vCenterTexcoord, 0); + float3 vCenterColor = SrcTexture2D.SampleLevel(BorderZeroSampler, vCenterTexcoord, 0).rgb; uv = vCenterTexcoord + vSrcTexelSize * float2(-1.0, -1.0); - float3 fLTColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroSampler); + float3 fLTColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroSampler).rgb; uv = vCenterTexcoord + vSrcTexelSize * float2(0.0, -1.0); - float3 fTColor = SrcTexture2D.SampleLevel(BorderZeroSampler, uv, 0); + float3 fTColor = SrcTexture2D.SampleLevel(BorderZeroSampler, uv, 0).rgb; uv = vCenterTexcoord + vSrcTexelSize * float2(+1.0, -1.0); - float3 fRTColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroSampler); + float3 fRTColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroSampler).rgb; uv = vCenterTexcoord + vSrcTexelSize * float2(-1.0, 0.0); - float3 fLColor = SrcTexture2D.SampleLevel(BorderZeroSampler, uv, 0); + float3 fLColor = SrcTexture2D.SampleLevel(BorderZeroSampler, uv, 0).rgb; uv = vCenterTexcoord + vSrcTexelSize * float2(1.0, 0.0); - float3 fRColor = SrcTexture2D.SampleLevel(BorderZeroSampler, uv, 0); + float3 fRColor = SrcTexture2D.SampleLevel(BorderZeroSampler, uv, 0).rgb; uv = vCenterTexcoord + vSrcTexelSize * float2(-1.0, +1.0); - float3 fLBColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroSampler); + float3 fLBColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroSampler).rgb; uv = vCenterTexcoord + vSrcTexelSize * float2(0.0, 1.0); - float3 fBColor = SrcTexture2D.SampleLevel(BorderZeroSampler, uv, 0); + float3 fBColor = SrcTexture2D.SampleLevel(BorderZeroSampler, uv, 0).rgb; uv = vCenterTexcoord + vSrcTexelSize * float2(+1.0, +1.0); - float3 fRBColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroSampler); + float3 fRBColor = BilinearFetches(vResolution, SrcTexture2D, uv, BorderZeroSampler).rgb; return vCenterColor * 0.25f + (fLTColor + fRTColor + fLBColor + fRBColor) * 0.0625f + (fTColor + fLColor + fRColor + fBColor) * 0.125f; } diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_BoneCombinedInsertion_Compute.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_BoneCombinedInsertion_Compute.hlsl new file mode 100644 index 000000000..ee1d7a957 --- /dev/null +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_BoneCombinedInsertion_Compute.hlsl @@ -0,0 +1,40 @@ +struct LocalPos +{ + row_major float4x4 Combined; + row_major float4x4 Local; + row_major float4x4 LocalCombined; +}; + +struct BoneCombined +{ + row_major float4x4 BoneCombinedTransformation; +}; + +StructuredBuffer g_CombinedMatIn : register(t0); + +RWStructuredBuffer g_LocalPosOutput : register(u0); + +cbuffer BoneInsertionCB : register(b0) +{ + uint iStartOffset; + uint iMatrixCount; + uint iPad0; + uint iPad1; +}; + +[numthreads(256, 1, 1)] +void CS_MAIN(uint3 DTid : SV_DispatchThreadID) +{ + uint iBoneIndex = DTid.x; + + if (iBoneIndex >= iMatrixCount) + { + return; + } + + float4x4 CombinedMatrix = g_CombinedMatIn[iBoneIndex].BoneCombinedTransformation; + + g_LocalPosOutput[iBoneIndex+iStartOffset].LocalCombined = CombinedMatrix; + g_LocalPosOutput[iBoneIndex+iStartOffset].Combined = CombinedMatrix; + +} diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Local_Compute.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Local_Compute.hlsl index a8ac33933..3d233fe57 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Local_Compute.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Local_Compute.hlsl @@ -25,6 +25,7 @@ StructuredBuffer g_PrevChannelBuffer : register(t3); StructuredBuffer g_ParentBuffer : register(t4); StructuredBuffer g_BoneLocalBuffer : register(t5); StructuredBuffer g_BoneRemap : register(t6); +StructuredBuffer g_SkipBone : register(t7); RWStructuredBuffer g_LocalMatrixOut : register(u0); @@ -42,7 +43,17 @@ cbuffer AnimCB : register(b0) float BlendRatio; int RootBoneIndex; - float3 _pad0; + int PlayHeadBone; + int HeadBoneIndex; + float HeadAimWeight; + + int SkipCount; + int _pad0; + int _pad1; + int _pad2; + + float3 TargetDir_Local; + float padding3; row_major float4x4 PreTransformMatrix; float4 RootInitRot; @@ -163,6 +174,37 @@ void DecomposeAffine_RowMajor(row_major float4x4 M, out float3 S, out float4 R, R = QuatNormalize(q); } +row_major float4x4 ApplyHeadAim(uint bone, row_major float4x4 M) +{ + if (PlayHeadBone != 1) + return M; + if (bone != HeadBoneIndex) + return M; + if (HeadAimWeight <= 0.f) + return M; + + float3 curFwd = normalize(float3(M._31, M._32, M._33)); + float3 target = normalize(TargetDir_Local); + + float d = dot(curFwd, target); + + float3 axis = cross(curFwd, target); + float axisLen = length(axis); + if (axisLen <= EPS) + return M; + + axis /= axisLen; + + float angle = acos(saturate(d)); + angle *= saturate(HeadAimWeight); + + float4 qAim = float4(axis * sin(angle * 0.5f), cos(angle * 0.5f)); + qAim = QuatNormalize(qAim); + + row_major float4x4 AimM = MakeAffine(float3(1, 1, 1), qAim, float3(0, 0, 0)); + return mul(AimM, M); +} + uint FindKeyIndexCur(uint start, uint count, float t) { @@ -274,55 +316,36 @@ void SampleLocalTRS_Prev(uint bone, float t, out float3 S, out float4 R, out flo row_major float4x4 SampleBlendedLocal(uint bone) { - if (PrevAnimIndex == -1) + float3 S; + float4 R; + float3 T; + + if (PrevAnimIndex == -1 || CurrentAnimIndex == PrevAnimIndex) { - float3 S; - float4 R; - float3 T; SampleLocalTRS_Cur(bone, CurrentTime, S, R, T); if (bone == RootBoneIndex) { T = 0; R = RootInitRot; } - return MakeAffine(S, R, T); - } - if (CurrentAnimIndex == PrevAnimIndex) - { - float3 S; - float4 R; - float3 T; - SampleLocalTRS_Cur(bone, CurrentTime, S, R, T); - - if (bone == RootBoneIndex) - { - T = 0; - R = RootInitRot; - } - return MakeAffine(S, R, T); + row_major float4x4 M = MakeAffine(S, R, T); + return ApplyHeadAim(bone, M); } float br = saturate(BlendRatio); float3 sA, sB, tA, tB; float4 rA, rB; - - float prevT = PrevTime; - - if (BlendRatio < 1e-4f) - { - prevT = CurrentTime; - } - + float prevT = (BlendRatio < 1e-4f) ? CurrentTime : PrevTime; SampleLocalTRS_Prev(bone, prevT, sA, rA, tA); SampleLocalTRS_Cur(bone, CurrentTime, sB, rB, tB); - float3 S = lerp(sA, sB, br); - float3 T = lerp(tA, tB, br); - float4 R = QuatSlerp(rA, rB, br); + S = lerp(sA, sB, br); + T = lerp(tA, tB, br); + R = QuatSlerp(rA, rB, br); if (bone == RootBoneIndex) { @@ -330,15 +353,31 @@ row_major float4x4 SampleBlendedLocal(uint bone) R = RootInitRot; } - return MakeAffine(S, R, T); + row_major float4x4 M = MakeAffine(S, R, T); + return ApplyHeadAim(bone, M); } + [numthreads(256, 1, 1)] void CS_LOCAL(uint3 DTid : SV_DispatchThreadID) { uint bone = DTid.x; + if (bone >= BoneCount) return; + + if (SkipCount != 0) + { + for (int i = 0; i < SkipCount; i++) + { + if (bone == g_SkipBone[i]) + { + g_LocalMatrixOut[bone] = g_BoneLocalBuffer[bone].BoneLocal; + return; + } + } + } + g_LocalMatrixOut[bone] = SampleBlendedLocal(bone); } diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl index e87c7476e..6e54e5656 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl @@ -24,7 +24,17 @@ cbuffer AnimCB : register(b0) float BlendRatio; int RootBoneIndex; - float3 _pad0; + int PlayHeadBone; + int HeadBoneIndex; + float HeadAimWeight; + + int SkipCount; + int _pad0; + int _pad1; + int _pad2; + + float3 TargetDir_Local; + float padding3; row_major float4x4 PreTransformMatrix; float4 RootInitRot; diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Volumetric_Accumulate.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Volumetric_Accumulate.hlsl index aa5694dfa..37f3b0529 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Volumetric_Accumulate.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Volumetric_Accumulate.hlsl @@ -28,11 +28,14 @@ cbuffer g_ConstantBuffer : register(b0) // b0 << 이 숫자와 컨스턴트 쉐 row_major matrix InvProjMatrix; row_major matrix InvViewMatrix; + row_major matrix ShadowViewMatrix; + row_major matrix ShadowViewProjMatrix; + float fAsymmetryParameter; - float padding0; - float padding1; - float padding2; -} + uint iNumLight; + float fHeightOffset; + float fBaseHeight; +}; float ConvertNdcZToDepth(float ndcZ); float SliceTickness(float ndcZ, uint dimZ); diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Volumetric_Compute.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Volumetric_Compute.hlsl index b602fc1e4..b732abfe0 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Volumetric_Compute.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Volumetric_Compute.hlsl @@ -5,16 +5,17 @@ static const float EPSILON = 1e-6f; struct LightData { - uint itype; - float3 vDirection; - - float3 vPosition; - float fRange; - - float4 vColor; + float3 vDirection; + float fRange; + float4 vPosition; + float4 vDiffuse; }; -//StructuredBuffer g_LightBuffer : register(t1); +StructuredBuffer g_LightBuffer : register(t0); +Texture2D g_ShadowMap : register(t1); +Texture2D NoiseTexture : register(t2); + +SamplerState g_Sampler : register(s0); RWTexture3D g_VolumeUAV : register(u0); @@ -39,18 +40,22 @@ cbuffer g_ConstantBuffer : register(b0) // b0 << 이 숫자와 컨스턴트 쉐 row_major matrix InvProjMatrix; row_major matrix InvViewMatrix; + row_major matrix ShadowViewMatrix; + row_major matrix ShadowViewProjMatrix; + float fAsymmetryParameter; - float padding0; - float padding1; - float padding2; -} + uint iNumLight; + float fHeightOffset; + float fBaseHeight; +}; float3 ConvertThreadIdToNdc(uint3 id, uint3 dims); float ConvertNdcZToDepth(float ndcZ); float3 ConvertToWorldPosition(float3 ndc, float depth); float3 ConvertThreadIdToWorldPosition(uint3 id, uint3 dims); float HenyeyGreensteinPhaseFunction(float3 vInputDir, float3 vOutputDir, float fAnisotropy); - +float ComputePointLightVisible(float3 vLightDir, float fRange); +float ComputeShadowVisibility(float3 vWorldPosition); // 볼륨 텍스쳐 밀도, 산란 계산 [numthreads(8, 8, 4)] void CS_MAIN( uint3 DispatchThreadID : SV_DispatchThreadID) @@ -60,18 +65,40 @@ void CS_MAIN( uint3 DispatchThreadID : SV_DispatchThreadID) if (!all(DispatchThreadID < dims)) return; - float3 worldPosition = ConvertThreadIdToWorldPosition(DispatchThreadID, dims); - float3 toCamera = normalize(vCameraPosition - worldPosition); + float3 vWorldPosition = ConvertThreadIdToWorldPosition(DispatchThreadID, dims); + float3 toCamera = normalize(vCameraPosition - vWorldPosition); - float3 lighting = vLightColor.rgb * vLightColor.a; - float3 lightDir = normalize(vLightDirection); - float3 toLight = -lightDir; + float3 lighting = float3(0.1f, 0.1f, 0.1f); //vLightColor.rgb * vLightColor.a; - float phase = HenyeyGreensteinPhaseFunction(lightDir, toCamera, fAsymmetryParameter); + float3 lightDir = float3(0.f, 0.f, 0.f); - lighting += vLightColor.rgb * vLightColor.rgb * phase; + [loop] + for (uint i = 0; i < iNumLight; ++i) + { + float visibility = 1.f; + + if (0.f < length(g_LightBuffer[i].vDirection)) + { + lightDir = normalize(g_LightBuffer[i].vDirection); + visibility = ComputeShadowVisibility(vWorldPosition); - g_VolumeUAV[DispatchThreadID] = float4(lighting * fLightIntensity * fDensity, fDensity); + } + else + { + lightDir = vWorldPosition - g_LightBuffer[i].vPosition.xyz; + visibility = ComputePointLightVisible(lightDir, g_LightBuffer[i].fRange); + lightDir = normalize(lightDir); + } + + float3 toLight = -lightDir; + float phase = HenyeyGreensteinPhaseFunction(lightDir, toCamera, fAsymmetryParameter); + + lighting += g_LightBuffer[i].vDiffuse.rgb * g_LightBuffer[i].vDiffuse.a * phase * visibility; + } + + float fHeightDensity = max(0.1f, exp(-(vWorldPosition.y - fBaseHeight) * fHeightOffset)) * fDensity; + + g_VolumeUAV[DispatchThreadID] = float4(lighting * fLightIntensity * fHeightDensity, fHeightDensity); } float3 ConvertThreadIdToNdc(uint3 id, uint3 dims) @@ -109,3 +136,26 @@ float HenyeyGreensteinPhaseFunction(float3 vInputDir, float3 vOutputDir, float f float denom = pow(1.f + (fAsymmetryParameter * fAsymmetryParameter) - 2.f * fAsymmetryParameter * cosTheta, 3.f / 2.f); return (1.f / (4.f * PI)) * ((1.f - (fAsymmetryParameter * fAsymmetryParameter)) / max(denom, EPSILON)); } + +float ComputePointLightVisible(float3 vLightDir, float fRange) +{ + float fDistance = length(vLightDir); + + if (fDistance < fRange) + return 1.f; + else + return 0.f; +} + +float ComputeShadowVisibility(float3 vWorldPosition) +{ + float4 vShadowCoord = mul(float4(vWorldPosition, 1.f), ShadowViewProjMatrix); + float3 DepthUV = vShadowCoord.xyz / vShadowCoord.w; + + DepthUV.x = DepthUV.x * 0.5f + 0.5f; + DepthUV.y = DepthUV.y * -0.5f + 0.5f; + + //float fNoise = NoiseTexture.SampleLevel(g_Sampler, DepthUV.xy, 4).r; + + return 1.f; +} diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj b/Jusin154_Team3D/Engine/Default/Engine.vcxproj index 1d215d3c5..474a61c1c 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj @@ -113,7 +113,7 @@ ENGINE_EXPORTS;IMGUI_EXPORTS;TINYXML2_EXPORT;EDITOR_PROJECT;$(USERNAME);_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true stdcpp17 - ../Public/;%(AdditionalIncludeDirectories) + ../Public/;../Public/PhysX/;%(AdditionalIncludeDirectories) true true Use @@ -151,7 +151,7 @@ call Update_Lib.bat ENGINE_EXPORTS;IMGUI_EXPORTS;TINYXML2_EXPORT;$(USERNAME);NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true stdcpp17 - ../Public/;%(AdditionalIncludeDirectories) + ../Public/;../Public/PhysX/;%(AdditionalIncludeDirectories) true true Use @@ -208,6 +208,7 @@ call Update_Lib.bat + @@ -218,10 +219,6 @@ call Update_Lib.bat - - true - true - @@ -426,6 +423,7 @@ call Update_Lib.bat + @@ -436,10 +434,6 @@ call Update_Lib.bat - - true - true - @@ -633,6 +627,10 @@ call Update_Lib.bat + + Effect + 5.0 + Effect 5.0 diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters index f09c9f9a1..324a02417 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters @@ -292,9 +292,6 @@ {7c82051e-19af-4284-8156-16f504db30b6} - - {bba1e91b-87a8-4a7b-8e4e-b42d2041d8eb} - {7eab7292-025e-40d7-aa71-73e7a3c71ea7} @@ -316,6 +313,9 @@ {950977f0-f3c9-42f1-83f1-270b4bebf7ef} + + {bba1e91b-87a8-4a7b-8e4e-b42d2041d8eb} + @@ -546,9 +546,6 @@ 02.Element\02.Component\02.VIBuffer\Instance - - 02.Element\02.Component\07.RigidBody\20.Joint - 02.Element\02.Component\02.VIBuffer\Trail @@ -577,7 +574,7 @@ 03.Management\02.Resource_Manager - 03.Management\04. Font_Manager + 03.Management\04.Font_Manager 02.Element\01.GameObject\01. Font @@ -603,6 +600,9 @@ 01.Utility\08.Volumetric + + 02.Element\02.Component\07.RigidBody\20.Joint + @@ -1196,9 +1196,6 @@ 02.Element\02.Component\02.VIBuffer\Instance - - 02.Element\02.Component\07.RigidBody\20.Joint - 02.Element\02.Component\02.VIBuffer\Trail @@ -1230,7 +1227,7 @@ 03.Management\02.Resource_Manager - 03.Management\04. Font_Manager + 03.Management\04.Font_Manager 02.Element\01.GameObject\01. Font @@ -1256,6 +1253,9 @@ 01.Utility\08.Volumetric + + 02.Element\02.Component\07.RigidBody\20.Joint + @@ -1356,5 +1356,8 @@ 99.Define\01.SHADER + + 99.Define\01.SHADER + \ No newline at end of file diff --git a/Jusin154_Team3D/Engine/Private/Channel.cpp b/Jusin154_Team3D/Engine/Private/Channel.cpp index fc4e1f6f6..ef532b799 100644 --- a/Jusin154_Team3D/Engine/Private/Channel.cpp +++ b/Jusin154_Team3D/Engine/Private/Channel.cpp @@ -164,11 +164,7 @@ void CChannel::Update_TransformationMatirx( vTranslation = XMVectorSetW(XMVectorLerp(XMLoadFloat3(&vSourTranslation), XMLoadFloat3(&vDestTranslation), fRatio), 1.f); } - /*if (!bIsSpine) - { - m_IsUpper = BoneMask[m_iBoneIndex]; - m_ilayerIndex = m_IsUpper ? 1 : 0; - }*/ + if (m_iBoneIndex == RootBoneIndex) { if (vector) @@ -185,23 +181,6 @@ void CChannel::Update_TransformationMatirx( XMMatrixAffineTransformation(vScale, XMVectorSet(0.f, 0.f, 0.f, 1.f), vRotation, vTranslation); Bones[m_iBoneIndex]->Set_TransformationMatrix(m_BoneTransformationMatrix); - //if (bIsSpine) - //{ - // m_BoneTransformationMatrix = - // XMMatrixAffineTransformation(vScale, XMVectorSet(0.f, 0.f, 0.f, 1.f), vRotation, vTranslation); - - // Bones[m_iBoneIndex]->Set_TransformationMatrix(m_BoneTransformationMatrix); - //} - //else - //{ - // if (m_ilayerIndex == 1) - // { - // m_BoneTransformationMatrix = - // XMMatrixAffineTransformation(vScale, XMVectorSet(0.f, 0.f, 0.f, 1.f), vRotation, vTranslation); - - // Bones[m_iBoneIndex]->Set_TransformationMatrix(m_BoneTransformationMatrix); - // } - //} } } diff --git a/Jusin154_Team3D/Engine/Private/Character_Controller.cpp b/Jusin154_Team3D/Engine/Private/Character_Controller.cpp index a618ddade..e5d350063 100644 --- a/Jusin154_Team3D/Engine/Private/Character_Controller.cpp +++ b/Jusin154_Team3D/Engine/Private/Character_Controller.cpp @@ -3,7 +3,7 @@ #include "GameInstance.h" #include "GameObject.h" -CPhysX_CctQueryFilterCallback CCharacter_Controller::s_QueryFilterCallback_IGNORE_Shield = {}; +CPhysX_CctQueryFilterCallback CCharacter_Controller::s_QueryFilterCallback_IGNORE_GLOBAL = {}; CCharacter_Controller::CCharacter_Controller(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CComponent{ pDevice, pContext } @@ -214,7 +214,7 @@ _bool CCharacter_Controller::UpdateGroundByCast(_float fTimeDelta) PSX::PxRigidActor* hitActor = sweepHit.actor; - PhsXUserData* hitUserData = static_cast(hitActor->userData); + PHYSX_USERDATA* hitUserData = static_cast(hitActor->userData); switch (PXOBJECT(hitUserData->iSubKind)) { @@ -262,7 +262,7 @@ void CCharacter_Controller::Move(_float fTimeDelta) PSX::PxVec3 pxVecMomentum = {}; // 순간 이동량 _float fMinimumDistant = FLT_EPSILON3; // 이동량 오차 허용치, ( 크면 클수록 이동이 더 일찍 끝난다, 순간 이동량보다 같거나 더 크면 안움직일듯? ) PSX::PxControllerFilters pxFilter = {}; // 충돌 대상 필터 - pxFilter.mFilterCallback = &s_QueryFilterCallback_IGNORE_Shield; // 쉴드 무시 + pxFilter.mFilterCallback = &s_QueryFilterCallback_IGNORE_GLOBAL; // 쉴드 무시 const PSX::PxObstacleContext* pPxObstacles = { nullptr }; // 캐릭터가 충돌해야할 추가적인 장애물 객체?, 닿은 장애물은 캐시된다? if (true == m_bGravity) { if (0 >= m_iIsOnGround) { // 공중: 무조건 중력 @@ -323,7 +323,7 @@ HRESULT CCharacter_Controller::Initialize(void* pArg) m_pTransform = pDesc->pTransform; m_fWalkableSlopeDegree = pDesc->fWalkableSlope; } - { // PhsXUserData + { // PHYSX_USERDATA m_tagData.eKind = PHYSX_KIND::CCTActor; m_tagData.pOwner = m_pOwner; XMStoreFloat4x4(&m_tagData.BeforeMatrix, m_pTransform->Get_XMWorldMatrix()); @@ -347,7 +347,6 @@ HRESULT CCharacter_Controller::Initialize(void* pArg) Desc.material = m_pGameInstance->Create_Material(&pDesc->fMaterial); m_pController = m_pGameInstance->Add_BoxController(Desc); m_pController->setUserData(&m_tagData); - m_pController->getActor()->userData = &m_tagData; } break; case ACTOR::CAPSULE: { @@ -363,14 +362,16 @@ HRESULT CCharacter_Controller::Initialize(void* pArg) Desc.material = m_pGameInstance->Create_Material(&pDesc->fMaterial); m_pController = m_pGameInstance->Add_CapsuleController(Desc); m_pController->setUserData(&m_tagData); - m_pController->getActor()->userData = &m_tagData; } break; default: assert(false); // PhysX에서 불가능 return E_FAIL; break; } - + + PSX::PxRigidDynamic* pActor = m_pController->getActor(); + pActor->userData = &m_tagData; + m_pGameInstance->ApplyFilterData(pActor); m_pController->setStepOffset(pDesc->fStepOffset); if (nullptr == m_pController) { diff --git a/Jusin154_Team3D/Engine/Private/Dynamic_D6Joint.cpp b/Jusin154_Team3D/Engine/Private/Dynamic_D6Joint.cpp new file mode 100644 index 000000000..3d27eb965 --- /dev/null +++ b/Jusin154_Team3D/Engine/Private/Dynamic_D6Joint.cpp @@ -0,0 +1,86 @@ +#include "pch.h" +#include "Dynamic_D6Joint.h" +#include "GameInstance.h" + +CDynamic_D6Joint::CDynamic_D6Joint(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CComponent(pDevice, pContext) +{ +} + +CDynamic_D6Joint::CDynamic_D6Joint(const CDynamic_D6Joint& rhs) + : CComponent(rhs) +{ +} + +HRESULT CDynamic_D6Joint::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CDynamic_D6Joint::Initialize(void* pArg) +{ + DYNAMICJOINT_DESC* pDesc = static_cast(pArg); + m_pJoint = m_pGameInstance->Create_PxD6Joint(pDesc->pActor0, pDesc->pActor1, *pDesc->pxJointWorldPos); + return S_OK; +} +#ifdef _DEBUG + +HRESULT CDynamic_D6Joint::Add_DebugShape() +{ + if (nullptr != m_pMainShape){ + m_pMainShape.reset(); + } + m_pMainShape = (GeometricPrimitive::CreateSphere(m_pContext, 0.05f, 10, false, false)); + + return S_OK; +} +HRESULT CDynamic_D6Joint::Render() +{ + //PSX::PxTransform pxTranform = m_pRigidBody->getGlobalPose(); + //_matrix WorldMatrix = XMMatrixTranslation(m_vLocalTranslation.x, m_vLocalTranslation.y, m_vLocalTranslation.z) * XMMatrixAffineTransformation(XMVectorSet(1.f, 1.f, 1.f, 0.f), XMVectorZero(), XMLoadFloat4((_float4*)&pxTranform.q), XMVectorSetW(XMLoadFloat3((_float3*)&pxTranform.p), 1.f)); + //_matrix ViewMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW); + //_matrix ProjMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ); + //_vector vColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0x2fc48000, 1.f); + + //m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true); + return S_OK; +} + +#endif // _DEBUG + + +CDynamic_D6Joint* CDynamic_D6Joint::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CDynamic_D6Joint* pInstance = new CDynamic_D6Joint(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) { + MSG_BOX("CDynamic_D6Joint Prototype Created Failed"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CComponent* CDynamic_D6Joint::Clone(void* pArg, CGameObject* pOwner) +{ + CDynamic_D6Joint* pInstance = new CDynamic_D6Joint(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) { + MSG_BOX("CDynamic_D6Joint Prototype Created Failed"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CDynamic_D6Joint::Free() +{ + __super::Free(); +} +#ifdef _DEBUG + +void CDynamic_D6Joint::Describe_Entity() +{ +} + +#endif // _DEBUG diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index 3b7e82526..01a3bcf11 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -82,7 +82,7 @@ HRESULT CGameInstance::Initialize_Engine(const ENGINE_DESC& EngineDesc, ID3D11De if (nullptr == m_pKey_Manager) { return E_FAIL; } - m_pPipeLine = CPipeLine::Create(); + m_pPipeLine = CPipeLine::Create(*ppDevice, *ppContext); if (nullptr == m_pPipeLine) { return E_FAIL; } @@ -724,6 +724,11 @@ _matrix CGameInstance::Get_Transform_Matrix(D3DTS eState) return m_pPipeLine->Get_Transform_Matrix(eState); } +_matrix CGameInstance::Get_ShadowTransform_Matrix(D3DTS eState, SHADOW eShadowType) +{ + return m_pPipeLine->Get_ShadowTransform_Matrix(eState, eShadowType); +} + const _float4* CGameInstance::Get_CamPosition() { return m_pPipeLine->Get_CamPosition(); @@ -794,6 +799,16 @@ _float CGameInstance::Get_ShadowBoxFar(_uint iShadowBoxIndex) return m_pPipeLine->Get_ShadowBoxFar(iShadowBoxIndex); } +HRESULT CGameInstance::Begin_OutLine_Write(_uint iDSSRef) +{ + return m_pPipeLine->Begin_OutLine_Write(iDSSRef); +} + +HRESULT CGameInstance::End_OutLine_Write() +{ + return m_pPipeLine->End_OutLine_Write(); +} + void CGameInstance::Add_Light(_uint _iCurrentLevel, CLight* _pLight) { m_pLight_Manager->Add_Light(_iCurrentLevel, _pLight); @@ -819,6 +834,15 @@ HRESULT CGameInstance::Render_Lights(_uint _iCurrentLevel, CShader* pShader, CVI return m_pLight_Manager->Render_Lights(_iCurrentLevel, pShader, pVIBuffer); } +list* CGameInstance::Get_LightList(_uint _iCurrentLevel) +{ + return m_pLight_Manager->Get_LightList(_iCurrentLevel); +} + +_uint CGameInstance::Get_NumLight(_uint _iCurrentLevel) +{ + return m_pLight_Manager->Get_NumLight(_iCurrentLevel); +} HRESULT CGameInstance::Add_ColliderGroup(_uint iColliderGroup, class CCollider* pBounding) { @@ -908,6 +932,11 @@ HRESULT CGameInstance::Clear_RenderTarget(const _wstring& strRenderTargetKey) return m_pRenderTarget_Manager->Clear_RenderTarget(strRenderTargetKey); } +ID3D11ShaderResourceView* CGameInstance::Get_RenderTarget_SRV(const _wstring& strRenderTargetKey) +{ + return m_pRenderTarget_Manager->Get_RenderTarget_SRV(strRenderTargetKey); +} + #ifdef _DEBUG void CGameInstance::RenderTarget_Debuger() { @@ -1017,9 +1046,13 @@ PSX::PxRigidStatic* CGameInstance::Add_StaticActor(CRigidBody_Static& RigidBody, { return m_pPhysX_Manager->Add_StaticActor(RigidBody, iLevel); } -PSX::PxRevoluteJoint* CGameInstance::Create_PxRevoluteJoint(PSX::PxRigidActor* pActorFrame, PSX::PxTransform& pxLocalWallFrame, PSX::PxRigidActor* pActorObject, PSX::PxTransform& pxLocalActorFrame, _uint iLevel) +PSX::PxJoint* CGameInstance::Create_PxJoint(PHYSX_JOINT eType, PSX::PxRigidActor* pActor0, PSX::PxTransform& pxLocalFrame0, PSX::PxRigidActor* pActor1, PSX::PxTransform& pxLocalFrame1) { - return m_pPhysX_Manager->Create_PxRevoluteJoint(pActorFrame, pxLocalWallFrame, pActorObject, pxLocalActorFrame, iLevel); + return m_pPhysX_Manager->Create_PxJoint(eType, pActor0, pxLocalFrame0, pActor1, pxLocalFrame1); +} +PSX::PxD6Joint* CGameInstance::Create_PxD6Joint(PSX::PxRigidDynamic* pActor0, PSX::PxRigidDynamic* pActor1, const PSX::PxTransform& pxJointWorldPos) +{ + return m_pPhysX_Manager->Create_PxD6Joint(pActor0, pActor1, pxJointWorldPos); } _bool CGameInstance::SphereCast(_float fRadius, _float3 vStartPos, _float3 vDir, _float fDistance, PSX::PxHitFlags flagHitsData, PSX::PxQueryFlags flagQuery, PSX::PxSweepBuffer& hitBuffer) { @@ -1065,6 +1098,10 @@ void CGameInstance::Release_Actor(PSX::PxActor& Actor) { m_pPhysX_Manager->Release_Actor(Actor); } +void CGameInstance::ApplyFilterData(PSX::PxRigidActor* pRigidActor) +{ + m_pPhysX_Manager->ApplyFilterData(pRigidActor); +} HRESULT CGameInstance::ConvertToTriMeshes(vector& Meshes, vector& pxTriMeshes, _fmatrix WorldMatrix) { return m_pPhysX_Manager->ConvertToTriMeshes(Meshes, pxTriMeshes, WorldMatrix); @@ -1074,7 +1111,7 @@ HRESULT CGameInstance::SaveTriMeshes(const _char* pPath, vectorSaveTriMeshes(pPath, TriMeshes); } -void CGameInstance::Add_Editor_Plane(PhsXUserData& PlaneData) +void CGameInstance::Add_Editor_Plane(PHYSX_USERDATA& PlaneData) { m_pPhysX_Manager->Add_Editor_Plane(PlaneData); } @@ -1316,6 +1353,11 @@ void CGameInstance::Setting_Volumetirc(_float fDensity, _float fLightIntensity, m_pVolumetric->Setting_Volumetirc(fDensity , fLightIntensity , fAsymmetryParameter, fDepthPackExponent); } +void CGameInstance::Update_Volumetric() +{ + m_pVolumetric->Update(); +} + #pragma endregion void CGameInstance::Release_Engine() { diff --git a/Jusin154_Team3D/Engine/Private/Light.cpp b/Jusin154_Team3D/Engine/Private/Light.cpp index adc31e056..a7991c7b8 100644 --- a/Jusin154_Team3D/Engine/Private/Light.cpp +++ b/Jusin154_Team3D/Engine/Private/Light.cpp @@ -220,7 +220,14 @@ void CLight::Describe_Entity() GUI::Spacing(); + if (m_LightDesc.eType == LIGHT::DIRECTIONAL) + { + GUI::Text("Direction:"); + GUI::InputFloat3("##Direction", (_float*)m_LightDesc.pDirection); + } m_pOwner->Get_Component()->Describe_Entity(); + + GUI::TreePop(); } diff --git a/Jusin154_Team3D/Engine/Private/Light_Manager.cpp b/Jusin154_Team3D/Engine/Private/Light_Manager.cpp index 7103da91e..73bfb8e12 100644 --- a/Jusin154_Team3D/Engine/Private/Light_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/Light_Manager.cpp @@ -84,6 +84,14 @@ const LIGHT_DESC* CLight_Manager::Get_Light_Info(_uint _iCurrentLevel, _uint _iL return (*iter)->Get_LightDesc(); } +_uint CLight_Manager::Get_NumLight(_uint _iCurrentLevel) +{ + if(true == m_Lights[_iCurrentLevel].empty()) + return 0; + + return static_cast<_uint>(m_Lights[_iCurrentLevel].size()); +} + HRESULT CLight_Manager::Render_Lights(_uint iCurrentLevel, CShader* pShader, CVIBuffer* pVIBuffer) { diff --git a/Jusin154_Team3D/Engine/Private/Material.cpp b/Jusin154_Team3D/Engine/Private/Material.cpp index f02b8bd22..f432e661c 100644 --- a/Jusin154_Team3D/Engine/Private/Material.cpp +++ b/Jusin154_Team3D/Engine/Private/Material.cpp @@ -691,6 +691,8 @@ HRESULT CMaterial::Add_Texture(const _char* pTextureFolderPath, string& FileType return S_OK; else if (!strcmp(FileType.c_str(), "Ground MRO/SRO")) return S_OK; + else if (!strcmp(FileType.c_str(), "Corruption Mask")) + return S_OK; else if (!strcmp(FileType.c_str(), "Rock_Texture")) { eTexture = aiTextureType::aiTextureType_DIFFUSE; } diff --git a/Jusin154_Team3D/Engine/Private/Mesh.cpp b/Jusin154_Team3D/Engine/Private/Mesh.cpp index d4db9762a..8b5a1b518 100644 --- a/Jusin154_Team3D/Engine/Private/Mesh.cpp +++ b/Jusin154_Team3D/Engine/Private/Mesh.cpp @@ -422,6 +422,7 @@ HRESULT CMesh::Ready_VertexBuffer_For_Anim(const CModel* pModel, SaveMesh* _Save HRESULT CMesh::Create_BoneRemapBuffer() { + D3D11_BUFFER_DESC desc{}; desc.Usage = D3D11_USAGE_DEFAULT; desc.ByteWidth = sizeof(_uint) * (_uint)m_BoneRemap.size(); diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index 7a42d8cb7..a9784e5a2 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -95,7 +95,7 @@ HRESULT CModel::Bind_Material(_uint iMeshIndex, CShader* pShader) return m_Materials[iMaterialIndex]->Bind_SRV(pShader, m_eType); } -HRESULT CModel::Begin(_uint iMeshIndex, CShader* pShader, _bool OutLine) +HRESULT CModel::Begin(_uint iMeshIndex, CShader* pShader) { if (iMeshIndex >= m_iNumMeshes) { return E_FAIL; @@ -107,12 +107,7 @@ HRESULT CModel::Begin(_uint iMeshIndex, CShader* pShader, _bool OutLine) return E_FAIL; } HRESULT hr = { E_FAIL }; - if (false == OutLine) { - hr = pShader->Begin(m_Materials[iMaterialIndex]->Get_UsingPass()); - } - else { - hr = pShader->Begin(m_Materials[iMaterialIndex]->Get_OutLinePass()); - } + hr = pShader->Begin(m_Materials[iMaterialIndex]->Get_UsingPass()); return hr; } @@ -177,6 +172,8 @@ _bool CModel::Play_Anim(_float fTimeDelta, CTransform* pTransform) ComputeAnimation(m_iCurrentAnimIndex, m_iIndexAnimPlayableMesh); + Apply_CPU_HeadAim(); + if (m_bIsFinishedAnim) { if (m_bIsLoop) @@ -517,6 +514,47 @@ vector<_float4x4> CModel::Get_OffsetMatrix(_int iIndex) return m_Meshes[iIndex]->Get_OffsetMatrix(); } +void CModel::Apply_CPU_HeadAim() +{ + _int headIdx = m_iBoneIndex[ENUM_CLASS(BLEND_BONE::HEAD)]; + if (headIdx < 0) + return; + + _float4x4 localF = m_Bones[headIdx]->Get_TransformationMatrix(); + _matrix local = XMLoadFloat4x4(&localF); + + _vector headFwd = XMVector3Normalize(local.r[2]); + + _vector dirWS = XMVector3Normalize(m_vTargetPos - m_pTransform->Get_State(STATE::POSITION)); + + _matrix worldInv = m_pTransform->Get_WorldMatrixInv(); + + _vector dirLocal = XMVector3Normalize(XMVector3TransformNormal(dirWS, worldInv)); + + _float dot = XMVectorGetX(XMVector3Dot(headFwd, dirLocal)); + dot = clamp(dot, -1.f, 1.f); + + _float angle = acosf(dot) * m_fHeadAimWeight; + + _vector axis = XMVector3Cross(headFwd, dirLocal); + if (XMVector3LengthSq(axis).m128_f32[0] < 1e-6f) + return; + + axis = XMVector3Normalize(axis); + + _vector qAim = XMQuaternionRotationAxis(axis, angle); + + _matrix aimRot = XMMatrixRotationQuaternion(qAim); + _matrix newLocal = aimRot * local; + + m_Bones[headIdx]->Set_TransformationMatrix(newLocal); + + Mark_CPUChain(headIdx); + Apply_CPUMask_ToBones(); +} + + + void CModel::Apply_CPUMask_ToBones() { for (size_t i = 0; i < m_Bones.size(); ++i) @@ -551,6 +589,20 @@ const _float4x4* CModel::Get_BoneMatrixPtr(const _char* pBoneName) return m_Bones[boneIdx]->Get_CombinedTransformationMatrixPtr(); } +_matrix CModel::Get_BoneMatrix(const _char* pBoneName) +{ + _int boneIdx = Get_BoneIndex(pBoneName); + + if (boneIdx < 0) + return XMMatrixIdentity(); + + Mark_CPUChain(boneIdx); + + Apply_CPUMask_ToBones(); + + return m_Bones[boneIdx]->Get_CombinedTransformationMatrix(); +} + _matrix CModel::Get_BoneMatrix(const _char* pBoneName) const { vector::const_iterator iter = find_if(m_Bones.begin(), m_Bones.end(), [&](CBone* pBone)->_bool @@ -564,6 +616,20 @@ _matrix CModel::Get_BoneMatrix(const _char* pBoneName) const return (*iter)->Get_CombinedTransformationMatrix(); } +const _float4x4* CModel::Get_BoneLocalMatrixPtr(const _char* pBoneName) +{ + _int boneIdx = Get_BoneIndex(pBoneName); + + if (boneIdx < 0) + return nullptr; + + Mark_CPUChain(boneIdx); + + Apply_CPUMask_ToBones(); + + return m_Bones[boneIdx]->Get_TransformationMatrixPtr(); +} + _matrix CModel::Get_BoneLocalMatrix(const _char* pBoneName) const { vector::const_iterator iter = find_if(m_Bones.begin(), m_Bones.end(), [&](CBone* pBone)->_bool @@ -597,6 +663,18 @@ void CModel::Combined_BoneMatrix() } } +void CModel::Combined_BoneMatrix(_int iStartBoneIndex, _uint iBoneCount) +{ + if (iStartBoneIndex < 0) { + return; + } + _matrix IdenMatrix = XMMatrixIdentity(); + _uint iEndIndex = (_uint)iStartBoneIndex + iBoneCount; + for (_uint i = iStartBoneIndex; i < iEndIndex; ++i) { + m_Bones[i]->Update_CombinedTransformationMatrix(m_Bones, IdenMatrix); + } +} + _int CModel::Find_BoneIndex(const _char* pBoneName) { if (pBoneName == nullptr) @@ -611,6 +689,16 @@ _int CModel::Find_BoneIndex(const _char* pBoneName) return -1; } +HRESULT CModel::Set_BoneCombinedTransformation(const _char* pBoneName, _fmatrix newTransformation) +{ + _int iBoneIndex = Find_BoneIndex(pBoneName); + if (iBoneIndex < 0) { + return E_FAIL; + } + m_Bones[iBoneIndex]->Set_CombinedTransformationMatrix(newTransformation); + return S_OK; +} + void CModel::Set_CurrentTrackPosition(_float TrackPosition) { @@ -1341,6 +1429,14 @@ void CModel::InItialize_BoneIndex() { m_iBoneIndex[ENUM_CLASS(BLEND_BONE::NECK)] = i; } + if (m_Bones[i]->Compare_Name("head")) + { + m_iBoneIndex[ENUM_CLASS(BLEND_BONE::HEAD)] = i; + } + if (m_Bones[i]->Compare_Name("Hips_Cloth")) + { + m_iBoneIndex[ENUM_CLASS(BLEND_BONE::HIPS_CLOTH)] = i; + } } } @@ -1373,6 +1469,19 @@ void CModel::Initialize_BoneMasks() BuildMask(m_iBoneIndex[ENUM_CLASS(BLEND_BONE::SHOULDER_L)], m_BoneMask[ENUM_CLASS(BLEND_BONE::SHOULDER_L)]); BuildMask(m_iBoneIndex[ENUM_CLASS(BLEND_BONE::SHOULDER_R)], m_BoneMask[ENUM_CLASS(BLEND_BONE::SHOULDER_R)]); BuildMask(m_iBoneIndex[ENUM_CLASS(BLEND_BONE::NECK)], m_BoneMask[ENUM_CLASS(BLEND_BONE::NECK)]); + BuildMask(m_iBoneIndex[ENUM_CLASS(BLEND_BONE::HIPS_CLOTH)], m_BoneMask[ENUM_CLASS(BLEND_BONE::HIPS_CLOTH)]); + + if (m_iBoneIndex[ENUM_CLASS(BLEND_BONE::HIPS_CLOTH)] != -1) + { + for (_uint i = 0; i < (_uint)m_BoneMask[ENUM_CLASS(BLEND_BONE::HIPS_CLOTH)].size(); i++) + { + if (m_BoneMask[ENUM_CLASS(BLEND_BONE::HIPS_CLOTH)][i] == 1) + { + m_iSkipBoneCount++; + m_SkipBoneindex.push_back(i); + } + } + } for (_uint i = 0; i < m_Bones.size(); i++) { @@ -1421,9 +1530,10 @@ HRESULT CModel::Create_ComputeShaderLocal() sizeof(CHANNEL_DESC), // 채널 sizeof(KEYFRAME_DESC), // 이전애님 키프레임 sizeof(CHANNEL_DESC), // 이전애님 채널 - sizeof(int), // 부모 인덱스 + sizeof(_int), // 부모 인덱스 sizeof(_float4x4), // 로컬좌표 - sizeof(_uint) + sizeof(_uint), + sizeof(_int) //스킵본 인덱스 }; _uint CS_OutputStrides[] = { @@ -1433,7 +1543,7 @@ HRESULT CModel::Create_ComputeShaderLocal() CComputeShader::CS_INFO CS_Desc = {}; CS_Desc.iNumElement = (_uint)m_Bones.size(); - CS_Desc.iNumInputBuffer = 7; + CS_Desc.iNumInputBuffer = 8; CS_Desc.iNumOutputBuffer = 1; CS_Desc.iInputStructStride = CS_InputStrides; @@ -1448,6 +1558,34 @@ HRESULT CModel::Create_ComputeShaderLocal() return S_OK; } +HRESULT CModel::Create_ComputeShaderBoneInsertion() +{ + _uint CS_InputStrides[] = { + sizeof(_float4x4) + }; + + _uint CS_OutputStrides[] = { + sizeof(BONE_DESC), + }; + + CComputeShader::CS_INFO CS_Desc = {}; + + CS_Desc.iNumElement = (_uint)m_Bones.size(); + CS_Desc.iNumInputBuffer = 1; + CS_Desc.iNumOutputBuffer = 1; + + CS_Desc.iInputStructStride = CS_InputStrides; + CS_Desc.iOutputStructStride = CS_OutputStrides; + + m_pCS_BoneInsertion = (CComputeShader*)m_pGameInstance->Clone_Asset_Prototype(g_iStaticLevel, CS_BONEINSERT, &CS_Desc, nullptr); + + if (nullptr == m_pCS_BoneInsertion) { + return E_FAIL; + } + + return S_OK; +} + HRESULT CModel::Create_Temp() { for (auto& anim : m_Animations) @@ -1493,6 +1631,33 @@ HRESULT CModel::Create_BoneLocalVB() return S_OK; } +HRESULT CModel::Create_SkipBoneVB() +{ + D3D11_BUFFER_DESC desc{}; + desc.Usage = D3D11_USAGE_DEFAULT; + desc.ByteWidth = sizeof(_int) * (_uint)m_Bones.size(); + desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; + desc.CPUAccessFlags = 0; + desc.StructureByteStride = sizeof(_int); + desc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED; + + D3D11_SUBRESOURCE_DATA init{}; + init.pSysMem = m_SkipBoneindex.data(); + + m_pDevice->CreateBuffer(&desc, &init, &m_pSkipBoneBuffer); + + D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc = {}; + srvDesc.ViewDimension = D3D11_SRV_DIMENSION_BUFFER; + srvDesc.Format = DXGI_FORMAT_UNKNOWN; + srvDesc.Buffer.FirstElement = 0; + srvDesc.Buffer.NumElements = (_uint)m_Bones.size(); + + if (FAILED(m_pDevice->CreateShaderResourceView(m_pSkipBoneBuffer, &srvDesc, &m_pSkipBoneSRV))) + return E_FAIL; + + return S_OK; +} + HRESULT CModel::Create_BoneMatrixVB() { _uint iCount = (_uint)m_Bones.size(); @@ -1546,18 +1711,28 @@ HRESULT CModel::Create_BoneMatrixVB() HRESULT CModel::Create_Const() { + { + D3D11_BUFFER_DESC cbDesc = {}; + cbDesc.Usage = D3D11_USAGE_DYNAMIC; + cbDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; + cbDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; + cbDesc.ByteWidth = sizeof(ANIMSTATE_DESC); - D3D11_BUFFER_DESC cbDesc = {}; - cbDesc.Usage = D3D11_USAGE_DYNAMIC; - cbDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; - cbDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; - cbDesc.ByteWidth = sizeof(ANIMSTATE_DESC); - - D3D11_SUBRESOURCE_DATA CBInitialDesc = {}; - - if (FAILED(m_pDevice->CreateBuffer(&cbDesc, nullptr, &m_pConstantBuffer))) - return E_FAIL; + if (FAILED(m_pDevice->CreateBuffer(&cbDesc, nullptr, &m_pConstantBuffer))){ + return E_FAIL; + } + } + { + D3D11_BUFFER_DESC cbDesc = {}; + cbDesc.Usage = D3D11_USAGE_DYNAMIC; + cbDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; + cbDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; + cbDesc.ByteWidth = sizeof(BONEINSERTION_DESC); + if (FAILED(m_pDevice->CreateBuffer(&cbDesc, nullptr, &m_pInsertionCB))) { + return E_FAIL; + } + } return S_OK; } @@ -1685,6 +1860,8 @@ void CModel::ComputeAnimation(_uint AnimIndex,_uint MeshIndex) void CModel::ComputeLocal(_uint AnimIndex, _uint MeshIndex) { + + D3D11_MAPPED_SUBRESOURCE ConstantSubResource = {}; auto* anim = m_Animations[AnimIndex]; @@ -1697,13 +1874,40 @@ void CModel::ComputeLocal(_uint AnimIndex, _uint MeshIndex) pDesc->Duration = anim->Get_Duration(); pDesc->MeshBoneCount = m_Meshes[MeshIndex]->Get_NumBone(); pDesc->BoneCount = (_uint)m_Bones.size(); + pDesc->CurrentAnimIndex = m_iCurrentAnimIndex; pDesc->PrevAnimIndex = m_iPreAnimIndex; pDesc->PrevTime = m_Animations[m_iPreAnimIndex]->Get_CurrentTrackPosition(); pDesc->BlendRatio = m_fRatio; + pDesc->RootBoneIndex = m_iRootBoneIndex; + pDesc->PlayHeadBone = m_bHeadBone; + pDesc->HeadBoneIndex = m_iBoneIndex[ENUM_CLASS(BLEND_BONE::HEAD)]; + pDesc->HeadAimWeight = m_fHeadAimWeight; + + pDesc->SkipCount = m_iSkipBoneCount; + pDesc->padding0 = 0; + pDesc->padding1 = 0; + pDesc->padding2 = 0; + + if (m_iBoneIndex[ENUM_CLASS(BLEND_BONE::HEAD)] != -1) + { + _vector dirWS = XMVector3Normalize(m_vTargetPos - m_pTransform->Get_State(STATE::POSITION)); + + _matrix worldInv = m_pTransform->Get_WorldMatrixInv(); + + _vector dirLocal = XMVector3Normalize(XMVector3TransformNormal(dirWS, worldInv)); + + XMStoreFloat3(&pDesc->TargetDir_Local, dirLocal); + } + else { + pDesc->TargetDir_Local = _float3(0.f, 0.f, 0.f); + } + pDesc->padding3 = 0.f; + pDesc->PreTransformMatrix = m_PreTransformMatrix; pDesc->RootInitRot = m_vInitialRootRot; + m_pContext->Unmap(m_pConstantBuffer, 0); } @@ -1721,7 +1925,8 @@ void CModel::ComputeLocal(_uint AnimIndex, _uint MeshIndex) m_Animations[m_iPreAnimIndex]->Get_ChannelBuffer(), m_pParentBuffer, m_pBoneLocalBuffer, - m_Meshes[MeshIndex]->Get_BoneRemapBuffer() + m_Meshes[MeshIndex]->Get_BoneRemapBuffer(), + m_pSkipBoneBuffer }; ID3D11ShaderResourceView* srvs[] = @@ -1732,7 +1937,8 @@ void CModel::ComputeLocal(_uint AnimIndex, _uint MeshIndex) m_Animations[m_iPreAnimIndex]->Get_ChannelSrv(), m_pParentSRV, m_pBoneLocalSRV, - m_Meshes[MeshIndex]->Get_BoneRemapSRV() + m_Meshes[MeshIndex]->Get_BoneRemapSRV(), + m_pSkipBoneSRV }; ID3D11UnorderedAccessView* uavs[] = @@ -1745,7 +1951,7 @@ void CModel::ComputeLocal(_uint AnimIndex, _uint MeshIndex) 0, _float3((_float)iGroupCountX, 1.f, 1.f), srvs, - 7, + 8, uavs, 1, m_pConstantBuffer @@ -1755,13 +1961,62 @@ void CModel::ComputeLocal(_uint AnimIndex, _uint MeshIndex) UINT counts[1] = { 0 }; m_pContext->CSSetUnorderedAccessViews(0, 1, nullUAV, counts); - ID3D11ShaderResourceView* nullSRV[7] = { nullptr }; + ID3D11ShaderResourceView* nullSRV[8] = { nullptr }; - m_pContext->CSSetShaderResources(0, 7, nullSRV); + m_pContext->CSSetShaderResources(0, 8, nullSRV); } +void CModel::ComputeInsertionBoneBuffer(BONEINSERTION_DESC& CBDesc, ID3D11ShaderResourceView* pSRV) +{ + if (m_pComputeShader == nullptr){ + return; + } + + D3D11_MAPPED_SUBRESOURCE ConstantSubResource = {}; + + if (SUCCEEDED(m_pContext->Map(m_pInsertionCB, 0, D3D11_MAP_WRITE_DISCARD, 0, &ConstantSubResource))) + { + BONEINSERTION_DESC* pDesc = static_cast(ConstantSubResource.pData); + memcpy_s(pDesc, sizeof(BONEINSERTION_DESC), &CBDesc, sizeof(BONEINSERTION_DESC)); + m_pContext->Unmap(m_pInsertionCB, 0); + } + + ID3D11ShaderResourceView* srvs[] = + { + pSRV, + }; + + ID3D11UnorderedAccessView* uavs[] = + { + m_pBoneMatrixUAV + }; + _uint iThreadPerX = 256; + _uint iGroupCountX = (CBDesc.iMatrixCount + iThreadPerX - 1) / iThreadPerX; + if (iGroupCountX == 0) { + iGroupCountX = 1; + } + + m_pCS_BoneInsertion->Dispatch_ExternalSRV_UAV( + 0, + 0, + _float3((_float)iGroupCountX, 1.f, 1.f), + srvs, + 1, + uavs, + 1, + m_pInsertionCB + ); + + ID3D11UnorderedAccessView* nullUAV[1] = { nullptr }; + UINT counts[1] = { 0 }; + m_pContext->CSSetUnorderedAccessViews(0, 1, nullUAV, counts); + + ID3D11ShaderResourceView* nullSRV[1] = { nullptr }; + m_pContext->CSSetShaderResources(0, 1, nullSRV); +} + void CModel::Bind_OutPut_SRV_VS(_uint iIndex, _uint iBufferIndex) { @@ -2231,6 +2486,7 @@ HRESULT CModel::Initialize(void* pArg) Create_BoneMatrixVB(); Create_ParentVB(); Create_BoneLocalVB(); + Create_SkipBoneVB(); Create_ParentSrv(); Create_BoneLocalSrv(); @@ -2242,6 +2498,10 @@ HRESULT CModel::Initialize(void* pArg) return E_FAIL; } + if (FAILED(Create_ComputeShaderBoneInsertion())){ + return E_FAIL; + } + for (int i = 0; i < m_Meshes.size(); i++) { if (1 < m_Meshes[i]->Get_NumBone()) { @@ -2249,10 +2509,10 @@ HRESULT CModel::Initialize(void* pArg) break; } } - if (-1 == m_iIndexAnimPlayableMesh) { + /* if (-1 == m_iIndexAnimPlayableMesh) { assert(false); - } + }*/ } @@ -2362,16 +2622,20 @@ void CModel::Free() SAFE_RELEASE(m_pComputeShader); SAFE_RELEASE(m_pCS_AnimLocal); + SAFE_RELEASE(m_pCS_BoneInsertion); SAFE_RELEASE(m_pConstantBuffer); SAFE_RELEASE(m_pParentBuffer); SAFE_RELEASE(m_pBoneLocalBuffer); SAFE_RELEASE(m_pBoneMatrixBuffer); SAFE_RELEASE(m_pPrevBoneMatrixBuffer); + SAFE_RELEASE(m_pSkipBoneBuffer); SAFE_RELEASE(m_pLocalMatrixBuffer); + SAFE_RELEASE(m_pInsertionCB); SAFE_RELEASE(m_pParentSRV); SAFE_RELEASE(m_pBoneLocalSRV); SAFE_RELEASE(m_pBoneMatrixSRV); SAFE_RELEASE(m_pPrevBoneMatrixSRV); + SAFE_RELEASE(m_pSkipBoneSRV); SAFE_RELEASE(m_pBoneMatrixUAV); SAFE_RELEASE(m_pLocalMatrixSRV); SAFE_RELEASE(m_pLocalMatrixUAV); diff --git a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp index 37cc85f7d..55b6d05d5 100644 --- a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp @@ -19,7 +19,7 @@ CPhysX_Manager::CPhysX_Manager(ID3D11Device* pDevice, ID3D11DeviceContext* pCont PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody_Dynamic& RigidBody, _uint iLevel) { _matrix WorldMatrix = RigidBody.Get_TransformPtr()->Get_XMWorldMatrix(); - PSX::PxTransform pxWorldMatrix = XMWorldToPx_NoScale(WorldMatrix); + PSX::PxTransform pxWorldMatrix = XMWorldToPx_NoScaleNoFlip(WorldMatrix); // PxRigidDynamic 씬의 동적 바디 인터페이스 PSX::PxRigidDynamic* pActorDynamic = m_pPhysics->createRigidDynamic(pxWorldMatrix); @@ -36,6 +36,7 @@ PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody_Dynamic& RigidB case ACTOR::CAPSULE: geoHolder = PSX::PxCapsuleGeometry(vVolume.x, vVolume.y); pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActorDynamic, geoHolder.capsule(), *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]); + FixCapsuleShapeAxisToY(pShape); break; case ACTOR::SPHERE: geoHolder = PSX::PxSphereGeometry(vVolume.x); @@ -59,6 +60,8 @@ PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody_Dynamic& RigidB PSX::PxRigidBodyExt::updateMassAndInertia(*pActorDynamic, (PSX::PxReal)RigidBody.Get_Density()); m_pRestBodies[iLevel].insert(pActorDynamic); + pActorDynamic->userData = RigidBody.Get_UserDataPtr(); + ApplyFilterData(pActorDynamic); Attach_Actor(*pActorDynamic, iLevel); return pActorDynamic; @@ -67,11 +70,11 @@ PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody_Dynamic& RigidB PSX::PxRigidStatic* CPhysX_Manager::Add_StaticActor(CRigidBody_Static& RigidBody, _uint iLevel) { _matrix WorldMatrix = RigidBody.Get_TransformPtr()->Get_XMWorldMatrix(); - PSX::PxTransform pxWorldMatrix = XMWorldToPx_NoScale(WorldMatrix); + PSX::PxTransform pxWorldMatrix = XMWorldToPx_NoScaleNoFlip(WorldMatrix); // PxRigidStatic 씬의 정적 바디 인터페이스 - PSX::PxRigidStatic* pActor = m_pPhysics->createRigidStatic(pxWorldMatrix); + PSX::PxRigidStatic* pActorStatic = m_pPhysics->createRigidStatic(pxWorldMatrix); PSX::PxShape* pShape = { nullptr }; PSX::PxGeometry* pGeometry = { nullptr }; @@ -130,24 +133,83 @@ PSX::PxRigidStatic* CPhysX_Manager::Add_StaticActor(CRigidBody_Static& RigidBody break; } - pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActor, *pGeometry, *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]); + pShape = PSX::PxRigidActorExt::createExclusiveShape(*pActorStatic, *pGeometry, *m_pMaterials[ENUM_CLASS(RigidBody.Get_MaterialType())]); pShape->setFlags(RigidBody.Get_ShapeFlags()); pShape->setContactOffset(RigidBody.Get_ContactOffset()); pShape->setRestOffset(0.f); - m_pRestBodies[iLevel].insert(pActor); - Attach_Actor(*pActor, iLevel); + m_pRestBodies[iLevel].insert(pActorStatic); + ApplyFilterData(pActorStatic); + Attach_Actor(*pActorStatic, iLevel); - return pActor; + return pActorStatic; } -PSX::PxRevoluteJoint* CPhysX_Manager::Create_PxRevoluteJoint(PSX::PxRigidActor* pActorFrame, PSX::PxTransform& pxLocalWallFrame, PSX::PxRigidActor* pActorObject, PSX::PxTransform& pxLocalActorFrame, _uint iLevel) +PSX::PxJoint* CPhysX_Manager::Create_PxJoint(PHYSX_JOINT eType, PSX::PxRigidActor* pActor0, PSX::PxTransform& pxLocalFrame0, PSX::PxRigidActor* pActor1, PSX::PxTransform& pxLocalFrame1) { - PSX::PxRevoluteJoint* pJoint = PSX::PxRevoluteJointCreate(*m_pPhysics, pActorFrame, pxLocalWallFrame, pActorObject, pxLocalActorFrame); + PSX::PxJoint* pOut = { nullptr }; + switch (eType) + { + case PHYSX_JOINT::D6: + { + PSX::PxD6Joint* pJoint = PSX::PxD6JointCreate(*m_pPhysics, pActor0, pxLocalFrame0, pActor1, pxLocalFrame1); + pOut = pJoint; + } + break; + case PHYSX_JOINT::DISTANCE: + { + PSX::PxDistanceJoint* pJoint = PSX::PxDistanceJointCreate(*m_pPhysics, pActor0, pxLocalFrame0, pActor1, pxLocalFrame1); + pOut = pJoint; + } + break; + case PHYSX_JOINT::REVOLUTE: + { + PSX::PxRevoluteJoint* pJoint = PSX::PxRevoluteJointCreate(*m_pPhysics, pActor0, pxLocalFrame0, pActor1, pxLocalFrame1); + pOut = pJoint; + } + break; + default: + break; + } + assert(nullptr != pOut); - assert(nullptr != pJoint); + return pOut; +} +PSX::PxD6Joint* CPhysX_Manager::Create_PxD6Joint(PSX::PxRigidDynamic* pActor0, PSX::PxRigidDynamic* pActor1, const PSX::PxTransform& pxJointWorldPos) +{ + const PSX::PxTransform pxWorldParentPos = pActor0->getGlobalPose(); + const PSX::PxTransform pxWorldChildPos = pActor1->getGlobalPose(); + + const PSX::PxTransform pxLocalParentPOs = pxWorldParentPos.transformInv(pxJointWorldPos); + const PSX::PxTransform pxLocalChildPos = pxWorldChildPos.transformInv(pxJointWorldPos); + + PSX::PxD6Joint* pJoint = PSX::PxD6JointCreate(*m_pPhysics, pActor0, pxLocalParentPOs, pActor1, pxLocalChildPos); + + pActor0->setSolverIterationCounts(8, 2); + pActor1->setSolverIterationCounts(8, 2); + + pJoint->setMotion(PSX::PxD6Axis::eX, PSX::PxD6Motion::eLOCKED); + pJoint->setMotion(PSX::PxD6Axis::eY, PSX::PxD6Motion::eLOCKED); + pJoint->setMotion(PSX::PxD6Axis::eZ, PSX::PxD6Motion::eLOCKED); + pJoint->setMotion(PSX::PxD6Axis::eTWIST, PSX::PxD6Motion::eLIMITED); + pJoint->setMotion(PSX::PxD6Axis::eSWING1, PSX::PxD6Motion::eLIMITED); + pJoint->setMotion(PSX::PxD6Axis::eSWING2, PSX::PxD6Motion::eLIMITED); + + + pJoint->setTwistLimit(PSX::PxJointAngularLimitPair(-0.35f, 0.35f)); // 20도 + pJoint->setSwingLimit(PSX::PxJointLimitCone(0.10f, 0.10f)); // 40도 + + pJoint->setDrive(PSX::PxD6Drive::eSLERP, PSX::PxD6JointDrive(50.0f, 10.0f, FLT_MAX, true)); + pJoint->setDrivePosition(PSX::PxTransform(PSX::PxIdentity)); //생성 시 프레임 기준 + //pJoint->setDrive(PSX::PxD6Drive::eSLERP, PSX::PxD6JointDrive(0.0f, 0.0f, 0.0f, false)); + + pJoint->setConstraintFlag(PSX::PxConstraintFlag::eVISUALIZATION, true); + pJoint->setConstraintFlag(PSX::PxConstraintFlag::eIMPROVED_SLERP, true); + pJoint->setConstraintFlag(PSX::PxConstraintFlag::eCOLLISION_ENABLED, false); + + pJoint->setBreakForce(1e30f, 1e30f); return pJoint; } @@ -297,7 +359,7 @@ HRESULT CPhysX_Manager::SaveTriMeshes(const _char* pPath, vectorgetRigidBodyFlags() & PSX::PxRigidBodyFlag::eKINEMATIC) { - const CTransform* pTransform = static_cast(pBody->userData)->pOwner->Get_Component(); + PHYSX_USERDATA* pUserData = (PHYSX_USERDATA*)pBody->userData; + if (false == pUserData->bAutoOwnerTranslation) { + continue; + } + const CTransform* pTransform = pUserData->pOwner->Get_Component(); - pActor->setKinematicTarget(XMWorldToPx_NoScale(pTransform->Get_XMWorldMatrix())); + pActor->setKinematicTarget(XMWorldToPx_NoScaleNoFlip(pTransform->Get_XMWorldMatrix())); } } } @@ -414,12 +480,15 @@ void CPhysX_Manager::Update_Dynamic_ActiveActors() PSX::PxActor** ppActiveActors = m_pScene->getActiveActors(iNumActiveActor); for (PSX::PxU32 i = 0; i < iNumActiveActor; ++i) { - PhsXUserData* pUserData = (PhsXUserData*)ppActiveActors[i]->userData; + PHYSX_USERDATA* pUserData = (PHYSX_USERDATA*)ppActiveActors[i]->userData; PSX::PxRigidDynamic* pActorDynamic = ppActiveActors[i]->is(); if (nullptr != pActorDynamic) { if (nullptr == ppActiveActors[i]->userData) { continue; } + if (false == pUserData->bAutoOwnerTranslation) { + continue; + } CTransform* pTransform = pUserData->pOwner->Get_Component(); PSX::PxTransform pPxTransform = pActorDynamic->getGlobalPose(); @@ -432,6 +501,107 @@ void CPhysX_Manager::Update_Dynamic_ActiveActors() } } +void CPhysX_Manager::FixCapsuleShapeAxisToY(PSX::PxShape* pShape) +{ + PSX::PxTransform shapeLocalPose = pShape->getLocalPose(); + + // X -> Y : Z축 기준 +90도 회전 + shapeLocalPose.q = PSX::PxQuat(PSX::PxHalfPi, PSX::PxVec3(0.f, 0.f, 1.f)) * shapeLocalPose.q; + + pShape->setLocalPose(shapeLocalPose); +} + +uint32_t CPhysX_Manager::ConvertPhysxKindToBit(const PHYSX_USERDATA& physxUserData) +{ + if (physxUserData.eKind == PHYSX_KIND::BODY_STATIC) + return COLLISIONCATERGORY_BIT32::WorldStatic; + + if (physxUserData.eKind == PHYSX_KIND::CCTActor) + return COLLISIONCATERGORY_BIT32::CharacterController; + + if (physxUserData.eKind == PHYSX_KIND::BODY_DYNAMIC) + { + _bool isJointRelatedPart = + physxUserData.iSubKind == ENUM_CLASS(PXOBJECT::JOINT_ANCHOR) || + physxUserData.iSubKind == ENUM_CLASS(PXOBJECT::JOINT_ROUTE); + + if (true == isJointRelatedPart) + return COLLISIONCATERGORY_BIT32::JointedParts; + + return COLLISIONCATERGORY_BIT32::WorldDynamic; + } + + return 0u; +} + +uint32_t CPhysX_Manager::BuildCollisionMaskFromCategoryBit(uint32_t iMyBit) +{ + if (iMyBit == COLLISIONCATERGORY_BIT32::CharacterController) + { + // CCT는 조인트 파츠 충돌x + return COLLISIONCATERGORY_BIT32::WorldStatic | COLLISIONCATERGORY_BIT32::WorldDynamic; + } + + if (iMyBit == COLLISIONCATERGORY_BIT32::JointedParts) + { + // 조인트 파츠도 CCT 충돌x + return COLLISIONCATERGORY_BIT32::WorldStatic | COLLISIONCATERGORY_BIT32::WorldDynamic; + } + + // 기본값 + return COLLISIONCATERGORY_BIT32::WorldStatic | COLLISIONCATERGORY_BIT32::WorldDynamic | COLLISIONCATERGORY_BIT32::CharacterController | COLLISIONCATERGORY_BIT32::JointedParts; +} + +void CPhysX_Manager::ApplyFilterData(PSX::PxRigidActor* pRigidActor) +{ + if (pRigidActor == nullptr){ + return; + } + + PHYSX_USERDATA* physxUserData = reinterpret_cast(pRigidActor->userData); + if (physxUserData == nullptr){ + return; + } + + const uint32_t CategoryBit = ConvertPhysxKindToBit(*physxUserData); // who am i + const uint32_t MaskBits = BuildCollisionMaskFromCategoryBit(CategoryBit); // for what + + PSX::PxFilterData DATAfilter = {}; + DATAfilter.word0 = CategoryBit; // 나는 누구인가 + DATAfilter.word1 = MaskBits; // 누구와 부딪힐 것인가 + + const PSX::PxU32 shapeCount = pRigidActor->getNbShapes(); + vector shapes(shapeCount); + pRigidActor->getShapes(shapes.data(), shapeCount); + + for (PSX::PxShape* shape : shapes) + { + shape->setSimulationFilterData(DATAfilter); + } +} + +PSX::PxFilterFlags CPhysX_Manager::SimulationFilterShader(PSX::PxFilterObjectAttributes pxAttributes0, PSX::PxFilterData pxFilterData0, PSX::PxFilterObjectAttributes pxAttributes1, PSX::PxFilterData pxFilterData1, PSX::PxPairFlags& pxPairFlags, const void* pConstantBlock, PSX::PxU32 iConstantBlockSize) +{ + _bool bFilter0_1 = (pxFilterData0.word0 & pxFilterData1.word1) != 0u; + _bool bFilter1_0 = (pxFilterData1.word0 & pxFilterData0.word1) != 0u; + + if (!bFilter0_1 || !bFilter1_0) + { + // Event. 접촉제거 + return PSX::PxFilterFlag::eSUPPRESS; + } + + if (PSX::PxFilterObjectIsTrigger(pxAttributes0) || PSX::PxFilterObjectIsTrigger(pxAttributes1)) + { + // 트리거 처리 + pxPairFlags = PSX::PxPairFlag::eTRIGGER_DEFAULT; + return PSX::PxFilterFlag::eDEFAULT; + } + + pxPairFlags = PSX::PxPairFlag::eCONTACT_DEFAULT; + return PSX::PxFilterFlag::eDEFAULT; +} + void CPhysX_Manager::ClearScene(_uint iLevel) { for (auto& pBody : m_pActiveBodys[iLevel]) { @@ -585,6 +755,7 @@ HRESULT CPhysX_Manager::Initialize(_uint iLevel) #ifndef _DEBUG m_pPhysics = PxCreatePhysics(PX_PHYSICS_VERSION, *m_pFoundation, m_ToleranceScale, true); #endif // _DEBUG + PxInitExtensions(*m_pPhysics, m_pPvd); m_pCookingParam = new PSX::PxCookingParams(m_pPhysics->getTolerancesScale()); m_pCookingParam->meshPreprocessParams |= PSX::PxMeshPreprocessingFlag::eWELD_VERTICES; @@ -597,9 +768,10 @@ HRESULT CPhysX_Manager::Initialize(_uint iLevel) assert(false); return E_FAIL; } + sceneDesc.solverType = PSX::PxSolverType::Enum::eTGS; sceneDesc.cpuDispatcher = m_pDispatcher; //sceneDesc.simulationEventCallback = ; // fetchResults 때 불림. 아래 필터랑, pair랑 같이 짝꿍임. 좀 더 공부해야 쓸 수 있을듯;; - sceneDesc.filterShader = PSX::PxDefaultSimulationFilterShader; // 레이어 충돌, 오브젝트에 속성을 주고 복잡한 필터링 충돌 식 + sceneDesc.filterShader = &SimulationFilterShader;// PSX::PxDefaultSimulationFilterShader; // 레이어 충돌, 오브젝트에 속성을 주고 복잡한 필터링 충돌 식 sceneDesc.flags = PSX::PxSceneFlag::eENABLE_PCM // 기본 true, 현대적인 충돌시스템 적용 | PSX::PxSceneFlag::eENABLE_ACTIVE_ACTORS // 현재 움직임이 있는 액터만 가져옴 @@ -609,7 +781,7 @@ HRESULT CPhysX_Manager::Initialize(_uint iLevel) //| PSX::PxSceneFlag::eDISABLE_CONTACT_REPORT_BUFFER_RESIZE // 접촉 리포트버퍼 리사이즈 금지 -> 보통 끔 //| PSX::PxSceneFlag::eDISABLE_CONTACT_CACHE // 접촉 캐시를 금지 -> 그냥 켜두자, 캐시 있는게 보통 더 낫다 //| PSX::PxSceneFlag::eREQUIRE_RW_LOCK // 멀티스레딩 환경에서 혹시라도 락 걸고 접근하지 않아 발생할 일을 제거, - //| PSX::PxSceneFlag::eENABLE_STABILIZATION // 물체가 얽힌 상황에서 불안정한걸 방지. 추가비용인듯 + | PSX::PxSceneFlag::eENABLE_STABILIZATION // 물체가 얽힌 상황에서 불안정한걸 방지. 추가비용인듯 //| PSX::PxSceneFlag::eENABLE_AVERAGE_POINT // 이해 못하겠음 //| PSX::PxSceneFlag::eEnable_GPU_Dynamics // 피직스 그래픽가속 설정. 여기선 세팅 안돼서 비활성화ㅏ //| PSX::PxSceneFlag::eEnable_Direct_GPU_API // 직접 그래픽버퍼를 다루게끔 설정 @@ -627,7 +799,14 @@ HRESULT CPhysX_Manager::Initialize(_uint iLevel) return E_FAIL; } + // SCENE m_pScene = m_pPhysics->createScene(sceneDesc); +#ifdef _DEBUG + m_pScene->setVisualizationParameter(PSX::PxVisualizationParameter::Enum::eJOINT_LOCAL_FRAMES, 1.f); + m_pScene->setVisualizationParameter(PSX::PxVisualizationParameter::Enum::eJOINT_LIMITS, 1.f); +#endif // _DEBUG + + // CCT m_pCCTManager = PxCreateControllerManager(*m_pScene); @@ -654,7 +833,7 @@ HRESULT CPhysX_Manager::Initialize(_uint iLevel) PlaneData.pOwner = nullptr; PlaneData.pBody = nullptr; - PSX::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 85), *m_pMaterials[ENUM_CLASS(PXMATERIAL::DEFAULT)]); + PSX::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 80), *m_pMaterials[ENUM_CLASS(PXMATERIAL::DEFAULT)]); pGroundPlane->userData = &PlaneData; pGroundPlane->setName("PHYSX_MANAGER_PLANE"); m_pScene->addActor(*pGroundPlane); @@ -740,7 +919,7 @@ void CPhysX_Manager::Free() if (nullptr != m_pDispatcher) { m_pDispatcher->release(); m_pDispatcher = nullptr; } - + PxCloseExtensions(); if (nullptr != m_pPhysics) { m_pPhysics->release(); m_pPhysics = nullptr; } diff --git a/Jusin154_Team3D/Engine/Private/PipeLine.cpp b/Jusin154_Team3D/Engine/Private/PipeLine.cpp index 9647912da..248b114bf 100644 --- a/Jusin154_Team3D/Engine/Private/PipeLine.cpp +++ b/Jusin154_Team3D/Engine/Private/PipeLine.cpp @@ -3,9 +3,13 @@ #include "Shader.h" #include "GameInstance.h" -CPipeLine::CPipeLine() - :m_pGameInstance(CGameInstance::GetInstance()) +CPipeLine::CPipeLine(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : m_pDevice{ pDevice } + , m_pContext{ pContext } + , m_pGameInstance{ CGameInstance::GetInstance() } { + SAFE_ADDREF(m_pDevice); + SAFE_ADDREF(m_pContext); SAFE_ADDREF(m_pGameInstance); } @@ -24,6 +28,23 @@ _matrix CPipeLine::Get_Transform_Matrix(D3DTS eState) return XMLoadFloat4x4(&m_TransformStateMatrices[ENUM_CLASS(eState)]); } +_matrix CPipeLine::Get_ShadowTransform_Matrix(D3DTS eState, SHADOW eShadowType) +{ + _uint iPass = UINT_MAX; + if (0 < ((_ubyte)eShadowType & (_ubyte)SHADOW::SHADOW_NEAR)) { + iPass = 0; + } + else if (0 < ((_ubyte)eShadowType & (_ubyte)SHADOW::SHADOW_MIDDLE)) { + iPass = 1; + } + else if (0 < ((_ubyte)eShadowType & (_ubyte)SHADOW::SHADOW_FAR)) { + iPass = 2; + } + assert(iPass != UINT_MAX); + + return XMLoadFloat4x4(&m_ShadowTransformStateMatrices[iPass][ENUM_CLASS(eState)]); +} + const _float4* CPipeLine::Get_CamPosition() { return &m_vCamPosition; @@ -150,6 +171,20 @@ HRESULT CPipeLine::Load_GlobalSRV(const _tchar* wszKeyGlobalSRV, filesystem::pat return S_OK; } +HRESULT CPipeLine::Begin_OutLine_Write(_uint iDSSRef) +{ + m_pContext->OMGetDepthStencilState(&m_pPrevDSS, &m_iPrevDSSRef); + m_pContext->OMSetDepthStencilState(m_pDSS_OutLineWrite, iDSSRef); + return S_OK; +} + +HRESULT CPipeLine::End_OutLine_Write() +{ + m_pContext->OMSetDepthStencilState(m_pPrevDSS, m_iPrevDSSRef); + SAFE_RELEASE(m_pPrevDSS); + return S_OK; +} + HRESULT CPipeLine::Ready_Shadow_Light(const _float4& vShadowDirRPYQuat) { _vector vShadowQuat = XMQuaternionNormalize(XMLoadFloat4(&vShadowDirRPYQuat)); @@ -256,6 +291,30 @@ HRESULT CPipeLine::Initialize() XMStoreFloat4x4(&m_TransformStateMatrices[i], XMMatrixIdentity()); } + if (nullptr == m_pDSS_OutLineWrite) { + D3D11_DEPTH_STENCIL_DESC depthStencilDescription{}; + depthStencilDescription.DepthEnable = TRUE; + depthStencilDescription.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ALL; // true에 해당 + depthStencilDescription.DepthFunc = D3D11_COMPARISON_LESS_EQUAL; // less_equal + + depthStencilDescription.StencilEnable = TRUE; + depthStencilDescription.StencilReadMask = 0xFF; + depthStencilDescription.StencilWriteMask = 0xFF; + + // FrontFace + depthStencilDescription.FrontFace.StencilFailOp = D3D11_STENCIL_OP_KEEP; + depthStencilDescription.FrontFace.StencilDepthFailOp = D3D11_STENCIL_OP_KEEP; + depthStencilDescription.FrontFace.StencilPassOp = D3D11_STENCIL_OP_REPLACE; // Replace + depthStencilDescription.FrontFace.StencilFunc = D3D11_COMPARISON_ALWAYS; // Always + + // BackFace + depthStencilDescription.BackFace.StencilFailOp = D3D11_STENCIL_OP_KEEP; + depthStencilDescription.BackFace.StencilDepthFailOp = D3D11_STENCIL_OP_KEEP; + depthStencilDescription.BackFace.StencilPassOp = D3D11_STENCIL_OP_REPLACE; + depthStencilDescription.BackFace.StencilFunc = D3D11_COMPARISON_ALWAYS; + m_pDevice->CreateDepthStencilState(&depthStencilDescription, &m_pDSS_OutLineWrite); + } + return S_OK; } @@ -440,9 +499,9 @@ ID3D11ShaderResourceView* CPipeLine::Find_GlobalShaderResourceView(const _tchar* return (*iter).second; } -CPipeLine* CPipeLine::Create() +CPipeLine* CPipeLine::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { - CPipeLine* pInstance = new CPipeLine(); + CPipeLine* pInstance = new CPipeLine(pDevice, pContext); if (FAILED(pInstance->Initialize())) { @@ -455,6 +514,10 @@ CPipeLine* CPipeLine::Create() void CPipeLine::Free() { __super::Free(); + SAFE_RELEASE(m_pDevice); + SAFE_RELEASE(m_pContext); + SAFE_RELEASE(m_pDSS_OutLineWrite); + SAFE_RELEASE(m_pGameInstance); for (auto& pairSRV : m_mapGlobalSRV) { SAFE_RELEASE(pairSRV.second); } diff --git a/Jusin154_Team3D/Engine/Private/Prototype_Manager.cpp b/Jusin154_Team3D/Engine/Private/Prototype_Manager.cpp index 9c22da455..6039d2a5f 100644 --- a/Jusin154_Team3D/Engine/Private/Prototype_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/Prototype_Manager.cpp @@ -147,7 +147,6 @@ HRESULT CPrototype_Manager::Ready_EngineAssets() CComputeShader::Create(m_pDevice, m_pContext, L"../Bin/Resources/ShaderFiles/Shader_Instance_Compute.hlsl", "CS_MAIN")))) { return E_FAIL; - } if (FAILED(Add_Asset_Prototype(g_iStaticLevel, CS_MODEL, @@ -161,7 +160,12 @@ HRESULT CPrototype_Manager::Ready_EngineAssets() CComputeShader::Create(m_pDevice, m_pContext, L"../Bin/Resources/ShaderFiles/Shader_Local_Compute.hlsl", "CS_LOCAL")))) { return E_FAIL; + } + if (FAILED(Add_Asset_Prototype(g_iStaticLevel, CS_BONEINSERT, + CComputeShader::Create(m_pDevice, m_pContext, + L"../Bin/Resources/ShaderFiles/Shader_BoneCombinedInsertion_Compute.hlsl", "CS_MAIN")))) { + return E_FAIL; } #pragma endregion diff --git a/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp b/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp index dd9ed2d22..ed23bf69d 100644 --- a/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp @@ -252,6 +252,16 @@ HRESULT CRenderTarget_Manager::Clear_RenderTarget(const _wstring& strRenderTarge return S_OK; } +ID3D11ShaderResourceView* CRenderTarget_Manager::Get_RenderTarget_SRV(const _wstring& strRenderTargetKey) +{ + CRenderTarget* pRenderTarget = Find_RenderTarget(strRenderTargetKey); + + if(nullptr == pRenderTarget) + return nullptr; + + return pRenderTarget->Get_SRV(); +} + HRESULT CRenderTarget_Manager::Accumulate_RenderTarget(CVIBuffer_Rect* pVIBuffer, CShader* pShader, const _wstring& wstrRenderTarget_SrcA, const _wstring& wstrRenderTarget_SrcB, diff --git a/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic.cpp b/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic.cpp index 933eb0ea2..f76ae0d29 100644 --- a/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic.cpp +++ b/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic.cpp @@ -21,28 +21,34 @@ CRigidBody_Dynamic::CRigidBody_Dynamic(const CRigidBody_Dynamic& rhs) : #ifdef _DEBUG HRESULT CRigidBody_Dynamic::Render() { - _matrix WorldMatrix = XMMatrixTranslation(m_vLocalTranslation.x, m_vLocalTranslation.y, m_vLocalTranslation.z) * m_pTransform->Get_XMWorldMatrix(); + return Render(nullptr); +} +HRESULT CRigidBody_Dynamic::Render(function custumState) +{ + PSX::PxTransform pxTranform = m_pRigidBody->getGlobalPose(); + _matrix WorldMatrix = XMMatrixTranslation(m_vLocalTranslation.x, m_vLocalTranslation.y, m_vLocalTranslation.z) + * XMMatrixAffineTransformation(XMVectorSet(1.f, 1.f, 1.f, 0.f), XMVectorZero(), XMLoadFloat4((_float4*)&pxTranform.q), XMVectorSetW(XMLoadFloat3((_float3*)&pxTranform.p), 1.f)); _matrix ViewMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW); _matrix ProjMatrix = m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ); _vector vColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0x2fc48000, 1.f); - switch (m_eActorType) { case ACTOR::BOX: { - m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true); + m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true, custumState); } break; case ACTOR::CAPSULE: { - m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true); - _matrix WorldUp = XMMatrixTranslationFromVector(m_pTransform->Get_State(STATE::UP) * m_vhalfGeometryInfo.y); - _matrix WorldDown = XMMatrixTranslationFromVector(m_pTransform->Get_State(STATE::UP) * -m_vhalfGeometryInfo.y); - m_pSubShape->Draw(WorldUp * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true); - m_pSubShape->Draw(WorldDown * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true); + WorldMatrix = XMMatrixAffineTransformation(XMVectorSet(1.f, 1.f, 1.f, 0.f), XMVectorZero(), XMQuaternionMultiply(XMQuaternionRotationAxis(XMVectorSet(0.f, 1.f, 0.f, 0.f), XMConvertToRadians(90.f)), XMLoadFloat4((_float4*)&pxTranform.q)), XMVectorSetW(XMLoadFloat3((_float3*)&pxTranform.p), 1.f)); + m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true, custumState); + _matrix WorldUp = XMMatrixTranslationFromVector(WorldMatrix.r[1] * m_vhalfGeometryInfo.y); + _matrix WorldDown = XMMatrixTranslationFromVector(WorldMatrix.r[1] * -m_vhalfGeometryInfo.y); + m_pSubShape->Draw(WorldUp * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true, custumState); + m_pSubShape->Draw(WorldDown * WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true, custumState); } break; case ACTOR::SPHERE: { - m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true); + m_pMainShape->Draw(WorldMatrix, ViewMatrix, ProjMatrix, vColor, nullptr, true, custumState); } break; default: break; @@ -50,6 +56,10 @@ HRESULT CRigidBody_Dynamic::Render() return S_OK; } #endif +void CRigidBody_Dynamic::Set_Name(const _char* szName) +{ + m_pRigidBody->setName(szName); +} void CRigidBody_Dynamic::Set_HalfGeometryInfo(_float3 vhalfGeometryInfo) { m_vhalfGeometryInfo = vhalfGeometryInfo; @@ -101,17 +111,26 @@ void CRigidBody_Dynamic::Set_HalfGeometryInfo(_float3 vhalfGeometryInfo) Add_DebugShape(); #endif // _DEBUG } -void CRigidBody_Dynamic::Move_LocalPos(_float4 vNewRotQ, _float3 vNewTranslation) +void CRigidBody_Dynamic::Move_LocalPos(_matrix newLocalPos) { - m_vLocalRotQ = vNewRotQ; - m_vLocalTranslation = vNewTranslation; + _vector vScale, vPos, vRotQ; + XMMatrixDecompose(&vScale, &vRotQ, &vPos, newLocalPos); + Move_LocalPos(vPos, vRotQ); +} +void CRigidBody_Dynamic::Move_LocalPos(_float4& vNewRotQ, _float3& vNewTranslation) +{ + Move_LocalPos(XMLoadFloat4(&vNewRotQ), XMLoadFloat3(&vNewTranslation)); +} +void CRigidBody_Dynamic::Move_LocalPos(_fvector vNewRotQ, _gvector vNewTranslation) +{ + XMStoreFloat4(&m_vLocalRotQ, vNewRotQ); + XMStoreFloat3(&m_vLocalTranslation, vNewTranslation); PSX::PxShape* pShape = { nullptr }; m_pRigidBody->getShapes(&pShape, m_pRigidBody->getNbShapes()); - pShape->setLocalPose(PSX::PxTransform(vNewTranslation.x, vNewTranslation.y, vNewTranslation.z, PSX::PxQuat(vNewRotQ.x, vNewRotQ.y, vNewRotQ.z, vNewRotQ.w))); + pShape->setLocalPose(PSX::PxTransform(m_vLocalTranslation.x, m_vLocalTranslation.y, m_vLocalTranslation.z, PSX::PxQuat(m_vLocalRotQ.x, m_vLocalRotQ.y, m_vLocalRotQ.z, m_vLocalRotQ.w))); #ifdef _DEBUG Add_DebugShape(); #endif // _DEBUG - } _float CRigidBody_Dynamic::Get_Mass() { @@ -137,6 +156,31 @@ void CRigidBody_Dynamic::Set_Kinematic(_bool bKinematic) m_pRigidBody->setRigidBodyFlag(PSX::PxRigidBodyFlag::eKINEMATIC, bKinematic); } +void CRigidBody_Dynamic::Move_Kinematic(_fmatrix xmTransform, _bool bTeleport) +{ + _vector vScale, vPos, vRotQ; + XMMatrixDecompose(&vScale, &vRotQ, &vPos, xmTransform); + Move_Kinematic(vPos, vRotQ, bTeleport); +} + +void CRigidBody_Dynamic::Move_Kinematic(_fvector vPos, _gvector vRotq, _bool bTeleport) +{ + PSX::PxTransform pxTransform = {}; + XMStoreFloat3((_float3*)&pxTransform.p, vPos); + XMStoreFloat4((_float4*)&pxTransform.q, vRotq); + Move_Kinematic(pxTransform, bTeleport); +} + +void CRigidBody_Dynamic::Move_Kinematic(PSX::PxTransform& pxDestination, _bool bTeleport) +{ + if (true == bTeleport) { + Set_Transform(pxDestination, bTeleport); + } + else { + m_pRigidBody->setKinematicTarget(pxDestination); + } +} + HRESULT CRigidBody_Dynamic::ConvertToCCT(CCharacter_Controller& CCTOriginal) { m_pTransform->Set_WorldMatrix(m_pRigidBody->getGlobalPose()); @@ -164,26 +208,33 @@ _vector CRigidBody_Dynamic::Get_Position() return vPos; } -void CRigidBody_Dynamic::Set_Position(_vector vPos) +void CRigidBody_Dynamic::Set_Position(_vector vPos, _bool bTeleport) { PSX::PxTransform pxTransform = m_pRigidBody->getGlobalPose(); pxTransform.p.x = vPos.m128_f32[0]; pxTransform.p.y = vPos.m128_f32[1]; pxTransform.p.z = vPos.m128_f32[2]; - Set_Transform(pxTransform); + Set_Transform(pxTransform, bTeleport); } -void CRigidBody_Dynamic::Set_Rotation(_vector vRotQ) +void CRigidBody_Dynamic::Set_Rotation(_vector vRotQ, _bool bTeleport) { PSX::PxTransform pxTransform = m_pRigidBody->getGlobalPose(); pxTransform.q.x = vRotQ.m128_f32[0]; pxTransform.q.y = vRotQ.m128_f32[1]; pxTransform.q.z = vRotQ.m128_f32[2]; pxTransform.q.w = vRotQ.m128_f32[3]; - Set_Transform(pxTransform); + Set_Transform(pxTransform, bTeleport); } -void CRigidBody_Dynamic::Set_Transform(_vector vPos, _vector vRotQ) +void CRigidBody_Dynamic::Set_Transform(_matrix WorldMatrix, _bool bTeleport) +{ + _vector vScale, vPos, vRotQ; + XMMatrixDecompose(&vScale, &vRotQ, &vPos, WorldMatrix); + Set_Transform(vPos, vRotQ, bTeleport); +} + +void CRigidBody_Dynamic::Set_Transform(_vector vPos, _vector vRotQ, _bool bTeleport) { PSX::PxTransform pxTransform = m_pRigidBody->getGlobalPose(); pxTransform.p.x = vPos.m128_f32[0]; @@ -194,12 +245,42 @@ void CRigidBody_Dynamic::Set_Transform(_vector vPos, _vector vRotQ) pxTransform.q.y = vRotQ.m128_f32[1]; pxTransform.q.z = vRotQ.m128_f32[2]; pxTransform.q.w = vRotQ.m128_f32[3]; - Set_Transform(pxTransform); + Set_Transform(pxTransform, bTeleport); } -void CRigidBody_Dynamic::Set_Transform(PSX::PxTransform pxTransform) +void CRigidBody_Dynamic::Set_CenterTransform(_vector vStart, _vector vEnd, _bool bTeleport) { - m_pRigidBody->setGlobalPose(pxTransform); + _vector vCenterWorldPos = (vStart + vEnd) * 0.5f; + _vector vRotQ = XMQuaternionIdentity(); + _vector vDir = XMVectorSetW(vEnd - vStart, 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); + } + if (true == bTeleport) { + Set_Transform(vCenterWorldPos, vRotQ, bTeleport); + } + else { + if (m_pRigidBody->getRigidBodyFlags() & PSX::PxRigidBodyFlag::eKINEMATIC) { + Move_Kinematic(vCenterWorldPos, vRotQ); + } + else { + Set_Transform(vCenterWorldPos, vRotQ, bTeleport); + } + } +} + +void CRigidBody_Dynamic::Set_Transform(PSX::PxTransform pxTransform, _bool bTeleport) +{ + m_pRigidBody->setGlobalPose(pxTransform, true); + + if (true == bTeleport) { + m_pRigidBody->setLinearVelocity(PSX::PxVec3(0.f, 0.f, 0.f)); + m_pRigidBody->setAngularVelocity(PSX::PxVec3(0.f, 0.f, 0.f)); + m_pRigidBody->clearForce(); + m_pRigidBody->clearTorque(); + } } _float3 CRigidBody_Dynamic::Get_FootPosition() @@ -244,6 +325,19 @@ _float3 CRigidBody_Dynamic::Get_HeadPosition() return vOut; } +PSX::PxTransform CRigidBody_Dynamic::Get_GlobalPosition() +{ + return m_pRigidBody->getGlobalPose(); +} + +PSX::PxTransform CRigidBody_Dynamic::Get_HeadPositionPxTransform() +{ + PSX::PxTransform pxTransform = m_pRigidBody->getGlobalPose(); + _float3 vFootPos = Get_HeadPosition(); + pxTransform.p = { vFootPos.x, vFootPos.y, vFootPos.z }; + return pxTransform; +} + PSX::PxTransform CRigidBody_Dynamic::Get_FootPositionPxTransform() { PSX::PxTransform pxTransform = m_pRigidBody->getGlobalPose(); @@ -283,22 +377,42 @@ HRESULT CRigidBody_Dynamic::Initialize(void* pArg) return E_FAIL; } #endif // _DEBUG + RIGIDBODY_DYNAMIC_DESC* pDesc = static_cast(pArg); m_tagData.pOwner = m_pOwner; XMStoreFloat4x4(&m_tagData.BeforeMatrix, m_pTransform->Get_XMWorldMatrix()); m_tagData.pBody = this; + m_tagData.bAutoOwnerTranslation = pDesc->bAutoOwnerTranslation; m_pRigidBody = m_pGameInstance->Add_DynamicActor(*this, m_pGameInstance->Get_NextLevelID()); - m_pRigidBody->userData = &m_tagData; m_pRigidBody->setCMassLocalPose(m_PxMassCenter); m_pRigidBody->setRigidDynamicLockFlags(m_eLockFlag); m_pRigidBody->setLinearDamping(m_vDamping.x); m_pRigidBody->setAngularDamping(m_vDamping.y); - Move_LocalPos(m_vLocalRotQ, m_vLocalTranslation); - //m_pRigidBody->joint; - //PSX::PxRevol + if (ACTOR::CAPSULE != m_eActorType) { + Move_LocalPos(m_vLocalRotQ, m_vLocalTranslation); + } + + return S_OK; } +//void CRigidBody_Dynamic::Move(PSX::PxTransform& pxTransform, _bool bTeleport) +//{ +// if (m_pRigidBody->getRigidBodyFlags().isSet(PSX::PxRigidBodyFlag::eKINEMATIC)) { +// m_pRigidBody->setKinematicTarget(pxTransform); +// } +// else { +// m_pRigidBody->setGlobalPose(pxTransform, true); +// +// if (true == bTeleport) { +// m_pRigidBody->setLinearVelocity(PSX::PxVec3(0.f, 0.f, 0.f)); +// m_pRigidBody->setAngularVelocity(PSX::PxVec3(0.f, 0.f, 0.f)); +// m_pRigidBody->clearForce(); +// m_pRigidBody->clearTorque(); +// } +// } +//} + #ifdef _DEBUG HRESULT CRigidBody_Dynamic::Add_DebugShape() { diff --git a/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic_Joint.cpp b/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic_Joint.cpp deleted file mode 100644 index bcb5590be..000000000 --- a/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic_Joint.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "pch.h" diff --git a/Jusin154_Team3D/Engine/Private/Volumetric.cpp b/Jusin154_Team3D/Engine/Private/Volumetric.cpp index 353da513a..5c8fd5aed 100644 --- a/Jusin154_Team3D/Engine/Private/Volumetric.cpp +++ b/Jusin154_Team3D/Engine/Private/Volumetric.cpp @@ -27,18 +27,71 @@ HRESULT CVolumetric::Initialize() if(FAILED(CreateResourceViews())) return E_FAIL; + if(FAILED(Create_SamplerState())) + return E_FAIL; + return S_OK; } void CVolumetric::Update() { - + } void CVolumetric::Cumpute_Volume() { EVENTSCOPE_("Render_Cumpute_Volume"); + XMStoreFloat4x4(&m_ShadowViewMatrix, + m_pGameInstance->Get_ShadowTransform_Matrix(D3DTS::VIEW, SHADOW::SHADOW_MIDDLE)); + XMStoreFloat4x4(&m_ShadowViewProjMatrix, + m_pGameInstance->Get_ShadowTransform_Matrix(D3DTS::VIEW, SHADOW::SHADOW_MIDDLE) * + m_pGameInstance->Get_ShadowTransform_Matrix(D3DTS::PROJ, SHADOW::SHADOW_MIDDLE) + ); + + /* Light Buffer Update */ + D3D11_MAPPED_SUBRESOURCE LightSubResource = {}; + if (FAILED(m_pContext->Map(m_pLightInfoBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &LightSubResource))) + { + MSG_BOX("Failed to Map : CVolumetric"); + } + else + { + _uint iCurentLevel = m_pGameInstance->Get_CurrentLevelID(); + + m_iNumLights = min(m_iMaxNumLights, m_pGameInstance->Get_NumLight(iCurentLevel)); + + if (0 != m_iNumLights) + { + + CS_LIGHT_DESC* pDesc = static_cast(LightSubResource.pData); + list* Lights = m_pGameInstance->Get_LightList(iCurentLevel); + + _uint iIndex = 0; + for (auto& Light : *Lights) + { + const LIGHT_DESC* pLihgtDesc = Light->Get_LightDesc(); + memcpy(&pDesc[iIndex].vDiffuse, &pLihgtDesc->vDiffuse, sizeof(_float4)); + if(LIGHT::DIRECTIONAL != pLihgtDesc->eType) + { + memcpy(&pDesc[iIndex].vPosition, pLihgtDesc->pPosition, sizeof(_float3)); + ZeroMemory(&pDesc[iIndex].vDirection, sizeof(_float3)); + } + else + memcpy(&pDesc[iIndex].vDirection , pLihgtDesc->pDirection, sizeof(_float4)); + + pDesc[iIndex].fRange = pLihgtDesc->fRange; + ++iIndex; + if (m_iMaxNumLights <= iIndex) + break; + } + } + + m_pContext->Unmap(m_pLightInfoBuffer, 0); + } + + + /* Constannt Buffer Update */ D3D11_MAPPED_SUBRESOURCE ConstantSubResource = {}; if (FAILED(m_pContext->Map(m_pConstantBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &ConstantSubResource))) @@ -74,10 +127,13 @@ void CVolumetric::Cumpute_Volume() XMStoreFloat4x4(&pDesc->InvProjMatrix, m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ_INV)); XMStoreFloat4x4(&pDesc->InvViewMatrix, m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW_INV)); + XMStoreFloat4x4(&pDesc->ShadowViewMatrix, XMLoadFloat4x4(&m_ShadowViewMatrix)); + XMStoreFloat4x4(&pDesc->ShadowViewProjMatrix, XMLoadFloat4x4(&m_ShadowViewProjMatrix)); + pDesc->fAsymmetryParameter = m_fAsymmetryParameter; - pDesc->padding0 = 0.f; - pDesc->padding1 = 0.f; - pDesc->padding2 = 0.f; + pDesc->iNumLight = m_iNumLights; + pDesc->fHeightOffset = m_fHieghtOffset; + pDesc->fBaseHeight = m_fBaseHeight; m_pContext->Unmap(m_pConstantBuffer, 0); } @@ -88,6 +144,15 @@ void CVolumetric::Cumpute_Volume() //SRV, UAV 바인딩 m_pContext->CSSetUnorderedAccessViews(0, 1, &m_pVolumeUAV, nullptr); + m_pContext->CSSetShaderResources(0, 1, &m_pLightInfoSRV); + + // Sampler 바인딩 + m_pContext->CSSetSamplers(0, 1, &m_pSamplerState); + + // 쉐도우 맵 바인딩 + ID3D11ShaderResourceView* ShadowSRV[1] = { m_pGameInstance->Get_RenderTarget_SRV(TEXT("Target_Shadow_Middle")) }; + m_pContext->CSSetShaderResources(1, 1, ShadowSRV); + m_pContext->CSSetShaderResources(2, 1, &m_pNoiseTexture); //컴퓨트 쉐이더 실행 XMUINT3 vGroupCount = { (160 + 7) / 8, (90 + 7) / 8, (128 + 3) / 4 }; @@ -169,6 +234,9 @@ void CVolumetric::Free() SAFE_RELEASE(m_pConstantBuffer); SAFE_RELEASE(m_pLightInfoBuffer); + SAFE_RELEASE(m_pLightInfoSRV); + SAFE_RELEASE(m_pSamplerState); + SAFE_RELEASE(m_pNoiseTexture); SAFE_RELEASE(m_pAccVolumeUAV); SAFE_RELEASE(m_pAccVolumeSRV); @@ -193,10 +261,12 @@ void CVolumetric::Describe_Entity() _bool open = true; GUI::Begin("SYSTEM", &open, IMGUI_GLOBAL_BEGIN_FLAG); if (GUI::CollapsingHeader("VOLUMETRIC")) { - GUI::SliderFloat("Density", &m_fDensity,0.01f, 5.f); - GUI::SliderFloat("LightIntensity", &m_fLightIntensity, 0.01f, 5.f); - GUI::SliderFloat("AsymmetryParameter", &m_fAsymmetryParameter, 0.01f, 5.f); + GUI::SliderFloat("Density", &m_fDensity,0.001f, 5.f); + GUI::SliderFloat("LightIntensity", &m_fLightIntensity, 0.01f, 0.5f, "%.4f"); + GUI::SliderFloat("AsymmetryParameter", &m_fAsymmetryParameter, -0.9f, 0.9f, "%.4f"); GUI::SliderFloat("DepthPackExponent", &m_fDepthPackExponent, 0.01f, 5.f); + GUI::SliderFloat("HieghtOffset", &m_fHieghtOffset, 0.f, 1.f, "%.5f"); + GUI::InputFloat("BaseHeight", &m_fBaseHeight, 0.1f, 1.f); } GUI::End(); @@ -268,8 +338,6 @@ HRESULT CVolumetric::CreateBuffers() cbDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; cbDesc.ByteWidth = sizeof(CS_VOLUME_CONSTANT_DESC); - D3D11_SUBRESOURCE_DATA CBInitialDesc = {}; - if (FAILED(m_pDevice->CreateBuffer(&cbDesc, nullptr, &m_pConstantBuffer))) return E_FAIL; @@ -304,13 +372,26 @@ HRESULT CVolumetric::CreateBuffers() XMStoreFloat4x4(&pDesc->InvViewMatrix, m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW_INV)); pDesc->fAsymmetryParameter = 0.0f; - pDesc->padding0 = 0.f; - pDesc->padding1 = 0.f; - pDesc->padding2 = 0.f; + pDesc->iNumLight = 0; + pDesc->fHeightOffset = 0.f; + pDesc->fBaseHeight = 0.f; m_pContext->Unmap(m_pConstantBuffer, 0); } + + // 라이트 정보 버퍼 생성 + D3D11_BUFFER_DESC cbLIghtDesc = {}; + cbLIghtDesc.Usage = D3D11_USAGE_DYNAMIC; + cbLIghtDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE; + cbLIghtDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; + cbLIghtDesc.ByteWidth = sizeof(CS_LIGHT_DESC) * m_iMaxNumLights; + cbLIghtDesc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED; + cbLIghtDesc.StructureByteStride = sizeof(CS_LIGHT_DESC); + + if (FAILED(m_pDevice->CreateBuffer(&cbLIghtDesc, nullptr, &m_pLightInfoBuffer))) + return E_FAIL; + return S_OK; } @@ -358,6 +439,48 @@ HRESULT CVolumetric::CreateResourceViews() if (FAILED(m_pDevice->CreateUnorderedAccessView(m_pAccumulateTexture3D, &UAV_Decs, &m_pAccVolumeUAV))) return E_FAIL; + // Light Info SRV + D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc = {}; + srvDesc.Format = DXGI_FORMAT_UNKNOWN; + srvDesc.ViewDimension = D3D_SRV_DIMENSION_BUFFER; + srvDesc.Buffer.FirstElement = 0; + srvDesc.Buffer.NumElements = m_iMaxNumLights; + + if (FAILED(m_pDevice->CreateShaderResourceView(m_pLightInfoBuffer, &srvDesc, &m_pLightInfoSRV))) + return E_FAIL; + + + // Noise Texture SRV + + if(FAILED(CreateDDSTextureFromFile(m_pDevice, + TEXT("C:/MeshTable/Game/Environment/MasterMaterials/BaseTextures/Noise/T_PerlinNoise.dds"), + nullptr, + &m_pNoiseTexture + ))) + { + assert(false); + return E_FAIL; + } + + return S_OK; +} + +HRESULT CVolumetric::Create_SamplerState() +{ + D3D11_SAMPLER_DESC desc = {}; + desc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR; + + desc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP; + desc.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP; + desc.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP; + desc.MinLOD = 0.0f; + desc.MaxLOD = D3D11_FLOAT32_MAX; + if (FAILED(m_pDevice->CreateSamplerState(&desc, &m_pSamplerState))) + { + assert(false); + return E_FAIL; + } + return S_OK; } diff --git a/Jusin154_Team3D/Engine/Public/Bone.h b/Jusin154_Team3D/Engine/Public/Bone.h index 83c6f4236..4f57e7e3a 100644 --- a/Jusin154_Team3D/Engine/Public/Bone.h +++ b/Jusin154_Team3D/Engine/Public/Bone.h @@ -11,18 +11,12 @@ class ENGINE_DLL CBone final : public CBase CBone(const CBone& other); virtual ~CBone() = default; public: - _matrix Get_CombinedTransformationMatrix() const { - return XMLoadFloat4x4(&m_CombinedTransformationMatrix); - } - _float4x4* Get_CombinedTransformationMatrixPtr() { - return &m_CombinedTransformationMatrix; - } - void Set_CombinedTransformationMatrixPtr(_matrix& newMatrix) { - return XMStoreFloat4x4(&m_CombinedTransformationMatrix, newMatrix); - } - _bool Compare_Name(const _char* pBoneName) const { - return !strcmp(pBoneName, m_strName.c_str()); - } + _matrix Get_CombinedTransformationMatrix() const { return XMLoadFloat4x4(&m_CombinedTransformationMatrix); } + _float4x4* Get_CombinedTransformationMatrixPtr() { return &m_CombinedTransformationMatrix; } + _float4x4* Get_TransformationMatrixPtr() { return &m_TransformationMatrix; }; + + void Set_CombinedTransformationMatrix(_fmatrix newMatrix) { return XMStoreFloat4x4(&m_CombinedTransformationMatrix, newMatrix); } + _bool Compare_Name(const _char* pBoneName) const { return !strcmp(pBoneName, m_strName.c_str()); } void Get_KeyFrame(KEYFRAME& kf, _bool bIsCurrentFrame); // 현재 본의 로컬매트릭스를 캡쳐해서 키프레임으로 성분 분해하여 올려보낸다. const _char* Get_Name() const { return m_strName.c_str(); } _float3 Get_LocalPosition(); diff --git a/Jusin154_Team3D/Engine/Public/CallBack_QueryFilterCallback.h b/Jusin154_Team3D/Engine/Public/CallBack_QueryFilterCallback.h index 4cf8bdf97..520078614 100644 --- a/Jusin154_Team3D/Engine/Public/CallBack_QueryFilterCallback.h +++ b/Jusin154_Team3D/Engine/Public/CallBack_QueryFilterCallback.h @@ -9,12 +9,30 @@ class CPhysX_CctQueryFilterCallback final : public PSX::PxQueryFilterCallback { if (actor != nullptr && actor->userData != nullptr) { - PhsXUserData* physxUserData = (PhsXUserData*)actor->userData; + PHYSX_USERDATA* physxUserData = (PHYSX_USERDATA*)actor->userData; if (physxUserData->eKind == PHYSX_KIND::BODY_DYNAMIC) { - if (PXOBJECT(physxUserData->iSubKind) == PXOBJECT::SKILL_PROTEGO) + switch (PXOBJECT(physxUserData->iSubKind)) + { + case PXOBJECT::LEG: return PSX::PxQueryHitType::eNONE; + break; + case PXOBJECT::SKILL_PROTEGO: + return PSX::PxQueryHitType::eNONE; + break; + case PXOBJECT::GOBLIN_PROTEGO: + return PSX::PxQueryHitType::eNONE; + break; + case PXOBJECT::JOINT_ROUTE: + return PSX::PxQueryHitType::eNONE; + break; + case PXOBJECT::JOINT_ANCHOR: + return PSX::PxQueryHitType::eNONE; + break; + default: + break; + } } } diff --git a/Jusin154_Team3D/Engine/Public/Character_Controller.h b/Jusin154_Team3D/Engine/Public/Character_Controller.h index 872129d95..08118b0ba 100644 --- a/Jusin154_Team3D/Engine/Public/Character_Controller.h +++ b/Jusin154_Team3D/Engine/Public/Character_Controller.h @@ -14,7 +14,7 @@ class ENGINE_DLL CCharacter_Controller final : /* dev-treadmill.tistory.com/159 */ // 기본적으로 아무 힘도 받지 않는, 주지 않는 놈임 // kinematic 기반임 - static CPhysX_CctQueryFilterCallback s_QueryFilterCallback_IGNORE_Shield; + static CPhysX_CctQueryFilterCallback s_QueryFilterCallback_IGNORE_GLOBAL; public: #pragma region STRUCT typedef struct tagCharacter_ControllerDesc @@ -93,7 +93,7 @@ class ENGINE_DLL CCharacter_Controller final : _float m_fCurrentSlopeDegree = { 0.f }; _int m_iIsOnGround = { 0 }; _float4 m_vAccHeight = { 0.f, 0.16f, 0.f, 0.01f }; - PhsXUserData m_tagData = {}; + PHYSX_USERDATA m_tagData = {}; PSX::PxControllerCollisionFlags m_eBeforeCollisionFlags = {}; _bool m_bActive = { true }; diff --git a/Jusin154_Team3D/Engine/Public/Dynamic_D6Joint.h b/Jusin154_Team3D/Engine/Public/Dynamic_D6Joint.h new file mode 100644 index 000000000..6fbd85016 --- /dev/null +++ b/Jusin154_Team3D/Engine/Public/Dynamic_D6Joint.h @@ -0,0 +1,51 @@ +#pragma once +#include "Component.h" + +NS_BEGIN(Engine) +class CTransform; +class CMesh; + +class ENGINE_DLL CDynamic_D6Joint final : public CComponent +{ +public: + typedef struct tagDynamicJointDesc { + PHYSX_JOINT eType; + PSX::PxRigidDynamic* pActor0; + PSX::PxRigidDynamic* pActor1; + const PSX::PxTransform* pxJointWorldPos; + }DYNAMICJOINT_DESC; +private: + CDynamic_D6Joint(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CDynamic_D6Joint(const CDynamic_D6Joint& rhs); + ~CDynamic_D6Joint() = default; + +public: +#ifdef _DEBUG + virtual HRESULT Render()override; +#endif // _DEBUG + PSX::PxD6Joint* Get_JointPtr() { return m_pJoint; }; +private: + PSX::PxD6Joint* m_pJoint = { nullptr }; + +#ifdef _DEBUG + unique_ptr m_pMainShape = { nullptr }; +#endif // _DEBUG + +private: + HRESULT Initialize_Prototype(); + virtual HRESULT Initialize(void* pArg) override; + +#ifdef _DEBUG + HRESULT Add_DebugShape(); +#endif + +public: + static CDynamic_D6Joint* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CComponent* Clone(void* pArg, class CGameObject* pOwner = nullptr) override; + virtual void Free() override; +#ifdef _DEBUG + virtual void Describe_Entity() override; +#endif // _DEBUG +}; + +NS_END diff --git a/Jusin154_Team3D/Engine/Public/Engine_Enum.h b/Jusin154_Team3D/Engine/Public/Engine_Enum.h index 422570c33..9cab65c86 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Enum.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Enum.h @@ -8,7 +8,7 @@ enum class COLLIDER { AABB, OBB, SPHERE, END }; enum class RENDER {PRIORITY, SHADOW_NEAR, NONBLEND, DECAL, BLUR, NONLIGHT, EFFECT ,BLEND, BLOOM, DISTORTION, BULR_MESH ,UI, OCCLUSION, SHADOW_MIDDLE, PRESHADOW, UI_OVERLAY ,END }; enum class RAY { LOCAL, WORLD, END }; enum class ACTOR { BOX, CAPSULE, SPHERE, PLANE, TRIANGLEMESH, HEIGHTFIELD, END }; -enum class BLEND_BONE{SPINE,SHOULDER_L,SHOULDER_R,NECK,SHOULDER_NECK_L, SHOULDER_NECK_R,END}; +enum class BLEND_BONE{SPINE,SHOULDER_L,SHOULDER_R,NECK,SHOULDER_NECK_L, SHOULDER_NECK_R,HEAD, HIPS_CLOTH, END}; enum class STAT { NAME, CURRENTHP, MAXHP, TARGETHP, MELEE, MAGIC, DEFENSE, SPEED, AGILITY, LEVEL, EXPERIENCE, MAX_EXPERIENCE, GOLD, END }; //enum class CONDITION { POISON, HPREGENERATION, PANIC, GRAP, END }; enum class SHADOW : _ubyte { @@ -118,9 +118,17 @@ enum class PHYSX_KIND { OBSTACLEActor, }; +enum class PHYSX_JOINT { + D6, + DISTANCE, + REVOLUTE, + END +}; + enum class PXOBJECT : _uint { #pragma region NOT_DEFINE - NOT_DEFINE = 000, + NOT_DEFINE = 0, + LEG, #pragma endregion #pragma region PLAYER PLAYER = 10, @@ -144,13 +152,7 @@ enum class PXOBJECT : _uint { GOBLIN_SHIELD_BREAK_MAGIC, GOBLIN_NORMAL_MAGIC, TROLL_GROUND_STRIKE, - - /* - * _int iKind; - * if (iKind > 100 && iKind < 200){ - * dammage - */ - + GOBLIN_PROTEGO, #pragma endregion #pragma region ALLY_HITBOX ALLY_HITBOX = 200, @@ -216,6 +218,8 @@ enum class PXOBJECT : _uint { #pragma region NOCOLLIDE NOCOLLIDE = 900, GAIL, + JOINT_ROUTE, + JOINT_ANCHOR, #pragma endregion END = 999 @@ -223,7 +227,7 @@ enum class PXOBJECT : _uint { enum class HIT_TYPE : _ubyte { - HIT_NONE = 0, + HIT_NONE = 0, // 히트모션 없음 HIT_PROJECTILE = 1 << 0, // 발사체 HIT_MEDIUM = 1 << 1, // 적당한 공격 HIT_HEAVY = 1 << 2, // 강공격 diff --git a/Jusin154_Team3D/Engine/Public/Engine_Function.h b/Jusin154_Team3D/Engine/Public/Engine_Function.h index 64086a61a..345bfeaee 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Function.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Function.h @@ -47,7 +47,7 @@ unsigned long Safe_Release(T& pInstance) return dwRefCnt; } -static PSX::PxTransform XMWorldToPx_NoScale(const _fmatrix& WorldMatrix) +static PSX::PxTransform XMWorldToPx_NoScaleNoFlip(const _fmatrix& WorldMatrix) { _vector vPos, vRotq, vScale; XMMatrixDecompose(&vScale, &vRotq, &vPos, WorldMatrix); @@ -60,6 +60,8 @@ static PSX::PxTransform XMWorldToPx_NoScale(const _fmatrix& WorldMatrix) return out; } + + static void GUIHelpMarker(const char* desc) { GUI::SameLine(); diff --git a/Jusin154_Team3D/Engine/Public/Engine_Macro.h b/Jusin154_Team3D/Engine/Public/Engine_Macro.h index b4c869e2e..0b13bccea 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Macro.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Macro.h @@ -98,6 +98,7 @@ #define CS_INSTANCE_MODEL TEXT("CS_INSTANCE_MODEL") #define CS_MODEL TEXT("CS_MODEL") #define CS_LOCAL TEXT("CS_LOCAL") +#define CS_BONEINSERT TEXT("CS_BONEINSERT") #define SAFE_ADDREF(pInstance) Safe_AddRef(pInstance) diff --git a/Jusin154_Team3D/Engine/Public/Engine_Struct.h b/Jusin154_Team3D/Engine/Public/Engine_Struct.h index 16e48c4b0..e9528790d 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Struct.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Struct.h @@ -373,9 +373,10 @@ typedef struct tagVertexInstance_UIDesc }VTX_POSTEX_INSTANCE_UI; -typedef struct tagPhsXUserData { +typedef struct tagPHYSX_USERDATA { PHYSX_KIND eKind = PHYSX_KIND::NOT_DEFINED; + _bool bAutoOwnerTranslation = true; class CGameObject* pOwner = { nullptr }; _float4x4 BeforeMatrix = { }; @@ -387,7 +388,11 @@ typedef struct tagPhsXUserData { class CObstacle_Controller* pObstacle = { nullptr }; }; -}PhsXUserData; +}PHYSX_USERDATA; + +typedef struct tagD6JointDesc { + +}PHYSX_JOINT_D6Desc; typedef struct tagOnCollsionInfo { diff --git a/Jusin154_Team3D/Engine/Public/FSM.h b/Jusin154_Team3D/Engine/Public/FSM.h index 0ca39ed21..d9f1b646b 100644 --- a/Jusin154_Team3D/Engine/Public/FSM.h +++ b/Jusin154_Team3D/Engine/Public/FSM.h @@ -53,6 +53,8 @@ enum ESTATE : _u64Flag SWIPE = 1ULL << 46, SLIDE = 1ULL << 47, FALL = 1ULL << 48, + SLASH = 1ULL << 49, + DASH = 1ULL << 50, END }; NS_END diff --git a/Jusin154_Team3D/Engine/Public/GameInstance.h b/Jusin154_Team3D/Engine/Public/GameInstance.h index 7ffe06d36..ca2940a6a 100644 --- a/Jusin154_Team3D/Engine/Public/GameInstance.h +++ b/Jusin154_Team3D/Engine/Public/GameInstance.h @@ -94,7 +94,7 @@ class ENGINE_DLL CGameInstance final : public CBase } return hr; } - void Set_LayerEnabled(_bool isEnable); + class CLayer* Get_Layer(_uint iLayerLevelIndex, const _wstring& strLayerTag); void Clear_Objects_With_Layers(_uint iLevelIndex); @@ -136,6 +136,7 @@ class ENGINE_DLL CGameInstance final : public CBase void Set_Transform(D3DTS eState, _fmatrix TransformStateMatrix); const _float4x4* Get_Transform_Float4x4(D3DTS eState); _matrix Get_Transform_Matrix(D3DTS eState); + _matrix Get_ShadowTransform_Matrix(D3DTS eState, SHADOW eShadowType); const _float4* Get_CamPosition(); const _vector Get_CamXMPosition(); void Transform_Frustum_ToLocalSpace(_fmatrix WorldMatrixInverse); @@ -151,6 +152,8 @@ class ENGINE_DLL CGameInstance final : public CBase HRESULT Bind_Shadow_Resource(class CShader* pShader, const _char* pConstantName, D3DTS eType, SHADOW eShadowType) const; const _float4x4* Get_ShadowMatricesPtr(_uint iShadowBoxIndex); _float Get_ShadowBoxFar(_uint iShadowBoxIndex); + HRESULT Begin_OutLine_Write(_uint iDSSMask); + HRESULT End_OutLine_Write(); #pragma endregion #pragma region LIGHT_MANAGER void Add_Light(_uint _iCurrentLevel, class CLight* _pLight); @@ -158,6 +161,8 @@ class ENGINE_DLL CGameInstance final : public CBase void Delete_Light(_uint _iCurrentLevel, class CLight* _pLight); const LIGHT_DESC* Get_Light_Info(_uint _iCurrentLevel, _uint _iLightIndex); HRESULT Render_Lights(_uint _iCurrentLevel, class CShader* pShader, class CVIBuffer* pVIBuffer); + list* Get_LightList(_uint _iCurrentLevel); + _uint Get_NumLight(_uint _iCurrentLevel); #pragma endregion #pragma region COLLIDER_MANAGER HRESULT Add_ColliderGroup(_uint iColliderGroup, class CCollider* pBounding); @@ -183,6 +188,7 @@ class ENGINE_DLL CGameInstance final : public CBase HRESULT Finish_RenderTarget(class CVIBuffer_Rect* pVIBuffer, class CShader* pShader, const _wstring& wstrRenderTargetOriginal, const _wstring& wstrRenderTargetBloomed, SHADER_PASS_DEFERRED ePass); HRESULT Bind_CS_RenderTarget(_uint iIndex, const _wstring& strTargetTag); HRESULT Clear_RenderTarget(const _wstring& strRenderTargetKey); + ID3D11ShaderResourceView* Get_RenderTarget_SRV(const _wstring& strRenderTargetKey); #ifdef _DEBUG void RenderTarget_Debuger(); HRESULT Render_RenderTarget_Debug(class CShader* pShader, class CVIBuffer_Rect* pVIBuffer); @@ -212,7 +218,8 @@ class ENGINE_DLL CGameInstance final : public CBase void RegistHeight(const _tchar* pName, PSX::PxHeightFieldDesc& Desc, _uint iLevel); PSX::PxRigidDynamic* Add_DynamicActor(CRigidBody_Dynamic& RigidBody, _uint iLevel); PSX::PxRigidStatic* Add_StaticActor(CRigidBody_Static& RigidBody, _uint iLevel); - PSX::PxRevoluteJoint* Create_PxRevoluteJoint(PSX::PxRigidActor* pActorFrame, PSX::PxTransform& pxLocalWallFrame, PSX::PxRigidActor* pActorObject, PSX::PxTransform& pxLocalActorFrame, _uint iLevel); + PSX::PxJoint* Create_PxJoint(PHYSX_JOINT eType, PSX::PxRigidActor* pActor0, PSX::PxTransform& pxLocalFrame0, PSX::PxRigidActor* pActor1, PSX::PxTransform& pxLocalFrame1); + PSX::PxD6Joint* Create_PxD6Joint(PSX::PxRigidDynamic* pActor0, PSX::PxRigidDynamic* pActor1, const PSX::PxTransform& pxJointWorldPos); _bool SphereCast(_float fRadius, _float3 vStartPos, _float3 vDir, _float fDistance, PSX::PxHitFlags flagHitsData, PSX::PxQueryFlags flagQuery, PSX::PxSweepBuffer& hitBuffer); _bool SphereCast(_float fRadius, _fvector vStartPos, _gvector vDir, _float fDistance, PSX::PxHitFlags flagHitsData, PSX::PxQueryFlags flagQuery, PSX::PxSweepBuffer& hitBuffer); @@ -226,12 +233,13 @@ class ENGINE_DLL CGameInstance final : public CBase void Attach_Actor(PSX::PxActor& Actor, _uint iLevel); void Detach_Actor(PSX::PxActor& pActor, _uint iLevel); void Release_Actor(PSX::PxActor& Actor); + void ApplyFilterData(PSX::PxRigidActor* pRigidActor); HRESULT ConvertToTriMeshes(vector& Meshes, vector& pxTriMeshes, _fmatrix WorldMatrix = XMMatrixIdentity()); #ifdef EDITOR_PROJECT HRESULT SaveTriMeshes(const _char* pPath, vector& TriMeshes); #endif // EDITOR_PROJECT HRESULT LoadTriMeshes(const _char* pPath, vector& TriMeshes); // 모델 불러왔던 경로에 그대로 있음 - void Add_Editor_Plane(PhsXUserData& PlaneData); + void Add_Editor_Plane(PHYSX_USERDATA& PlaneData); #pragma endregion #pragma region THREADHOLDER template @@ -270,6 +278,7 @@ class ENGINE_DLL CGameInstance final : public CBase ID3D11ShaderResourceView* Get_VolumeSRV(); _float* Get_DepthPackExponentPtr(); void Setting_Volumetirc(_float fDensity, _float fLightIntensity, _float fAsymmetryParameter, _float fDepthPackExponent); + void Update_Volumetric(); #pragma endregion diff --git a/Jusin154_Team3D/Engine/Public/Light_Manager.h b/Jusin154_Team3D/Engine/Public/Light_Manager.h index 05fcaade6..c9636a915 100644 --- a/Jusin154_Team3D/Engine/Public/Light_Manager.h +++ b/Jusin154_Team3D/Engine/Public/Light_Manager.h @@ -15,7 +15,8 @@ class CLight_Manager final : public CBase void Delete_Light(_uint _iCurrentLevel, class CLight* _pLight); void Light_Clear(_uint _iCurrentLevel); const LIGHT_DESC* Get_Light_Info(_uint _iCurrentLevel ,_uint _iLightIndex); - + list* Get_LightList(_uint _iCurrentLevel) { return &m_Lights[_iCurrentLevel]; } + _uint Get_NumLight(_uint _iCurrentLevel); public: HRESULT Render_Lights(_uint iCurrentLevel, class CShader* pShader, class CVIBuffer* pVIBuffer); diff --git a/Jusin154_Team3D/Engine/Public/Model.h b/Jusin154_Team3D/Engine/Public/Model.h index ad89d1f19..d1d36466f 100644 --- a/Jusin154_Team3D/Engine/Public/Model.h +++ b/Jusin154_Team3D/Engine/Public/Model.h @@ -20,12 +20,28 @@ class ENGINE_DLL CModel final : public CComponent _float BlendRatio; _int RootBoneIndex; - _float3 padding; + _int PlayHeadBone; + _int HeadBoneIndex; + _float HeadAimWeight; + + _int SkipCount; + _int padding0; + _int padding1; + _int padding2; + + _float3 TargetDir_Local; + _float padding3; _float4x4 PreTransformMatrix; _float4 RootInitRot; }ANIMSTATE_DESC; + typedef struct tagBoneInsertionDesc { + _uint iStartOffset; + _uint iMatrixCount; + _uint iPad0; + _uint iPad1; + }BONEINSERTION_DESC; private: @@ -43,6 +59,12 @@ class ENGINE_DLL CModel final : public CComponent virtual HRESULT Render_Indexed(_uint iMeshIndex, _uint IndexCount, _uint StartIndexLocation, _uint BaseVertexLocation); MODEL Get_Type() { return m_eType; } void Set_Temp(_bool Temp) { m_bTemp = Temp; } + void Set_TargetPos(_vector vTargetPos) { m_vTargetPos = vTargetPos; } + void Set_HeadPos(_vector vHeadPos) { m_vHeadPos = vHeadPos; } + void Play_HeadBone(_bool bPlay) { m_bHeadBone = bPlay; } + void Set_HeadAimWeight(_float fWeight) { m_fHeadAimWeight = fWeight; } + _bool Get_PlayHeadBone() const { return m_bHeadBone; } + _int Get_SkipBoneIndex(_int Index) { return m_SkipBoneindex[Index]; } #pragma endregion #pragma region Animation _bool Play_Animation(_float fTimeDelta, class CTransform* pTransform = nullptr); // 애니메이션에 델타타임을 넣어줌 @@ -77,34 +99,40 @@ class ENGINE_DLL CModel final : public CComponent void Update_RootBone(_float Amount = 1.f); void Initialize_RootBone(); vector<_float4x4> Get_OffsetMatrix(_int iIndex); + void Apply_CPU_HeadAim(); void Apply_CPUMask_ToBones(); void Mark_CPUChain(_int boneIdx); #pragma endregion #pragma region Bone HRESULT Bind_BoneMatrices(_uint iMeshIndex, class CShader* pShader, const _char* pConstantName); const _float4x4* Get_BoneMatrixPtr(const _char* pBoneName); + _matrix Get_BoneMatrix(const _char* pBoneName); _matrix Get_BoneMatrix(const _char* pBoneName) const; + const _float4x4* Get_BoneLocalMatrixPtr(const _char* pBoneName); _matrix Get_BoneLocalMatrix(const _char* pBoneName) const; static _int Get_BoneIndex(const _char* pBoneName, vector Bones); // 본의 벡터와 이름을 넘겨주면 인덱스를 넘겨줌 ( n 순회 ) _int Get_BoneIndex(const _char* pBoneName) const; _matrix Get_BoneMatrix(_uint iBoneIndex); void Combined_BoneMatrix(); + void Combined_BoneMatrix(_int iStartBoneIndex, _uint iBoneCount); _int Find_BoneIndex(const _char* pBoneName); + HRESULT Set_BoneCombinedTransformation(const _char* pBoneName, _fmatrix newTransformation); #pragma endregion #pragma region Material HRESULT Bind_Material(_uint iMeshIndex, class CShader* pShader); - HRESULT Begin(_uint iMeshIndex, class CShader* pShader, _bool OutLine = false); + HRESULT Begin(_uint iMeshIndex, class CShader* pShader); #pragma endregion - void ComputeAnimation(_uint AnimIndex, _uint MeshIndex); - void ComputeLocal(_uint AnimIndex, _uint MeshIndex); - void Bind_OutPut_SRV_VS(_uint iIndex, _uint iBufferIndex); - void Bind_OutPut_SRV_VS_Prev(_uint iIndex, _uint iBufferIndex); - void ComputeAnimation_Second(_uint AnimIndex); - void InItialize_BoneIndex(); + void ComputeAnimation(_uint AnimIndex, _uint MeshIndex); + void ComputeLocal(_uint AnimIndex, _uint MeshIndex); + void ComputeInsertionBoneBuffer(BONEINSERTION_DESC& CBDesc, ID3D11ShaderResourceView* pSRV); + void Bind_OutPut_SRV_VS(_uint iIndex, _uint iBufferIndex); + void Bind_OutPut_SRV_VS_Prev(_uint iIndex, _uint iBufferIndex); + void ComputeAnimation_Second(_uint AnimIndex); + void InItialize_BoneIndex(); - void Initialize_BoneMasks(); + void Initialize_BoneMasks(); public: HRESULT Ready_PhysXMeshes(_fmatrix& PreTransformMatrix, _uint iLevel); @@ -164,7 +192,7 @@ class ENGINE_DLL CModel final : public CComponent _float m_fRatio = {}; _int m_iCurrSecondAnimIndex = { -1 }; - _int m_iBoneIndex[ENUM_CLASS(BLEND_BONE::END)] = { -1,-1,-1,-1,-1,-1 }; + _int m_iBoneIndex[ENUM_CLASS(BLEND_BONE::END)] = { -1,-1,-1,-1,-1,-1,-1,-1 }; vector> m_BoneMask; vector<_bool> m_CPUBoneMask; @@ -185,16 +213,22 @@ class ENGINE_DLL CModel final : public CComponent _int m_iIndexAnimPlayableMesh = { -1 }; _vector m_vector[3]; - vector<_uint> m_iBoneMask; - _bool m_bInitialRootPos = { false }; - _bool m_bInitialRootRotSaved = { false }; - _bool m_bLoopRestarted = false; - _bool m_bIsSecondFinishedAnim = { false }; - _bool m_bIsSecondLoop = { false }; - _bool m_bRatio = { false }; - _bool m_bRootBone = {}; - _float4x4 m_RootMatrix = {}; - _bool m_bTemp = {false}; + vector<_uint> m_iBoneMask; + _bool m_bInitialRootPos = { false }; + _bool m_bInitialRootRotSaved = { false }; + _bool m_bLoopRestarted = false; + _bool m_bIsSecondFinishedAnim = { false }; + _bool m_bIsSecondLoop = { false }; + _bool m_bRatio = { false }; + _bool m_bRootBone = {}; + _float4x4 m_RootMatrix = {}; + _bool m_bTemp = {false}; + _vector m_vTargetPos = XMVectorZero(); + _vector m_vHeadPos = XMVectorZero(); + _bool m_bHeadBone = { false }; + _float m_fHeadAimWeight = { 0.f }; + _int m_iSkipBoneCount = {}; + vector<_int> m_SkipBoneindex = {}; private: @@ -209,8 +243,10 @@ class ENGINE_DLL CModel final : public CComponent private: HRESULT Create_ComputeShader(); HRESULT Create_ComputeShaderLocal(); + HRESULT Create_ComputeShaderBoneInsertion(); HRESULT Create_ParentVB(); HRESULT Create_BoneLocalVB(); + HRESULT Create_SkipBoneVB(); HRESULT Create_Temp(); HRESULT Create_BoneMatrixVB(); HRESULT Create_Const(); @@ -219,31 +255,33 @@ class ENGINE_DLL CModel final : public CComponent HRESULT Create_Local(); - _uint m_iNumBuffer = {}; + _uint m_iNumBuffer = {}; - vector<_int> m_Parent = {}; + vector<_int> m_Parent = {}; vector<_float4x4> m_BoneLocal = {}; vector m_AnimRanges; - vector<_float4x4> m_BoneMatrixCPU; class CComputeShader* m_pComputeShader = nullptr; class CComputeShader* m_pCS_AnimLocal = nullptr; + class CComputeShader* m_pCS_BoneInsertion = nullptr; ID3D11Buffer* m_pConstantBuffer = { nullptr }; ID3D11Buffer* m_pParentBuffer = { nullptr }; ID3D11Buffer* m_pBoneMatrixBuffer = { nullptr }; ID3D11Buffer* m_pPrevBoneMatrixBuffer = { nullptr }; ID3D11Buffer* m_pBoneLocalBuffer = { nullptr }; + ID3D11Buffer* m_pSkipBoneBuffer = { nullptr }; ID3D11Buffer* m_pLocalMatrixBuffer = { nullptr }; - + ID3D11Buffer* m_pInsertionCB = { nullptr }; ID3D11ShaderResourceView* m_pParentSRV = { nullptr }; ID3D11ShaderResourceView* m_pBoneLocalSRV = { nullptr }; ID3D11ShaderResourceView* m_pBoneMatrixSRV = { nullptr }; ID3D11ShaderResourceView* m_pPrevBoneMatrixSRV = { nullptr }; ID3D11ShaderResourceView* m_pLocalMatrixSRV = { nullptr }; + ID3D11ShaderResourceView* m_pSkipBoneSRV = { nullptr }; ID3D11UnorderedAccessView* m_pBoneMatrixUAV = { nullptr }; ID3D11UnorderedAccessView* m_pLocalMatrixUAV = { nullptr }; diff --git a/Jusin154_Team3D/Engine/Public/MyTools.h b/Jusin154_Team3D/Engine/Public/MyTools.h index f9732bda1..c47ac63bd 100644 --- a/Jusin154_Team3D/Engine/Public/MyTools.h +++ b/Jusin154_Team3D/Engine/Public/MyTools.h @@ -11,35 +11,35 @@ class CMyTools { #pragma region Color // [(255, 255, 255, xx), alpha] -> [(0~1, 0~1, 0~1, alpha)] // 0xRRGGBBxx, alpha -> _float4( 0~1, 0~1, 0~1, alpha ) - static _float4 ColorRGB_A_HEXtoFLOAT4(_uint hexCode, _float alpha) { + inline static _float4 ColorRGB_A_HEXtoFLOAT4(_uint hexCode, _float alpha) { float r, g, b, a; DecodeRGBA(hexCode, r, g, b, a, false); a = alpha; return _float4(r, g, b, a); } // [(255, 255, 255, 255)] -> [(0~1, 0~1, 0~1, 0~1)] // 0xRRGGBBAA -> _float4( 0~1, 0~1, 0~1, 0~1 ) - static _float4 ColorRGBA_HEXtoFLOAT4(_uint hexCode) { + inline static _float4 ColorRGBA_HEXtoFLOAT4(_uint hexCode) { float r, g, b, a; DecodeRGBA(hexCode, r, g, b, a, true); return _float4(r, g, b, a); } // [(255, 255, 255, xx), alpha] -> [(0~1, 0~1, 0~1, alpha)] // 0xRRGGBBxx, alpha -> _vector( 0~1, 0~1, 0~1, alpha ) - static _vector ColorRGB_A_HEXtoVECTOR(_uint hexCode, _float alpha) { + inline static _vector ColorRGB_A_HEXtoVECTOR(_uint hexCode, _float alpha) { float r, g, b, a; DecodeRGBA(hexCode, r, g, b, a, false); a = alpha; return XMVectorSet(r, g, b, a); } // [(255, 255, 255, 255)] -> [(0~1, 0~1, 0~1, 0~1)] // 0xRRGGBBAA -> _vector( 0~1, 0~1, 0~1, 0~1 ) - static _vector ColorRGBA_HEXtoVECTOR(_uint hexCode) { + inline static _vector ColorRGBA_HEXtoVECTOR(_uint hexCode) { float r, g, b, a; DecodeRGBA(hexCode, r, g, b, a, true); return XMVectorSet(r, g, b, a); } #pragma endregion #pragma region String // wstring --> string 변환 - static _string ToString(const _wstring& var) + inline static _string ToString(const _wstring& var) { int size_needed = WideCharToMultiByte(CP_UTF8, 0, var.c_str(), (int)var.size(), nullptr, 0, nullptr, nullptr); @@ -52,7 +52,7 @@ class CMyTools { } // string --> wstring 변환 - static _wstring ToWstring(const _string& var) + inline static _wstring ToWstring(const _string& var) { int size_needed = MultiByteToWideChar(CP_UTF8, 0, var.c_str(), (int)var.size(), nullptr, 0); @@ -65,7 +65,7 @@ class CMyTools { } // source에 keyword가 있는지 검사 - static _bool ContainsString(const char* source, const char* keyword) { + inline static _bool ContainsString(const char* source, const char* keyword) { if (!source || !keyword || *keyword == '\0') { return false; } @@ -75,13 +75,13 @@ class CMyTools { #pragma endregion #pragma region Mathematics // ratio로 현재 value 가져오기 - static _float Lerp_f1D(_float fA, _float fB, _float fRatio) + inline static _float Lerp_f1D(_float fA, _float fB, _float fRatio) { return fA + (fB - fA) * fRatio; } // value로 현재 ratio 가져오기 - static _float InverseLerp_f1D(_float fA, _float fB, _float fValue) + inline static _float InverseLerp_f1D(_float fA, _float fB, _float fValue) { if (fA == fB) { return 0.0f; @@ -101,7 +101,7 @@ class CMyTools { } // dx9에 있던 IntersectTri - static _bool IntersectTri( + inline static _bool IntersectTri( const _fvector& vPos, const _fvector& vDir, const _fvector& vertexA, const _gvector& vertexB, const _hvector& vertexC, _float& t, _float& u, _float& v) @@ -130,17 +130,24 @@ class CMyTools { return t >= 0.f; } - // 매트릭스 럴프 - static void MatrixLerp( _In_ _float4x4* pMatOrigin, // Origin -> 0 + inline static void MatrixLerp( _In_ _float4x4* pMatOrigin, // Origin -> 0 _In_ _float4x4* pMatTarget, // Target -> 1 _Out_ _float4x4& matOut, _float fRatio) { + _matrix matOrigin = XMLoadFloat4x4(pMatOrigin); + _matrix matTarget = XMLoadFloat4x4(pMatTarget); + MatrixLerp(&matOrigin, &matTarget, matOut, fRatio); + } + + inline static void MatrixLerp( _In_ _matrix* pMatOrigin, // Origin -> 0 + _In_ _matrix* pMatTarget, // Target -> 1 + _Out_ _float4x4& matOut, _float fRatio) { fRatio = Saturate(fRatio); _vector vTargetScale{}, vTargetRotq{}, vTargetTrans{}; _vector vOriginScale{}, vOriginRotq{}, vOriginTrans{}; - XMMatrixDecompose(&vTargetScale, &vTargetRotq, &vTargetTrans, XMLoadFloat4x4(pMatTarget)); - XMMatrixDecompose(&vOriginScale, &vOriginRotq, &vOriginTrans, XMLoadFloat4x4(pMatOrigin)); + XMMatrixDecompose(&vTargetScale, &vTargetRotq, &vTargetTrans, *pMatTarget); + XMMatrixDecompose(&vOriginScale, &vOriginRotq, &vOriginTrans, *pMatOrigin); vTargetScale = XMVectorLerp(vOriginScale, vTargetScale, fRatio); vTargetRotq = XMQuaternionSlerp(vOriginRotq, vTargetRotq, fRatio); @@ -150,7 +157,7 @@ class CMyTools { } // 비슷하면 1 직교하면 0 완전 반대방향일수록 -1 - static _float DirectionCompare(_vector a, _vector b) + inline static _float DirectionCompare(_vector a, _vector b) { _vector vNormalA = XMVector3Normalize(a); _vector vNormalB = XMVector3Normalize(b); @@ -158,7 +165,7 @@ class CMyTools { } // hlsl에 있는 Saturate - static _float Saturate(_float fValue) { + inline static _float Saturate(_float fValue) { if (fValue > 1.f) { fValue = 1.f; } @@ -169,7 +176,7 @@ class CMyTools { } // 입력 라디안이 들어오면 -PI ~ +PI로 정규화된 라디안으로 변경 - static _float NormalizeRadian(_float fRadian) + inline static _float NormalizeRadian(_float fRadian) { fRadian = fmodf(fRadian, XM_2PI); if (fRadian <= -XM_PI) { @@ -267,6 +274,40 @@ class CMyTools { vAccumulateRadianPitchYaw.x = -fPitchLimitRadian; } } + static inline _vector MakeQuaternionFromTo(_vector vAOrigin, _vector vBDest) + { + vAOrigin = XMVector3Normalize(vAOrigin); + vBDest = XMVector3Normalize(vBDest); + + _float fDot = XMVectorGetX(XMVector3Dot(vAOrigin, vBDest)); + + if ( 1.f - fDot < FLT_EPSILON) { // 같은 방향 제외 + return XMQuaternionIdentity(); + } + if (fDot < -1.f + FLT_EPSILON) { // 반대방향 제외 + _vector vTempAxis = XMVector3Cross(vAOrigin, XMVectorSet(1.f, 0.f, 0.f, 0.f)); + _float fTempLength = XMVectorGetX(XMVector3Length(vTempAxis)); + + if (fTempLength < FLT_EPSILON5) { + vTempAxis = XMVector3Cross(vAOrigin, XMVectorSet(0.f, 0.f, 1.f, 0.f)); + } + + vTempAxis = XMVector3Normalize(vTempAxis); + return XMQuaternionRotationAxis(vTempAxis, XM_PI); + } + + _vector vRotAxis = XMVector3Cross(vAOrigin, vBDest); + _float fRotLength = XMVectorGetX(XMVector3Length(vRotAxis)); + if (fRotLength < FLT_EPSILON5) { + return XMQuaternionIdentity(); + } + vRotAxis = XMVector3Normalize(vRotAxis); + + _float fRotAngle = acosf(clamp(fDot, -1.f, 1.f)); + _vector vRotQ = XMQuaternionRotationAxis(vRotAxis, fRotAngle); + return XMQuaternionNormalize(vRotQ); + } + inline static void SortHitsByDistance(vector& hits) { @@ -296,6 +337,24 @@ class CMyTools { return (Alphabet - 'A'); } + + inline static PSX::PxTransform MakeJointWorldPoseFromRouteEnd(PSX::PxRigidActor* routeRigidActor, _float3 vCapsuleHalfLengths, bool isHeadEnd) + { + PSX::PxShape* shapeArray[1] = {}; + routeRigidActor->getShapes(shapeArray, 1); + + PSX::PxShape* routeShape = shapeArray[0]; + + const PSX::PxTransform pxRouteWorldTransfom = PSX::PxShapeExt::getGlobalPose(*routeShape, *routeRigidActor); + + const PSX::PxVec3 capsuleAxisWorld = pxRouteWorldTransfom.q.rotate(PSX::PxVec3(1.f, 0.f, 0.f)); + + PSX::PxTransform jointWorldPose; + jointWorldPose.q = pxRouteWorldTransfom.q; + jointWorldPose.p = pxRouteWorldTransfom.p + (isHeadEnd ? 1.f : -1.f) * capsuleAxisWorld * (vCapsuleHalfLengths.y + vCapsuleHalfLengths.x); + + return jointWorldPose; + } #pragma endregion #pragma region FileSystem //static void Folder_Func(/* 재귀적으로 탐색할지 */ _In_ _bool bRecursive, diff --git a/Jusin154_Team3D/Engine/Public/PhysX/PxRigidDynamic.h b/Jusin154_Team3D/Engine/Public/PhysX/PxRigidDynamic.h index 642de486a..c467b573f 100644 --- a/Jusin154_Team3D/Engine/Public/PhysX/PxRigidDynamic.h +++ b/Jusin154_Team3D/Engine/Public/PhysX/PxRigidDynamic.h @@ -1,4 +1,4 @@ -// Redistribution and use in source and binary forms, with or without +// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxD6Joint.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxD6Joint.h index 12e7014b5..66e70e1e1 100644 --- a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxD6Joint.h +++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxD6Joint.h @@ -1,4 +1,4 @@ -// Redistribution and use in source and binary forms, with or without +// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxExtensionsAPI.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxExtensionsAPI.h index 99a2a2af1..5516b6855 100644 --- a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxExtensionsAPI.h +++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxExtensionsAPI.h @@ -1,4 +1,4 @@ -// Redistribution and use in source and binary forms, with or without +// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright diff --git a/Jusin154_Team3D/Engine/Public/PhysX/foundation/PxMath.h b/Jusin154_Team3D/Engine/Public/PhysX/foundation/PxMath.h index b2866f485..e004b2df9 100644 --- a/Jusin154_Team3D/Engine/Public/PhysX/foundation/PxMath.h +++ b/Jusin154_Team3D/Engine/Public/PhysX/foundation/PxMath.h @@ -1,4 +1,4 @@ -// Redistribution and use in source and binary forms, with or without +// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright diff --git a/Jusin154_Team3D/Engine/Public/PhysX_Manager.h b/Jusin154_Team3D/Engine/Public/PhysX_Manager.h index bdfb0cc60..13c86a027 100644 --- a/Jusin154_Team3D/Engine/Public/PhysX_Manager.h +++ b/Jusin154_Team3D/Engine/Public/PhysX_Manager.h @@ -11,6 +11,16 @@ class CMesh; class CPhysX_Manager final : public CBase { +private: + // 주의: 피직스 내부 플래그 전용. 건드리려면 먼저 말하고 건드리기 + // 가장 기본이 되는 필터 플래그 + enum COLLISIONCATERGORY_BIT32 : uint32_t + { + CharacterController = 1u << 0 + , JointedParts = 1u << 1 + , WorldStatic = 1u << 2 + , WorldDynamic = 1u << 3 + }; private: CPhysX_Manager(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual ~CPhysX_Manager() = default; @@ -23,7 +33,10 @@ class CPhysX_Manager final : public CBase PSX::PxRigidDynamic* Add_DynamicActor(CRigidBody_Dynamic& RigidBody, _uint iLevel); PSX::PxRigidStatic* Add_StaticActor(CRigidBody_Static& RigidBody, _uint iLevel); - PSX::PxRevoluteJoint* Create_PxRevoluteJoint(PSX::PxRigidActor* pActorFrame, PSX::PxTransform& pxLocalWallFrame, PSX::PxRigidActor* pActorObject, PSX::PxTransform& pxLocalActorFrame, _uint iLevel); + + // https://documentation.help/nvidia-physx-sdk-guide/Joints.html + PSX::PxJoint* Create_PxJoint(PHYSX_JOINT eType, PSX::PxRigidActor* pActor0, PSX::PxTransform& pxLocalFrame0, PSX::PxRigidActor* pActor1, PSX::PxTransform& pxLocalFrame1); + PSX::PxD6Joint* Create_PxD6Joint(PSX::PxRigidDynamic* pActor0, PSX::PxRigidDynamic* pActor1, const PSX::PxTransform& pxJointWorldPos); void RegistTriMesh(const _char* pName, PSX::PxTriangleMesh* pPxTriMesh, _uint iLevel); void RegistHeight(const _tchar* pName, PSX::PxHeightFieldDesc& Desc, _uint iLevel); @@ -41,7 +54,7 @@ class CPhysX_Manager final : public CBase #ifdef EDITOR_PROJECT HRESULT SaveTriMeshes(const _char* pPath, vector& TriMeshes); - void Add_Editor_Plane(PhsXUserData& PlaneData); + void Add_Editor_Plane(PHYSX_USERDATA& PlaneData); #endif // EDITOR_PROJECT HRESULT LoadTriMeshes(const _char* pPath, vector& TriMeshes); //HRESULT LoadTriMeshes_Binary(const _char* pPath, vector& TriMeshes); @@ -60,6 +73,7 @@ class CPhysX_Manager final : public CBase public: PSX::PxController* Add_CapsuleController(PSX::PxCapsuleControllerDesc& Desc); PSX::PxController* Add_BoxController(PSX::PxBoxControllerDesc& Desc); + void ApplyFilterData(PSX::PxRigidActor* pRigidActor); PSX::PxController* Get_Controller(_uint iControllerIndex); void ReleaseController(_uint iControllerIndex); @@ -102,7 +116,7 @@ class CPhysX_Manager final : public CBase map<_wstring, PSX::PxHeightFieldGeometry*>* m_HeightFieldGeometry = { nullptr }; - PhsXUserData PlaneData = {}; + PHYSX_USERDATA PlaneData = {}; vector m_pMaterials = { }; _uint m_iNumLevel = { UINT_MAX }; @@ -114,7 +128,13 @@ class CPhysX_Manager final : public CBase void Update_Kinematic(); void Update_Dynamic_ActiveActors(); - //void Update_Dynamic_AllActors(); + void FixCapsuleShapeAxisToY(PSX::PxShape* pShape); + uint32_t ConvertPhysxKindToBit(const PHYSX_USERDATA& physxKind); + uint32_t BuildCollisionMaskFromCategoryBit(uint32_t iMyBit); + static PSX::PxFilterFlags SimulationFilterShader(PSX::PxFilterObjectAttributes pxAttributes0, PSX::PxFilterData pxFilterData0, + PSX::PxFilterObjectAttributes pxAttributes1, PSX::PxFilterData pxFilterData1, + PSX::PxPairFlags& pxPairFlags, const void* pConstantBlock, PSX::PxU32 iConstantBlockSize); + public: static CPhysX_Manager* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, _uint iLevel); diff --git a/Jusin154_Team3D/Engine/Public/PipeLine.h b/Jusin154_Team3D/Engine/Public/PipeLine.h index 5a3557e6d..eab3e69a8 100644 --- a/Jusin154_Team3D/Engine/Public/PipeLine.h +++ b/Jusin154_Team3D/Engine/Public/PipeLine.h @@ -21,12 +21,13 @@ cascade class CPipeLine final : public CBase { private: - CPipeLine(); + CPipeLine(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual ~CPipeLine() = default; public: void Set_Transform(D3DTS eState, _fmatrix TransformStateMatrix); const _float4x4* Get_Transform_Float4x4(D3DTS eState); _matrix Get_Transform_Matrix(D3DTS eState); + _matrix Get_ShadowTransform_Matrix(D3DTS eState, SHADOW eShadowType); const _float4* Get_CamPosition(); const _vector Get_CamXMPosition(); @@ -43,6 +44,9 @@ class CPipeLine final : public CBase HRESULT Bind_GlobalSRV(class CShader* pShader, const _tchar* wszKeyGlobalSRV, const _char* pConstantName); HRESULT Load_GlobalSRV(const _tchar* wszKeyGlobalSRV, filesystem::path pathSRVFolder); + HRESULT Begin_OutLine_Write(_uint iDSSRef); + HRESULT End_OutLine_Write(); + HRESULT Ready_Shadow_Light(const _float4& vShadowDirRPYQuat); HRESULT Bind_Shadow_Resource(class CShader* pShader, const _char* pConstantName, D3DTS eType, SHADOW eShadowType) const; const _float4x4* Get_ShadowMatricesPtr(_uint iShadowBoxIndex); @@ -51,6 +55,8 @@ class CPipeLine final : public CBase void Update(); // Objects의 Priority, Update사이에서 불려야만 함 private: + ID3D11Device* m_pDevice = { nullptr }; + ID3D11DeviceContext* m_pContext = { nullptr }; class CGameInstance* m_pGameInstance = { nullptr }; _float4x4 m_TransformStateMatrices[ENUM_CLASS(D3DTS::END)] = {}; _float4x4 m_ShadowTransformStateMatrices[3][ENUM_CLASS(D3DTS::END)] = {}; @@ -83,6 +89,10 @@ class CPipeLine final : public CBase _float4 m_vShadowInvDirectionalRPYQuat = { 0.f, 0.f, 0.f, 1.f }; unordered_map<_wstring, ID3D11ShaderResourceView*> m_mapGlobalSRV = {}; + ID3D11DepthStencilState* m_pDSS_OutLineWrite = { nullptr }; + ID3D11DepthStencilState* m_pPrevDSS = { nullptr }; + _uint m_iPrevDSSRef = { }; + private: HRESULT Initialize(); void Make_Planes(const _float4* pPoints, _float4* pPlanes); @@ -93,7 +103,7 @@ class CPipeLine final : public CBase ID3D11ShaderResourceView* Find_GlobalShaderResourceView(const _tchar* wszKeyGlobalSRV); public: - static CPipeLine* Create(); + static CPipeLine* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual void Free() override; #ifdef _DEBUG virtual void Describe_Entity(); diff --git a/Jusin154_Team3D/Engine/Public/Prototype_Manager.h b/Jusin154_Team3D/Engine/Public/Prototype_Manager.h index c4386893b..13526382b 100644 --- a/Jusin154_Team3D/Engine/Public/Prototype_Manager.h +++ b/Jusin154_Team3D/Engine/Public/Prototype_Manager.h @@ -7,6 +7,7 @@ #include "Navigation.h" #include "RigidBody_Dynamic.h" #include "RigidBody_Static.h" +#include "Dynamic_D6Joint.h" #include "Texture.h" #include "Cell.h" #include "Model.h" diff --git a/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h b/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h index 55923d76f..65ad0f832 100644 --- a/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h +++ b/Jusin154_Team3D/Engine/Public/RenderTarget_Manager.h @@ -23,7 +23,7 @@ class CRenderTarget_Manager final : public CBase HRESULT Copy_RenderTargetAToB(const _wstring& strATag, const _wstring& strBTag); HRESULT Bind_CS_RenderTarget(_uint iIndex, const _wstring& strTargetTag); HRESULT Clear_RenderTarget(const _wstring& strRenderTargetKey); - + ID3D11ShaderResourceView* Get_RenderTarget_SRV(const _wstring& strRenderTargetKey); // 두 랜더타겟을 하나로 모음 HRESULT Accumulate_RenderTarget(class CVIBuffer_Rect* pVIBuffer, class CShader* pShader, const _wstring& wstrRenderTarget_SrcA, const _wstring& wstrRenderTarget_SrcB, const _wstring& wstrRenderTarget_Target, SHADER_PASS_DEFERRED ePass); // 랜더 타겟의 크기를 dest로 다시 맞춤 diff --git a/Jusin154_Team3D/Engine/Public/RigidBody.h b/Jusin154_Team3D/Engine/Public/RigidBody.h index 54c5fc3d2..b1028e9dd 100644 --- a/Jusin154_Team3D/Engine/Public/RigidBody.h +++ b/Jusin154_Team3D/Engine/Public/RigidBody.h @@ -39,6 +39,8 @@ class ENGINE_DLL CRigidBody abstract : public CComponent PSX::PxShapeFlags Get_ShapeFlags() const { return m_ePxShapeFlags; } PSX::PxRigidBodyFlags Get_RigidBodyFlags() const { return m_ePxRigidBodyFlags; } + PHYSX_USERDATA* Get_UserDataPtr() { return &m_tagData; }; + protected: ACTOR m_eActorType = ACTOR::END; PSX::PxRigidBodyFlags m_ePxRigidBodyFlags = { }; @@ -49,7 +51,7 @@ class ENGINE_DLL CRigidBody abstract : public CComponent _float3 m_vLocalTranslation = { 0.f, 0.f, 0.f }; CTransform* m_pTransform = { nullptr }; - PhsXUserData m_tagData = {}; + PHYSX_USERDATA m_tagData = {}; protected: virtual HRESULT Initialize(void* pArg); diff --git a/Jusin154_Team3D/Engine/Public/RigidBody_Dynamic.h b/Jusin154_Team3D/Engine/Public/RigidBody_Dynamic.h index 29288d8e4..f49664b07 100644 --- a/Jusin154_Team3D/Engine/Public/RigidBody_Dynamic.h +++ b/Jusin154_Team3D/Engine/Public/RigidBody_Dynamic.h @@ -19,7 +19,7 @@ class ENGINE_DLL CRigidBody_Dynamic : public CRigidBody typedef struct tagRigidBody_DYNAMIC_Desc : public CRigidBody::RIGIDBODY_DESC { - + _bool bAutoOwnerTranslation = true; }RIGIDBODY_DYNAMIC_DESC; private: @@ -31,18 +31,27 @@ class ENGINE_DLL CRigidBody_Dynamic : public CRigidBody #ifdef _DEBUG _float3 Get_LocalTranslation() {return m_vLocalTranslation; } virtual HRESULT Render()override; + HRESULT Render(function custumState); #endif // _DEBUG virtual PSX::PxRigidDynamic* Get_Actor() override { return m_pRigidBody; }; + void Set_Name(const _char* szName); _float3 Get_HalfGeometryInfo() const { return m_vhalfGeometryInfo; } void Set_HalfGeometryInfo(_float3 vhalfGeometryInfo); - void Move_LocalPos(_float4 vNewRotQ, _float3 vNewTranslation); + + + void Move_LocalPos(_matrix newLocalPos);// 캡슐은 이 함수 쓸 거면 말하고 써야함 + void Move_LocalPos(_fvector vNewRotQ, _gvector vNewTranslation);// 캡슐은 이 함수 쓸 거면 말하고 써야함 + void Move_LocalPos(_float4& vNewRotQ, _float3& vNewTranslation);// 캡슐은 이 함수 쓸 거면 말하고 써야함 _float Get_Density() const { return m_fDensity; } _float Get_Mass(); virtual void Add_Force(_fvector vForce, PSX::PxForceMode::Enum eType = PSX::PxForceMode::Enum::eFORCE); // 속도 + 방향 virtual void Add_Torque(_fvector vDirection, PSX::PxForceMode::Enum eType = PSX::PxForceMode::Enum::eFORCE); // 방향 ( 회전축은 MassCenter ) void Set_Kinematic(_bool bKinematic); + void Move_Kinematic(_fmatrix xmTransform, _bool bTeleport = true); + void Move_Kinematic(_fvector vPos, _gvector vRotq, _bool bTeleport = true); + void Move_Kinematic(PSX::PxTransform& pxDestination, _bool bTeleport = true); HRESULT ConvertToCCT(class CCharacter_Controller& CCTOriginal); void Detach_Actor(_uint iLevel); @@ -50,12 +59,20 @@ class ENGINE_DLL CRigidBody_Dynamic : public CRigidBody void SetActive(_bool bCondition) { m_bActive = bCondition; } _vector Get_Position(); - void Set_Position(_vector vPos); - void Set_Rotation(_vector vRotQ); - void Set_Transform(_vector vPos, _vector vRotQ); - void Set_Transform(PSX::PxTransform pxTransform); + void Set_Position(_vector vPos, _bool bTeleport); + void Set_Rotation(_vector vRotQ, _bool bTeleport); + void Set_AutoOwnerTranlation(_bool bAutoOwnerTranslation) { m_tagData.bAutoOwnerTranslation = bAutoOwnerTranslation; }; + _bool Get_AutoOwnerTranlation() { return m_tagData.bAutoOwnerTranslation; }; + + void Set_Transform(_matrix WorldMatrix, _bool bTeleport); + void Set_Transform(_vector vPos, _vector vRotQ, _bool bTeleport); + void Set_Transform(PSX::PxTransform pxTransform, _bool bTeleport); + + void Set_CenterTransform(_vector vStart, _vector vEnd, _bool bTeleport); _float3 Get_FootPosition(); _float3 Get_HeadPosition(); + PSX::PxTransform Get_GlobalPosition(); + PSX::PxTransform Get_HeadPositionPxTransform(); PSX::PxTransform Get_FootPositionPxTransform(); private: PSX::PxRigidDynamic* m_pRigidBody = { nullptr }; // 실제 시뮬레이션을 도는 본체 @@ -75,6 +92,7 @@ class ENGINE_DLL CRigidBody_Dynamic : public CRigidBody private: HRESULT Initialize_Prototype(RIGIDBODY_PROTOTYPE_DYNAMIC_DESC& Desc); virtual HRESULT Initialize(void* pArg) override; +// void Move(PSX::PxTransform& pxTransform, _bool bTeleport); #ifdef _DEBUG HRESULT Add_DebugShape(); diff --git a/Jusin154_Team3D/Engine/Public/RigidBody_Dynamic_Joint.h b/Jusin154_Team3D/Engine/Public/RigidBody_Dynamic_Joint.h deleted file mode 100644 index def8cb1dc..000000000 --- a/Jusin154_Team3D/Engine/Public/RigidBody_Dynamic_Joint.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once -class CDynamic_Joint -{ - -}; - diff --git a/Jusin154_Team3D/Engine/Public/State.h b/Jusin154_Team3D/Engine/Public/State.h index 06f76f2c0..d62346d41 100644 --- a/Jusin154_Team3D/Engine/Public/State.h +++ b/Jusin154_Team3D/Engine/Public/State.h @@ -26,7 +26,7 @@ enum ESTATE BROOM_IDLE,BROOM_FWD,BROOM_LEFT,BROOM_RIGHT,BROOM_DOWN,BROOM_UP, BROOM_REVELIO, BROOM_HOVER_IDLE, BROOM_HOVER_FWD, BROOM_HOVER_LEFT, BROOM_HOVER_RIGHT, BROOM_HOVER_START, BROOM_HOVER_REVELIO,BROOM_MOUNT, BROOM_MOUNT_END,BROOM_DISMOUNT,BROOM_TURBO_FWD, BROOM_TURBO_DOWN, BROOM_TURBO_UP, BROOM_TURBO_LEFT, BROOM_TURBO_RIGHT, RUSH_START,RUSH_LOOP,RUSH_END, THROW_ROCK_START,THROW_ROCK, - BACKHAND_SWING_JOG,SWING_FWD,SLAM, + BACKHAND_SWING_JOG,SWING_FWD,SLAM,SLASH,DASH, SUSTAIN_START,SUSTAIN_LOOP,SUSTAIN_END, BLINK,BLINK_START, HIT, HIT_FWD, HIT_BWD, HIT_BWD2, HIT_BWD3, HIT_BWD4, HIT_L, HIT_R,HIT_FACE,HIT_FACE_END,HIT_LEVIOSO,INCARCEROUS, diff --git a/Jusin154_Team3D/Engine/Public/Volumetric.h b/Jusin154_Team3D/Engine/Public/Volumetric.h index 7bd847a2b..e368327fd 100644 --- a/Jusin154_Team3D/Engine/Public/Volumetric.h +++ b/Jusin154_Team3D/Engine/Public/Volumetric.h @@ -27,12 +27,22 @@ class CVolumetric final : public CBase _float4x4 InvProjMatrix; _float4x4 InvViewMatrix; + _float4x4 ShadowViewMatrix; + _float4x4 ShadowViewProjMatrix; + _float fAsymmetryParameter; - _float padding0; - _float padding1; - _float padding2; + _uint iNumLight; + _float fHeightOffset; + _float fBaseHeight; }CS_VOLUME_CONSTANT_DESC; + typedef struct tagCSLightDesc + { + _float3 vDirection; + _float fRange; + _float4 vPosition; + _float4 vDiffuse; + }CS_LIGHT_DESC; private: CVolumetric(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); @@ -46,7 +56,7 @@ class CVolumetric final : public CBase HRESULT Dispatch(); ID3D11ShaderResourceView* Get_VolumeSRV() { return m_pAccVolumeSRV; } - _float* Get_DepthPackExponentPtr() { return &m_fDepthPackExponent; } + _float* Get_DepthPackExponentPtr() { return &m_fDepthPackExponent; } void Setting_Volumetirc(_float fDensity , _float fLightIntensity, _float fAsymmetryParameter , _float fDepthPackExponent); private: @@ -56,6 +66,8 @@ class CVolumetric final : public CBase ID3D11Texture3D* m_pTexture3D = { nullptr }; ID3D11Texture3D* m_pAccumulateTexture3D = { nullptr }; + ID3D11ShaderResourceView* m_pNoiseTexture = { nullptr }; + ID3D11ShaderResourceView* m_pVolumeSRV = {nullptr}; ID3D11UnorderedAccessView* m_pVolumeUAV = { nullptr }; @@ -64,6 +76,7 @@ class CVolumetric final : public CBase ID3D11Buffer* m_pConstantBuffer = { nullptr }; ID3D11Buffer* m_pLightInfoBuffer = { nullptr }; + ID3D11ShaderResourceView* m_pLightInfoSRV = { nullptr }; ID3D11ComputeShader* m_pCSVolumeCalculate = { nullptr }; ID3DBlob* m_pCSBlobCalculate = { nullptr }; @@ -71,10 +84,19 @@ class CVolumetric final : public CBase ID3D11ComputeShader* m_pCSVolumeAccumulate = { nullptr }; ID3DBlob* m_pCSBlobAccumulate = { nullptr }; - _float m_fDensity = { 0.5f }; - _float m_fLightIntensity = { 1.f }; - _float m_fAsymmetryParameter = { 0.2f }; - _float m_fDepthPackExponent = { 2.f }; + ID3D11SamplerState* m_pSamplerState = { nullptr }; + + _float m_fDensity = { 0.953f }; // 밀도 + _float m_fLightIntensity = { 0.01f }; // 광원 강도 + _float m_fAsymmetryParameter = { 0.5344f }; // 이방성 계수 값이 클 수록 들어오는 방향으로 나가는 빛의 양이 많아짐 + _float m_fDepthPackExponent = { 1.f }; // 깊이 비선형 분포 지수 + _float m_fHieghtOffset = { 0.f }; + _float m_fBaseHeight = { 0.f }; + _uint m_iNumLights = { 1 }; + _uint m_iMaxNumLights = { 20 }; + + _float4x4 m_ShadowViewMatrix = {}; + _float4x4 m_ShadowViewProjMatrix = {}; #ifdef _DEBUG class CRenderEventDebugger m_AnnotationHelper = {}; @@ -87,6 +109,7 @@ class CVolumetric final : public CBase HRESULT CreateBlob(); HRESULT CreateBuffers(); HRESULT CreateResourceViews(); + HRESULT Create_SamplerState(); public: static CVolumetric* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Engine/Public/pch.h b/Jusin154_Team3D/Engine/Public/pch.h index c226fdfe9..590dbf9ac 100644 --- a/Jusin154_Team3D/Engine/Public/pch.h +++ b/Jusin154_Team3D/Engine/Public/pch.h @@ -79,9 +79,9 @@ using namespace FMOD; #pragma warning(push) #pragma warning(disable: 26495) #pragma warning(disable: 33010) - -#include "PhysX/PxPhysics.h" +#include "PhysX/foundation/PxMath.h" #include "PhysX/PxPhysicsAPI.h" +#include "PhysX/extensions/PxExtensionsAPI.h" #pragma warning(pop) diff --git a/Jusin154_Team3D/Update_Lib.bat b/Jusin154_Team3D/Update_Lib.bat index 61455f141..76d78382e 100644 --- a/Jusin154_Team3D/Update_Lib.bat +++ b/Jusin154_Team3D/Update_Lib.bat @@ -36,8 +36,12 @@ xcopy /y .\Engine\Bin\Assimp\assimp-vc145-mt.dll .\Editor\Bin\Release\ :: fMod는 아쉽게도 pdb가 없기 때문에 안옮김 xcopy /y .\Engine\ThirdPartyLib\Assimp\assimp-vc145-mtd.pdb .\Client\Bin\Debug\ xcopy /y .\Engine\ThirdPartyLib\Assimp\assimp-vc145-mt.pdb .\Client\Bin\Release\ +xcopy /y .\Engine\ThirdPartyLib\PhysX_debug\*.pdb .\Client\Bin\Debug\ +xcopy /y .\Engine\ThirdPartyLib\PhysX_release\*.pdb .\Client\Bin\Release\ xcopy /y .\Engine\ThirdPartyLib\Assimp\assimp-vc145-mtd.pdb .\Editor\Bin\Debug\ xcopy /y .\Engine\ThirdPartyLib\Assimp\assimp-vc145-mt.pdb .\Editor\Bin\Release\ +xcopy /y .\Engine\ThirdPartyLib\PhysX_debug\*.pdb .\Editor\Bin\Debug\ +xcopy /y .\Engine\ThirdPartyLib\PhysX_release\*.pdb .\Editor\Bin\Release\ xcopy /y .\Editor\ThirdPartyLib\ZLib\Debug\zlibd.pdb .\Editor\Bin\Debug\ xcopy /y .\Editor\ThirdPartyLib\ZLib\Release\zlib.pdb .\Editor\Bin\Release\ @@ -55,3 +59,5 @@ xcopy /y .\Engine\ThirdPartyLib\fMod\fmod_vc.lib .\EngineSDK\Lib\Debug\ xcopy /y .\Engine\ThirdPartyLib\fMod\fmod_vc.lib .\EngineSDK\Lib\Release\ xcopy /y .\Engine\ThirdPartyLib\DirectXTK\DirectXTKd.lib .\EngineSDK\Lib\Debug\ +xcopy /y .\Engine\ThirdPartyLib\PhysX\PhysX_debug\*.lib .\EngineSDK\Lib\Debug\ +xcopy /y .\Engine\ThirdPartyLib\PhysX\PhysX_release\*.lib .\EngineSDK\Lib\Release\