diff --git a/Jusin154_Team3D/Client/Default/Client.cpp b/Jusin154_Team3D/Client/Default/Client.cpp index faf8b9092..4084d56e2 100644 --- a/Jusin154_Team3D/Client/Default/Client.cpp +++ b/Jusin154_Team3D/Client/Default/Client.cpp @@ -179,7 +179,7 @@ ATOM MyRegisterClass(HINSTANCE hInstance) BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) { g_hInstance = hInstance; - +#ifdef _DEBUG RECT rcWindow = { 0, 0, g_iWinSizeX, g_iWinSizeY }; AdjustWindowRect(&rcWindow, WS_OVERLAPPEDWINDOW, FALSE); @@ -196,7 +196,35 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) UpdateWindow(hWnd); g_hWnd = hWnd; +#endif // _DEBUG +#ifdef Bin +#ifndef _DEBUG + int screenX = GetSystemMetrics(SM_CXSCREEN); + int screenY = GetSystemMetrics(SM_CYSCREEN); + + HWND hWnd = CreateWindowW( + szWindowClass, + szTitle, + WS_POPUP, + 0, 0, + screenX, screenY, + nullptr, + nullptr, + hInstance, + nullptr + ); + + if (!hWnd) + return FALSE; + + g_hWnd = hWnd; + + ShowWindow(hWnd, SW_SHOW); + UpdateWindow(hWnd); + +#endif // !_DEBUG +#endif // Bin return TRUE; } diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj b/Jusin154_Team3D/Client/Default/Client.vcxproj index 53519c337..c3d34fcb5 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj @@ -180,6 +180,7 @@ call Update_Resources.bat + @@ -190,6 +191,7 @@ call Update_Resources.bat + @@ -441,6 +443,7 @@ call Update_Resources.bat + @@ -450,6 +453,7 @@ call Update_Resources.bat + diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters index 8b1dd71e2..0c2e953a6 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters @@ -800,6 +800,12 @@ 02.GameObjects\Environment\02.InstancedProp\Light + + 02.GameObjects\Effect\MonsterEffect\Ranrok\Ranrok_Pulse + + + 02.GameObjects\Effect\MonsterEffect\Ranrok\Ranrok_Charge + @@ -1665,6 +1671,12 @@ {05a0db73-4fbf-456c-9137-bb605c632d68} + + {0464c6ff-87b8-4a3e-bc06-c912b32a65eb} + + + {fd036f05-4c10-4322-b0c2-aac65e7011a1} + @@ -2412,6 +2424,12 @@ 02.GameObjects\Environment\02.InstancedProp\Light + + 02.GameObjects\Effect\MonsterEffect\Ranrok\Ranrok_Pulse + + + 02.GameObjects\Effect\MonsterEffect\Ranrok\Ranrok_Charge + diff --git a/Jusin154_Team3D/Client/Private/Broom.cpp b/Jusin154_Team3D/Client/Private/Broom.cpp index f3fd2b4db..d6369f97b 100644 --- a/Jusin154_Team3D/Client/Private/Broom.cpp +++ b/Jusin154_Team3D/Client/Private/Broom.cpp @@ -84,9 +84,6 @@ void CBroom::Update(_float fTimeDelta) if(!m_pParentUnit->IsAI()) PlayerInput(); else { - m_bHoverToggle = m_Input.bHoverToggle; - m_bTurbo = m_Input.bTurbo; - m_fAITime += fTimeDelta; _float target = 1.f + sinf(m_fAITime * 0.3f + m_fAISeed) * 0.15f; @@ -130,7 +127,7 @@ void CBroom::Update(_float fTimeDelta) return; } - m_pWindEffect->Set_Visible(false); + m_pWindEffect->Set_Visible(true); m_pWindEffect->Get_Component()->Set_TimeMult(0.5f + m_fSpeed / 20.f); m_pWindEffect->Get_Effect_Info()->fBlurIntensity = m_fSpeed / 30.f; diff --git a/Jusin154_Team3D/Client/Private/BroomRaceManager.cpp b/Jusin154_Team3D/Client/Private/BroomRaceManager.cpp index d17d99620..f77bc4bcb 100644 --- a/Jusin154_Team3D/Client/Private/BroomRaceManager.cpp +++ b/Jusin154_Team3D/Client/Private/BroomRaceManager.cpp @@ -78,8 +78,6 @@ void CBroomRaceManager::Update(_float fTimeDelta) } } - - #ifdef _DEBUG Describe_Entity(); #endif // _DEBUG @@ -88,7 +86,6 @@ void CBroomRaceManager::Update(_float fTimeDelta) void CBroomRaceManager::Late_Update(_float fTimeDelta) { __super::Late_Update(fTimeDelta); - m_pGameInstance->Add_RenderGroup(RENDER::UI, this); } HRESULT CBroomRaceManager::Render() @@ -165,6 +162,18 @@ void CBroomRaceManager::Describe_Entity() m_eRaceState = ENUM_CLASS(RACE_STATE::READY); const _float SPAWN_DISTANCE = 80.f; + if (FAILED(Load_RaceRing())) + { + MSG_BOX("Failed Load RaceRing"); + } + + for (_uint i = 0; i < 3; i++) + { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_RACERAI, this))) + return; + } + m_pGameInstance->Get_Layer(NEXT_LEVEL, LAYER_PLAYER)->Get_Object()->Set_RaceInfo(); + for (auto& racer : m_Racers) { CTransform* pRingTransform = @@ -178,20 +187,20 @@ void CBroomRaceManager::Describe_Entity() if (racer.pAI) { - CTransform* pBroomTransform = - racer.pAI->Get_Broom()->Get_Component(); + CTransform* pTransform = + racer.pAI->Get_Component(); _float fRand = m_pGameInstance->Real_Random_Float(-10.f, 10.f); - spawnPos.m128_f32[2] += fRand; + spawnPos.m128_f32[0] += fRand; + + pTransform->Set_State(STATE::POSITION, spawnPos); + pTransform->LookAt(pRingTransform->Get_State(STATE::POSITION)); - pBroomTransform->Set_State(STATE::POSITION, spawnPos); - pBroomTransform->LookAt(pRingTransform->Get_State(STATE::POSITION)); racer.pAI->Get_Broom()->Set_Move(false); } else if (racer.pRacer) { CTransform* pTransform = racer.pRacer->Get_Component(); - spawnPos.m128_f32[1] -= 2.f; pTransform->Set_State(STATE::POSITION, spawnPos); pTransform->LookAt(pRingTransform->Get_State(STATE::POSITION)); racer.pRacer->Get_Component()->Change_State(FSMSTATE::BROOM_RIDE); @@ -328,13 +337,13 @@ void CBroomRaceManager::SetTargetRing(CGameObject* pRacer) { if (racer.pAI == pRacer) { + if (racer.curRing == m_pRaceRings.size() - 1 ) { + racer.pAI->Get_Broom()->Set_Hover(true); + racer.pAI->Get_Broom()->Set_Move(false); + } + if (racer.pAI) { - if (racer.curRing == m_pRaceRings.size() - 1) - { - racer.pAI->Get_Broom()->Set_Hover(true); - racer.pAI->Get_Broom()->Set_Move(false); - } racer.pAI->Set_RaceRing(m_pRaceRings[racer.curRing]); } } @@ -343,16 +352,16 @@ void CBroomRaceManager::SetTargetRing(CGameObject* pRacer) { if (racer.pRacer == pRacer) { - if (racer.curRing == m_pRaceRings.size() - 1) - { + if (racer.curRing == m_pRaceRings.size() - 1) { racer.pRacer->Get_Broom()->Set_Hover(true); racer.pRacer->Get_Broom()->Set_Move(false); } racer.pRacer->Set_RaceRing(m_pRaceRings[racer.curRing]); m_pInfoInstance->Event_CallBack(TEXT("CurrentRing")); + m_iLastRing++; } } - m_iLastRing++; + } } @@ -379,3 +388,73 @@ void CBroomRaceManager::Push_RaceRing(CRaceRing* Ring) SAFE_ADDREF(Ring); } +HRESULT CBroomRaceManager::Load_RaceRing() +{ + tinyxml2::XMLDocument xmlDoc; + + string strPath = "../Bin/Resources/Data/Map/RaceRing/RaceRing_Data.xml"; + + if ((tinyxml2::XML_SUCCESS != xmlDoc.LoadFile(strPath.c_str()))) + return E_FAIL; + + tinyxml2::XMLElement* root = xmlDoc.FirstChildElement("Ring"); + + if (nullptr == root) + { + MSG_BOX("Failed to Find root"); + return S_OK; + } + + //for (auto* Object = root->FirstChildElement("Object"); Object; Object = Object->NextSiblingElement("Object")) + //{ + // CRaceRing::RACERING_DESC Desc = {}; + + // Desc.pBroomRaceManager = this; + + // /* Transform */ + // auto* Rotation = Object->FirstChildElement("Scale"); + // Rotation->QueryFloatAttribute("x", &Desc.vScale.x); + // Rotation->QueryFloatAttribute("y", &Desc.vScale.y); + // Rotation->QueryFloatAttribute("z", &Desc.vScale.z); + + // auto* Scale = Object->FirstChildElement("Rotation"); + // Scale->QueryFloatAttribute("x", &Desc.vRotation.x); + // Scale->QueryFloatAttribute("y", &Desc.vRotation.y); + // Scale->QueryFloatAttribute("z", &Desc.vRotation.z); + + // auto* Position = Object->FirstChildElement("Position"); + // Position->QueryFloatAttribute("x", &Desc.vPosition.x); + // Position->QueryFloatAttribute("y", &Desc.vPosition.y); + // Position->QueryFloatAttribute("z", &Desc.vPosition.z); + + // if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_RING, &Desc))) + // return E_FAIL; + //} + + + CRaceRing::RACERING_DESC Desc = {}; + + Desc.pBroomRaceManager = this; + + /* Transform */ + auto* Rotation = root->FirstChildElement("Object")->FirstChildElement("Scale"); + Rotation->QueryFloatAttribute("x", &Desc.vScale.x); + Rotation->QueryFloatAttribute("y", &Desc.vScale.y); + Rotation->QueryFloatAttribute("z", &Desc.vScale.z); + + auto* Scale = root->FirstChildElement("Object")->FirstChildElement("Rotation"); + Scale->QueryFloatAttribute("x", &Desc.vRotation.x); + Scale->QueryFloatAttribute("y", &Desc.vRotation.y); + Scale->QueryFloatAttribute("z", &Desc.vRotation.z); + + auto* Position = root->FirstChildElement("Object")->FirstChildElement("Position"); + Position->QueryFloatAttribute("x", &Desc.vPosition.x); + Position->QueryFloatAttribute("y", &Desc.vPosition.y); + Position->QueryFloatAttribute("z", &Desc.vPosition.z); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_RING, &Desc))) + return E_FAIL; + + return S_OK; +} + diff --git a/Jusin154_Team3D/Client/Private/BroomRacerAI.cpp b/Jusin154_Team3D/Client/Private/BroomRacerAI.cpp index f2adcb02d..f6a4fec1c 100644 --- a/Jusin154_Team3D/Client/Private/BroomRacerAI.cpp +++ b/Jusin154_Team3D/Client/Private/BroomRacerAI.cpp @@ -59,7 +59,7 @@ HRESULT CBroomRacerAI::Initialize(void* pArg) Add_FSM(); - Load_AnimXML("../Bin/Resources/Data/AnimList/RacerAI.xml"); + Load_AnimXML("../Bin/Resources/Data/AnimList/BroomRacerAI.xml"); { CFSM::FSM_DESC FSMDesc{}; @@ -116,8 +116,6 @@ HRESULT CBroomRacerAI::Initialize(void* pArg) void CBroomRacerAI::Priority_Update(_float fTimeDelta) { __super::Priority_Update(fTimeDelta); - - } void CBroomRacerAI::Update(_float fTimeDelta) @@ -737,8 +735,6 @@ void CBroomRacerAI::Add_FSM() } - - void CBroomRacerAI::Set_Input(_float fTimeDelta) { _float targetX = ComputeTurnToRing(); @@ -750,12 +746,12 @@ void CBroomRacerAI::Set_Input(_float fTimeDelta) InputDesc.Y = 0.f; InputDesc.Z = 0.f; - /*if (m_bMove) - {*/ + if (m_pBroom->Get_Move()) + { InputDesc.Z = 1.f; InputDesc.X = targetX*m_TurnGain; InputDesc.Y = targetY*m_HeightGain; - //} + } InputDesc.bHoverToggle = (m_pBroomRaceManager->Get_RaceState() != ENUM_CLASS(CBroomRaceManager::RACE_STATE::RACING)); diff --git a/Jusin154_Team3D/Client/Private/Broom_States.cpp b/Jusin154_Team3D/Client/Private/Broom_States.cpp index 7b7ea8f28..1be8242ab 100644 --- a/Jusin154_Team3D/Client/Private/Broom_States.cpp +++ b/Jusin154_Team3D/Client/Private/Broom_States.cpp @@ -205,12 +205,10 @@ HRESULT CBroom::Behavior_Broom_HoverExitCheck(_float fTimeDelta) m_pTransformCom->Go_LerpStraight(m_fSpeed, fTimeDelta); pairAnimInfo = m_Animation[STATEANIM::BROOM_HOVER_STOP_B]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); return S_OK; } - - - if (m_bHoverToggle) { _float fTargetVertSpeed = 0.f; @@ -447,20 +445,20 @@ HRESULT CBroom::Behavior_Broom_FlyExitCheck(_float fTimeDelta) { if (vInput.z <= 0.f) { - m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta * 0.4f); + m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta * 0.5f); } else { - m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta * 0.2f); + m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta * 0.3f); } } else if (vInput.x > 0.f) { if (vInput.z <= 0.f) { - m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta * 0.4f); + m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta * 0.5f); } else { - m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta * 0.2f); + m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta * 0.3f); } } diff --git a/Jusin154_Team3D/Client/Private/CallBack_Playable_HitReport.cpp b/Jusin154_Team3D/Client/Private/CallBack_Playable_HitReport.cpp index a65b21501..3d49e310e 100644 --- a/Jusin154_Team3D/Client/Private/CallBack_Playable_HitReport.cpp +++ b/Jusin154_Team3D/Client/Private/CallBack_Playable_HitReport.cpp @@ -75,13 +75,27 @@ void CCallBack_Playable_HitReport::onShapeHit(const PSX::PxControllerShapeHit& h case PXOBJECT::DOOR: { PSX::PxRigidDynamic* pDynamic = static_cast(pActor); - _float fDot = vDir.dot(PSX::PxVec3(0.f, 1.f, 0.f)); - if (fDot > 0) { - pDynamic->addTorque(PSX::PxVec3(0.f, 1.f, 0.f) * fLength * 100.f, PSX::PxForceMode::eFORCE); + if (pDynamic->getRigidBodyFlags().isSet(PSX::PxRigidBodyFlag::eKINEMATIC)){ + pDynamic->setRigidBodyFlag(PSX::PxRigidBodyFlag::eKINEMATIC, false); } - else { - pDynamic->addTorque(PSX::PxVec3(0.f, -1.f, 0.f) * fLength * 100.f, PSX::PxForceMode::eFORCE); + pDynamic->wakeUp(); + PSX::PxVec3 vCompressedDir = hit.dir; + if (vCompressedDir.magnitudeSquared() < FLT_EPSILON5) { + vCompressedDir = -hit.worldNormal; } + vCompressedDir.normalize(); + PSX::PxVec3 hingeAxis = PSX::PxVec3(0.f, 1.f, 0.f); + + PSX::PxVec3 vForceDir = vCompressedDir - hingeAxis * vCompressedDir.dot(hingeAxis); + if (vForceDir.magnitudeSquared() < FLT_EPSILON5){ + break; + } + vForceDir.normalize(); + + float forceMagnitude = PSX::PxClamp(fLength * 600.f, 0.f, 2000.f); + PSX::PxRigidBodyExt::addForceAtPos(*pDynamic, vForceDir * forceMagnitude, { (_float)hit.worldPos.x, (_float)hit.worldPos.y, (_float)hit.worldPos.z }, PSX::PxForceMode::eFORCE); + pTargetActorData->pOwner->OnCollision(); + } break; default: { diff --git a/Jusin154_Team3D/Client/Private/EffectObject.cpp b/Jusin154_Team3D/Client/Private/EffectObject.cpp index 0e743a908..ca2cbfa53 100644 --- a/Jusin154_Team3D/Client/Private/EffectObject.cpp +++ b/Jusin154_Team3D/Client/Private/EffectObject.cpp @@ -37,14 +37,10 @@ HRESULT CEffectObject::Render() for (_uint i = 0; i < m_pInstance_ModelCom->Get_NumMeshes(); i++) { - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(m_EffectInfo.eShaderPass)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Bind_DepthStencil(m_pShaderCom, "g_DepthStencilTexture"))) - return E_FAIL; - if (FAILED(m_pInstance_ModelCom->Bind_CS_Output(5, 1))) return E_FAIL; @@ -100,10 +96,11 @@ HRESULT CEffectObject::Render_Blur() } } - if (m_EffectInfo.eShaderPass == SHADER_PASS_INSTANCE_MODEL::NONPOS || m_EffectInfo.eShaderPass == SHADER_PASS_INSTANCE_MODEL::DEFAULT_NONPOS) + if (m_EffectInfo.eShaderPass == SHADER_PASS_INSTANCE_MODEL::NONPOS || m_EffectInfo.eShaderPass == SHADER_PASS_INSTANCE_MODEL::DEFAULT_NONPOS + || m_EffectInfo.eShaderPass == SHADER_PASS_INSTANCE_MODEL::NONWB_NONPOS) BlurPass = SHADER_PASS_INSTANCE_MODEL::NONPOS_BLUR; - if (m_EffectInfo.eShaderPass == SHADER_PASS_INSTANCE_MODEL::WB_CULLING) + if (m_EffectInfo.eShaderPass == SHADER_PASS_INSTANCE_MODEL::WB_CULLING || m_EffectInfo.eShaderPass == SHADER_PASS_INSTANCE_MODEL::BLEND_CULLING) { if (m_EffectInfo.isBlurNoEmissive == false) { @@ -122,7 +119,6 @@ HRESULT CEffectObject::Render_Blur() } - for (_uint i = 0; i < m_pInstance_ModelCom->Get_NumMeshes(); i++) { diff --git a/Jusin154_Team3D/Client/Private/EffectPool.cpp b/Jusin154_Team3D/Client/Private/EffectPool.cpp index ca37e620b..d116a9121 100644 --- a/Jusin154_Team3D/Client/Private/EffectPool.cpp +++ b/Jusin154_Team3D/Client/Private/EffectPool.cpp @@ -45,6 +45,8 @@ #include "Ranrok_FireBall.h" #include "Ranrok_Breath.h" #include "Ranrok_Point.h" +#include "Ranrok_Pulse.h" +#include "Ranrok_Charge.h" CEffectPool::CEffectPool(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -87,8 +89,8 @@ HRESULT CEffectPool::Initialize(void* pArg) m_isActiveMonsterEffectCreate = true; #endif // #ifdef 기무리 - m_isActiveEffectCreate = true; - m_isActiveMonsterEffectCreate = true; + m_isActiveEffectCreate = false; + m_isActiveMonsterEffectCreate = false; #endif // #ifdef 나 m_isActiveEffectCreate = false; @@ -592,6 +594,26 @@ HRESULT CEffectPool::Ready_MonsterEffect() return pEffect; } ))) return E_FAIL; + + if (FAILED(Create_Effect(SKILL_TYPE::RANROK_PURSE, 5, g_iStaticLevel, g_iStaticLevel, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + + CRanrok_Pulse* pEffect = nullptr; + + pEffect = m_pGameInstance->Clone_Prototype(iPrototypeLevel, nullptr); + + return pEffect; } + + ))) return E_FAIL; + + if (FAILED(Create_Effect(SKILL_TYPE::RANROK_CHARGE, 5, g_iStaticLevel, g_iStaticLevel, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + + CRanrok_Charge* pEffect = nullptr; + + pEffect = m_pGameInstance->Clone_Prototype(iPrototypeLevel, nullptr); + + return pEffect; } + + ))) return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Goblin.cpp b/Jusin154_Team3D/Client/Private/Goblin.cpp index 704c2bcf6..bcff1fb48 100644 --- a/Jusin154_Team3D/Client/Private/Goblin.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin.cpp @@ -580,7 +580,7 @@ void CGoblin::Free() void CGoblin::Describe_Entity() { GUI::Begin("UNIT", 0, IMGUI_GLOBAL_BEGIN_FLAG); - GUI::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); if (GUI::CollapsingHeader("Goblin")) { GUI::Checkbox("LookAt", &m_bLookAt); diff --git a/Jusin154_Team3D/Client/Private/Goblin_Assassin.cpp b/Jusin154_Team3D/Client/Private/Goblin_Assassin.cpp index f7491aae2..f9823cc77 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Assassin.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Assassin.cpp @@ -64,7 +64,7 @@ HRESULT CGoblin_Assassin::Initialize(void* pArg) m_pEffectPool = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_EffectPool"))->Get_Object(); SAFE_ADDREF(m_pEffectPool); - m_pModelCom->Set_Temp(true); + m_pModelCom->Set_DisableRootMotionScale(true); return S_OK; } @@ -661,7 +661,7 @@ void CGoblin_Assassin::Free() void CGoblin_Assassin::Describe_Entity() { GUI::Begin("UNIT", 0, IMGUI_GLOBAL_BEGIN_FLAG); - GUI::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); if (GUI::CollapsingHeader("Goblin")) { GUI::Checkbox("LookAt", &m_bLookAt); diff --git a/Jusin154_Team3D/Client/Private/Goblin_Assassin_Spector.cpp b/Jusin154_Team3D/Client/Private/Goblin_Assassin_Spector.cpp index d8ff2fc24..3b24a2d10 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Assassin_Spector.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Assassin_Spector.cpp @@ -356,7 +356,7 @@ void CGoblin_Assassin_Spector::Free() void CGoblin_Assassin_Spector::Describe_Entity() { GUI::Begin("UNIT", 0, IMGUI_GLOBAL_BEGIN_FLAG); - GUI::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); if (GUI::CollapsingHeader("GoblinSpector")) { _float3 vScale = m_pTransformCom->Get_Scale(); GUI::DragFloat3("Scale", (_float*)&vScale); diff --git a/Jusin154_Team3D/Client/Private/Goblin_Mage.cpp b/Jusin154_Team3D/Client/Private/Goblin_Mage.cpp index 7a07734a6..2c5ff339e 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Mage.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Mage.cpp @@ -518,7 +518,7 @@ void CGoblin_Mage::Free() void CGoblin_Mage::Describe_Entity() { GUI::Begin("UNIT", 0, IMGUI_GLOBAL_BEGIN_FLAG); - GUI::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); if (GUI::CollapsingHeader("Goblin_Mage")) { GUI::Checkbox("LookAt", &m_bLookAt); diff --git a/Jusin154_Team3D/Client/Private/Goblin_Spector.cpp b/Jusin154_Team3D/Client/Private/Goblin_Spector.cpp index bfc9d7298..77348aaa1 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Spector.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Spector.cpp @@ -337,7 +337,7 @@ void CGoblin_Spector::Free() void CGoblin_Spector::Describe_Entity() { GUI::Begin("UNIT", 0, IMGUI_GLOBAL_BEGIN_FLAG); - GUI::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); if (GUI::CollapsingHeader("GoblinSpector")) { _float3 vScale = m_pTransformCom->Get_Scale(); GUI::DragFloat3("Scale", (_float*)&vScale); diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index 90654d47c..f7e74c29a 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -94,13 +94,9 @@ HRESULT CLevel_GamePlay::Initialize(void* pArg) return E_FAIL; } - if (FAILED(Ready_Layer_RaceRing(TEXT("Layer_RaceRing")))) { - return E_FAIL; - } - - if (FAILED(Ready_Layer_ReparoObject(TEXT("Layer_ReparoObject")))) { - return E_FAIL; - } + //if (FAILED(Ready_Layer_ReparoObject(TEXT("Layer_ReparoObject")))) { + // return E_FAIL; + //} if (FAILED(Ready_Layer_SkyBox(TEXT("Layer_SkyBox")))) { return E_FAIL; @@ -108,9 +104,6 @@ HRESULT CLevel_GamePlay::Initialize(void* pArg) if (FAILED(Ready_Layer_Player(LAYER_PLAYER))) { return E_FAIL; } - if (FAILED(Ready_Layer_BroomRacerAI(TEXT("Layer_BroomRacerAI")))) { - return E_FAIL; - } if (FAILED(Ready_Layer_Monster())) { return E_FAIL; } @@ -325,8 +318,8 @@ HRESULT CLevel_GamePlay::Ready_Background() #ifdef gimch isReady_Background = true; - isReady_Hogsmeade = true; - isReady_Hogwart = false; + isReady_Hogsmeade = false; + isReady_Hogwart = true; #endif // gimch #ifdef Bin isReady_Background = false; @@ -340,8 +333,8 @@ HRESULT CLevel_GamePlay::Ready_Background() #endif // #ifdef 기무리 isReady_Background = true; - isReady_Hogsmeade = false; - isReady_Hogwart = false; + isReady_Hogsmeade = true; + isReady_Hogwart = true; #endif // #ifdef 나 isReady_Background = true; @@ -689,13 +682,13 @@ HRESULT CLevel_GamePlay::Ready_Layer_Player(const _wstring& strLayerTag) #endif // #ifdef 기무리 - isLoad_NPC = false; + isLoad_NPC = true; #endif // #ifdef 나 #endif // #ifdef Bin - + isLoad_NPC = false; #endif // Bin #endif // _DEBUG @@ -721,37 +714,11 @@ HRESULT CLevel_GamePlay::Ready_Layer_Player(const _wstring& strLayerTag) return S_OK; } -HRESULT CLevel_GamePlay::Ready_Layer_BroomRacerAI(const _wstring& strLayerTag) -{ -#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; -} - HRESULT CLevel_GamePlay::Ready_Layer_Item(const _wstring& strLayerTag) { return S_OK; } -HRESULT CLevel_GamePlay::Ready_Layer_RaceRing(const _wstring& strLayerTag) -{ - for (_uint i = 0; i < 1; ++i) { - - 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; -} HRESULT CLevel_GamePlay::Ready_Layer_ReparoObject(const _wstring& strLayerTag) { @@ -781,10 +748,10 @@ HRESULT CLevel_GamePlay::Ready_Layer_Monster() #endif // gimch #ifdef 진우 - + isLoad_Monster = true; #endif // #ifdef 기무리 - isLoad_Monster = false; + isLoad_Monster = true; #endif // #ifdef 나 diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index 293dfb4bb..4de85f7c0 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -1,4 +1,5 @@ -#include "pch.h" +#pragma region HEADER +#include "pch.h" #include "Camera_Debug.h" #include "Client_Struct.h" #include "GameInstance.h" @@ -196,6 +197,8 @@ #include "Ranrok_FireBall.h" #include "Ranrok_Breath.h" #include "Ranrok_Point.h" +#include "Ranrok_Charge.h" +#include "Ranrok_Pulse.h" #include "StunEffect.h" #include "Box_Splesh.h" @@ -234,7 +237,7 @@ #pragma endregion - +#pragma endregion CLoader::CLoader(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : m_pDevice{ pDevice } , m_pContext{ pContext } @@ -374,8 +377,8 @@ HRESULT CLoader::Loading_For_GamePlay() #ifdef _DEBUG #ifdef gimch - isLoad_Background = true; - isLoad_Hogwart = false; + isLoad_Background = false; + isLoad_Hogwart = true; isLoad_UI_SEQUANTIAL = false; #endif // gimch #ifdef 진우 @@ -385,10 +388,10 @@ HRESULT CLoader::Loading_For_GamePlay() #endif // #ifdef 기무리 isLoad_Background = true; - isLoad_Hogwart = false; - isLoad_UI_SEQUANTIAL = false; - isLoad_NPC = false; - isLoad_Monster = false; + isLoad_Hogwart = true; + isLoad_UI_SEQUANTIAL = true; + isLoad_NPC = true; + isLoad_Monster = true; #endif // #ifdef 나 isLoad_Background = true; @@ -1581,6 +1584,52 @@ HRESULT CLoader::Loading_For_GamePlay() }); + Asset_FileLoad("../Bin/Resources/Textures/Effect/Nomal", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) { + + _string strFilePath = pFilePath; + _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); + + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, wstrFileName, + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { + return E_FAIL; + } + + return S_OK; + + }); + + Asset_FileLoad("../Bin/Resources/Textures/Effect/Decal", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) { + + _string strFilePath = pFilePath; + _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); + + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, wstrFileName, + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { + return E_FAIL; + } + + return S_OK; + + }); + + + Asset_FileLoad("../Bin/Resources/Textures/Effect/DecalNormal", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) { + + _string strFilePath = pFilePath; + _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); + + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, wstrFileName, + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { + return E_FAIL; + } + + return S_OK; + + }); + #pragma endregion @@ -1751,13 +1800,32 @@ HRESULT CLoader::Loading_For_GamePlay() Desc.fDensity = 0.01f; Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY()); Desc.eLockFlag = {}; - Desc.vAutoDamping = { 12.f, 12.f }; + Desc.vAutoDamping = { 12.f, 120.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::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.75f, 0.25f, 0.25f }; + Desc.fDensity = 0.01f; + Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY()); + Desc.eLockFlag = {}; + Desc.vAutoDamping = { 1200.f, 1200.f }; + Desc.vLocalRotQ = { 0.f, 0.f, 0.f, 1.f }; + Desc.vLocalTranslation = { 0.f, 1.0f, 0.f }; + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_NPC_HITBOX"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) { + return E_FAIL; + } + } { CRigidBody_Dynamic::RIGIDBODY_PROTOTYPE_DYNAMIC_DESC Desc{}; Desc.eType = ACTOR::CAPSULE; @@ -1770,7 +1838,7 @@ HRESULT CLoader::Loading_For_GamePlay() Desc.fDensity = 0.01f; Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY()); Desc.eLockFlag = {}; - Desc.vAutoDamping = { 12.f, 12.f }; + Desc.vAutoDamping = { 12.f, 120.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)))) { @@ -1785,7 +1853,7 @@ HRESULT CLoader::Loading_For_GamePlay() 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.vhalfGeometryInfo = { 0.06f, 0.25f, 0.f }; Desc.fDensity = 122.f; Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY()); Desc.eLockFlag = {}; @@ -1796,6 +1864,25 @@ HRESULT CLoader::Loading_For_GamePlay() 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.01f, 0.01f, 0.01f }; + Desc.fContactOffset = { 0.01f }; + Desc.vhalfGeometryInfo = { 0.120f, 0.460f, 0.010f }; + Desc.fDensity = 100.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_LowerBound"), 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; @@ -1858,25 +1945,25 @@ HRESULT CLoader::Loading_For_GamePlay() CRigidBody_Dynamic::RIGIDBODY_PROTOTYPE_DYNAMIC_DESC Desc{}; { Desc.eType = ACTOR::BOX; - Desc.ePxRigidBodyFlags = { PSX::PxRigidBodyFlag::eKINEMATIC }; + 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 = { 0.35f, 0.65f, 0.15f }; + Desc.vhalfGeometryInfo = { 0.5f, 1.f, 0.125f }; Desc.fDensity = 1.f; PSX::PxTransform pxPivotTransform = PSX::PxTransform(PSX::PxVec3(0.f, 1.f, 0.f)); Desc.vLocalRotQ = { 0.f, 0.f, 0.f, 1.f }; - Desc.vLocalTranslation = { 0.5f, 0.f, 0.f }; + Desc.vLocalTranslation = { 0.5f, 1.375f, 0.f }; Desc.pxMassCenter = pxPivotTransform; Desc.eLockFlag = { - PSX::PxRigidDynamicLockFlag::eLOCK_ANGULAR_X | + //PSX::PxRigidDynamicLockFlag::eLOCK_ANGULAR_X | //PSX::PxRigidDynamicLockFlag::eLOCK_ANGULAR_Y | - PSX::PxRigidDynamicLockFlag::eLOCK_ANGULAR_Z | - PSX::PxRigidDynamicLockFlag::eLOCK_LINEAR_Y | - PSX::PxRigidDynamicLockFlag::eLOCK_LINEAR_X | - PSX::PxRigidDynamicLockFlag::eLOCK_LINEAR_Z + //PSX::PxRigidDynamicLockFlag::eLOCK_ANGULAR_Z | + //PSX::PxRigidDynamicLockFlag::eLOCK_LINEAR_Y | + //PSX::PxRigidDynamicLockFlag::eLOCK_LINEAR_X | + //PSX::PxRigidDynamicLockFlag::eLOCK_LINEAR_Z }; Desc.vAutoDamping = { 10.f, 10.f }; } @@ -2179,6 +2266,14 @@ HRESULT CLoader::Loading_For_GamePlay() return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CRanrok_Pulse::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CRanrok_Charge::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CGoblin_Teleport::Create(m_pDevice, m_pContext)))) { return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/MainApp.cpp b/Jusin154_Team3D/Client/Private/MainApp.cpp index a792a9d92..1109068a5 100644 --- a/Jusin154_Team3D/Client/Private/MainApp.cpp +++ b/Jusin154_Team3D/Client/Private/MainApp.cpp @@ -69,7 +69,7 @@ void CMainApp::Update(_float fTimeDelta) #ifdef _DEBUG m_pGameInstance->Present_TimeCost(); GUI::Begin("SYSTEM", 0, IMGUI_GLOBAL_BEGIN_FLAG); - GUI::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); GUI::SliderFloat("fTimeMult", &g_fTimeMult, 0.01f, 4.f); GUI::End(); m_pGameInstance->Update_Engine(fTimeDelta * g_fTimeMult); @@ -222,13 +222,13 @@ HRESULT CMainApp::Ready_Prototypes() HRESULT CMainApp::Ready_IMGUI() { IMGUI_CHECKVERSION(); - ImGui::CreateContext(); - ImGuiIO& io = ImGui::GetIO(); (void)io; + GUI::CreateContext(); + ImGuiIO& io = GUI::GetIO(); (void)io; ImFont* font = nullptr; io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; - ImGui::StyleColorsDark(); + GUI::StyleColorsDark(); ImGui_ImplWin32_Init(g_hWnd); ImGui_ImplDX11_Init(m_pDevice, m_pContext); @@ -255,7 +255,7 @@ HRESULT CMainApp::Release_IMGUI() { ImGui_ImplDX11_Shutdown(); ImGui_ImplWin32_Shutdown(); - ImGui::DestroyContext(); + GUI::DestroyContext(); return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/MapElement_Chest.cpp b/Jusin154_Team3D/Client/Private/MapElement_Chest.cpp index 2b25e411a..2bffa31c1 100644 --- a/Jusin154_Team3D/Client/Private/MapElement_Chest.cpp +++ b/Jusin154_Team3D/Client/Private/MapElement_Chest.cpp @@ -63,6 +63,10 @@ HRESULT CMapElement_Chest::Initialize(void* pArg) void CMapElement_Chest::Priority_Update(_float fTimeDelta) { + m_iEntered -= 1; + if (m_iEntered < 0) { + m_iEntered = 0; + } m_pLid->Priority_Update(fTimeDelta); } @@ -168,6 +172,17 @@ HRESULT CMapElement_Chest::Render() return S_OK; } +void CMapElement_Chest::OnRayCollision(CGameObject* pCaster, _uint iCastedOrder, _float fDistance, _float3 vCastedWorldPos) +{ + CPlayer* pPlayer = dynamic_cast(pCaster); + if (nullptr == pPlayer) { + return; + } + if (fDistance < m_fEncounterDistance) { + m_iEntered = 4; + } +} + HRESULT CMapElement_Chest::Ready_Components(void* pArg) { if (FAILED(__super::Ready_Components(pArg))) { diff --git a/Jusin154_Team3D/Client/Private/MapElement_Door.cpp b/Jusin154_Team3D/Client/Private/MapElement_Door.cpp index 368b0985e..ac1f0ed49 100644 --- a/Jusin154_Team3D/Client/Private/MapElement_Door.cpp +++ b/Jusin154_Team3D/Client/Private/MapElement_Door.cpp @@ -40,91 +40,59 @@ HRESULT CMapElement_Door::Initialize(void* pArg) if (FAILED(Ready_Components(pArg))) return E_FAIL; - m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vPosition), 1.f)); - m_pTransformCom->Set_Scale(pDesc->vScale); - m_pTransformCom->Rotation(XMConvertToRadians(pDesc->vRotation.x), XMConvertToRadians(pDesc->vRotation.y), XMConvertToRadians(pDesc->vRotation.z)); - - XMStoreFloat4((_float4*)&m_pxStartQuat, m_pTransformCom->Get_QuarternionVector()); - XMStoreFloat4x4(&m_InitialMatrix, m_pTransformCom->Get_XMWorldMatrix()); - - m_vRadianYAngle.y = pDesc->vRotation.z; - m_vRadianYAngle.x = m_vRadianYAngle.y + XMConvertToRadians(-70.f); - m_vRadianYAngle.z = m_vRadianYAngle.y + XMConvertToRadians(70.f); - - { // RIGID_BODY - CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; - Desc.iSubKind = ENUM_CLASS(PXOBJECT::DOOR); - if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_DOOR"), (CComponent**)&m_pRigidBody, &Desc))) { - return E_FAIL; - } - } - m_pActor = (PSX::PxRigidDynamic*)m_pRigidBody->Get_Actor(); - return S_OK; } void CMapElement_Door::Priority_Update(_float fTimeDelta) { - if (m_pActor->getRigidBodyFlags() & PSX::PxRigidBodyFlag::eKINEMATIC) { + GUI::Text("m_vKinematicTimer %.3f", m_vKinematicTimer.x); + if (m_vKinematicTimer.x != 0) { m_vKinematicTimer.x += fTimeDelta; - if (m_vKinematicTimer.x < m_vKinematicTimer.z) { - // 행렬없이 럴프 버전 - _float fTime = max(0.f, ((m_vKinematicTimer.x - m_vKinematicTimer.y) / (m_vKinematicTimer.z - m_vKinematicTimer.y))); - Lerp_Matrix(fTime); - //Lerp_NonMatrix(fTime); + if (m_vKinematicTimer.y < m_vKinematicTimer.x) { + m_vKinematicTimer.x = 0.f; } - else { - m_pActor->setRigidBodyFlag(PSX::PxRigidBodyFlag::eKINEMATIC, false); + } + else { + ActingIdle(); + } +} + +void CMapElement_Door::ActingIdle() +{ + _float fCurrentDegree = XMConvertToDegrees(m_pJoint->getAngle()); + GUI::Text("%.2f", fCurrentDegree); + GUI::Text("%.2f", m_pJoint->getVelocity()); + if (fabsf(fCurrentDegree) >= 2.f) { // 각도가 벌어져 있는데 + if (false == m_bDrive) { // 드라이브 중이 아니면 드라이브시킴 + m_bDrive = true; + m_pJoint->setRevoluteJointFlag(PSX::PxRevoluteJointFlag::eDRIVE_ENABLED, true); + m_pJoint->setDriveForceLimit(120.f); + } + if (true == m_bDrive) { // 드라이브 중이면 + if (fCurrentDegree > 0.f) { + + } + else { + m_pJoint->setDriveVelocity(40.f); + } + } + } + else { // 각도가 안벌어져 있음 + if (true == m_bDrive && fCurrentDegree < 0.3f) { // 드라이브 중지 트리거 + m_pJoint->setRevoluteJointFlag(PSX::PxRevoluteJointFlag::eDRIVE_ENABLED, false); } } } void CMapElement_Door::Update(_float fTimeDelta) { +#ifdef _DEBUG + Describe_Entity(); +#endif // _DEBUG } void CMapElement_Door::Late_Update(_float fTimeDelta) { - - _vector vRPY = m_pTransformCom->Get_RollPitchYawVector(); - if (!(m_pActor->getRigidBodyFlags() & PSX::PxRigidBodyFlag::eKINEMATIC)) { - _float fPitch = XMVectorGetX(vRPY); - _float fYaw = XMVectorGetY(vRPY); - _float fRoll = XMVectorGetZ(vRPY); - - _float fClampedYaw = ClampRadian(fYaw); - if (fClampedYaw != fYaw) { - _vector vNewQuat = XMQuaternionRotationRollPitchYaw(fPitch, fClampedYaw, fRoll); - - PSX::PxTransform actorPose = m_pActor->getGlobalPose(); - PSX::PxTransform massLocalPose = m_pActor->getCMassLocalPose(); - - PSX::PxVec3 vpxMassLocal = massLocalPose.p; - PSX::PxVec3 vpxMassWorld = actorPose.transform(vpxMassLocal); - - _vector vMassLocal = XMVectorSet(vpxMassLocal.x, vpxMassLocal.y, vpxMassLocal.z, 0.f); - _vector vMassWorld = XMVectorSet(vpxMassWorld.x, vpxMassWorld.y, vpxMassWorld.z, 1.f); - - _float3 vScale = m_pTransformCom->Get_Scale(); - _matrix ScaleMatrix = XMMatrixScalingFromVector(XMLoadFloat3(&vScale)); - _matrix RotationMatrix = XMMatrixRotationQuaternion(vNewQuat); - - _matrix TranslationLocal = XMMatrixTranslationFromVector(-vMassLocal); - _matrix TranslationWorld = XMMatrixTranslationFromVector(vMassWorld); - - // 최종 월드 행렬 - _matrix world = TranslationLocal // 피벗중심으로 좌표계를 이동시킴 - * (ScaleMatrix * RotationMatrix * TranslationWorld); // 그 후 SRT 적용 - - m_pTransformCom->Set_WorldMatrix(world); - m_pActor->setGlobalPose(XMWorldToPx_NoScaleNoFlip(world)); - - m_pActor->setAngularVelocity(PSX::PxVec3(0)); - m_pActor->setLinearVelocity(PSX::PxVec3(0)); - m_pActor->setRigidBodyFlag(PSX::PxRigidBodyFlag::eKINEMATIC, true); - m_vKinematicTimer.x = 0.f; - } - } if (m_pGameInstance->IsIn_WorldFrustum(Get_WorldPostion(), m_pModelComs[0]->Get_Radius())) { m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); } @@ -161,6 +129,15 @@ HRESULT CMapElement_Door::Render() return S_OK; } +void CMapElement_Door::OnCollision(CGameObject* pOther, void* pDesc) +{ + if (0.f != m_vKinematicTimer.x) { + return; + } + + m_vKinematicTimer.x = FLT_EPSILON3; +} + HRESULT CMapElement_Door::Ready_Components(void* pArg) { if (FAILED(__super::Ready_Components(pArg))) { @@ -187,12 +164,49 @@ HRESULT CMapElement_Door::Ready_Components(void* pArg) ELEMENT_DOOR_DESC* pPhysXDummyDesc = static_cast(pArg); + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pPhysXDummyDesc->vPosition), 1.f)); + m_pTransformCom->Set_Scale(pPhysXDummyDesc->vScale); + m_pTransformCom->Rotation(XMConvertToRadians(pPhysXDummyDesc->vRotation.x), XMConvertToRadians(pPhysXDummyDesc->vRotation.y), XMConvertToRadians(pPhysXDummyDesc->vRotation.z)); + + { // RIGID_BODY + CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; + Desc.iSubKind = ENUM_CLASS(PXOBJECT::DOOR); + Desc.bAutoOwnerTranslation = false; + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_DOOR"), (CComponent**)&m_pRigidBody, &Desc))) { + return E_FAIL; + } + m_pActor = (PSX::PxRigidDynamic*)m_pRigidBody->Get_Actor(); + m_pRigidBody->Move_Kinematic(m_pTransformCom->Get_State(STATE::POSITION), m_pTransformCom->Get_QuarternionVector(), true); + } + PSX::PxTransform doorWorldPose = m_pActor->getGlobalPose(); + PSX::PxVec3 hingePivotWorld = PSX::PxVec3(39.64f, 5.12f, 71.f); + PSX::PxVec3 hingeAxisWorld = doorWorldPose.q.rotate(PSX::PxVec3(0.f, 1.f, 0.f)).getNormalized(); + PSX::PxTransform jointWorldPose; + jointWorldPose.p = hingePivotWorld; + jointWorldPose.q = CMyTools::Calc_RevJointPosFromWorldHingeAxis(hingeAxisWorld); + PSX::PxTransform localFrameDoor = doorWorldPose.transformInv(jointWorldPose); + + m_pJoint = (PSX::PxRevoluteJoint*)m_pGameInstance->Create_PxJoint(PHYSX_JOINT::REVOLUTE, nullptr, jointWorldPose, m_pActor, localFrameDoor); + + m_pJoint->setLimit(PSX::PxJointAngularLimitPair(-XMConvertToRadians(100.f), XMConvertToRadians(100.f))); + m_pJoint->setRevoluteJointFlag(PSX::PxRevoluteJointFlag::eLIMIT_ENABLED, true); + + m_pJoint->setDriveForceLimit(120.f); + + m_pJoint->setConstraintFlag(PSX::PxConstraintFlag::eVISUALIZATION, true); + m_pActor->setLinearVelocity(PSX::PxVec3(0.f, 0.f, 0.f)); + m_pActor->setAngularVelocity(PSX::PxVec3(0.f, 0.f, 0.f)); + m_pActor->putToSleep(); return S_OK; } HRESULT CMapElement_Door::Bind_ShaderResources() { - if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", m_pTransformCom->Get_WorldMatrixPtr()))) { + _float3 vScale = m_pTransformCom->Get_Scale(); + _float4x4 WorldMatirx = {}; + PSX::PxTransform pxPos = m_pRigidBody->Get_GlobalPosition(); + XMStoreFloat4x4(&WorldMatirx, XMMatrixAffineTransformation(XMLoadFloat3(&vScale), XMVectorZero(), XMLoadFloat4((_float4*)&pxPos.q), XMVectorSetW(XMLoadFloat3((_float3*)&pxPos.p), 1.f))); + if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", &WorldMatirx))) { return E_FAIL; } if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) { @@ -209,67 +223,6 @@ HRESULT CMapElement_Door::Bind_ShaderResources() return S_OK; } -void CMapElement_Door::Lerp_Matrix(_float fTime) -{ - { - _float4x4 OutMatrix = {}; - _float4x4 CurrentMatrix = {}; - XMStoreFloat4x4(&CurrentMatrix, m_pTransformCom->Get_XMWorldMatrix()); - CMyTools::MatrixLerp(&CurrentMatrix, &m_InitialMatrix, OutMatrix, fTime); - m_pTransformCom->Set_WorldMatrix(OutMatrix); - } -} - -void CMapElement_Door::Lerp_NonMatrix(_float fTime) -{ - { - _vector vCurrQ = m_pTransformCom->Get_QuarternionVector(); - _vector vInitialQ = XMLoadFloat4((_float4*)&m_pxStartQuat); - _vector vLerpQuat = XMVector4Normalize(XMVectorLerp(vCurrQ, vInitialQ, fTime)); - - PSX::PxTransform actorPose = m_pActor->getGlobalPose(); - PSX::PxTransform massLocalPose = m_pActor->getCMassLocalPose(); - - PSX::PxVec3 vpxMassLocal = massLocalPose.p; - PSX::PxVec3 vpxMassWorld = actorPose.transform(vpxMassLocal); - - _vector vMassLocal = XMVectorSet(vpxMassLocal.x, vpxMassLocal.y, vpxMassLocal.z, 0.f); - _vector vMassWorld = XMVectorSet(vpxMassWorld.x, vpxMassWorld.y, vpxMassWorld.z, 1.f); - - - _float3 vScale = m_pTransformCom->Get_Scale(); - _matrix ScaleMatrix = XMMatrixScalingFromVector(XMLoadFloat3(&vScale)); - _matrix RotationMatrix = XMMatrixRotationQuaternion(vLerpQuat); - - _matrix TranslationLocal = XMMatrixTranslationFromVector(-vMassLocal); - _matrix TranslationWorld = XMMatrixTranslationFromVector(vMassWorld); - - // 최종 월드 행렬 - _matrix world = TranslationLocal // 피벗중심으로 좌표계를 이동시킴 - * (ScaleMatrix * RotationMatrix * TranslationWorld); // 그 후 SRT 적용 - - m_pTransformCom->Set_WorldMatrix(world); - } -} - -_float CMapElement_Door::ClampRadian(_float fNewRadian) -{ - // [x, z] 사이로 잘라주는 단순한 클램프 - _float minYaw = m_vRadianYAngle.x; - _float maxYaw = m_vRadianYAngle.z; - - // 라디안 노멀라이즈 ([-pi, pi] 같은 범위로) - fNewRadian = CMyTools::NormalizeRadian(fNewRadian); - - if (fNewRadian < minYaw) { - fNewRadian = minYaw; - } - else if (fNewRadian > maxYaw) { - fNewRadian = maxYaw; - } - return fNewRadian; -} - CMapElement_Door* CMapElement_Door::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { CMapElement_Door* pInstance = new CMapElement_Door(pDevice, pContext); @@ -313,7 +266,50 @@ void CMapElement_Door::Free() #ifdef _DEBUG void CMapElement_Door::Describe_Entity() { - + GUI::Begin("PhysX"); + if (GUI::CollapsingHeader("Door")) { + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); + if (GUI::CollapsingHeader("DOOR")) { + { + GUI::Text("Velo : %.2f", m_pJoint->getVelocity()); + PSX::PxTransform pxActorLocalPos = m_pJoint->getLocalPose(PSX::PxJointActorIndex::eACTOR1); + if (true == CMyTools::DescribePxTransform(pxActorLocalPos, (size_t)this)) { + m_pJoint->setLocalPose(PSX::PxJointActorIndex::eACTOR1, pxActorLocalPos); + } + } + { + PSX::PxTransform pxRelativeLocalPos = m_pJoint->getRelativeTransform(); + PSX::PxVec3 vAxis = {}; + _float fAngle = {}; + pxRelativeLocalPos.q.toRadiansAndUnitAxis(fAngle, vAxis); + GUI::Text("RelPos : %.2f %.2f %.2f", pxRelativeLocalPos.p.x, pxRelativeLocalPos.p.y, pxRelativeLocalPos.p.z); + GUI::Text("fAngle vAxis : %.2f %.2f %.2f %.2f", fAngle, vAxis.x, vAxis.y, vAxis.z); + } + _float fDrive = m_pJoint->getDriveVelocity(); + _float fDriveDegree = XMConvertToDegrees(fDrive); + if (GUI::DragFloat("Drive", &fDriveDegree, 1.f, -180.f, 180.f, "%.2f")) { + fDrive = XMConvertToRadians(fDriveDegree); + m_pJoint->setDriveVelocity(fDrive); + } + _float2 vDriveLimit = {}; + _float2 vSpring = {}; + { + auto pxDriveLimit = m_pJoint->getLimit(); + vDriveLimit = { pxDriveLimit.lower, pxDriveLimit.upper }; + vSpring.x = pxDriveLimit.stiffness; + vSpring.y = pxDriveLimit.damping; + //pxDriveLimit.; + } + if (GUI::DragFloat2("Limit ", (_float*)&vDriveLimit, XMConvertToRadians(1.f), -XMConvertToRadians(180.f), XMConvertToRadians(180.f), "%.2f")) { + m_pJoint->setLimit(PSX::PxJointAngularLimitPair(vDriveLimit.x, vDriveLimit.y, PSX::PxSpring(vSpring.x, vSpring.y))); + } + if (GUI::DragFloat2("Spring Damping", (_float*)&vSpring, 1.f, 0.f, 100.f, "%.2f")) { + m_pJoint->setLimit(PSX::PxJointAngularLimitPair(vDriveLimit.x, vDriveLimit.y, PSX::PxSpring(vSpring.x, vSpring.y))); + } + m_pRigidBody->Describe_Entity(); + } + } + GUI::End(); } #endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp b/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp index 6999d09c0..ac6a3296c 100644 --- a/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp +++ b/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp @@ -272,18 +272,6 @@ HRESULT CMapElement_Interactable::Render_OutLine() return E_FAIL; } -#ifdef _DEBUG - GUI::Begin("Unit", 0, IMGUI_GLOBAL_BEGIN_FLAG); - if (GUI::CollapsingHeader("OutLine")) { - GUI::SetNextItemWidth(80.f); - GUI::ColorPicker3("vOutLineColor", (_float*)&m_vOutLineColor); - GUI::SliderFloat("Thickness", &m_fOutLineThickness, 0.1f, 2.f, "%.1f"); - GUI::SliderFloat("Scale", &m_fOutLineScale, 0.1f, 2.f, "%.1f"); - GUI::SliderFloat("Power", &m_fOutLinePower, 0.1f, 2.f, "%.1f"); - } - GUI::End(); -#endif // _DEBUG - Compute_Depth(); _float fCamFar = *m_pGameInstance->Get_CurrentCameraFar(); _float fRatio = CMyTools::Saturate((m_fCamDepth / (fCamFar * fCamFar))); diff --git a/Jusin154_Team3D/Client/Private/Monster.cpp b/Jusin154_Team3D/Client/Private/Monster.cpp index 24148ddf9..ee678db8b 100644 --- a/Jusin154_Team3D/Client/Private/Monster.cpp +++ b/Jusin154_Team3D/Client/Private/Monster.cpp @@ -180,7 +180,6 @@ _float2 CMonster::Get_Hp() { return { m_pStat->Get_Stat().fCurrentHp, m_pStat->Get_Stat().fMaxHp }; } - CStat* CMonster::Get_Stat() { return m_pStat; @@ -191,6 +190,11 @@ const _float4x4* CMonster::Get_HeadMatrix() return m_pModelCom->Get_BoneMatrixPtr("Head"); } +_float CMonster::Get_HpRatio() +{ + return Get_Hp().x / Get_Hp().y; +} + void CMonster::CameraShake(_float ClampValue, _float Min, _float Max, _float Time) { CPlayer* pPlayer = static_cast(m_pInfoInstance->Get_NearestPlayerAlly(Get_WorldPostion()).first); @@ -201,6 +205,16 @@ void CMonster::CameraShake(_float ClampValue, _float Min, _float Max, _float Tim pPlayer->Start_CameraShake(Time, fShakeValue); } +_bool CMonster::IsHitStateDisabled() +{ + return _bool(); +} + +_bool CMonster::IsHitSpellDisabled() +{ + return _bool(); +} + HRESULT CMonster::Ready_Components(void*pArg) { __super::Ready_Components(pArg); @@ -286,11 +300,11 @@ void CMonster::Free() void CMonster::Describe_Entity() { - if (ImGui::TreeNode("ANIM STATE")) { + if (GUI::TreeNode("ANIM STATE")) { for (auto& pState : m_States) { - if (ImGui::Button(to_string(pState.first).c_str())) + if (GUI::Button(to_string(pState.first).c_str())) { m_pFSM->Change_State(pState.first); } @@ -299,7 +313,7 @@ void CMonster::Describe_Entity() GUI::Text(to_string(m_pModelCom->Get_CurrentTrackProgressRatio()).c_str()); - ImGui::TreePop(); + GUI::TreePop(); } } diff --git a/Jusin154_Team3D/Client/Private/NPC_EleazarFig.cpp b/Jusin154_Team3D/Client/Private/NPC_EleazarFig.cpp index 8f0bff5d1..263d1f7dc 100644 --- a/Jusin154_Team3D/Client/Private/NPC_EleazarFig.cpp +++ b/Jusin154_Team3D/Client/Private/NPC_EleazarFig.cpp @@ -21,6 +21,10 @@ CNPC_EleazarFig::CNPC_EleazarFig(const CNPC_EleazarFig& Prototype) void CNPC_EleazarFig::Priority_Update(_float fTimeDelta) { m_pTransformCom->RewindMomentum(); + m_iEntered -= 1; + if (m_iEntered < 0) { + m_iEntered = 0; + } __super::Priority_Update(fTimeDelta); } @@ -38,6 +42,8 @@ void CNPC_EleazarFig::Update(_float fTimeDelta) m_pCharacter_Controller->Move(fTimeDelta); m_pCallBack_HitReport->Set_CurrentSlop(); } + + //m_pNPCInteraction->Set_Visible(0 < m_iEntered); } void CNPC_EleazarFig::Late_Update(_float fTimeDelta) @@ -152,19 +158,16 @@ HRESULT CNPC_EleazarFig::Bind_ShaderResources() return S_OK; } -_bool CNPC_EleazarFig::CastToPlayer() +void CNPC_EleazarFig::OnRayCollision(CGameObject* pCaster, _uint iCastedOrder, _float fDistance, _float3 vCastedWorldPos) { - _vector vCurrentPos = m_pTransformCom->Get_State(STATE::POSITION); - _vector vTargetPos = {}; - pair pairAllyInfo = m_pInfoInstance->Get_NearestPlayerAlly(m_pTransformCom->Get_State(STATE::POSITION)); - vTargetPos = pairAllyInfo.second->Get_State(STATE::POSITION); - _float fLength = XMVectorGetX(XMVector4Length(vTargetPos - vCurrentPos)); - if (fLength < m_fEncounterDistance) { - return true; + CPlayer* pPlayer = dynamic_cast(pCaster); + if (nullptr == pPlayer) { + return; + } + if (fDistance < m_fEncounterDistance) { + m_iEntered = 4; } - return false; } - HRESULT CNPC_EleazarFig::Initialize_Prototype() { return S_OK; @@ -216,7 +219,7 @@ HRESULT CNPC_EleazarFig::Ready_Components(void* pArg) { // CCT CCharacter_Controller::Character_Controller_DESC Desc{}; - Desc.iSubKind = ENUM_CLASS(PXOBJECT::OLLIVANDER); + Desc.iSubKind = ENUM_CLASS(PXOBJECT::ELEAZARFIG); Desc.pTransform = m_pTransformCom; Desc.eBodyType = ACTOR::CAPSULE; Desc.fContactOffset = 0.0001f; @@ -234,6 +237,14 @@ HRESULT CNPC_EleazarFig::Ready_Components(void* pArg) } m_pCharacter_Controller->SetGravity(true); } + { // DO + CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; + Desc.iSubKind = ENUM_CLASS(PXOBJECT::ELEAZARFIG); + Desc.bAutoOwnerTranslation = false; + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_NPC_HITBOX"), (CComponent**)&m_pRigidBody, &Desc))) { + return E_FAIL; + } + } return S_OK; } @@ -266,6 +277,7 @@ void CNPC_EleazarFig::Free() { __super::Free(); + SAFE_RELEASE(m_pRigidBody); SAFE_RELEASE(m_pCharacter_Controller); if (nullptr != m_pInfoInstance) { CInfoInstance* pInfo = m_pInfoInstance; diff --git a/Jusin154_Team3D/Client/Private/NPC_Ollivander.cpp b/Jusin154_Team3D/Client/Private/NPC_Ollivander.cpp index 91c8304cd..c4f6f74a6 100644 --- a/Jusin154_Team3D/Client/Private/NPC_Ollivander.cpp +++ b/Jusin154_Team3D/Client/Private/NPC_Ollivander.cpp @@ -22,6 +22,10 @@ CNPC_Ollivander::CNPC_Ollivander(const CNPC_Ollivander& Prototype) void CNPC_Ollivander::Priority_Update(_float fTimeDelta) { m_pTransformCom->RewindMomentum(); + m_iEntered -= 1; + if (m_iEntered < 0) { + m_iEntered = 0; + } __super::Priority_Update(fTimeDelta); } @@ -33,82 +37,14 @@ void CNPC_Ollivander::Update(_float fTimeDelta) #ifdef _DEBUG Describe_Entity(); #endif // _DEBUG - if (false == m_bEntered) - { - if (true == CastToPlayer()) { - m_vEnteringTimer.x += fTimeDelta; - if (m_vEnteringTimer.x > m_vEnteringTimer.y) { - m_vEnteringTimer.x -= m_vEnteringTimer.y; - m_bEntered = true; - // Active(); - } -#ifdef _DEBUG - GUI::Begin("UNIT"); - if (GUI::CollapsingHeader("Ollivander")) { - GUI::Text("Timer :%.1f", m_vEnteringTimer.x); - GUI::Text("Hello"); - } - GUI::End(); -#endif // _DEBUG - } - } - else { - if (false == CastToPlayer()) { - m_vEnteringTimer.x += fTimeDelta; - if (m_vEnteringTimer.x > m_vEnteringTimer.y) { - m_vEnteringTimer.x -= m_vEnteringTimer.y; - m_bEntered = false; - // DeActive(), Ready To Enter; - } -#ifdef _DEBUG - GUI::Begin("UNIT"); - if (GUI::CollapsingHeader("Ollivander")) { - GUI::Text("Timer :%.1f", m_vEnteringTimer.x); - GUI::Text("CoolTime"); - } - GUI::End(); -#endif // _DEBUG - } - else { -#ifdef _DEBUG - GUI::Begin("UNIT"); - if (GUI::CollapsingHeader("Ollivander")) { - GUI::Text("Timer :%.1f", m_vEnteringTimer.x); - GUI::Text("You must go Out"); - } - GUI::End(); -#endif // _DEBUG - } - } - - if (false == CastToPlayer() && false == m_bEntered) { -#ifdef _DEBUG - GUI::Begin("UNIT"); - if (GUI::CollapsingHeader("Ollivander")) { - GUI::Text("Timer :%.1f", m_vEnteringTimer.x); - GUI::Text("Waiting For ReEnter"); - } - GUI::End(); -#endif // _DEBUG - } - - { // 세트 m_pCallBack_HitReport->BeginFrame(); m_pCharacter_Controller->Move(fTimeDelta); m_pCallBack_HitReport->Set_CurrentSlop(); } - m_pNPCInteraction->Set_Visible(m_bEntered); - - if (m_bEntered == true) - { - if (m_pGameInstance->Key_Down(DIK_F)) - { - - } - } - + m_pNPCInteraction->Set_Visible(0 < m_iEntered); + m_pRigidBody->Set_Position(m_pTransformCom->Get_State(STATE::POSITION), true); } void CNPC_Ollivander::Late_Update(_float fTimeDelta) @@ -197,6 +133,17 @@ HRESULT CNPC_Ollivander::Render_Shadow(SHADOW eType) return S_OK; } +void CNPC_Ollivander::OnRayCollision(CGameObject* pCaster, _uint iCastedOrder, _float fDistance, _float3 vCastedWorldPos) +{ + CPlayer* pPlayer = dynamic_cast(pCaster); + if (nullptr == pPlayer) { + return; + } + if (fDistance < m_fEncounterDistance) { + m_iEntered = 4; + } +} + HRESULT CNPC_Ollivander::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { @@ -223,19 +170,6 @@ HRESULT CNPC_Ollivander::Bind_ShaderResources() return S_OK; } -_bool CNPC_Ollivander::CastToPlayer() -{ - _vector vCurrentPos = m_pTransformCom->Get_State(STATE::POSITION); - _vector vTargetPos = {}; - pair pairAllyInfo = m_pInfoInstance->Get_NearestPlayerAlly(m_pTransformCom->Get_State(STATE::POSITION)); - vTargetPos = pairAllyInfo.second->Get_State(STATE::POSITION); - _float fLength = XMVectorGetX(XMVector4Length(vTargetPos - vCurrentPos)); - if (fLength < m_fEncounterDistance) { - return true; - } - return false; -} - HRESULT CNPC_Ollivander::Initialize_Prototype() { return S_OK; @@ -295,8 +229,8 @@ HRESULT CNPC_Ollivander::Ready_Components(void* pArg) Desc.fMaterial = { 1.2f, 1.0f, 0.0f }; Desc.bAutoStepping = { false }; Desc.fStepOffset = { 0.02f }; - Desc.fRadius = 0.5f; - Desc.fHeight = 0.6f; + Desc.fRadius = 0.2f; + Desc.fHeight = 0.3f; Desc.pCallback_HitReport = m_pCallBack_HitReport = CCallBack_NonPlayable_HitReport::Create(); Desc.pCallback_Behavior = m_pCallBack_Behavior = CCallBack_NonPlayable_Behavior::Create(); Desc.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY; @@ -306,6 +240,15 @@ HRESULT CNPC_Ollivander::Ready_Components(void* pArg) } m_pCharacter_Controller->SetGravity(true); } + { // DO + CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; + Desc.iSubKind = ENUM_CLASS(PXOBJECT::OLLIVANDER); + Desc.bAutoOwnerTranslation = false; + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_NPC_HITBOX"), (CComponent**)&m_pRigidBody, &Desc))) { + return E_FAIL; + } + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("OLLIVENDER"), (CComponent**)&m_pNpcStat))) { return E_FAIL; @@ -350,6 +293,7 @@ void CNPC_Ollivander::Free() SAFE_RELEASE(m_pCharacter_Controller); SAFE_RELEASE(m_pNpcStat); + SAFE_RELEASE(m_pRigidBody); if (nullptr != m_pInfoInstance) { CInfoInstance* pInfo = m_pInfoInstance; m_pInfoInstance = nullptr; diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index 9361d0dab..4e044dd1f 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -93,17 +93,6 @@ HRESULT CPlayer::Initialize(void* pArg) m_pTransformCom->Rotation(vRotQ); m_pBroomRaceManager = pDesc->pBroomRaceManager; - - if (m_pBroomRaceManager) - { - CBroomRaceManager::RacerInfo Info; - - Info.pRacer = this; - Info.curRing = 0; - Info.prevPos = Get_WorldPostion(); - - m_pBroomRaceManager->Push_BroomRacer(Info); - } } #ifdef _DEBUG @@ -121,12 +110,9 @@ HRESULT CPlayer::Initialize(void* pArg) m_bAI = false; - //XMLoadFloat4x4(m_pBroomModel->Get_BoneMatrixPtr("broomSocket")); - - m_pModelCom->Set_Temp(true); - - - + XMLoadFloat4x4(m_pBroomModel->Get_BoneMatrixPtr("broomSocket")); + m_fRayDistance = 10.f; + m_pModelCom->Set_DisableRootMotionScale(true); return S_OK; } @@ -145,6 +131,7 @@ void CPlayer::Update(_float fTimeDelta) { Update_CameraCoordinateSystem(fTimeDelta); UpdateGrapInteractive(fTimeDelta); + Update_RaycastElements(); m_pFSM->Update_State(fTimeDelta); @@ -219,20 +206,6 @@ void CPlayer::Late_Update(_float fTimeDelta) m_pTransformCom->Set_State(STATE::UP, up); m_pTransformCom->Set_State(STATE::LOOK, look); //////////////////////////////////////////////////////////////////////////// - - - if (nullptr == m_pRobePart) { - { - CPlayerRobe::PlayerRobe_DESC Desc{}; - Desc.pModel = m_pModelCom; - Desc.pParentTransform = m_pTransformCom; - Desc.pSocketMatrix = m_pModelCom->Get_BoneMatrixPtr("Hips_Cloth"); - if (FAILED(Add_PartObject("RobePart", g_iStaticLevel, &m_pRobePart, &Desc))) { - assert(false); - } - } - } - } @@ -277,7 +250,6 @@ HRESULT CPlayer::Render() return E_FAIL; } - m_pModelCom->Bind_OutPut_SRV_VS(26, 0); m_pModelCom->Bind_OutPut_SRV_VS_Prev(27, 0); @@ -329,6 +301,39 @@ void CPlayer::Update_CameraShake(_float fTimeDelta) } } } +HRESULT CPlayer::Update_RaycastElements() +{ + if (E_FAIL == m_pGameInstance->IsBinded_Camera(CAMERA_SHOULDER)) { + m_iRayHitCount = 0; + return E_FAIL; + } + _vector vCameraPos = m_pGameInstance->Get_CamXMPosition(); + _vector vCameraDir = m_pGameInstance->Get_CameraLook(); + vector m_vRayHits = {}; + m_vRayHits.resize(12); + _bool bHit = m_pGameInstance->RayCast(vCameraPos, vCameraDir, m_fRayDistance, m_vRayHits.data(), (_uint)m_vRayHits.size(), m_iRayHitCount); + if (true == bHit) { + CMyTools::SortHitsByDistance(m_vRayHits); + for (_uint i = 0; i < m_iRayHitCount; ++i) { + if (nullptr != m_vRayHits[i].actor->userData) { + PHYSX_USERDATA* pData = (PHYSX_USERDATA*)m_vRayHits[i].actor->userData; + switch (pData->eKind) + { + case PHYSX_KIND::BODY_STATIC: + break; + case PHYSX_KIND::BODY_DYNAMIC: + pData->pBody->OnRayCollision(this, i, m_vRayHits[i].distance, _float3(m_vRayHits[i].position.x, m_vRayHits[i].position.y, m_vRayHits[i].position.z)); + break; + case PHYSX_KIND::CCTActor: + break; + default: + break; + } + } + } + } + return S_OK; +} HRESULT CPlayer::Render_Shadow(SHADOW eType) { if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", m_pTransformCom->Get_WorldMatrixPtr()))) { @@ -419,6 +424,20 @@ void CPlayer::Set_RaceRing(CRaceRing* pRaceRing) SAFE_ADDREF(m_pRaceRing); } +void CPlayer::Set_RaceInfo() +{ + if (m_pBroomRaceManager) + { + CBroomRaceManager::RacerInfo Info; + + Info.pRacer = this; + Info.curRing = 0; + Info.prevPos = Get_WorldPostion(); + + m_pBroomRaceManager->Push_BroomRacer(Info); + } +} + HRESULT CPlayer::Ready_Components() { CTransform::TRANSFORM_DESC Desc = {}; @@ -497,7 +516,6 @@ HRESULT CPlayer::Ready_Components() HRESULT CPlayer::Ready_Parts() { CWand::WAND_DESC WandDesc{}; - WandDesc.pParentTransform = m_pTransformCom; WandDesc.pSocketMatrices = m_pModelCom->Get_BoneMatrixPtr("SKT_RightHand"); @@ -530,6 +548,19 @@ HRESULT CPlayer::Ready_Parts() return E_FAIL; } + //m_pModelCom->Play_Animation() + //XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("broomSocket")); + { + 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); + } + } + + return S_OK; } @@ -621,19 +652,6 @@ HRESULT CPlayer::Bind_ShaderParameters(_uint iMeshOrder) } } - //array<_int, 256> paletteMask{}; - //paletteMask.fill(0); - - //for (_uint i = 0; i < paletteCount; ++i) - //{ - // if (i == 29) - // continue; - // _uint global = boneIndices[i]; - // paletteMask[i] = globalMask[global]; - //} - - //m_pShaderCom->Bind_IntArray("g_RobeBoneMask", paletteMask.data(), 256); - GUI::DragFloat("TempWeight", &m_fTempWeight, 0.01f); if (FAILED(m_pShaderCom->Bind_RawValue("g_TempWeight", &m_fTempWeight, sizeof(_float)))) { @@ -649,13 +667,6 @@ HRESULT CPlayer::Bind_ShaderParameters(_uint iMeshOrder) { return E_FAIL; } - - - if (nullptr != m_pRobePart) { - if (FAILED(m_pRobePart->Bind_PrevBoneMatrices(m_pShaderCom, "g_PrevBoneMatrices"))) { - return E_FAIL; - } - } } break; #endif // _DEBUG @@ -702,7 +713,7 @@ void CPlayer::SetGravity() eCollisionFlags; if (false == eCollisionFlags.isSet(PSX::PxControllerCollisionFlag::Enum::eCOLLISION_DOWN) && false == eCollisionFlags.isSet(PSX::PxControllerCollisionFlag::Enum::eCOLLISION_SIDES)) { - if (false == m_pFSM->IsEnable(FSMSTATE::JUMP)) { // 벽에 닿지 않았는데 점프 중이 아닐 땐 중력 on + if (false == m_pFSM->IsEnable(FSMSTATE::JUMP) && m_eHitType != ENUM_CLASS(HIT_TYPE::HIT_HEAVY)) { // 벽에 닿지 않았는데 점프 중이 아닐 땐 중력 on m_pCharacter_Controller->SetGravity(true); } else { // 점프 중일 땐 off @@ -764,6 +775,7 @@ void CPlayer::Free() SAFE_RELEASE(m_pRobePart); SAFE_RELEASE(m_pGrapInteractive); + if (nullptr != m_pInfoInstance) { CInfoInstance* pInfo = m_pInfoInstance; m_pInfoInstance = nullptr; @@ -801,7 +813,7 @@ void CPlayer::Render_CameraCoordinateSystem() GUI::Begin("CAMERA", 0, IMGUI_GLOBAL_BEGIN_FLAG); - GUI::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); if (GUI::CollapsingHeader("Player_CAM_COOORD")) { GUI::Text("%d", m_LockOnInfo.pUnit); @@ -844,7 +856,7 @@ void CPlayer::Render_CameraCoordinateSystem() void CPlayer::Describe_Entity() { GUI::Begin("UNIT", 0, IMGUI_GLOBAL_BEGIN_FLAG); - GUI::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); if (GUI::CollapsingHeader("PLAYER_DESC")) { if (true == GUI::Button("ShaderRefresh")) { m_pShaderCom->Shader_Refresh(); diff --git a/Jusin154_Team3D/Client/Private/PlayerRobe.cpp b/Jusin154_Team3D/Client/Private/PlayerRobe.cpp index 8c8849385..306f2a4e5 100644 --- a/Jusin154_Team3D/Client/Private/PlayerRobe.cpp +++ b/Jusin154_Team3D/Client/Private/PlayerRobe.cpp @@ -14,8 +14,13 @@ CPlayerRobe::CPlayerRobe(const CPlayerRobe& Prototype) void CPlayerRobe::Priority_Update(_float fTimeDelta) { #ifdef _DEBUG +#ifdef 기무리 + Update_RobeJoints(); +#endif // 기무리 + Describe_Entity(); #endif // _DEBUG + } void CPlayerRobe::Update(_float fTimeDelta) @@ -32,22 +37,15 @@ void CPlayerRobe::Update(_float fTimeDelta) void CPlayerRobe::Late_Update(_float fTimeDelta) { -#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() { #ifdef _DEBUG - Render_BonePhysX(); +#ifdef 기무리 + //Render_BonePhysX(); +#endif // 기무리 #endif // _DEBUG return S_OK; } @@ -58,12 +56,12 @@ HRESULT CPlayerRobe::Update_RobeSocketPosition() PSX::PxTransform pxTransform = {}; _matrix WorldMatrix = {}; _matrix OwnerInvWorldMatrix = m_pParentTransformCom->Get_WorldMatrixInv(); - { - pxTransform = m_pRobeMainAnchor->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)); - _fmatrix LocalMatrix = WorldMatrix * OwnerInvWorldMatrix; - m_pModelCom->Set_BoneCombinedTransformation("Hips_Cloth", LocalMatrix); - } + //{ + // pxTransform = m_pRobeMainAnchor->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)); + // _fmatrix LocalMatrix = WorldMatrix * OwnerInvWorldMatrix; + // m_pModelCom->Set_BoneCombinedTransformation("Hips_Cloth", LocalMatrix); + //} 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)); @@ -75,14 +73,6 @@ HRESULT CPlayerRobe::Update_RobeSocketPosition() return S_OK; } -HRESULT CPlayerRobe::Bind_PrevBoneMatrices(CShader* pShader, const _char* pConstant) -{ - HRESULT hr = E_FAIL; - hr = pShader->Bind_Matrices(pConstant, m_PrevRobeBoneMatrices.data(), m_iBoneNum); - m_pModelCom->Capture_BoneMatrices(ENUM_CLASS(PLAYER_JOINT_BONE_ORDER::END), m_PrevRobeBoneMatrices); - return hr; -} - HRESULT CPlayerRobe::Helper_RouteJointGenerater(CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC& Desc_Body, ROUTE_DESC& Desc_Route, _matrix* xmAnchorMatricesWorld) { @@ -96,12 +86,12 @@ HRESULT CPlayerRobe::Helper_RouteJointGenerater(CRigidBody_Dynamic::RIGIDBODY_DY 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++ + PSX::PxTransform startJointWorldPose = CMyTools::Calc_JointPosFromRoute(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), false); // start y-- + PSX::PxTransform endJointWorldPose = CMyTools::Calc_JointPosFromRoute(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), true); // end y++ - m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_PxD6Joint(startAnchorRigidActor, routeRigidActor, startJointWorldPose); + m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_BasicPxD6Joint(startAnchorRigidActor, routeRigidActor, startJointWorldPose); - m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_PxD6Joint(routeRigidActor, endAnchorRigidActor, endJointWorldPose); + m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_BasicPxD6Joint(routeRigidActor, endAnchorRigidActor, endJointWorldPose); return S_OK; } @@ -147,6 +137,8 @@ HRESULT CPlayerRobe::Update_LegsPosition() } #endif // _DEBUG } + m_pLower0Bound->Move_Kinematic(m_pParentTransformCom->Get_XMWorldMatrix(), false); + m_pLower1Bound->Move_Kinematic(m_pParentTransformCom->Get_XMWorldMatrix(), false); return S_OK; } @@ -192,9 +184,121 @@ HRESULT CPlayerRobe::Render_Legs() [this]() { m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0); }); + m_pLower0Bound->Render([this]() { + m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0); + }); + m_pLower1Bound->Render([this]() { + m_pContext->OMSetDepthStencilState(m_pDepthStencilStateNone, 0); + }); return S_OK; } +HRESULT CPlayerRobe::Update_RobeJoints() +{ + for (_uint i = ENUM_CLASS(PLAYER_JOINT_ORDER::ORIGIN_TO_RUP_START); i < ENUM_CLASS(PLAYER_JOINT_ORDER::END); ++i) { + m_JointDescriptions[i].InitFromJoint(*m_pDynamicJoints[i]); + switch (PLAYER_JOINT_ORDER(i)) + { + /* From Origin */ + case PLAYER_JOINT_ORDER::ORIGIN_TO_RUP_START: + case PLAYER_JOINT_ORDER::ORIGIN_TO_TUP_START: + case PLAYER_JOINT_ORDER::ORIGIN_TO_LUP_START: + m_JointDescriptions[i].iMotionTwist = 0; + m_JointDescriptions[i].iMotionSwing1 = 0; + m_JointDescriptions[i].iMotionSwing2 = 0; + m_JointDescriptions[i].fLinearLimit = 0.f; + m_JointDescriptions[i].fTwistAbsDeg = 0.f; + m_JointDescriptions[i].fSwingDeg = 5.f; + break; + case PLAYER_JOINT_ORDER::ORIGIN_TO_RUP_END: + case PLAYER_JOINT_ORDER::ORIGIN_TO_TUP_END: + case PLAYER_JOINT_ORDER::ORIGIN_TO_LUP_END: + m_JointDescriptions[i].iMotionTwist = 0; + m_JointDescriptions[i].iMotionSwing1 = 0; + m_JointDescriptions[i].iMotionSwing2 = 0; + m_JointDescriptions[i].fLinearLimit = 0.f; + m_JointDescriptions[i].fTwistAbsDeg = 0.f; + m_JointDescriptions[i].fSwingDeg = 5.f; + break; + + + /* From_Middle */ + case PLAYER_JOINT_ORDER::RUP_TO_RMIDDLE_START: + case PLAYER_JOINT_ORDER::TUP_TO_TMIDDLE_START: + case PLAYER_JOINT_ORDER::LUP_TO_LMIDDLE_START: + m_JointDescriptions[i].iMotionTwist = 0; + m_JointDescriptions[i].iMotionSwing1 = 0; + m_JointDescriptions[i].iMotionSwing2 = 0; + m_JointDescriptions[i].fLinearLimit = 0.f; + m_JointDescriptions[i].fTwistAbsDeg = 0.f; + m_JointDescriptions[i].fSwingDeg = 10.f; + break; + + case PLAYER_JOINT_ORDER::RUP_TO_RMIDDLE_END: + case PLAYER_JOINT_ORDER::TUP_TO_TMIDDLE_END: + case PLAYER_JOINT_ORDER::LUP_TO_LMIDDLE_END: + m_JointDescriptions[i].iMotionTwist = 1; + m_JointDescriptions[i].iMotionSwing1 = 1; + m_JointDescriptions[i].iMotionSwing2 = 1; + m_JointDescriptions[i].fLinearLimit = 0.f; + m_JointDescriptions[i].fSwingDeg = 0.f; + m_JointDescriptions[i].fTwistAbsDeg = 0.f; + + m_JointDescriptions[i].bEnableSlerpDrive = true; + m_JointDescriptions[i].fLinearStiffness = 10.f; + m_JointDescriptions[i].fSlerpDamping = 3.f; + m_JointDescriptions[i].fSlerpForceLimit = 40.f; + m_JointDescriptions[i].bSlerpAccel = true; + break; + + + /* From_Lower */ + case PLAYER_JOINT_ORDER::RMIDDLE_TO_RR_START: + case PLAYER_JOINT_ORDER::RMIDDLE_TO_R_START: + m_JointDescriptions[i].iMotionTwist = 1; + m_JointDescriptions[i].iMotionSwing1 = 1; + m_JointDescriptions[i].iMotionSwing2 = 1; + m_JointDescriptions[i].fLinearLimit = 0.f; + m_JointDescriptions[i].fTwistAbsDeg = 15.f; + m_JointDescriptions[i].fSwingDeg = 15.f; + break; + + case PLAYER_JOINT_ORDER::RMIDDLE_TO_R_END: + case PLAYER_JOINT_ORDER::RMIDDLE_TO_RR_END: + break; + case PLAYER_JOINT_ORDER::TMIDDLE_TO_TR_START: + case PLAYER_JOINT_ORDER::TMIDDLE_TO_TL_START: + m_JointDescriptions[i].iMotionTwist = 1; + m_JointDescriptions[i].iMotionSwing1 = 1; + m_JointDescriptions[i].iMotionSwing2 = 1; + m_JointDescriptions[i].fLinearLimit = 0.f; + m_JointDescriptions[i].fTwistAbsDeg = 15.f; + m_JointDescriptions[i].fSwingDeg = 15.f; + break; + + case PLAYER_JOINT_ORDER::TMIDDLE_TO_TR_END: + case PLAYER_JOINT_ORDER::TMIDDLE_TO_TL_END: + break; + case PLAYER_JOINT_ORDER::LMIDDLE_TO_L_START: + case PLAYER_JOINT_ORDER::LMIDDLE_TO_LL_START: + m_JointDescriptions[i].iMotionTwist = 1; + m_JointDescriptions[i].iMotionSwing1 = 1; + m_JointDescriptions[i].iMotionSwing2 = 1; + m_JointDescriptions[i].fLinearLimit = 0.f; + m_JointDescriptions[i].fTwistAbsDeg = 15.f; + m_JointDescriptions[i].fSwingDeg = 15.f; + break; + + case PLAYER_JOINT_ORDER::LMIDDLE_TO_L_END: + case PLAYER_JOINT_ORDER::LMIDDLE_TO_LL_END: + break; + default: + break; + } + m_JointDescriptions[i].ApplyToJoint(*m_pDynamicJoints[i]); + } + return S_OK; +} HRESULT CPlayerRobe::Render_BonePhysX() { _vector vColor = CMyTools::ColorRGB_A_HEXtoVECTOR(0x00ff00, 1.f); @@ -224,13 +328,6 @@ HRESULT CPlayerRobe::Render_BonePhysX() }); 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); @@ -270,6 +367,22 @@ HRESULT CPlayerRobe::Ready_Components() return E_FAIL; } } + { // + CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; + Desc.iSubKind = ENUM_CLASS(PXOBJECT::LEG); + Desc.bAutoOwnerTranslation = false; + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_Player_LowerBound"), (CComponent**)&m_pLower0Bound, &Desc))) { + return E_FAIL; + } + } + { // + CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; + Desc.iSubKind = ENUM_CLASS(PXOBJECT::LEG); + Desc.bAutoOwnerTranslation = false; + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_Player_LowerBound"), (CComponent**)&m_pLower1Bound, &Desc))) { + return E_FAIL; + } + } { // RobeSocket { // Fixed_MainAnchor CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; @@ -324,11 +437,11 @@ HRESULT CPlayerRobe::Ready_Components() 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++ + PSX::PxTransform startJointWorldPose = CMyTools::Calc_JointPosFromRoute(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), false); // start y-- + PSX::PxTransform endJointWorldPose = CMyTools::Calc_JointPosFromRoute(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), true); // end y++ - m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_PxD6Joint(startAnchorRigidActor, routeRigidActor, startJointWorldPose); - m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_PxD6Joint(routeRigidActor, endAnchorRigidActor, endJointWorldPose); + m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_BasicPxD6Joint(startAnchorRigidActor, routeRigidActor, startJointWorldPose); + m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_BasicPxD6Joint(routeRigidActor, endAnchorRigidActor, endJointWorldPose); } } { @@ -349,11 +462,11 @@ HRESULT CPlayerRobe::Ready_Components() 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++ + PSX::PxTransform startJointWorldPose = CMyTools::Calc_JointPosFromRoute(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), false); // start y-- + PSX::PxTransform endJointWorldPose = CMyTools::Calc_JointPosFromRoute(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), true); // end y++ - m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_PxD6Joint(startAnchorRigidActor, routeRigidActor, startJointWorldPose); - m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_PxD6Joint(routeRigidActor, endAnchorRigidActor, endJointWorldPose); + m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_BasicPxD6Joint(startAnchorRigidActor, routeRigidActor, startJointWorldPose); + m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_BasicPxD6Joint(routeRigidActor, endAnchorRigidActor, endJointWorldPose); } } { @@ -374,11 +487,11 @@ HRESULT CPlayerRobe::Ready_Components() 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++ + PSX::PxTransform startJointWorldPose = CMyTools::Calc_JointPosFromRoute(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), false); // start y-- + PSX::PxTransform endJointWorldPose = CMyTools::Calc_JointPosFromRoute(routeRigidActor, m_pRobeJointRoute[Desc_Route.iTargetRouteIndex]->Get_HalfGeometryInfo(), true); // end y++ - m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_PxD6Joint(startAnchorRigidActor, routeRigidActor, startJointWorldPose); - m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_PxD6Joint(routeRigidActor, endAnchorRigidActor, endJointWorldPose); + m_pDynamicJoints[Desc_Route.iStartJointIndex] = m_pGameInstance->Create_BasicPxD6Joint(startAnchorRigidActor, routeRigidActor, startJointWorldPose); + m_pDynamicJoints[Desc_Route.iEndJointIndex] = m_pGameInstance->Create_BasicPxD6Joint(routeRigidActor, endAnchorRigidActor, endJointWorldPose); } } } @@ -553,6 +666,14 @@ HRESULT CPlayerRobe::Initialize(void* pArg) if (FAILED(Ready_Components())) { return E_FAIL; } + + D6JOINTDESC JointDesc = D6JOINTDESC(); + for (_uint i = ENUM_CLASS(PLAYER_JOINT_ORDER::ORIGIN_TO_RUP_START); i < ENUM_CLASS(PLAYER_JOINT_ORDER::END); ++i) { + JointDesc.ApplyToJoint(*m_pDynamicJoints[i]); + m_JointDescriptions[i] = JointDesc; + } + Update_RobeJoints(); + #ifdef _DEBUG m_pSubShape = (GeometricPrimitive::CreateSphere(m_pContext, 0.05f, 22, false, false)); m_pMainShape = (GeometricPrimitive::CreateCylinder(m_pContext, 0.3f, 0.075f, 22, false)); @@ -603,6 +724,8 @@ void CPlayerRobe::Free() SAFE_RELEASE(m_pDepthStencilStateNone); #endif // _DEBUG SAFE_RELEASE(m_pRightLeg); + SAFE_RELEASE(m_pLower0Bound); + SAFE_RELEASE(m_pLower1Bound); SAFE_RELEASE(m_pLeftLeg); SAFE_RELEASE(m_pRobeMainAnchor); for (_uint i = 0; i < ENUM_CLASS(PLAYER_JOINT_ROUTE_ORDER::END); ++i) { @@ -619,11 +742,24 @@ void CPlayerRobe::Describe_Entity() GUI::Begin("PhysX"); if (GUI::CollapsingHeader("Robe")) { for (_uint i = 0; i < ENUM_CLASS(PLAYER_JOINT_ORDER::END); ++i) { - if (GUI::BeginChild(("Child ID: " + to_string((size_t)(this))).c_str())) { - + _uint iActor0 = i; + if (GUI::TreeNode(("Child ID: " + to_string(iActor0)).c_str())) { + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); + PSX::PxTransform pxDrivePos0 = m_pDynamicJoints[iActor0]->getDrivePosition(); + if (true == CMyTools::DescribePxTransform(pxDrivePos0, iActor0)) { + m_pDynamicJoints[iActor0]->setDrivePosition(pxDrivePos0); + } + { + _bool bModified = false; + if (CMyTools::Modify_D6Joint(*m_pDynamicJoints[iActor0], iActor0)) { + bModified = true; + } + GUI::TreePop(); + } } - GUI::EndChild(); } + m_pLower0Bound->Describe_Entity(); + m_pLower1Bound->Describe_Entity(); } GUI::End(); } diff --git a/Jusin154_Team3D/Client/Private/Player_States.cpp b/Jusin154_Team3D/Client/Private/Player_States.cpp index 7ab1a8200..e403871dc 100644 --- a/Jusin154_Team3D/Client/Private/Player_States.cpp +++ b/Jusin154_Team3D/Client/Private/Player_States.cpp @@ -185,9 +185,13 @@ HRESULT CPlayer::InputBroom() } void CPlayer::Behavior_IdleEnter() { + pair<_uint, _bool> pairAnimInfo; m_pFSM->Enable_State(FSMSTATE::IDLE); m_bSprintToggle = false; m_bWalkToggle = false; + + pairAnimInfo = m_Animation[STATEANIM::IDLE]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } @@ -344,6 +348,7 @@ HRESULT CPlayer::Behavior_IdleExitCheck(_float fTimeDelta) void CPlayer::Behavior_IdleExit() { m_pFSM->Disable_State(FSMSTATE::IDLE | FSMSTATE::IDLE_TURN); + Reset_Event(); } void CPlayer::Behavior_MoveEnter() @@ -781,6 +786,7 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta) void CPlayer::Behavior_MoveExit() { m_pFSM->Disable_State(FSMSTATE::MOVE | FSMSTATE::SPRINT | FSMSTATE::JOG | FSMSTATE::WALK | FSMSTATE::STOP); + Reset_Event(); } void CPlayer::Behavior_JumpEnter() @@ -831,6 +837,7 @@ HRESULT CPlayer::Behavior_JumpExitCheck() void CPlayer::Behavior_JumpExit() { m_pFSM->Disable_State(FSMSTATE::JUMP); + Reset_Event(); } void CPlayer::Behavior_LandEnter() @@ -884,6 +891,7 @@ void CPlayer::Behavior_LandExit() m_pFSM->Disable_State(FSMSTATE::LAND); m_pCharacter_Controller->Set_GravityAmount(m_fOriginGravityAmount); m_fGravityAmount = 0.f; + Reset_Event(); } void CPlayer::Behavior_FallEnter() @@ -906,6 +914,7 @@ HRESULT CPlayer::Behavior_FallExitCheck(_float fTimeDelta) void CPlayer::Behavior_FallExit() { m_pFSM->Disable_State(FSMSTATE::FALL); + Reset_Event(); } void CPlayer::Behavior_DodgeEnter() @@ -943,12 +952,14 @@ HRESULT CPlayer::Behavior_DodgeExitCheck(_float fTimeDelta) void CPlayer::Behavior_DodgeExit() { m_pFSM->Disable_State(FSMSTATE::DODGE); + Reset_Event(); } void CPlayer::Behavior_BlinkEnter() { m_pFSM->Enable_State(FSMSTATE::BLINK); m_bVisible = false; + Get_PartObject()->Set_Visible(false); Add_Event(m_Animation[STATEANIM::DODGE].first, [&]() { m_pEffectPool->Use_Skill(SKILL_TYPE::BLINK, this); @@ -967,6 +978,7 @@ HRESULT CPlayer::Behavior_BlinkExitCheck(_float fTimeDelta) if (m_fBlinkTime >= 0.8f && iCurrAnimIndex != m_Animation[STATEANIM::DODGE_BLINK].first) { m_bVisible = true; + Get_PartObject()->Set_Visible(true); pairAnimInfo = m_Animation[STATEANIM::DODGE_BLINK]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 0.8f,false,1.5f); } @@ -1001,6 +1013,7 @@ void CPlayer::Behavior_BlinkExit() { m_pFSM->Disable_State(FSMSTATE::BLINK); m_fBlinkTime = 0.f; + Reset_Event(); } void CPlayer::Behavior_SlideEnter() @@ -1053,6 +1066,7 @@ void CPlayer::Behavior_SlideExit() { m_pFSM->Disable_State(FSMSTATE::SLIDE); m_fSlideSpeed = 0.f; + Reset_Event(); } void CPlayer::Behavior_CombatEnter() @@ -1062,64 +1076,71 @@ void CPlayer::Behavior_CombatEnter() if (m_pModelCom->Get_SecondAnimIndex() == m_Animation[STATEANIM::LUMOS].first) { - m_pModelCom->Set_Second_AnimationIndex(ENUM_CLASS(BLEND_BONE::SHOULDER_R) ,-1) ; + m_pModelCom->Set_Second_AnimationIndex(ENUM_CLASS(BLEND_BONE::SHOULDER_R), -1); m_eSpell = ENUM_CLASS(SKILL_TYPE::END); } - if (m_pGameInstance->Key_Down(DIK_R)) { - m_pFSM->Enable_State(FSMSTATE::SKILL); - pairAnimInfo = m_Animation[STATEANIM::SKILL]; - m_pEffectPool->Use_Skill(SKILL_TYPE::REVELIO, this); - } - else if (m_pGameInstance->Key_Down(DIK_Q)) { - m_pFSM->Change_State(FSMSTATE::SHIELD); - return; - } - else if (m_pGameInstance->Mouse_Down(DIM_LBUTTON)) { - m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK); - return; - } - else if (SUCCEEDED(InputSpell())) { - m_pFSM->Change_State(FSMSTATE::SPELL); - return; - } - else if (m_pGameInstance->Key_Down(DIK_V)) { - m_pFSM->Enable_State(FSMSTATE::MAPHELP); - pairAnimInfo = m_Animation[STATEANIM::MAPHELP]; - } - else if (m_pGameInstance->Key_Down(DIK_X)) { - m_pFSM->Change_State(FSMSTATE::ANCIENT_SPELL); - return; - } - else if (m_pGameInstance->Key_Down(DIK_Z)) { - - if (nullptr != m_LockOnInfo.pInteractive) { - m_pFSM->Enable_State(FSMSTATE::ANCIENT_THROW); - pairAnimInfo = m_Animation[STATEANIM::ANCIENT_THROW]; - m_pGrapInteractive = m_LockOnInfo.pInteractive; - SAFE_ADDREF(m_pGrapInteractive); - m_pGrapInteractive->Set_KinematicFlag(true); - m_vGrapInteratableLerp.x = 0.f; + if (SUCCEEDED(InputAction()) || SUCCEEDED(InputSpell())) + { + if (m_pGameInstance->Key_Down(DIK_R)) { + m_pFSM->Enable_State(FSMSTATE::SKILL); + pairAnimInfo = m_Animation[STATEANIM::SKILL]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + m_pEffectPool->Use_Skill(SKILL_TYPE::REVELIO, this); } - else { + else if (m_pGameInstance->Key_Down(DIK_Q)) { + + m_pFSM->Change_State(FSMSTATE::SHIELD); return; } + else if (m_pGameInstance->Mouse_Down(DIM_LBUTTON)) { + m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK); + return; + } + else if (SUCCEEDED(InputSpell())) { + m_pFSM->Change_State(FSMSTATE::SPELL); + return; + } + else if (m_pGameInstance->Key_Down(DIK_V)) { + m_pFSM->Enable_State(FSMSTATE::MAPHELP); + pairAnimInfo = m_Animation[STATEANIM::MAPHELP]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + } + else if (m_pGameInstance->Key_Down(DIK_X)) { + m_pFSM->Change_State(FSMSTATE::ANCIENT_SPELL); + return; + } + else if (m_pGameInstance->Key_Down(DIK_Z)) { - Add_Event(pairAnimInfo.first, - [this]() { m_bLookAt = true; }, - 0.12f); + if (nullptr != m_LockOnInfo.pInteractive) { + m_pFSM->Enable_State(FSMSTATE::ANCIENT_THROW); + pairAnimInfo = m_Animation[STATEANIM::ANCIENT_THROW]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + m_pGrapInteractive = m_LockOnInfo.pInteractive; + SAFE_ADDREF(m_pGrapInteractive); + m_pGrapInteractive->Set_KinematicFlag(true); + m_vGrapInteratableLerp.x = 0.f; + } + else { + return; + } - Add_Event(pairAnimInfo.first, - [this]() { Throwing_Interactive(); }, - 0.2f); + Add_Event(pairAnimInfo.first, + [this]() { m_bLookAt = true; }, + 0.12f); - Add_Event(pairAnimInfo.first, - [this]() { - m_pGameInstance->SlowMotion(0.1f, 0.35f); - }, - 0.1f); + Add_Event(pairAnimInfo.first, + [this]() { Throwing_Interactive(); }, + 0.2f); + + Add_Event(pairAnimInfo.first, + [this]() { + m_pGameInstance->SlowMotion(0.1f, 0.35f); + }, + 0.1f); + } } - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + } HRESULT CPlayer::Behavior_CombatExitCheck() @@ -1209,6 +1230,7 @@ void CPlayer::Behavior_CombatExit() { m_pFSM->Disable_State(FSMSTATE::COMBAT | FSMSTATE::SKILL | FSMSTATE::MAPHELP | FSMSTATE::ANCIENT_THROW); + Reset_Event(); } void CPlayer::Behavior_LightAttackEnter() @@ -1251,10 +1273,12 @@ void CPlayer::Behavior_LightAttackEnter() if (Cross < 0.f) { pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK_90_L]; + fRatio = 0.15f; } else { pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK_90_R2]; + fRatio = 0.15f; } Add_Event(pairAnimInfo.first, [this]() {m_bLookAt = true; @@ -1391,6 +1415,7 @@ void CPlayer::Behavior_LightAttackExit() { m_pFSM->Disable_State(FSMSTATE::LIGHT_ATTACK); m_pModelCom->Set_BlendDuration(0.3f); + Reset_Event(); m_bLookAt = false; } @@ -1422,12 +1447,21 @@ void CPlayer::Behavior_SpellEnter() _vector vCross = XMVector3Cross(vLook, vCameraLook); _float Cross = XMVectorGetY(vCross); - if (Degree <= 45.f) + if (Degree <= 30.f) { pairAnimInfo = m_Animation[STATEANIM::SPELL]; fRatio = 0.2f; } - else if (Degree <= 85.f) + else if (Degree <= 60.f) + { + pairAnimInfo = m_Animation[STATEANIM::SPELL]; + fRatio = 0.2f; + Add_Event(m_Animation[STATEANIM::SPELL].first, + [this]() {m_bLookAt = true; + }, + 0.01f); + } + else if (Degree <= 120.f) { if (Cross < 0.f) { @@ -1441,7 +1475,10 @@ void CPlayer::Behavior_SpellEnter() pairAnimInfo = m_Animation[STATEANIM::SPELL_90_L2]; break; } - + Add_Event(pairAnimInfo.first, + [this]() {m_bLookAt = true; + }, + 0.95f); fRatio = 0.17f; } else { @@ -1458,8 +1495,14 @@ void CPlayer::Behavior_SpellEnter() break; case 1: pairAnimInfo = m_Animation[STATEANIM::SPELL_90_R]; - fRatio = 0.17f; - fAnimSpeed = 1.3f; + fRatio = 0.14f; + if (Degree >= 120.f) + { + Add_Event(pairAnimInfo.first, + [this]() {m_bLookAt = true; + }, + 0.01f); + } break; } } @@ -1467,6 +1510,10 @@ void CPlayer::Behavior_SpellEnter() else { pairAnimInfo = m_Animation[STATEANIM::SPELL_180_R]; fRatio = 0.23f; + Add_Event(pairAnimInfo.first, + [this]() {m_bLookAt = true; + }, + 0.01f); } m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, fAnimSpeed); @@ -1546,15 +1593,19 @@ HRESULT CPlayer::Behavior_SpellExitCheck() } else if (SUCCEEDED(InputAction()) || SUCCEEDED(InputSpell())) { - if (fRatio >= 0.5f) - { - m_pFSM->Change_State(FSMSTATE::COMBAT); - return E_FAIL; + if (iIndex != m_Animation[STATEANIM::AVADA_KEDAVRA].first) { + if (fRatio >= 0.5f) + { + m_pFSM->Change_State(FSMSTATE::COMBAT); + return E_FAIL; + } + return S_OK; } - return S_OK; } } - else if (m_pGameInstance->Key_Down(DIK_Q)) { + else if (iIndex != m_Animation[STATEANIM::AVADA_KEDAVRA].first) + { + if (m_pGameInstance->Key_Down(DIK_Q)) { m_pFSM->Change_State(FSMSTATE::SHIELD); return E_FAIL; } @@ -1575,6 +1626,8 @@ HRESULT CPlayer::Behavior_SpellExitCheck() } return S_OK; } + } + Play_SpellHitAnim(); @@ -1604,10 +1657,11 @@ HRESULT CPlayer::Behavior_SpellExitCheck() void CPlayer::Behavior_SpellExit() { m_pFSM->Disable_State(FSMSTATE::SPELL); - m_pModelCom->Set_BlendDuration(0.3f); + Reset_Event(); m_bLookAt = false; m_bSpellHit = false; + } void CPlayer::Behavior_AncientSpellEnter() @@ -1663,6 +1717,7 @@ HRESULT CPlayer::Behavior_AncientSpellExitCheck() void CPlayer::Behavior_AncientSpellExit() { m_pFSM->Disable_State(FSMSTATE::ANCIENT_SPELL); + Reset_Event(); m_bLookAt = false; } @@ -1798,6 +1853,7 @@ void CPlayer::Behavior_ShieldExit() { m_pFSM->Disable_State(FSMSTATE::SHIELD); m_pFSM->Disable_State(FSMSTATE::PARRY); + Reset_Event(); m_bShield = false; m_bLookAt = false; } @@ -1859,8 +1915,9 @@ void CPlayer::Behavior_HitEnter() Add_Event(m_Animation[STATEANIM::KNOCKDOWN_BWD].first, [&]() {pairAnimInfo = m_Animation[STATEANIM::KNOCKDOWN_BWD_SPLT]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); - m_pCharacter_Controller->SetGravity(true); }, - 0.7f); + m_pCharacter_Controller->SetGravity(true); + m_eHitType = ENUM_CLASS(HIT_TYPE::END); }, + 0.9f); Add_Event(m_Animation[STATEANIM::KNOCKDOWN_BWD_SPLT].first, [&]() {pairAnimInfo = m_Animation[STATEANIM::GETUP_BWD]; @@ -1873,8 +1930,9 @@ void CPlayer::Behavior_HitEnter() Add_Event(m_Animation[STATEANIM::KNOCKDOWN_FWD].first, [&]() {pairAnimInfo = m_Animation[STATEANIM::KNOCKDOWN_FWD_SPLT]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); - m_pCharacter_Controller->SetGravity(true); }, - 0.7f); + m_pCharacter_Controller->SetGravity(true); + m_eHitType = ENUM_CLASS(HIT_TYPE::END); }, + 0.9f); Add_Event(m_Animation[STATEANIM::KNOCKDOWN_FWD_SPLT].first, [&]() {pairAnimInfo = m_Animation[STATEANIM::GETUP_FWD]; @@ -1930,6 +1988,8 @@ HRESULT CPlayer::Behavior_HitExitCheck() void CPlayer::Behavior_HitExit() { m_pFSM->Disable_State(FSMSTATE::HIT); + Reset_Event(); + m_eHitType = ENUM_CLASS(HIT_TYPE::END); m_bLookAt = false; } @@ -1978,6 +2038,7 @@ HRESULT CPlayer::Behavior_Broom_RideExitCheck(_float fTimeDelta) void CPlayer::Behavior_Broom_RideExit() { m_pFSM->Disable_State(FSMSTATE::BROOM_RIDE); + Reset_Event(); } void CPlayer::Behavior_Broom_Ride_MoveEnter() @@ -2007,6 +2068,7 @@ HRESULT CPlayer::Behavior_Broom_Ride_MoveExitCheck(_float fTimeDelta) void CPlayer::Behavior_Broom_Ride_MoveExit() { m_pFSM->Disable_State(FSMSTATE::BROOM_RIDE_MOVE); + Reset_Event(); } void CPlayer::Behavior_Broom_HoverEnter() @@ -2153,8 +2215,7 @@ void CPlayer::Behavior_Broom_HoverExit() void CPlayer::Behavior_Broom_FlyEnter() { m_pFSM->Enable_State(FSMSTATE::FLY); - m_fNeutralTime = 0.f; - m_fNoInputTime = 0.f; + Reset_Event(); } HRESULT CPlayer::Behavior_Broom_FlyExitCheck(_float fTimeDelta) @@ -2172,7 +2233,6 @@ HRESULT CPlayer::Behavior_Broom_FlyExitCheck(_float fTimeDelta) { if (SUCCEEDED(InputBroom()) || SUCCEEDED(InputMove())) { - m_fNoInputTime = 0.f; _float3 vInput = { 0.f, 0.f, 0.f }; if (bFwd) vInput.z += 1.f; @@ -2255,44 +2315,26 @@ HRESULT CPlayer::Behavior_Broom_FlyExitCheck(_float fTimeDelta) } } - _bool bNeutralAnim = - (pairAnimInfo.first == m_Animation[STATEANIM::BROOM_FWD].first || - pairAnimInfo.first == m_Animation[STATEANIM::BROOM_IDLE].first); - - if (!bNeutralAnim) + if (iCurrAnimIndex != pairAnimInfo.first) { - m_fNeutralTime = 0.f; - if (iCurrAnimIndex != pairAnimInfo.first) - { - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); - } - } - else - { - m_fNeutralTime += fTimeDelta; - - if (m_fNeutralTime > 0.25f) - { - if (iCurrAnimIndex != pairAnimInfo.first) - { - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); - } - } + m_pModelCom->Set_AnimationIndex( + pairAnimInfo.first, + pairAnimInfo.second, + 1.f, false, 1.f, true, true + ); } } else { + pairAnimInfo = Get_AnimInfo(STATEANIM::BROOM_IDLE); - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); - m_fNoInputTime += fTimeDelta; - if (m_fNoInputTime > 0.25f) + if (iCurrAnimIndex != pairAnimInfo.first) { - pairAnimInfo = Get_AnimInfo(STATEANIM::BROOM_IDLE); - - if (iCurrAnimIndex != pairAnimInfo.first) - { - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); - } + m_pModelCom->Set_AnimationIndex( + pairAnimInfo.first, + pairAnimInfo.second, + 1.f, false, 1.f, true, true + ); } } @@ -2344,13 +2386,12 @@ HRESULT CPlayer::Behavior_Broom_FlyExitCheck(_float fTimeDelta) void CPlayer::Behavior_Broom_FlyExit() { m_pFSM->Disable_State(FSMSTATE::FLY); + Reset_Event(); } void CPlayer::Behavior_Broom_TurboFlyEnter() { m_pFSM->Enable_State(FSMSTATE::TURBOFLY); - m_fNeutralTime = 0.f; - m_fNoInputTime = 0.f; } HRESULT CPlayer::Behavior_Broom_TurboFlyExitCheck(_float fTimeDelta) @@ -2368,7 +2409,6 @@ HRESULT CPlayer::Behavior_Broom_TurboFlyExitCheck(_float fTimeDelta) { if (SUCCEEDED(InputBroom()) || SUCCEEDED(InputMove())) { - m_fNoInputTime = 0.f; _float3 vInput = { 0.f, 0.f, 0.f }; if (bFwd) vInput.z += 1.f; @@ -2411,6 +2451,9 @@ HRESULT CPlayer::Behavior_Broom_TurboFlyExitCheck(_float fTimeDelta) pairAnimInfo = m_Animation[STATEANIM::BROOM_TURBO_UP]; else if(vInput.y<0.f) pairAnimInfo = m_Animation[STATEANIM::BROOM_TURBO_DOWN]; + else { + pairAnimInfo = m_Animation[STATEANIM::BROOM_TURBO_FWD]; + } } else { if (vInput.x < 0.f) @@ -2433,34 +2476,18 @@ HRESULT CPlayer::Behavior_Broom_TurboFlyExitCheck(_float fTimeDelta) } } - _bool bNeutralAnim = - (pairAnimInfo.first == m_Animation[STATEANIM::BROOM_TURBO_FWD].first); - - if (!bNeutralAnim) + if (iCurrAnimIndex != pairAnimInfo.first) { - m_fNeutralTime = 0.f; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second,1.f,true,1.f,false); - } - else - { - m_fNeutralTime += fTimeDelta; - - if (m_fNeutralTime > 0.25f) - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first,pairAnimInfo.second,1.f, false, 1.f, false,true); } } else { - m_fNoInputTime += fTimeDelta; + pairAnimInfo = Get_AnimInfo(STATEANIM::BROOM_TURBO_FWD); - if (m_fNoInputTime > 0.25f) + if (iCurrAnimIndex != pairAnimInfo.first) { - pairAnimInfo = Get_AnimInfo(STATEANIM::BROOM_TURBO_FWD); - - if (iCurrAnimIndex != pairAnimInfo.first) - { - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true, 1.f, false); - } + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first,pairAnimInfo.second,1.f, false, 1.f, false, true); } } } @@ -2493,6 +2520,7 @@ HRESULT CPlayer::Behavior_Broom_TurboFlyExitCheck(_float fTimeDelta) void CPlayer::Behavior_Broom_TurboFlyExit() { m_pFSM->Disable_State(FSMSTATE::TURBOFLY); + Reset_Event(); } void CPlayer::Behavior_Broom_DismountEnter() @@ -2552,6 +2580,7 @@ HRESULT CPlayer::Behavior_Broom_DismountExitCheck(_float fTimeDelta) void CPlayer::Behavior_Broom_DismountExit() { m_pFSM->Disable_State(FSMSTATE::BROOM_DISMOUNT); + Reset_Event(); } void CPlayer::Player_InterpTurn(_float fTimeDelta) diff --git a/Jusin154_Team3D/Client/Private/RaceRing.cpp b/Jusin154_Team3D/Client/Private/RaceRing.cpp index 9617d7c93..bc7828b29 100644 --- a/Jusin154_Team3D/Client/Private/RaceRing.cpp +++ b/Jusin154_Team3D/Client/Private/RaceRing.cpp @@ -30,14 +30,19 @@ HRESULT CRaceRing::Initialize(void* pArg) return E_FAIL; } - m_pBroomRaceManager = static_cast(pArg)->pBroomRaceManager; - m_iIndex = static_cast(pArg)->iIndex; - _float X = m_pGameInstance->Real_Random_Float(-200.f, 200.f); - _float Y = m_pGameInstance->Real_Random_Float(15.f, 60.f); - _float Z = m_pGameInstance->Real_Random_Float(-50.f, 50.f); + + //m_iIndex = static_cast(pArg)->iIndex; + //_float X = m_pGameInstance->Real_Random_Float(-200.f, 200.f); + //_float Y = m_pGameInstance->Real_Random_Float(15.f, 60.f); + //_float Z = m_pGameInstance->Real_Random_Float(-50.f, 50.f); - m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet((_float)m_iIndex *100.f, Y, Z, 1.f)); + RACERING_DESC* pDesc = static_cast(pArg); + m_pBroomRaceManager = pDesc->pBroomRaceManager; + _float3 vRotation = pDesc->vRotation; + m_pTransformCom->Rotation(XMConvertToRadians(vRotation.x), XMConvertToRadians(vRotation.y), XMConvertToRadians(vRotation.z)); + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(pDesc->vPosition.x, pDesc->vPosition.y, pDesc->vPosition.z, 1.f)); + m_pTransformCom->Set_Scale(pDesc->vScale); m_pBroomRaceManager->Push_RaceRing(this); return S_OK; @@ -54,7 +59,6 @@ void CRaceRing::Priority_Update(_float fTimeDelta) void CRaceRing::Update(_float fTimeDelta) { m_pModelCom->Combined_BoneMatrix(); - } void CRaceRing::Late_Update(_float fTimeDelta) diff --git a/Jusin154_Team3D/Client/Private/Ranrok.cpp b/Jusin154_Team3D/Client/Private/Ranrok.cpp index c643077f3..6a6f92aed 100644 --- a/Jusin154_Team3D/Client/Private/Ranrok.cpp +++ b/Jusin154_Team3D/Client/Private/Ranrok.cpp @@ -67,8 +67,8 @@ HRESULT CRanrok::Initialize(void* pArg) if (NEXT_LEVEL == ENUM_CLASS(LEVEL::FIELD)) { - m_pCharacter_Controller->Set_Position(XMVectorSet(58.990f, 71.321f, 241.628f, 1.f)); - m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(58.990f, 71.321f, 241.628f, 1.f)); + m_pCharacter_Controller->Set_Position(XMVectorSet(75.550f, 33.734f, 164.013f, 1.f)); + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(75.550f, 33.734f, 164.013f, 1.f)); } else { @@ -146,6 +146,9 @@ void CRanrok::Update(_float fTimeDelta) if (m_vEtherealTimer.x > m_vEtherealTimer.y) { m_vEtherealTimer.x -= m_vEtherealTimer.y; } + + + Update_Disolve(fTimeDelta); } void CRanrok::Late_Update(_float fTimeDelta) @@ -161,10 +164,14 @@ void CRanrok::Late_Update(_float fTimeDelta) if (!m_pFSM->IsEnable(FSMSTATE::TUCKED)) { if (true == m_bLookAt) { - m_pTransformCom->LookAt_Horizontal_Lerp(XMLoadFloat4(&m_vTargetPos), fTimeDelta, 3.f); + m_pTransformCom->LookAt_Horizontal_Lerp(XMLoadFloat4(&m_vTargetPos), fTimeDelta, 2.5f); } - m_pModelCom->Set_TargetPos((XMLoadFloat4(&m_vTargetPos))); + _vector vPos = m_pTransformCom->Get_State(STATE::POSITION); + _vector vRight = m_pTransformCom->Get_State(STATE::RIGHT); + + m_pModelCom->Set_TargetPos(vPos + (vRight* (_float)m_iBreathRand)); + } m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); @@ -250,7 +257,7 @@ void CRanrok::OnCollision(CGameObject* pOther, void* pDesc) ON_COLLISION_INFO* CollisionDesc = static_cast(pDesc); - m_DamageInfo.vTarget_Pos = m_pCharacter_Controller->Get_HeadPosition(); + //m_DamageInfo.vTarget_Pos = m_pCharacter_Controller->Get_HeadPosition(); CEffect_Container* pEffect_Container = dynamic_cast(pOther); @@ -302,18 +309,39 @@ void CRanrok::OnCollision(CGameObject* pOther, void* pDesc) } - m_DamageInfo.fDamage = damagePair.first; - m_pInfoInstance->Event_CallBack(TEXT("Monster_Hit"), &m_DamageInfo); + /*m_DamageInfo.fDamage = damagePair.first; + m_pInfoInstance->Event_CallBack(TEXT("Monster_Hit"), &m_DamageInfo);*/ if (0 == damagePair.second) { m_pFSM->Change_State(FSMSTATE::DEAD); return; } - if (damagePair.second <= Get_Hp().y / 2.f && m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_AIR)) + + _float curr = Get_HpRatio(); + + if (m_fPrevHpRatio > 0.85f && curr <= 0.85f) { - m_pFSM->Change_State(FSMSTATE::LAND); + m_pFSM->Change_State(FSMSTATE::TUCKED); + m_fPrevHpRatio = curr; return; } - m_pFSM->Change_State(FSMSTATE::HIT); + else if (m_fPrevHpRatio > 0.7f && curr <= 0.7f) + { + m_pFSM->Change_State(FSMSTATE::TUCKED); + m_fPrevHpRatio = curr; + return; + } + else if (m_fPrevHpRatio > 0.5f && curr <= 0.5f) + { + m_ePhase = ENUM_CLASS(RANROK_PHASE::PHASE_GROUND); + m_pFSM->Change_State(FSMSTATE::TUCKED); + m_fPrevHpRatio = curr; + return; + } + m_fPrevHpRatio = curr; + + if (IsHitStateDisabled() && IsHitSpellDisabled()) { + m_pFSM->Change_State(FSMSTATE::HIT); + } } void CRanrok::OnHit(CGameObject* pOther, CGameObject* pCaller) @@ -433,6 +461,13 @@ HRESULT CRanrok::Render_Nonblend() return E_FAIL; } +//#ifdef _DEBUG +//#ifdef 기무리 +// if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) { +// return E_FAIL; +// } +//#endif // 기무리 +//#endif // _DEBUG if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) { return E_FAIL; } @@ -628,7 +663,7 @@ void CRanrok::MoveTo(_float fTimeDelta) _vector toTarget = Target - CurPos; _float fDist = XMVectorGetX(XMVector3Length(toTarget)); - if (m_iCurrentPoint + 1 < m_Points[m_iCurrentFlow].size() && fDist < 30.f) + if (m_iCurrentPoint + 1 < m_Points[m_iCurrentFlow].size() && fDist < 15.f) { NextTarget = m_Points[m_iCurrentFlow][m_iCurrentPoint + 1]; } @@ -638,7 +673,7 @@ void CRanrok::MoveTo(_float fTimeDelta) if (m_iCurrentPoint == m_Points[m_iCurrentFlow].size() - 1) { - if (fDist < 10.f) + if (fDist < 5.f) { if (m_iCurrentPoint == m_Points[m_iCurrentFlow].size() - 1) { @@ -650,21 +685,15 @@ void CRanrok::MoveTo(_float fTimeDelta) return; } } - else if (fDist < 20.f) + else if (fDist < 10.f) { - if (m_iCurrentPoint == m_Points[m_iCurrentFlow].size() - 1) - { - m_bTucked = true; - m_pFSM->Disable_State(FSMSTATE::TUCKED); - } - m_iCurrentPoint = (m_iCurrentPoint + 1) % m_Points[m_iCurrentFlow].size(); return; } _vector LerpTarget = XMVectorLerp(Target, NextTarget, 0.5f); - m_pTransformCom->LookAt_Lerp(LerpTarget, fTimeDelta,2.5f); + m_pTransformCom->LookAt_Lerp(LerpTarget, fTimeDelta,5.f); m_pCharacter_Controller->Set_Position(CurPos + vLook * m_fTuckedSpeed * fTimeDelta); } @@ -710,6 +739,34 @@ HRESULT CRanrok::Load_RanrokPos(const _char* pFilePath) return S_OK; } +void CRanrok::Update_Disolve(_float fTimeDelta) +{ + if (!m_bDisolve) + return; + + if (!m_bDisolveReverse) + { + m_fDisolveTime += fTimeDelta * 0.8f; + + if (m_fDisolveTime >= 1.f) + { + m_fDisolveTime = 1.f; + } + } + else + { + m_fDisolveTime -= fTimeDelta * 0.8f; + + if (m_fDisolveTime <= 0.f) + { + m_fDisolveTime = 0.f; + m_bDisolve = false; + m_bDisolveReverse = false; + } + } +} + + CRanrok* CRanrok::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { CRanrok* pInstance = new CRanrok(pDevice, pContext); @@ -778,55 +835,65 @@ void CRanrok::Describe_Entity() m_pCharacter_Controller->Set_Position(XMVectorSetW(XMLoadFloat3(&Pos), 1.f)); } - GUI::SameLine(); - - if (GUI::SmallButton("Copy")) - { - char buf[128]; - sprintf_s(buf, "", Pos.x, Pos.y, Pos.z); - - GUI::SetClipboardText(buf); - - m_Points[0].push_back(XMVectorSet(Pos.x, Pos.y, Pos.z, 1.f)); - } - - GUI::SameLine(); - - if (GUI::SmallButton("Clear")) - { - m_Points[0].clear(); - } - - GUI::Separator(); - GUI::Text("Points[0] Count : %d", (_int)m_Points[0].size()); - - for (_uint i = 0; i < m_Points[0].size();) - { - _vector v = m_Points[0][i]; - XMFLOAT3 p; - XMStoreFloat3(&p, v); - - GUI::PushID(i); - - GUI::Text("[%d] (%.2f, %.2f, %.2f)", i, p.x, p.y, p.z); - - GUI::SameLine(); - - if (GUI::SmallButton("X")) - { - m_Points[0].erase(m_Points[0].begin() + i); - GUI::PopID(); - continue; - } - - GUI::PopID(); - i++; - } - - if (GUI::Button("MovePos")) { - m_pCharacter_Controller->Set_Position(XMVectorSet(m_pGameInstance->Get_CamPosition()->x, m_pGameInstance->Get_CamPosition()->y, m_pGameInstance->Get_CamPosition()->z,1.f)); + m_pCharacter_Controller->Set_Position(XMVectorSet(m_pGameInstance->Get_CamPosition()->x, m_pGameInstance->Get_CamPosition()->y, m_pGameInstance->Get_CamPosition()->z, 1.f)); + } + + for (_uint i = 0; i < m_Points.size(); ++i) + { + GUI::Separator(); + + if (GUI::TreeNode(("Points " + to_string(i)).c_str())) + { + if (GUI::SmallButton("Copy")) + { + char buf[128]; + sprintf_s(buf, "", Pos.x, Pos.y, Pos.z); + + GUI::SetClipboardText(buf); + + m_Points[i].push_back(XMVectorSet(Pos.x, Pos.y, Pos.z, 1.f)); + } + + GUI::Text("Points[%d] Count : %d", i, (_int)m_Points[i].size()); + + for (_uint j = 0; j < m_Points[i].size(); ) + { + _float3 p; + XMStoreFloat3(&p, m_Points[i][j]); + + GUI::PushID((int)(i * 10000 + j)); + + GUI::Text("[%d] (%.2f, %.2f, %.2f)", j, p.x, p.y, p.z); + GUI::SameLine(); + + if (GUI::SmallButton("Move")) + { + m_pCharacter_Controller->Set_Position( + XMVectorSet(p.x, p.y, p.z, 1.f)); + } + + GUI::SameLine(); + + if (GUI::SmallButton("X")) + { + m_Points[i].erase(m_Points[i].begin() + j); + GUI::PopID(); + continue; + } + + GUI::PopID(); + ++j; + } + + if (GUI::SmallButton(("Clear##" + to_string(i)).c_str())) + { + m_Points[i].clear(); + } + GUI::TreePop(); + } + } m_pTransformCom->Describe_Entity(); diff --git a/Jusin154_Team3D/Client/Private/Ranrok_Breath.cpp b/Jusin154_Team3D/Client/Private/Ranrok_Breath.cpp index 2022c4da7..de8cf6b89 100644 --- a/Jusin154_Team3D/Client/Private/Ranrok_Breath.cpp +++ b/Jusin154_Team3D/Client/Private/Ranrok_Breath.cpp @@ -22,9 +22,10 @@ CRanrok_Breath::CRanrok_Breath(const CRanrok_Breath& rhs) HRESULT CRanrok_Breath::Initialize_Prototype() { - if (FAILED(Load_Package("../Bin/Resources/Data/Effect/MonsterPackage/Ranrok/RanrokBreath"))) return E_FAIL; + + return S_OK; } @@ -56,35 +57,6 @@ HRESULT CRanrok_Breath::Initialize(void* pArg) m_fDuration = 5.f; - m_Events.emplace(0.5f, [&]() { - m_isStartRayCast = true; - }); - - - m_Events.emplace(3.f, [&]() { - - // 파티클 제어 - m_isParticleEnd = true; - - CEffectParts* pRock_PT = Get_PartObject("Rock_PT"); - CEffectParts* pBottomFire = Get_PartObject("BottomFire"); - CEffectParts* pSplatterBottom0 = Get_PartObject("SplatterBottom0"); - - m_pMouthFire->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(0.f, -500.f, 0.f, 1.f)); - - pRock_PT->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(0.f, -500.f, 0.f, 1.f)); - pBottomFire->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(0.f, -500.f, 0.f, 1.f)); - pSplatterBottom0->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(0.f, -500.f, 0.f, 1.f)); - - m_pBreath->Get_Component()->Set_Loop(false); - m_pBreath->Get_Effect_Info()->isDissolve = true; - - m_pBreath_Black->Get_Component()->Set_Loop(false); - m_pBreath_Black->Get_Effect_Info()->isDissolve = true; - - m_pBreathSlog->Set_Visible(false); - - }); return S_OK; } @@ -104,13 +76,13 @@ void CRanrok_Breath::Update(_float fTimeDelta) Update_Event(fTimeDelta); - _matrix BoneMat = XMLoadFloat4x4(m_pOwner->Get_Component()->Get_BoneMatrixPtr("tongue_01")); + _matrix BoneMat = XMLoadFloat4x4(m_pOwner->Get_Component()->Get_BoneMatrixPtr("jaw")); for (int i = 0; i < 3; ++i) { BoneMat.r[i] = XMVector3Normalize(BoneMat.r[i]); } - _matrix WorldMat = m_pOwner->Get_Component()->Get_XMWorldMatrix() ; + _matrix WorldMat = m_pOwner->Get_Component()->Get_XMWorldMatrix(); _matrix CombinedMat = BoneMat * WorldMat; @@ -120,7 +92,7 @@ void CRanrok_Breath::Update(_float fTimeDelta) m_pBreath_Black->Get_Component()->Set_WorldMatrix(CombinedMat); m_pBreathSlog->Get_Component()->Set_WorldMatrix(CombinedMat); - if(m_isParticleEnd == false) + if (m_isParticleEnd == false) m_pMouthFire->Get_Component()->Set_State(STATE::POSITION, CombinedMat.r[3]); @@ -128,7 +100,7 @@ void CRanrok_Breath::Update(_float fTimeDelta) XMStoreFloat4(&m_vStartPos, vStartPos); - if(m_isStartRayCast == true) + if (m_isStartRayCast == true) { ON_COLLISION_INFO CollisionInfo = MonsterRayCast(XMLoadFloat4(&m_vStartPos), CombinedMat.r[2] * -1.f, 50.f, 50); if (m_bHit = true) @@ -137,7 +109,7 @@ void CRanrok_Breath::Update(_float fTimeDelta) } - + } void CRanrok_Breath::Late_Update(_float fTimeDelta) @@ -156,52 +128,58 @@ HRESULT CRanrok_Breath::Pre_Setting(CGameObject* pObject, void* pArg) return E_FAIL; + /* 브레스 시간 제어 */ + + _float fBreathTime = *static_cast<_float*>(pArg); + + Set_BreathTime(fBreathTime); + /* 초기 객체 비지블*/ CEffectParts* pBlurMesh = Get_PartObject("BlurMesh"); - m_pBreath->Set_Visible(true); - m_pBreath_Black->Set_Visible(true); - m_pBreathSlog->Set_Visible(true); - m_pMouthFire->Set_Visible(true); - pBlurMesh->Set_Visible(true); + m_pBreath->Set_Visible(true); + m_pBreath_Black->Set_Visible(true); + m_pBreathSlog->Set_Visible(true); + m_pMouthFire->Set_Visible(true); + pBlurMesh->Set_Visible(true); /* 초기 객체 위치 초기화*/ - _matrix BoneMat = XMLoadFloat4x4(m_pOwner->Get_Component()->Get_BoneMatrixPtr("tongue_01")); + _matrix BoneMat = XMLoadFloat4x4(m_pOwner->Get_Component()->Get_BoneMatrixPtr("jaw")); for (int i = 0; i < 3; ++i) { BoneMat.r[i] = XMVector3Normalize(BoneMat.r[i]); } - _matrix WorldMat = m_pOwner->Get_Component()->Get_XMWorldMatrix() ; + _matrix WorldMat = m_pOwner->Get_Component()->Get_XMWorldMatrix(); _matrix CombinedMat = BoneMat * WorldMat; - m_pBreath->Get_Component()->Set_WorldMatrix(CombinedMat); - m_pBreath_Black->Get_Component()->Set_WorldMatrix(CombinedMat); - m_pBreathSlog->Get_Component()->Set_WorldMatrix(CombinedMat); + m_pBreath->Get_Component()->Set_WorldMatrix(CombinedMat); + m_pBreath_Black->Get_Component()->Set_WorldMatrix(CombinedMat); + m_pBreathSlog->Get_Component()->Set_WorldMatrix(CombinedMat); - _vector vStartPos = CombinedMat.r[3]; + _vector vStartPos = CombinedMat.r[3]; - XMStoreFloat4(&m_vStartPos, vStartPos); + XMStoreFloat4(&m_vStartPos, vStartPos); - m_pMouthFire->Get_Component()->Set_State(STATE::POSITION, CombinedMat.r[3]); - pBlurMesh->Get_Component()->Set_State(STATE::POSITION, CombinedMat.r[3]); + m_pMouthFire->Get_Component()->Set_State(STATE::POSITION, CombinedMat.r[3]); + pBlurMesh->Get_Component()->Set_State(STATE::POSITION, CombinedMat.r[3]); - /* 브레스 디졸브를 위해 초기값 설정*/ - m_pBreath->Get_Component()->Set_Loop(true); - m_pBreath->Get_Effect_Info()->isDissolve = false; + /* 브레스 디졸브를 위해 초기값 설정*/ + m_pBreath->Get_Component()->Set_Loop(true); + m_pBreath->Get_Effect_Info()->isDissolve = false; - m_pBreath_Black->Get_Component()->Set_Loop(true); - m_pBreath_Black->Get_Effect_Info()->isDissolve = false; + m_pBreath_Black->Get_Component()->Set_Loop(true); + m_pBreath_Black->Get_Effect_Info()->isDissolve = false; - m_isParticleEnd = false; - m_isStartRayCast = false; + m_isParticleEnd = false; + m_isStartRayCast = false; return S_OK; } @@ -280,6 +258,42 @@ void CRanrok_Breath::OnCollision(CGameObject* pOther, void* pDesc) XMStoreFloat4(&m_vPreCollisionPos, vPos); } +void CRanrok_Breath::Set_BreathTime(_float fTime) +{ + m_Events.clear(); + + m_Events.emplace(fTime, [&]() { + + m_pBreath->Get_Component()->Set_Loop(false); + m_pBreath->Get_Effect_Info()->isDissolve = true; + + m_pBreath_Black->Get_Component()->Set_Loop(false); + m_pBreath_Black->Get_Effect_Info()->isDissolve = true; + + m_pBreathSlog->Set_Visible(false); + + }); + + m_Events.emplace(fTime + 0.5f, [&]() { + // 파티클 제어 + m_isParticleEnd = true; + + CEffectParts* pRock_PT = Get_PartObject("Rock_PT"); + CEffectParts* pBottomFire = Get_PartObject("BottomFire"); + CEffectParts* pSplatterBottom0 = Get_PartObject("SplatterBottom0"); + + m_pMouthFire->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(0.f, -500.f, 0.f, 1.f)); + + pRock_PT->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(0.f, -500.f, 0.f, 1.f)); + pBottomFire->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(0.f, -500.f, 0.f, 1.f)); + pSplatterBottom0->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(0.f, -500.f, 0.f, 1.f)); + }); + + m_Events.emplace(0.25f, [&]() { + m_isStartRayCast = true; + }); +} + void CRanrok_Breath::Free() { __super::Free(); @@ -290,7 +304,7 @@ void CRanrok_Breath::Free() SAFE_RELEASE(m_pBreath_Black); SAFE_RELEASE(m_pBreathSlog); SAFE_RELEASE(m_pMouthFire); - + //SAFE_RELEASE(m_pFireBall_Tail); } #ifdef _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Ranrok_Charge.cpp b/Jusin154_Team3D/Client/Private/Ranrok_Charge.cpp new file mode 100644 index 000000000..eae3e2e01 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Ranrok_Charge.cpp @@ -0,0 +1,187 @@ +#include "pch.h" +#include "Ranrok_Charge.h" + +#include "GameInstance.h" +#include "EffectParts.h" +#include "Wand.h" +#include "Player.h" +#include "InfoInstance.h" + +CRanrok_Charge::CRanrok_Charge(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CEffect_Container{ pDevice, pContext } +{ +} + +CRanrok_Charge::CRanrok_Charge(const CRanrok_Charge& rhs) + : CEffect_Container(rhs), + m_pInfoInstance(CInfoInstance::GetInstance()) +{ + SAFE_ADDREF(m_pInfoInstance); +} + +HRESULT CRanrok_Charge::Initialize_Prototype() +{ + + if (FAILED(Load_Package("../Bin/Resources/Data/Effect/MonsterPackage/Ranrok/RanrokCharge"))) + return E_FAIL; + + return S_OK; + +} + +HRESULT CRanrok_Charge::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components(pArg))) + return E_FAIL; + + if (FAILED(Create_Effect())) + return E_FAIL; + + + m_wstrEffectName = L"RanrokCharge"; + + + + m_fDuration = 4.f; + + + + + return S_OK; +} + +void CRanrok_Charge::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); + +} + +void CRanrok_Charge::Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Update(fTimeDelta); + + Update_Event(fTimeDelta); + + + + + +} + +void CRanrok_Charge::Late_Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Late_Update(fTimeDelta); + + +} + +HRESULT CRanrok_Charge::Pre_Setting(CGameObject* pObject, void* pArg) +{ + if (FAILED(__super::Pre_Setting(pObject, nullptr))) + return E_FAIL; + + + /* 초기 객체 비지블*/ + + CEffectParts* pCharge_Goo = Get_PartObject("Charge_Goo"); + CEffectParts* pCombinedPT = Get_PartObject("CombinedPT"); + + pCharge_Goo->Set_Visible(true); + pCombinedPT->Set_Visible(true); + + /* 초기 객체 위치 초기화*/ + + _vector vOwnerPos = m_pOwner->Get_Component()->Get_Position(); + + + pCharge_Goo->Get_Component()->Set_State(STATE::POSITION, vOwnerPos); + pCombinedPT->Get_Component()->Set_State(STATE::POSITION, vOwnerPos); + + + + return S_OK; +} + +HRESULT CRanrok_Charge::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CRanrok_Charge::Ready_Child() +{ + return S_OK; +} + +CRanrok_Charge* CRanrok_Charge::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CRanrok_Charge* pInstance = new CRanrok_Charge(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CRanrok_Charge"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + + +CGameObject* CRanrok_Charge::Clone(void* pArg, CGameObject* pOwner) +{ + CRanrok_Charge* pInstance = new CRanrok_Charge(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CRanrok_Charge"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CRanrok_Charge::OnCollision(CGameObject* pOther, void* pDesc) +{ + if (m_bHit == false) + return; + + ON_COLLISION_INFO CollisionDesc = *static_cast(pDesc); + + _vector vPos = XMLoadFloat4(&CollisionDesc.vWorldPos); + + +} + +void CRanrok_Charge::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pInfoInstance); + + +} +#ifdef _DEBUG +void CRanrok_Charge::Describe_Entity() +{ + +} +#endif + +HRESULT CRanrok_Charge::Bind_ShaderResources() +{ + return S_OK; +} + + diff --git a/Jusin154_Team3D/Client/Private/Ranrok_Pulse.cpp b/Jusin154_Team3D/Client/Private/Ranrok_Pulse.cpp new file mode 100644 index 000000000..b450ff23d --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Ranrok_Pulse.cpp @@ -0,0 +1,209 @@ +#include "pch.h" +#include "Ranrok_Pulse.h" + +#include "GameInstance.h" +#include "EffectParts.h" +#include "Wand.h" +#include "Player.h" +#include "InfoInstance.h" + +CRanrok_Pulse::CRanrok_Pulse(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CEffect_Container{ pDevice, pContext } +{ +} + +CRanrok_Pulse::CRanrok_Pulse(const CRanrok_Pulse& rhs) + : CEffect_Container(rhs), + m_pInfoInstance(CInfoInstance::GetInstance()) +{ + SAFE_ADDREF(m_pInfoInstance); +} + +HRESULT CRanrok_Pulse::Initialize_Prototype() +{ + + if (FAILED(Load_Package("../Bin/Resources/Data/Effect/MonsterPackage/Ranrok/RanrokPulse"))) + return E_FAIL; + + return S_OK; + +} + +HRESULT CRanrok_Pulse::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components(pArg))) + return E_FAIL; + + if (FAILED(Create_Effect())) + return E_FAIL; + + m_wstrEffectName = L"RanrokPulse"; + + + + m_fDuration = 15.f; + + + return S_OK; +} + +void CRanrok_Pulse::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); + +} + +void CRanrok_Pulse::Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Update(fTimeDelta); + + Update_Event(fTimeDelta); + + + + + +} + +void CRanrok_Pulse::Late_Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Late_Update(fTimeDelta); + + +} + +HRESULT CRanrok_Pulse::Pre_Setting(CGameObject* pObject, void* pArg) +{ + if (FAILED(__super::Pre_Setting(pObject, nullptr))) + return E_FAIL; + + + /* 초기 객체 비지블*/ + + CEffectParts* pBottomDecal = Get_PartObject("Bottom_Decal"); + CEffectParts* pBottomSplatter = Get_PartObject("BottomSplatter"); + CEffectParts* pBottomSplatter2 = Get_PartObject("BottomSplatter2"); + CEffectParts* pRed_Sphere = Get_PartObject("Red_Sphere"); + CEffectParts* pRock_PT = Get_PartObject("Rock_PT"); + CEffectParts* pSmoke = Get_PartObject("Smoke"); + + pBottomDecal->Set_Visible(true); + pBottomSplatter->Set_Visible(true); + pBottomSplatter2->Set_Visible(true); + pRock_PT->Set_Visible(true); + pSmoke->Set_Visible(true); + + pRed_Sphere->Set_Visible(true); + + + /* 초기 객체 위치 초기화*/ + + _vector vOwnerPos = m_pOwner->Get_Component()->Get_Position(); + + pRed_Sphere->Get_Component()->Set_WorldMatrix(m_pOwner->Get_Component()->Get_XMWorldMatrix()); + pRed_Sphere->Get_Component()->Set_State(STATE::POSITION, vOwnerPos); + + CUnit* pPlayer = m_pInfoInstance->Get_NearestPlayerAlly(m_pOwner->Get_WorldPostion()).first; + + if (pPlayer == nullptr) + return E_FAIL; + + _vector vPlayer_FootPos = pPlayer->Get_Component()->Get_FootPosition(); + + XMStoreFloat4(&m_vTargetPos, vPlayer_FootPos); + + _vector vCompute_Pos = XMVectorSetY(vOwnerPos, XMVectorGetY(vPlayer_FootPos)); + + pBottomDecal->Get_Component()->Set_State(STATE::POSITION, vCompute_Pos); + pBottomSplatter->Get_Component()->Set_State(STATE::POSITION, vCompute_Pos); + pBottomSplatter2->Get_Component()->Set_State(STATE::POSITION, vCompute_Pos); + pRock_PT->Get_Component()->Set_State(STATE::POSITION, vCompute_Pos); + pSmoke->Get_Component()->Set_State(STATE::POSITION, vCompute_Pos); + + + return S_OK; +} + +HRESULT CRanrok_Pulse::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CRanrok_Pulse::Ready_Child() +{ + return S_OK; +} + +CRanrok_Pulse* CRanrok_Pulse::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CRanrok_Pulse* pInstance = new CRanrok_Pulse(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CRanrok_Pulse"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + + +CGameObject* CRanrok_Pulse::Clone(void* pArg, CGameObject* pOwner) +{ + CRanrok_Pulse* pInstance = new CRanrok_Pulse(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CRanrok_Pulse"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CRanrok_Pulse::OnCollision(CGameObject* pOther, void* pDesc) +{ + if (m_bHit == false) + return; + + ON_COLLISION_INFO CollisionDesc = *static_cast(pDesc); + + _vector vPos = XMLoadFloat4(&CollisionDesc.vWorldPos); + + +} + +void CRanrok_Pulse::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pInfoInstance); + + +} +#ifdef _DEBUG +void CRanrok_Pulse::Describe_Entity() +{ + +} +#endif + +HRESULT CRanrok_Pulse::Bind_ShaderResources() +{ + return S_OK; +} + + diff --git a/Jusin154_Team3D/Client/Private/Ranrok_States.cpp b/Jusin154_Team3D/Client/Private/Ranrok_States.cpp index e38667d77..13e53d5de 100644 --- a/Jusin154_Team3D/Client/Private/Ranrok_States.cpp +++ b/Jusin154_Team3D/Client/Private/Ranrok_States.cpp @@ -56,12 +56,59 @@ 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); + if (m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_AIR)) + { + pairAnimInfo = m_Animation[STATEANIM::IDLE_BREAK2]; + } + else if(m_ePhase== ENUM_CLASS(RANROK_PHASE::PHASE_GROUND)) { + if (m_fDegree < 30.f) + { + _int iRand = m_pGameInstance->Real_Random_Int(0, 1); + if (iRand == 0) + { + pairAnimInfo = m_Animation[STATEANIM::IDLE_BREAK3]; + } + else { + pairAnimInfo = m_Animation[STATEANIM::IDLE_BREAK4]; + } + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + } + else if (m_fDegree < 80.f) + { + if (m_fCross < 0.f) + { + pairAnimInfo = m_Animation[STATEANIM::IDLE_TURN_45_L]; + } + else { + pairAnimInfo = m_Animation[STATEANIM::IDLE_TURN_45_R]; + } + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, false, 1.5f); + } + else if (m_fDegree < 150.f) + { + if (m_fCross < 0.f) + { + pairAnimInfo = m_Animation[STATEANIM::IDLE_TURN_90_L]; + } + else { + pairAnimInfo = m_Animation[STATEANIM::IDLE_TURN_90_R]; + } + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, false, 1.5f); + } + else { + if (m_fCross < 0.f) + { + pairAnimInfo = m_Animation[STATEANIM::IDLE_TURN_180_L]; + } + else { + pairAnimInfo = m_Animation[STATEANIM::IDLE_TURN_180_R]; + } + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second,1.f,false,1.5f); + } + } } -HRESULT CRanrok::Behavior_IdleBreakExitCheck() +HRESULT CRanrok::Behavior_IdleBreakExitCheck(_float fTimeDelta) { if (m_pModelCom->IsFinishedAnim()) { m_pFSM->Change_State(FSMSTATE::COMBAT); @@ -118,7 +165,6 @@ HRESULT CRanrok::Behavior_CombatExitCheck(_float fTimeDelta) return E_FAIL; } - if (m_fTargetDistance <= 100.f && m_fSkillCoolTime[ENUM_CLASS(RANROK_SKILL::FIREBREATH)] <= 0.f) { m_pFSM->Change_State(FSMSTATE::FIREBREATH); @@ -152,17 +198,11 @@ HRESULT CRanrok::Behavior_CombatExitCheck(_float fTimeDelta) } else { if (m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_AIR)) { - m_pFSM->Change_State(FSMSTATE::HOVER); + m_pFSM->Change_State(FSMSTATE::IDLE); return E_FAIL; } - else if (m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_GROUND)) { - if (m_pFSM->IsEnable_Previous(FSMSTATE::TUCKED | FSMSTATE::PULSE)) - { - m_pFSM->Change_State(FSMSTATE::LAND); - } - else { - m_pFSM->Change_State(FSMSTATE::GROUND); - } + else if (m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_GROUND)) { + m_pFSM->Change_State(FSMSTATE::GROUND); return E_FAIL; } } @@ -286,34 +326,57 @@ 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_pModelCom->Play_HeadBone(true); - 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_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); }, - 0.95f); + [&]() { + pairAnimInfo = m_Animation[STATEANIM::FIREBREATH_COOLDOWN_A]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + m_bLookAt = true; + }, 0.95f); + Add_Event(m_Animation[STATEANIM::FIREBREATH_A].first, [this]() { - m_pEffectPool->Use_Skill(SKILL_TYPE::RANROK_BREATH, this); + + _float fBreathTime = 1.f; + + m_pEffectPool->Use_Skill(SKILL_TYPE::RANROK_BREATH, this, &fBreathTime); + }, 0.1f); + + /*Add_Event(m_Animation[STATEANIM::FIREBREATH_A].first, + [this]() { + m_pModelCom->Play_HeadBone(true); + }, 0.2f);*/ } else if (m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_GROUND)) { + pairAnimInfo = m_Animation[STATEANIM::FIREBREATH_G]; m_fSkillCoolTime[ENUM_CLASS(RANROK_SKILL::FIREBREATH)] = m_fMaxSkillCoolTime[ENUM_CLASS(RANROK_SKILL::FIREBREATH)]; + + Add_Event(pairAnimInfo.first, + [this]() { + m_pEffectPool->Use_Skill(SKILL_TYPE::RANROK_BREATH, this); + m_bLookAt = false; + }, 0.1f); + + Add_Event(pairAnimInfo.first, + [this]() { + m_pModelCom->Play_HeadBone(true); + }, 0.2f); } m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } @@ -322,34 +385,38 @@ HRESULT CRanrok::Behavior_FireBreathExitCheck(_float fTimeDelta) { pair<_uint, _bool> pairAnimInfo = {}; _int iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + _float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio(); if (m_pModelCom->Get_PlayHeadBone()) { - m_fHeadAimWeight += fTimeDelta; - if (m_fHeadAimWeight >= 1.f) + m_fHeadAimWeight += fTimeDelta *0.3f; + if (m_fHeadAimWeight >= 0.7f) { - m_fHeadAimWeight = 1.f; + m_fHeadAimWeight = 0.7f; } m_pModelCom->Set_HeadAimWeight(m_fHeadAimWeight); } - if (iCurrAnimIndex == m_Animation[STATEANIM::FIREBREATH_COOLDOWN_A].first) + if (iCurrAnimIndex == m_Animation[STATEANIM::FIREBREATH_G].first && fRatio >= 0.8f) { - m_fHeadAimWeight -= fTimeDelta * 2.f; - m_pModelCom->Set_HeadAimWeight(m_fHeadAimWeight); + + m_fHeadAimWeight -= fTimeDelta*1.5f; + if (m_fHeadAimWeight >= 0.f) { + m_pModelCom->Set_HeadAimWeight(m_fHeadAimWeight); + } + else { + m_pModelCom->Set_HeadAimWeight(0.f); + } } if (m_pModelCom->IsFinishedAnim()) { - m_pModelCom->Play_HeadBone(false); - if (m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_AIR)) - { + if (m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_AIR)) { + m_pFSM->Change_State(FSMSTATE::HOVER); + } + else { m_pFSM->Change_State(FSMSTATE::IDLEBREAK); - return E_FAIL; - } - else if (m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_GROUND)) { - m_pFSM->Change_State(FSMSTATE::GROUND); - return E_FAIL; } + return E_FAIL; } return S_OK; @@ -358,6 +425,8 @@ HRESULT CRanrok::Behavior_FireBreathExitCheck(_float fTimeDelta) void CRanrok::Behavior_FireBreathExit() { m_pFSM->Disable_State(FSMSTATE::FIREBREATH); + //m_pModelCom->Set_HeadAimWeight(0.f); + //m_pModelCom->Play_HeadBone(false); m_fHeadAimWeight = 0.f; } @@ -374,7 +443,6 @@ 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_pModelCom->Play_HeadBone(true); m_bLookAt = false; }, 0.95f); @@ -384,11 +452,20 @@ void CRanrok::Behavior_FireSweepEnter() }, 0.95f); + Add_Event(m_Animation[STATEANIM::FIRESWEEP_A].first, + [this]() { + + _float fBreathTime = 3.f; + + m_pEffectPool->Use_Skill(SKILL_TYPE::RANROK_BREATH, this, &fBreathTime); + + }, 0.08f); Add_Event(m_Animation[STATEANIM::FIRESWEEP_A].first, [this]() { - m_pEffectPool->Use_Skill(SKILL_TYPE::RANROK_BREATH, this); - }, 0.08f); + m_pModelCom->Play_HeadBone(true); + }, + 0.2f); } else if (m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_GROUND)) { @@ -398,8 +475,17 @@ void CRanrok::Behavior_FireSweepEnter() Add_Event(m_Animation[STATEANIM::FIRESWEEP_G].first, [this]() { m_pEffectPool->Use_Skill(SKILL_TYPE::RANROK_BREATH, this); + m_bLookAt = false; }, 0.2f); + + + Add_Event(m_Animation[STATEANIM::FIRESWEEP_G].first, + [this]() { + m_pModelCom->Play_HeadBone(true); + }, 0.3f); } + + m_iBreathRand = (m_pGameInstance->Real_Random_Int(0, 1) == 0) ? -1 : 1; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } @@ -407,35 +493,34 @@ HRESULT CRanrok::Behavior_FireSweepExitCheck(_float fTimeDelta) { pair<_uint, _bool> pairAnimInfo = {}; _int iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + _float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio(); if (m_pModelCom->Get_PlayHeadBone()) { - m_fHeadAimWeight += fTimeDelta; - if (m_fHeadAimWeight >= 1.f) + m_fHeadAimWeight += fTimeDelta * 0.3f; + if (m_fHeadAimWeight >= 0.7f) { - m_fHeadAimWeight = 1.f; + m_fHeadAimWeight = 0.7f; } m_pModelCom->Set_HeadAimWeight(m_fHeadAimWeight); } - if (iCurrAnimIndex == m_Animation[STATEANIM::FIRESWEEP_COOLDOWN_A].first) + if (iCurrAnimIndex == m_Animation[STATEANIM::FIRESWEEP_COOLDOWN_A].first || + iCurrAnimIndex == m_Animation[STATEANIM::FIRESWEEP_G].first && fRatio >= 0.8f) { - m_fHeadAimWeight -= fTimeDelta * 2.f; - m_pModelCom->Set_HeadAimWeight(m_fHeadAimWeight); + m_fHeadAimWeight -= fTimeDelta * 1.5f; + if (m_fHeadAimWeight >= 0.f) { + m_pModelCom->Set_HeadAimWeight(m_fHeadAimWeight); + } + else { + m_pModelCom->Set_HeadAimWeight(0.f); + } } if (m_pModelCom->IsFinishedAnim()) { - m_pModelCom->Play_HeadBone(false); - if (m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_AIR)) - { - m_pFSM->Change_State(FSMSTATE::IDLEBREAK); - return E_FAIL; - } - else if (m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_GROUND)) { - m_pFSM->Change_State(FSMSTATE::GROUND); - return E_FAIL; - } + m_pFSM->Change_State(FSMSTATE::IDLEBREAK); + return E_FAIL; } return S_OK; @@ -444,6 +529,8 @@ HRESULT CRanrok::Behavior_FireSweepExitCheck(_float fTimeDelta) void CRanrok::Behavior_FireSweepExit() { m_pFSM->Disable_State(FSMSTATE::FIRESWEEP); + m_pModelCom->Set_HeadAimWeight(0.f); + m_pModelCom->Play_HeadBone(false); m_fHeadAimWeight = 0.f; } @@ -521,11 +608,10 @@ HRESULT CRanrok::Behavior_FireBallExitCheck(_float fTimeDelta) return E_FAIL; } else if (m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_GROUND)) { - m_pFSM->Change_State(FSMSTATE::GROUND); + m_pFSM->Change_State(FSMSTATE::COMBAT); return E_FAIL; } } - return S_OK; } @@ -540,17 +626,16 @@ void CRanrok::Behavior_SwipeEnter() m_pFSM->Enable_State(FSMSTATE::SWIPE); if (m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_GROUND)) { - /*if (m_fCross > 0) - {*/ - pairAnimInfo = m_Animation[STATEANIM::GROUND_SWIPE_L]; - /*} + if (m_fCross > 0.f) + { + pairAnimInfo = m_Animation[STATEANIM::GROUND_SWIPE_L]; + } else { pairAnimInfo = m_Animation[STATEANIM::GROUND_SWIPE_R]; - }*/ + } m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } - m_fSkillCoolTime[ENUM_CLASS(RANROK_SKILL::SWIPE)] = m_fMaxSkillCoolTime[ENUM_CLASS(RANROK_SKILL::SWIPE)]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } @@ -624,7 +709,7 @@ HRESULT CRanrok::Behavior_RushExitCheck(_float fTimeDelta) vLook = XMVectorSetY(vLook, 0.f); vLook = XMVector3Normalize(vLook); _vector vPos = m_pCharacter_Controller->Get_Position(); - _vector vNextPos = vPos + vLook * 5.f * fTimeDelta; + _vector vNextPos = vPos + vLook * 8.f * fTimeDelta; m_pCharacter_Controller->Set_Position(vNextPos); return S_OK; } @@ -655,8 +740,16 @@ void CRanrok::Behavior_PulseEnter() m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); Add_Event(pairAnimInfo.first, - [this]() { CameraShake(10.f, 2.f, 5.f, 1.2f); }, + [this]() { CameraShake(10.f, 2.f, 5.f, 1.2f); + m_pEffectPool->Use_Skill(SKILL_TYPE::RANROK_PURSE, this); + }, 0.39f); + + Add_Event(pairAnimInfo.first, + [this]() { + m_pEffectPool->Use_Skill(SKILL_TYPE::RANROK_CHARGE, this); + }, 0.f); + } HRESULT CRanrok::Behavior_PulseExitCheck(_float fTimeDelta) @@ -667,7 +760,12 @@ HRESULT CRanrok::Behavior_PulseExitCheck(_float fTimeDelta) if (fRatio >= 0.95f) { - m_pFSM->Change_State(FSMSTATE::COMBAT); + if (m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_AIR)) { + m_pFSM->Change_State(FSMSTATE::COMBAT); + } + else { + m_pFSM->Change_State(FSMSTATE::LAND); + } return E_FAIL; } return S_OK; @@ -683,36 +781,37 @@ void CRanrok::Behavior_TuckedEnter() { pair<_uint, _bool> pairAnimInfo = {}; m_pFSM->Enable_State(FSMSTATE::TUCKED); - - //if (m_iCurrentFlow == 0) - //{ - // pairAnimInfo = m_Animation[STATEANIM::FLY]; - //} - //else { - // pairAnimInfo = m_Animation[STATEANIM::TUCKED]; - //} - pairAnimInfo = m_Animation[STATEANIM::FLY]; + m_bDisolve = true; + pairAnimInfo = m_Animation[STATEANIM::TUCKED]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); Add_Event(pairAnimInfo.first, [this]() { - m_bVisible = false; m_pEffectPool->Use_Skill(SKILL_TYPE::RANROK_POINT, this, nullptr, &m_pRanrok_Point); - }, 0.1f); + }, 0.05f); + } HRESULT CRanrok::Behavior_TuckedExitCheck(_float fTimeDelta) { pair<_uint, _bool> pairAnimInfo = {}; _int iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); - - MoveTo(fTimeDelta); + if (m_fDisolveTime >= 0.3f) { + MoveTo(fTimeDelta); + } if (m_bTucked && iCurrAnimIndex != m_Animation[STATEANIM::FLY_TO_HOVER].first) { + m_bDisolveReverse = true; m_iCurrentFlow++; - pairAnimInfo = m_Animation[STATEANIM::FLY_TO_HOVER]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + if (m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_GROUND)) { + m_pFSM->Change_State(FSMSTATE::LAND); + return E_FAIL; + } + else { + pairAnimInfo = m_Animation[STATEANIM::FLY_TO_HOVER]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + } } if (m_pModelCom->IsFinishedAnim() && iCurrAnimIndex == m_Animation[STATEANIM::FLY_TO_HOVER].first) @@ -729,20 +828,23 @@ void CRanrok::Behavior_TuckedExit() m_pRanrok_Point->Setting_Pos(XMVectorSet(0.f, -500.f, 0.f, 1.f)); SAFE_RELEASE(m_pRanrok_Point); - m_pFSM->Disable_State(FSMSTATE::TUCKED); m_bTucked = false; + } void CRanrok::Behavior_LandEnter() { pair<_uint, _bool> pairAnimInfo = {}; m_pFSM->Enable_State(FSMSTATE::LAND); + _float fAnimSpeed = 1.f; m_pCharacter_Controller->SetGravity(true); - m_ePhase = ENUM_CLASS(RANROK_PHASE::PHASE_GROUND); + if (m_pFSM->IsEnable_Previous(FSMSTATE::TUCKED)) { + fAnimSpeed = 2.f; + } pairAnimInfo = m_Animation[STATEANIM::LAND]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second,1.f,false,fAnimSpeed); Add_Event(pairAnimInfo.first, [this]() { CameraShake(30.f, 5.f, 10.f, 1.2f); }, @@ -829,6 +931,22 @@ void CRanrok::Behavior_DeadExit() m_bDead = true; } +_bool CRanrok::IsHitStateDisabled() +{ + return m_pFSM->IsEnable(FSMSTATE::FIREBREATH | FSMSTATE::FIRESWEEP | FSMSTATE::FIREBALL | FSMSTATE::PULSE | FSMSTATE::SWIPE | FSMSTATE::RUSH |FSMSTATE::SKILL); +} + +_bool CRanrok::IsHitSpellDisabled() +{ + if (m_eHitSpell == ENUM_CLASS(SKILL_TYPE::ANCIENT_MAGIC) || + m_eHitSpell == ENUM_CLASS(SKILL_TYPE::ANCIENT_MAGIC_THROW) || + m_eHitSpell == ENUM_CLASS(SKILL_TYPE::AVADAKEDAVRA)) + { + return true; + } + return false; +} + void CRanrok::Add_FSM() { @@ -848,7 +966,7 @@ void CRanrok::Add_FSM() CState_IdleBreak::STATE_IDLEBREAK_DESC Desc{}; Desc.pOwner = this; Desc.funcEnterEvent = [this]() { Behavior_IdleBreakEnter(); }; - Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_IdleBreakExitCheck(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_IdleBreakExitCheck(fTimedelta); }; Desc.funcExitEvent = [this]() { Behavior_IdleBreakExit(); }; Desc.funcPriorityUpdate = nullptr; Desc.funcLateUpdate = nullptr; diff --git a/Jusin154_Team3D/Client/Private/Terrain.cpp b/Jusin154_Team3D/Client/Private/Terrain.cpp index b081de464..96c9a21ea 100644 --- a/Jusin154_Team3D/Client/Private/Terrain.cpp +++ b/Jusin154_Team3D/Client/Private/Terrain.cpp @@ -252,7 +252,7 @@ void CTerrain::Free() void CTerrain::Describe_Entity() { GUI::Begin("Renderer", 0, IMGUI_GLOBAL_BEGIN_FLAG); - GUI::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); size_t iIndex = (size_t)this; diff --git a/Jusin154_Team3D/Client/Private/Troll.cpp b/Jusin154_Team3D/Client/Private/Troll.cpp index 29947600b..d5e94e3f1 100644 --- a/Jusin154_Team3D/Client/Private/Troll.cpp +++ b/Jusin154_Team3D/Client/Private/Troll.cpp @@ -428,8 +428,10 @@ void CTroll::OnCollision(CGameObject* pOther, void* pDesc) return; } - if(m_eHitSpell != ENUM_CLASS(SKILL_TYPE::JAP)) + if (m_pFSM->IsEnable(FSMSTATE::SLAM) || IsHitSpellDisabled()) { m_pFSM->Change_State(FSMSTATE::HIT); + } + } void CTroll::OnHit(CGameObject* pOther, CGameObject* pCaller) diff --git a/Jusin154_Team3D/Client/Private/Troll_Rock.cpp b/Jusin154_Team3D/Client/Private/Troll_Rock.cpp index 8d47fc8a6..b033f2add 100644 --- a/Jusin154_Team3D/Client/Private/Troll_Rock.cpp +++ b/Jusin154_Team3D/Client/Private/Troll_Rock.cpp @@ -278,7 +278,7 @@ void CTroll_Rock::Free() void CTroll_Rock::Describe_Entity() { GUI::Begin("UNIT", 0, IMGUI_GLOBAL_BEGIN_FLAG); - GUI::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); if (GUI::CollapsingHeader("TrollRock")) { GUI::Checkbox("Visible", &m_bVisible); } diff --git a/Jusin154_Team3D/Client/Private/Troll_States.cpp b/Jusin154_Team3D/Client/Private/Troll_States.cpp index 75d70fe60..6ae4217d8 100644 --- a/Jusin154_Team3D/Client/Private/Troll_States.cpp +++ b/Jusin154_Team3D/Client/Private/Troll_States.cpp @@ -463,7 +463,7 @@ void CTroll::Behavior_SwingEnter() 0.6f); - Set_Easing(pairAnimInfo.first, 0.1f, 0.47f, 1.5f); + Set_Easing(pairAnimInfo.first, 0.1f, 0.47f, 1.8f); Set_Easing(pairAnimInfo.first, 0.47f, 0.5f, 0.5f); } @@ -520,7 +520,7 @@ void CTroll::Behavior_SlamEnter() m_pEffectPool->Use_Skill(SKILL_TYPE::TROLL_ATTACK, this); }, 0.3f); - Set_Easing(pairAnimInfo.first, 0.1f, 0.42f, 1.5f); + Set_Easing(pairAnimInfo.first, 0.1f, 0.42f, 1.8f); Set_Easing(pairAnimInfo.first, 0.42f, 0.45f, 0.5f); @@ -573,7 +573,7 @@ void CTroll::Behavior_BackHandSwingEnter() }, 0.9f); - Set_Easing(pairAnimInfo.first, 0.1f, 0.45f, 1.5f); + Set_Easing(pairAnimInfo.first, 0.1f, 0.45f, 1.8f); Set_Easing(pairAnimInfo.first, 0.65f, 0.7f, 0.5f); } @@ -727,6 +727,17 @@ void CTroll::Behavior_DeadExit() m_bDead = true; } +_bool CTroll::IsHitSpellDisabled() +{ + if (m_eHitSpell == ENUM_CLASS(SKILL_TYPE::ANCIENT_MAGIC) || + m_eHitSpell == ENUM_CLASS(SKILL_TYPE::ANCIENT_MAGIC_THROW) || + m_eHitSpell == ENUM_CLASS(SKILL_TYPE::AVADAKEDAVRA)) + { + return true; + } + return false; +} + void CTroll::Add_FSM() { diff --git a/Jusin154_Team3D/Client/Private/Wand.cpp b/Jusin154_Team3D/Client/Private/Wand.cpp index f38c50543..4785a8b5c 100644 --- a/Jusin154_Team3D/Client/Private/Wand.cpp +++ b/Jusin154_Team3D/Client/Private/Wand.cpp @@ -73,7 +73,7 @@ void CWand::Late_Update(_float fTimeDelta) HRESULT CWand::Render() { - if (!m_pModelCom) + if (!m_bVisible) return S_OK; if (FAILED(Bind_ShaderResources())) { diff --git a/Jusin154_Team3D/Client/Public/Broom.h b/Jusin154_Team3D/Client/Public/Broom.h index f3dd3b8bd..d9e6e0e79 100644 --- a/Jusin154_Team3D/Client/Public/Broom.h +++ b/Jusin154_Team3D/Client/Public/Broom.h @@ -38,6 +38,7 @@ class CBroom final : public CUnit void Set_Input(BroomInput broomInput) { m_Input = broomInput; } void Set_AISpeed(_float speedMul, _float accelMul); void Set_Move(_bool bMove) { m_bMove = bMove; } + _bool Get_Move() { return m_bMove; } HRESULT Ready_Child(); private: CInfoInstance* m_pInfoInstance = { nullptr }; @@ -52,7 +53,7 @@ class CBroom final : public CUnit _float m_fSpeed = 0.f; _float m_fTurnSpeed = 0.f; _float m_fTargetSpeed = 0.f; - _float m_fTurnMaxSpeed = 8.f; + _float m_fTurnMaxSpeed = 12.f; _float m_fFlyTurnMaxSpeed = 9.f; _float m_fTurboTurnMaxSpeed = 12.f; _float m_fHoverMaxSpeed = 5.f; diff --git a/Jusin154_Team3D/Client/Public/BroomRaceManager.h b/Jusin154_Team3D/Client/Public/BroomRaceManager.h index b97efbb80..74c28bca4 100644 --- a/Jusin154_Team3D/Client/Public/BroomRaceManager.h +++ b/Jusin154_Team3D/Client/Public/BroomRaceManager.h @@ -41,6 +41,8 @@ class CBroomRaceManager final : public CGameObject void Push_BroomRacer(RacerInfo Info); void Push_RaceRing(class CRaceRing* Ring); _int Get_RaceState() const { return m_eRaceState; } + + HRESULT Load_RaceRing(); private: CInfoInstance* m_pInfoInstance = { nullptr }; @@ -73,7 +75,6 @@ class CBroomRaceManager final : public CGameObject virtual void Free() override; #ifdef _DEBUG virtual void Describe_Entity() override; - #endif }; diff --git a/Jusin154_Team3D/Client/Public/BroomRacerAI.h b/Jusin154_Team3D/Client/Public/BroomRacerAI.h index 876b052f1..ef983a41d 100644 --- a/Jusin154_Team3D/Client/Public/BroomRacerAI.h +++ b/Jusin154_Team3D/Client/Public/BroomRacerAI.h @@ -41,7 +41,6 @@ class CBroomRacerAI final : public CUnit virtual void OnHit(CGameObject* pOther, CGameObject* pCaller = nullptr)override; void Set_RaceRing(class CRaceRing* pRaceRing) {m_pRaceRing = pRaceRing;} class CBroom* Get_Broom() { return m_pBroom; } - void Set_Move(_bool bMove) { m_bMove = bMove; } private: CLight* m_pLightCom = { nullptr }; LIGHT_DESC LightDesc = {}; @@ -99,7 +98,6 @@ class CBroomRacerAI final : public CUnit _float m_fScaleSmoothSpeed = 2.5f; _float m_fAnimTime = {}; _bool m_bTurbo = {}; - _bool m_bMove = {}; _float m_LaneOffsetX = 0.f; _float m_LaneOffsetY = 0.f; _float m_TurnGain = 1.f; diff --git a/Jusin154_Team3D/Client/Public/Client_Enum.h b/Jusin154_Team3D/Client/Public/Client_Enum.h index 94866b298..defd41fdd 100644 --- a/Jusin154_Team3D/Client/Public/Client_Enum.h +++ b/Jusin154_Team3D/Client/Public/Client_Enum.h @@ -11,7 +11,7 @@ namespace Client enum class SHADER_PASS_NORTEX { DEFAULT, TERRAIN, ENV_TERRAIN_ANISO, SHADOW, END }; enum class SHADER_PASS_PARTICLE { EXPLOSION, END }; enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, TRAIL_BLEND, TRAILWB_FOR_BLEND, TRAIL_BLUR, TRAIL_BLOOM, END }; - enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, NON_WORLD_BLUR, BLEND, BLEND_NOWORLD, BLOOM, BLOOM_NOWORLD, BLUR_NO_EMMISVE, BLUR_NO_WORLD_NO_EMISSIVE, WEIGHTBLEND_FOR_BLEND, DEPTH_STOP, WB_CULLING, SCREEN_FX, DISTORTION, NONPOS, NONPOS_BLUR , BLUR_MESH, BLUR_CULLING, BLUR_CULLING_NO_EMISSIVE, BLOOM_CULLING, DEFAULT_NONPOS, NONWB_NONPOS ,DECAL, DECAL_WB ,DECAL_BLUR , END}; + enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, NON_WORLD_BLUR, BLEND, BLEND_NOWORLD, BLOOM, BLOOM_NOWORLD, BLUR_NO_EMMISVE, BLUR_NO_WORLD_NO_EMISSIVE, WEIGHTBLEND_FOR_BLEND, DEPTH_STOP, WB_CULLING, SCREEN_FX, DISTORTION, NONPOS, NONPOS_BLUR , BLUR_MESH, BLUR_CULLING, BLUR_CULLING_NO_EMISSIVE, BLOOM_CULLING, DEFAULT_NONPOS, NONWB_NONPOS ,DECAL, DECAL_WB ,DECAL_BLUR , BLEND_CULLING,END}; enum class SHADER_PASS_UIEDITOR { DEFAULT, COLOR, LOGO, LOGO_TEXT, LOGO_GLOW, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTTYPE, UVMULT, NINECLICE, @@ -72,7 +72,7 @@ namespace Client /*란록*/ - RANROK_FIREBALL, RANROK_BREATH, RANROK_POINT, + RANROK_FIREBALL, RANROK_BREATH, RANROK_POINT, RANROK_PURSE, RANROK_CHARGE, END }; diff --git a/Jusin154_Team3D/Client/Public/Client_Macro.h b/Jusin154_Team3D/Client/Public/Client_Macro.h index 9e18c3844..d78e087bf 100644 --- a/Jusin154_Team3D/Client/Public/Client_Macro.h +++ b/Jusin154_Team3D/Client/Public/Client_Macro.h @@ -67,6 +67,8 @@ namespace Client { #define LAYER_UNIFIED TEXT("Layer_Unified") #define LAYER_DOOR TEXT("Layer_Door") #define LAYER_HIDDEN TEXT("Layer_HIDDEN") +#define LAYER_RING TEXT("Layer_Ring") +#define LAYER_RACERAI TEXT("Layer_RacerAI") #define LAYER_MAPOBJECTMANAGER TEXT("Layer_MapObjectManager") diff --git a/Jusin154_Team3D/Client/Public/Level_GamePlay.h b/Jusin154_Team3D/Client/Public/Level_GamePlay.h index 1a4e25fbd..1cb47133c 100644 --- a/Jusin154_Team3D/Client/Public/Level_GamePlay.h +++ b/Jusin154_Team3D/Client/Public/Level_GamePlay.h @@ -35,9 +35,7 @@ class CLevel_GamePlay final : public CLevel HRESULT Ready_Layer_Camera(); HRESULT Ready_Layer_Sound(); HRESULT Ready_Layer_Player(const _wstring& strLayerTag); - HRESULT Ready_Layer_BroomRacerAI(const _wstring& strLayerTag); HRESULT Ready_Layer_Item(const _wstring& strLayerTag); - HRESULT Ready_Layer_RaceRing(const _wstring& strLayerTag); HRESULT Ready_Layer_ReparoObject(const _wstring& strLayerTag); HRESULT Ready_Layer_SkyBox(const _wstring& strLayerTag); HRESULT Ready_Layer_Monster(); diff --git a/Jusin154_Team3D/Client/Public/MapElement_Chest.h b/Jusin154_Team3D/Client/Public/MapElement_Chest.h index 19a1b18ed..448aaffec 100644 --- a/Jusin154_Team3D/Client/Public/MapElement_Chest.h +++ b/Jusin154_Team3D/Client/Public/MapElement_Chest.h @@ -38,6 +38,7 @@ class CMapElement_Chest final : public CMapElement virtual void Update(_float fTimeDelta) override; virtual void Late_Update(_float fTimeDelta) override; virtual HRESULT Render() override; + virtual void OnRayCollision(CGameObject* pCaster, _uint iCastedOrder, _float fDistance, _float3 vCastedWorldPos)override; private: ELEMENT_INTERACTABLE_ID m_eInteractableID = { ELEMENT_INTERACTABLE_ID::END }; @@ -46,6 +47,9 @@ class CMapElement_Chest final : public CMapElement _uint m_iShaderPass_Index = {}; + _int m_iEntered = { 0 }; + _float2 m_vEnteringTimer = { 0.f, 1.f }; + _float m_fEncounterDistance = { 3.f }; _float m_fTimeAcc = {}; _float m_fRimLightPower = { 0.7f }; _float m_fRimLightStrength = { 3.7f }; @@ -53,7 +57,7 @@ class CMapElement_Chest final : public CMapElement _float4 m_vRimLightColor = { 0.71f, 0.39f, 0.02f, 1.f }; CTexture* m_pNoiseTextureCom = { nullptr }; - CRigidBody* m_pRigidBody = { nullptr }; + CRigidBody_Dynamic* m_pRigidBody = { nullptr }; PSX::PxRigidDynamic* m_pActor = { nullptr }; class CMapElement_Chest_Lid* m_pLid = { nullptr }; diff --git a/Jusin154_Team3D/Client/Public/MapElement_Door.h b/Jusin154_Team3D/Client/Public/MapElement_Door.h index 64fe81397..fcf460f4a 100644 --- a/Jusin154_Team3D/Client/Public/MapElement_Door.h +++ b/Jusin154_Team3D/Client/Public/MapElement_Door.h @@ -22,20 +22,20 @@ class CMapElement_Door final : public CMapElement public: virtual void Priority_Update(_float fTimeDelta) override; + void ActingIdle(); virtual void Update(_float fTimeDelta) override; virtual void Late_Update(_float fTimeDelta) override; virtual HRESULT Render() override; + virtual void OnCollision(CGameObject* pOther, void* pDesc)override; private: - - CRigidBody* m_pRigidBody = { nullptr }; + CRigidBody_Dynamic* m_pRigidBody = { nullptr }; PSX::PxRigidDynamic* m_pActor = { nullptr }; + PSX::PxRevoluteJoint* m_pJoint = { nullptr }; _float3 m_vRadianYAngle = {}; _float3 m_vKinematicTimer = { 0.f, 2.f, 2.3f }; - PSX::PxQuat m_pxStartQuat = {}; - _float4x4 m_InitialMatrix = {}; - + _bool m_bDrive = { false }; #ifdef _DEBUG _bool m_bUseSelectColor = { true }; @@ -50,9 +50,6 @@ class CMapElement_Door final : public CMapElement virtual HRESULT Initialize(void* pArg) override; virtual HRESULT Ready_Components(void* pArg) override; virtual HRESULT Bind_ShaderResources() override; - void Lerp_Matrix(_float fTime); - void Lerp_NonMatrix(_float fTime); - _float ClampRadian(_float fNewRadian); public: static CMapElement_Door* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Client/Public/Monster.h b/Jusin154_Team3D/Client/Public/Monster.h index f76ce6264..504e7bf8f 100644 --- a/Jusin154_Team3D/Client/Public/Monster.h +++ b/Jusin154_Team3D/Client/Public/Monster.h @@ -33,8 +33,10 @@ class CMonster abstract : public CUnit virtual _float2 Get_Hp(); virtual CStat* Get_Stat(); const _float4x4* Get_HeadMatrix(); + _float Get_HpRatio(); void CameraShake(_float ClampValue, _float Min, _float Max, _float Time); - + virtual _bool IsHitStateDisabled(); + virtual _bool IsHitSpellDisabled(); protected: CInfoInstance* m_pInfoInstance = { nullptr }; CUnit* m_pTarget = { nullptr }; @@ -71,6 +73,8 @@ class CMonster abstract : public CUnit #endif // _DEBUG + + }; NS_END diff --git a/Jusin154_Team3D/Client/Public/NPC_EleazarFig.h b/Jusin154_Team3D/Client/Public/NPC_EleazarFig.h index a66506c75..47a248dd0 100644 --- a/Jusin154_Team3D/Client/Public/NPC_EleazarFig.h +++ b/Jusin154_Team3D/Client/Public/NPC_EleazarFig.h @@ -23,23 +23,24 @@ class CNPC_EleazarFig final : public CUnit virtual void Late_Update(_float fTimeDelta) override; virtual HRESULT Render() override; virtual HRESULT Render_Shadow(SHADOW eType) override; + virtual void OnRayCollision(CGameObject* pCaster, _uint iCastedOrder, _float fDistance, _float3 vCastedWorldPos)override; protected: CInfoInstance* m_pInfoInstance = { nullptr }; CCharacter_Controller* m_pCharacter_Controller = { nullptr }; + CRigidBody_Dynamic* m_pRigidBody = { nullptr }; class CCallBack_NonPlayable_Behavior* m_pCallBack_Behavior = { nullptr }; class CCallBack_NonPlayable_HitReport* m_pCallBack_HitReport = { nullptr }; CUnit* m_pPlayerAllyUnit = { nullptr }; - _bool m_bEntered = { false }; - _float2 m_vEnteringTimer = { 0.f, 1.f }; - _float m_fEncounterDistance = { 10.f }; + _int m_iEntered = { 0 }; + _float2 m_vEnteringTimer = { 0.f, 1.f }; + _float m_fEncounterDistance = { 3.f }; protected: virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; HRESULT Ready_Components(void* pArg); HRESULT Bind_ShaderResources() override; - _bool CastToPlayer(); public: static CNPC_EleazarFig* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Client/Public/NPC_Ollivander.h b/Jusin154_Team3D/Client/Public/NPC_Ollivander.h index f78ef2a6a..8942ad872 100644 --- a/Jusin154_Team3D/Client/Public/NPC_Ollivander.h +++ b/Jusin154_Team3D/Client/Public/NPC_Ollivander.h @@ -24,9 +24,11 @@ class CNPC_Ollivander final : public CUnit virtual void Late_Update(_float fTimeDelta) override; virtual HRESULT Render() override; virtual HRESULT Render_Shadow(SHADOW eType) override; + virtual void OnRayCollision(CGameObject* pCaster, _uint iCastedOrder, _float fDistance, _float3 vCastedWorldPos)override; protected: CInfoInstance* m_pInfoInstance = { nullptr }; CCharacter_Controller* m_pCharacter_Controller = { nullptr }; + CRigidBody_Dynamic* m_pRigidBody = { nullptr }; class CCallBack_NonPlayable_Behavior* m_pCallBack_Behavior = { nullptr }; class CCallBack_NonPlayable_HitReport* m_pCallBack_HitReport = { nullptr }; CUnit* m_pPlayerAllyUnit = { nullptr }; @@ -35,7 +37,7 @@ class CNPC_Ollivander final : public CUnit class CNPCInteraction* m_pNPCInteraction = { nullptr }; CNPCStat* m_pNpcStat = { nullptr }; - _bool m_bEntered = { false }; + _int m_iEntered = { 0 }; _float2 m_vEnteringTimer = { 0.f, 1.f }; _float m_fEncounterDistance = { 3.f }; protected: @@ -43,7 +45,6 @@ class CNPC_Ollivander final : public CUnit virtual HRESULT Initialize(void* pArg) override; HRESULT Ready_Components(void* pArg); HRESULT Bind_ShaderResources() override; - _bool CastToPlayer(); public: static CNPC_Ollivander* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Client/Public/Player.h b/Jusin154_Team3D/Client/Public/Player.h index 8a99456da..71b3f16a1 100644 --- a/Jusin154_Team3D/Client/Public/Player.h +++ b/Jusin154_Team3D/Client/Public/Player.h @@ -34,13 +34,15 @@ class CPlayer final : public CUnit _int Get_UIState() { return m_eUIState; } void Set_RaceRing(class CRaceRing* pRaceRing); class CBroom* Get_Broom() { return m_pBroom; } -#ifdef _DEBUG - void Render_CameraCoordinateSystem(); -#endif // _DEBUG + void Set_RaceInfo(); _bool Set_Sprint(_bool bSprint) { m_bSprintToggle = bSprint; } _matrix Get_WandPos(); void UpdateGrapInteractive(_float fTimeDelta); void Update_CameraShake(_float fTimeDelta); + HRESULT Update_RaycastElements(); +#ifdef _DEBUG + void Render_CameraCoordinateSystem(); +#endif // _DEBUG private: CInfoInstance* m_pInfoInstance = { nullptr }; LOCKON_INFO m_LockOnInfo = {}; @@ -60,8 +62,12 @@ class CPlayer final : public CUnit _float m_fOriginGravityAmount = {}; _float m_fGravityAmount = {}; + _float m_fTempWeight = {}; + class CCamPosition_Shoulder* m_pCamPosition_ShoulderPart = { nullptr }; class CCamPosition_Head* m_pCamPosition_HeadPart = { nullptr }; + _float m_fRayDistance = { 10.f }; + _uint m_iRayHitCount = { 0 }; CCharacter_Controller* m_pCharacter_Controller = { nullptr }; CRigidBody_Dynamic* m_pRigidBody = { nullptr }; @@ -80,13 +86,6 @@ class CPlayer final : public CUnit class CBroomRaceManager* m_pBroomRaceManager = { nullptr }; class CRaceRing* m_pRaceRing = { nullptr }; - - - - - - - _float m_fTempWeight = {}; private: virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; @@ -160,8 +159,6 @@ class CPlayer final : public CUnit _float m_fMoveTime = {}; _float m_fCross = 0.f; _float m_fabsDir = 0.f; - _float m_fNoInputTime = 0.f; - _float m_fNeutralTime = 0.f; array<_float4x4, 256> SkinMatrices; /* 무적 불 변수*/ diff --git a/Jusin154_Team3D/Client/Public/PlayerRobe.h b/Jusin154_Team3D/Client/Public/PlayerRobe.h index b403a5869..bd7a6af1e 100644 --- a/Jusin154_Team3D/Client/Public/PlayerRobe.h +++ b/Jusin154_Team3D/Client/Public/PlayerRobe.h @@ -33,7 +33,6 @@ class CPlayerRobe final : public CPartObject virtual void Late_Update(_float fTimeDelta) override; virtual HRESULT Render() override; HRESULT Update_RobeSocketPosition(); - HRESULT Bind_PrevBoneMatrices(CShader* pShader, const _char* pConstant); vector<_float4x4> Get_RobeJointAnchorMatrix() const { return m_ReconstructedJointAnchorMatirces; } _float4x4 Get_RobeJointAnchorMatrix(_uint iIndex) const { return m_ReconstructedJointAnchorMatirces[iIndex]; } private: @@ -51,10 +50,13 @@ class CPlayerRobe final : public CPartObject _int m_iBoneNum = -1; CRigidBody_Dynamic* m_pRightLeg = { nullptr }; CRigidBody_Dynamic* m_pLeftLeg = { nullptr }; + CRigidBody_Dynamic* m_pLower0Bound = { nullptr }; + CRigidBody_Dynamic* m_pLower1Bound = { 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 }; + D6JOINTDESC m_JointDescriptions[ENUM_CLASS(PLAYER_JOINT_ORDER::END)] = { }; vector<_float4x4> m_PrevRobeBoneMatrices = { }; #ifdef _DEBUG @@ -75,6 +77,7 @@ class CPlayerRobe final : public CPartObject #ifdef _DEBUG HRESULT Render_BonePhysX(); HRESULT Render_Legs(); + HRESULT Update_RobeJoints(); #endif // _DEBUG public: static CPlayerRobe* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Client/Public/RaceRing.h b/Jusin154_Team3D/Client/Public/RaceRing.h index bc6385b74..947cb43ff 100644 --- a/Jusin154_Team3D/Client/Public/RaceRing.h +++ b/Jusin154_Team3D/Client/Public/RaceRing.h @@ -11,7 +11,9 @@ class CRaceRing final : public CGameObject typedef struct RaceRingDesc { class CBroomRaceManager* pBroomRaceManager = { nullptr }; - _int iIndex = { 0 }; + _float3 vPosition{}; + _float3 vRotation{}; + _float3 vScale{}; }RACERING_DESC; private: CRaceRing(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Client/Public/Ranrok.h b/Jusin154_Team3D/Client/Public/Ranrok.h index 8dfd69cfd..441a88b35 100644 --- a/Jusin154_Team3D/Client/Public/Ranrok.h +++ b/Jusin154_Team3D/Client/Public/Ranrok.h @@ -77,6 +77,7 @@ class CRanrok final : public CMonster HRESULT Render_Nonblend(); HRESULT Render_Blend(); void MoveTo(_float fTimeDelta); + void Update_Disolve(_float fTimeDelta); HRESULT Load_RanrokPos(const _char* pFilePath); public: static CRanrok* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); @@ -101,6 +102,8 @@ class CRanrok final : public CMonster _bool m_bHoverDash = { false }; _vector m_vMoveDir = XMVectorZero(); + _bool m_bDisolveReverse = { false }; + _float m_fDisolveDelay = 0.f; vector> m_Points; @@ -113,16 +116,18 @@ class CRanrok final : public CMonster _float m_fAroundTime = {}; _float m_fRushTime = {}; _float m_fHeadAimWeight = {}; + _float m_fPrevHpRatio = {}; + _int m_iBreathRand = {}; class CEffect_Container* m_pRanrok_Point = { nullptr }; - _float m_fTuckedSpeed = { 75.f }; + _float m_fTuckedSpeed = { 50.f }; void Behavior_IdleEnter(); HRESULT Behavior_IdleExitCheck(); void Behavior_IdleExit(); void Behavior_IdleBreakEnter(); - HRESULT Behavior_IdleBreakExitCheck(); + HRESULT Behavior_IdleBreakExitCheck(_float fTimeDelta); void Behavior_IdleBreakExit(); void Behavior_MoveEnter(); @@ -188,6 +193,10 @@ class CRanrok final : public CMonster void Behavior_DeadEnter(); HRESULT Behavior_DeadExitCheck(_float fTimeDelta); void Behavior_DeadExit(); + + + virtual _bool IsHitStateDisabled() override; + virtual _bool IsHitSpellDisabled() override; }; NS_END diff --git a/Jusin154_Team3D/Client/Public/Ranrok_Breath.h b/Jusin154_Team3D/Client/Public/Ranrok_Breath.h index 0f36e0daa..f8d7ba358 100644 --- a/Jusin154_Team3D/Client/Public/Ranrok_Breath.h +++ b/Jusin154_Team3D/Client/Public/Ranrok_Breath.h @@ -30,6 +30,7 @@ class CRanrok_Breath final : public CEffect_Container HRESULT Ready_Child(); HRESULT Bind_ShaderResources() override; virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; + void Set_BreathTime(_float fTime); private: _wstring m_wstrEffectName = {}; diff --git a/Jusin154_Team3D/Client/Public/Ranrok_Charge.h b/Jusin154_Team3D/Client/Public/Ranrok_Charge.h new file mode 100644 index 000000000..a9819ec3a --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Ranrok_Charge.h @@ -0,0 +1,56 @@ +#pragma once + +#include "Client_Define.h" +#include "Effect_Container.h" + +NS_BEGIN(Engine) +NS_END + +NS_BEGIN(Client) + +class CRanrok_Charge final : public CEffect_Container +{ +private: + CRanrok_Charge(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CRanrok_Charge(const CRanrok_Charge& rhs); + virtual ~CRanrok_Charge() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + +public: + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + HRESULT Ready_Child(); + HRESULT Bind_ShaderResources() override; + virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; +private: + _wstring m_wstrEffectName = {}; + + _bool m_isParticleEnd = {}; + + _float3 m_vLook = {}; + _float m_fLinearSpeed = 0.8f; + + _float4 m_vStartPos = { 0.f, 0.f, 0.f, 1.f }; + _float4 m_vTargetPos = { 0.f, 0.f, 10.f, 1.f }; +private: + class CInfoInstance* m_pInfoInstance = { nullptr }; +public: + static CRanrok_Charge* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual void Free() override; + CGameObject* Clone(void* pArg, CGameObject* pOwner) override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // DEBUG + + +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Ranrok_Pulse.h b/Jusin154_Team3D/Client/Public/Ranrok_Pulse.h new file mode 100644 index 000000000..26d8cd7cb --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Ranrok_Pulse.h @@ -0,0 +1,55 @@ +#pragma once + +#include "Client_Define.h" +#include "Effect_Container.h" + +NS_BEGIN(Engine) +NS_END + +NS_BEGIN(Client) + +class CRanrok_Pulse final : public CEffect_Container +{ +private: + CRanrok_Pulse(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CRanrok_Pulse(const CRanrok_Pulse& rhs); + virtual ~CRanrok_Pulse() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + +public: + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + HRESULT Ready_Child(); + HRESULT Bind_ShaderResources() override; + virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; +private: + _wstring m_wstrEffectName = {}; + + + _float3 m_vLook = {}; + _float m_fLinearSpeed = 0.8f; + + _float4 m_vStartPos = { 0.f, 0.f, 0.f, 1.f }; + _float4 m_vTargetPos = { 0.f, 0.f, 10.f, 1.f }; +private: + class CInfoInstance* m_pInfoInstance = { nullptr }; +public: + static CRanrok_Pulse* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual void Free() override; + CGameObject* Clone(void* pArg, CGameObject* pOwner) override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // DEBUG + + +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Troll.h b/Jusin154_Team3D/Client/Public/Troll.h index 0737e7eaf..46643f796 100644 --- a/Jusin154_Team3D/Client/Public/Troll.h +++ b/Jusin154_Team3D/Client/Public/Troll.h @@ -146,6 +146,8 @@ class CTroll final : public CMonster void Behavior_DeadEnter(); HRESULT Behavior_DeadExitCheck(_float fTimeDelta); void Behavior_DeadExit(); + + virtual _bool IsHitSpellDisabled() override; }; NS_END diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/AnimList/Ranrok.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/AnimList/Ranrok.xml index 9a404d77a..c91b8a316 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/AnimList/Ranrok.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/AnimList/Ranrok.xml @@ -4,8 +4,14 @@ - - + + + + + + + + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/MonsterPackage/Ranrok/RanrokCharge.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/MonsterPackage/Ranrok/RanrokCharge.bin new file mode 100644 index 000000000..0c685f3e1 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/MonsterPackage/Ranrok/RanrokCharge.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a4bc0a7714fe317754ad8ace468aca16c9e6b00370e76807f9f828ea9d2604c4 +size 148 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/MonsterPackage/Ranrok/RanrokPulse.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/MonsterPackage/Ranrok/RanrokPulse.bin new file mode 100644 index 000000000..093baf4be --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/MonsterPackage/Ranrok/RanrokPulse.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dbbe101306b0fe56ac803a185ae9e02ef1dbd1b74deee409a19854f1e7df99e0 +size 433 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokBomb/Red_Sphere.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokBomb/Red_Sphere.bin deleted file mode 100644 index 8153aa37e..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokBomb/Red_Sphere.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:338ec5d6973d6da7ae14027df395db65662a94b1c9953347cac4d5610d3bea64 -size 1069 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokBreath/SplatterBottom0.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokBreath/SplatterBottom0.bin index 46228fd43..037746e8b 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokBreath/SplatterBottom0.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokBreath/SplatterBottom0.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6c88d141245be0050de3b55f35a9fb0755bc13ecdca5bb22a0b5897c3081dc25 -size 1088 +oid sha256:643b56853acbe124797de1bd00b1dcf5012b93c879ac1428ff73a90cab70ca27 +size 1112 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokCharge/Charge_Goo.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokCharge/Charge_Goo.bin new file mode 100644 index 000000000..c3ab01833 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokCharge/Charge_Goo.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:44b8371f75635b1c753d2d0415d2f405c3aae72e50c061737cdc63cc797ba6ef +size 1132 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokCharge/CombinedPT.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokCharge/CombinedPT.bin new file mode 100644 index 000000000..75e82885c --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokCharge/CombinedPT.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c467b3966259a67c77e9773edf6c4f315a528da3219493e2a4d89b1447d5b04 +size 1198 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokPulse/BottomSplatter.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokPulse/BottomSplatter.bin new file mode 100644 index 000000000..62ebda91e --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokPulse/BottomSplatter.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3fc5ad1633c5a3b1939a6c870c91cfc960e0061e8346983d7752d768917cb829 +size 1107 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokPulse/BottomSplatter2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokPulse/BottomSplatter2.bin new file mode 100644 index 000000000..65416b20d --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokPulse/BottomSplatter2.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:46bae518a8d68340c1dbf2530ac3a10ca15078c7e519f6f1f7760a13af72402d +size 1109 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokPulse/Bottom_Decal.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokPulse/Bottom_Decal.bin new file mode 100644 index 000000000..545d2c203 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokPulse/Bottom_Decal.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f09943e1017552ee233fec131084c507eae42e076fcdda9dfb0ffd3e8c72675 +size 1124 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokPulse/Red_Sphere.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokPulse/Red_Sphere.bin new file mode 100644 index 000000000..94250877d --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokPulse/Red_Sphere.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:66cd66ad94519153b8cc82356b2a859baff1481f73ae2a6edf9cba62aa05a23d +size 1146 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokPulse/Rock_PT.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokPulse/Rock_PT.bin new file mode 100644 index 000000000..69f0488d6 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokPulse/Rock_PT.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1d805f9415164c23fe9de98efe866a6903230aa2634b241b2e04d94c6dfe7579 +size 1098 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokPulse/Smoke.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokPulse/Smoke.bin new file mode 100644 index 000000000..7d09ca8f5 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Ranrok/RanrokPulse/Smoke.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a27a4eac6b7e4b3245748c71235af792cf4f7151c5b2019abd4abbd2a1c4eae7 +size 1095 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Hogsmeade_MapContainer_Data.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Hogsmeade_MapContainer_Data.xml index 86ccaa0b7..d35dcebef 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Hogsmeade_MapContainer_Data.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Hogsmeade_MapContainer_Data.xml @@ -6,7 +6,7 @@ - + Prototype_GameObject_SM_HM_Ollivanders_Railing_Post_A Prototype_GameObject_SM_HM_Ollivanders_Railing_Post_A_Lod1 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/RaceRing/RaceRing_Data.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/RaceRing/RaceRing_Data.xml new file mode 100644 index 000000000..13979eb07 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/RaceRing/RaceRing_Data.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/RanrokPos/RanrokPos.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/RanrokPos/RanrokPos.xml index 13af489ce..f906f74c0 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/RanrokPos/RanrokPos.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/RanrokPos/RanrokPos.xml @@ -1,115 +1,156 @@ - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + + + + + + + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + - diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Potions/Meshes/Temp.txt b/Jusin154_Team3D/Editor/Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Potions/Meshes/Temp.txt new file mode 100644 index 000000000..e69de29bb diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/SK_GOB_M_Assassin_Master_Tumble.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/SK_GOB_M_Assassin_Master_Tumble.bin new file mode 100644 index 000000000..4b95638f7 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/SK_GOB_M_Assassin_Master_Tumble.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b4c3c4d445c454b1e335c79c165f9a88cca87a2c8d24f0683db75f919a16a6ac +size 4418133 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/SK_GOB_M_Assassin_Master_Tumble.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/SK_GOB_M_Assassin_Master_Tumble.fbx new file mode 100644 index 000000000..9736db4d0 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin_Assassin/SK_GOB_M_Assassin_Master_Tumble.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:267467c09021c0a29061e8ecea291dd8fb26f7e186b3a49dd143f55fda8bef6b +size 3482236 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index 2b88a9ed5..34f87bd19 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -88,6 +88,7 @@ float g_fMBSampleBias; vector g_vLightDiffuse; vector g_vLightAmbient; vector g_vLightSpecular; +float g_fLightSpecularMaximum; float g_fFogDensity; float g_fFogPow; @@ -483,7 +484,7 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) float3 vAmbient = g_vLightAmbient.rgb * fTotalOcclusion * fAttenuation; float3 vFinalDiffuse = PBR_Out.vShade + vAmbient; - float3 vFinalSpecular = PBR_Out.vSpecular * g_vLightSpecular.rgb; + float3 vFinalSpecular = clamp(PBR_Out.vSpecular, 0.f, g_fLightSpecularMaximum) * g_vLightSpecular.rgb; Out.vShade = float4(vFinalDiffuse, 1.f); Out.vSpecular = float4(vFinalSpecular, 0.f); @@ -569,7 +570,7 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In) float3 vAmbient = g_vLightAmbient.rgb * fTotalOcclusion * fAttenuation; float3 vFinalDiffuse = PBR_Out.vShade + vAmbient; - float3 vFinalSpecular = PBR_Out.vSpecular * g_vLightSpecular.rgb; + float3 vFinalSpecular = clamp(PBR_Out.vSpecular, 0.f, g_fLightSpecularMaximum) * g_vLightSpecular.rgb; Out.vShade = float4(vFinalDiffuse, 1.f); Out.vSpecular = float4(vFinalSpecular, 0.f); @@ -670,7 +671,7 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In) float3 vAmbient = g_vLightAmbient.rgb * fTotalOcclusion * fAttenuation; float3 vFinalDiffuse = PBR_Out.vShade + vAmbient; - float3 vFinalSpecular = PBR_Out.vSpecular * g_vLightSpecular.rgb; + float3 vFinalSpecular = clamp(PBR_Out.vSpecular, 0.f, g_fLightSpecularMaximum) * g_vLightSpecular.rgb; Out.vShade = float4(vFinalDiffuse, 1.f); Out.vSpecular = float4(vFinalSpecular, 0.f); 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 6e54e5656..3cf999034 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl @@ -54,7 +54,7 @@ void CS_MAIN(uint3 DTid : SV_DispatchThreadID) int p = g_ParentBuffer[global]; while (p != -1) { - combined = mul(combined,g_LocalMatIn[p]); + combined = mul(combined, g_LocalMatIn[p]); p = g_ParentBuffer[p]; } 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 067eb1772..27f9a031b 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 @@ -541,7 +541,7 @@ PS_OUT_OUTLINE PS_MAIN_OUTLINE_READ(PS_IN In) float fRim = saturate((1.0f - fNdotV) * g_fOutLineScale); fRim = pow(fRim, g_fOutLinePower); - Out.vAlbedo = float4(g_vOutLineColor.rgb, fRim); + Out.vAlbedo = float4(g_vOutLineColor.rgb * 5.f, fRim); Out.vNormal = float4(vNormal * 0.5f + 0.5f, 0.f); Out.vDepth = float4((In.vProjPos.z / In.vProjPos.w), (In.vProjPos.w / g_fFar), diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl index 3762ddc67..d9811a801 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl @@ -59,6 +59,11 @@ struct ParticleValue float3 vWolrdOffset; float fLoopCount; /* 현재 몇번째 루프중인지 */ + float fRoundRangeLength; + float fAzimuthAngle; + float fPolarAngle; + float fRoundLengthLerpSpeed; + row_major matrix PreWorldMatrix; row_major matrix LocalMatrixInv; }; @@ -99,7 +104,7 @@ cbuffer g_ConstantBuffer : register(b0) // b0 << 이 숫자와 컨스턴트 쉐 bool isNoResetTime; bool isLocal_Located_Not_TakeDelay; bool isCompute_LocalInverse; - bool isPadding2; + bool isRoundLengthLerp; float fTimeDelta; float fSizeLerpOption; // 반드시 상수버퍼는 16바이트 배수로 만들어져야 한다. @@ -160,6 +165,7 @@ void CS_MAIN( if (isNoPos) { + particle.vTranslation.xyz += WorldMatrix[3].xyz; /* 월드 오프셋 */ @@ -170,6 +176,21 @@ void CS_MAIN( } } + if (isRoundLengthLerp == true) + { + if (particleValue.vDelay.x < particleValue.vDelay.y) + { + float3 vRoundRange = float3( + particleValue.fRoundRangeLength * cos(particleValue.fAzimuthAngle) * sin(particleValue.fPolarAngle), + particleValue.fRoundRangeLength * sin(particleValue.fAzimuthAngle) * sin(particleValue.fPolarAngle), + particleValue.fRoundRangeLength * cos(particleValue.fPolarAngle)); + + + particleValue.vOriginTranslation.xyz += particleValue.fRoundLengthLerpSpeed * vRoundRange * fTimeDelta; + particle.vTranslation.xyz += particleValue.fRoundLengthLerpSpeed * vRoundRange * fTimeDelta; + + } + } particleValue.vDelay.x += fTimeDelta; if (particleValue.vDelay.x < particleValue.vDelay.y) @@ -271,6 +292,7 @@ void CS_MAIN( return ; } + if (isDrop == true) { diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl index 4878c28f7..0078b8a84 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl @@ -473,7 +473,7 @@ PS_OUT_OUTLINE PS_MAIN_OUTLINE(PS_IN_OUTLINE In) float fRim = saturate((1.0f - fNdotV) * g_fOutLineScale); fRim = pow(fRim, g_fOutLinePower); - Out.vAlbedo = float4(g_vOutLineColor.rgb, fRim); + Out.vAlbedo = float4(g_vOutLineColor.rgb * 5.f, 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 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl index 204be5929..1bb9ad1ec 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl @@ -694,8 +694,8 @@ 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.vAlbedo = float4(g_vOutLineColor.rgb, fRim); + + Out.vAlbedo = float4(g_vOutLineColor.rgb * 5.f, 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 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl index 83b47a7eb..551422ad3 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl @@ -49,6 +49,12 @@ struct ParticleValue float3 vWolrdOffset; float fLoopCount; /* 현재 몇번째 루프중인지 */ + float fRoundRangeLength; + float fAzimuthAngle; + float fPolarAngle; + float fRoundLengthLerpSpeed; + + row_major matrix PreWorldMatrix; row_major matrix LocalMatrixInv; }; @@ -284,6 +290,8 @@ VS_BULR_MESH_OUT VS_MAIN(VS_IN In, uint iGPUIndex : SV_InstanceID) { VS_BULR_MESH_OUT Out = (VS_BULR_MESH_OUT) 0; + + matrix matW, matWV, matWVP; row_major matrix TransformMatrix = float4x4(In.vRight, In.vUp, In.vLook, In.vTranslation); @@ -525,6 +533,10 @@ float4 DrawEffect(PS_IN In) discard; } + if (In.vLifeTime.x > In.vLifeTime.y) + discard; + + if (g_isDiffuse == true) { float2 UV; // 이미지의 UV값 @@ -732,56 +744,63 @@ float4 DrawEffect(PS_IN In) float2 vDissolveUV = In.vTexcoord + SelectLerpUV(g_vDissolveUVGainAmount, (vDissolveUVMoveTime.x / vDissolveUVMoveTime.y), 0); - if (g_isDissolveMove) - vMtrlDissolve = g_DissolveTexture.Sample(DefaultSampler, vDissolveUV); - else - vMtrlDissolve = g_DissolveTexture.Sample(DefaultSampler, In.vTexcoord); - - /* */ - float fDissolveValue = vMtrlDissolve.r; + if (g_fDissolveCutRatio > FLT_EPSILON5) + { + if (g_isDissolveMove) + vMtrlDissolve = g_DissolveTexture.Sample(DefaultSampler, vDissolveUV); + else + vMtrlDissolve = g_DissolveTexture.Sample(DefaultSampler, In.vTexcoord); + + float fDissolveValue = vMtrlDissolve.r; - if (g_isDissolve_G == true) - fDissolveValue = vMtrlDissolve.g; + if (g_isDissolve_G == true) + fDissolveValue = vMtrlDissolve.g; - if (g_isDissolve_B == true) - fDissolveValue = vMtrlDissolve.b; + if (g_isDissolve_B == true) + fDissolveValue = vMtrlDissolve.b; - float fSoftDissolve; + float fSoftDissolve; - if (g_fDissolveSoftMask > FLT_EPSILON5) - fSoftDissolve = saturate((fDissolveValue - g_fDissolveMaskEdge) * g_fDissolveSoftMask); - else - fSoftDissolve = fDissolveValue; + if (g_fDissolveSoftMask > FLT_EPSILON5) + fSoftDissolve = saturate((fDissolveValue - g_fDissolveMaskEdge) * g_fDissolveSoftMask); + else + fSoftDissolve = fDissolveValue; - vMtrlDissolve.r = fSoftDissolve; + vMtrlDissolve.r = fSoftDissolve; - if (g_isReverseDissolve == true) - { - if (vMtrlDissolve.r >= (In.vLifeTime.x / In.vLifeTime.y)) - discard; - } - else - { + if (g_isReverseDissolve == true) + { + if (vMtrlDissolve.r >= (In.vLifeTime.x / In.vLifeTime.y)) + discard; + } + else + { - if (g_fDissolveCutRatio <= fTimeRatio) // 일정 수준 이상 넘어가지 못하도록 막기 - { - fTimeRatio = g_fDissolveCutRatio; + if (g_fDissolveCutRatio <= fTimeRatio) // 일정 수준 이상 넘어가지 못하도록 막기 + { + fTimeRatio = g_fDissolveCutRatio; + + } + + + float fFade = smoothstep(fTimeRatio - 0.1f, fTimeRatio + 0.1f, vMtrlDissolve.r); + + if (g_isNoDissolveSmoothStep == true) + { + fFade = smoothstep(fTimeRatio, fTimeRatio, vMtrlDissolve.r); + } + + vMtrlDiffuse.a *= fFade; } - - - float fFade = smoothstep(fTimeRatio - 0.1f, fTimeRatio + 0.1f, vMtrlDissolve.r); - - if (g_isNoDissolveSmoothStep == true) - { - fFade = smoothstep(fTimeRatio, fTimeRatio, vMtrlDissolve.r); - } - - vMtrlDiffuse.a *= fFade; - } + + + /* */ + + clip(vMtrlDiffuse.a - FLT_EPSILON5); } @@ -920,6 +939,9 @@ float4 SoftEffect(PS_IN In, float4 vMtrlDiffuse) vDiffuse.a = vDiffuse.a * saturate(fDistance); + if(vDiffuse.a < FLT_EPSILON5) + discard; + return vDiffuse; } @@ -1037,21 +1059,22 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) { PS_OUT Out = (PS_OUT)0; + + //int2 iTexel = int2(In.vPosition.xy); + + //float fDepthStencilValue = g_DepthStencilTexture.Load(int3(iTexel, 0)).r; + + //float fbias = 0.000005f; + + //if (fDepthStencilValue <= In.vProjPos.z / In.vProjPos.w + fbias) + // discard; + float4 vMtrlDiffuse; vMtrlDiffuse = DrawEffect(In); vMtrlDiffuse = SoftEffect(In, vMtrlDiffuse); - int2 iTexel = int2(In.vPosition.xy); - - float fDepthStencilValue = g_DepthStencilTexture.Load(int3(iTexel, 0)).r; - - float fbias = 0.000005f; - - if (fDepthStencilValue <= In.vProjPos.z / In.vProjPos.w + fbias) - discard; - vMtrlDiffuse.rgb += EmissiveDraw(In, vMtrlDiffuse).rgb; vMtrlDiffuse += RimLight(In); @@ -1770,7 +1793,7 @@ technique11 DefaultTechnique pass Default_NonPos { SetRasterizerState(RS_Nocull); - SetDepthStencilState(DSS_None, 0); + SetDepthStencilState(DSS_Default, 0); SetBlendState(BS_None, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); VertexShader = compile vs_5_0 VS_MAIN_NO_POS(); GeometryShader = NULL; @@ -1819,6 +1842,16 @@ technique11 DefaultTechnique GeometryShader = NULL; PixelShader = compile ps_5_0 PS_DECAL_BLUR(); } +//28 + pass Blend_Culling + { + SetRasterizerState(RS_Default); + SetDepthStencilState(DSS_Effect, 0); + SetBlendState(BS_Blend, 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_BLEND(); + } } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_Dirt_H.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_Dirt_H.png new file mode 100644 index 000000000..4f40c8ce2 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_Dirt_H.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_Dirt_Med_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_Dirt_Med_D.png new file mode 100644 index 000000000..8f4f8f167 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_Dirt_Med_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_Dirt_Med_H.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_Dirt_Med_H.png new file mode 100644 index 000000000..91a96612f Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_Dirt_Med_H.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_Rock_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_Rock_D.png new file mode 100644 index 000000000..504ec2288 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_Rock_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_Rock_H.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_Rock_H.png new file mode 100644 index 000000000..705fe34ee Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_Rock_H.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_Water_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_Water_D.png new file mode 100644 index 000000000..722efeb96 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_Water_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_Water_Large_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_Water_Large_D.png new file mode 100644 index 000000000..f24ebd6e4 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_Water_Large_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_claw_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_claw_D.png new file mode 100644 index 000000000..8fe86bebe Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_claw_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_claw_H.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_claw_H.png new file mode 100644 index 000000000..09c1a51ba Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_claw_H.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_claw_Soft_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_claw_Soft_D.png new file mode 100644 index 000000000..18968edee Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_FX_Decal_claw_Soft_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_Scorch_Black_Edgy_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_Scorch_Black_Edgy_D.png new file mode 100644 index 000000000..30f50ecba Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/T_Scorch_Black_Edgy_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_AMFireball02Impact01_Decal_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_AMFireball02Impact01_Decal_D.png new file mode 100644 index 000000000..02a79934b Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_AMFireball02Impact01_Decal_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_AMFireball02Impact01_Decal_DSP.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_AMFireball02Impact01_Decal_DSP.png new file mode 100644 index 000000000..4115fa4f2 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_AMFireball02Impact01_Decal_DSP.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_FrolicsomeFelinePlateGCL_01_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_FrolicsomeFelinePlateGCL_01_D.png new file mode 100644 index 000000000..6d0662979 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_FrolicsomeFelinePlateGCL_01_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_FrolicsomeFelinePlateGCSt_01_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_FrolicsomeFelinePlateGCSt_01_D.png new file mode 100644 index 000000000..cce2a075f Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_FrolicsomeFelinePlateGCSt_01_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_FrolicsomeFelinePlateGSK_01_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_FrolicsomeFelinePlateGSK_01_D.png new file mode 100644 index 000000000..667270163 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_FrolicsomeFelinePlateGSK_01_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_FrolicsomeFelinePlateOLC_01_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_FrolicsomeFelinePlateOLC_01_D.png new file mode 100644 index 000000000..6988e4d7c Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_FrolicsomeFelinePlateOLC_01_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_FrolicsomeFelinePlateOLK_01_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_FrolicsomeFelinePlateOLK_01_D.png new file mode 100644 index 000000000..ed946f0db Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_FrolicsomeFelinePlateOLK_01_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_FrolicsomeFelinePlateOSC_01_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_FrolicsomeFelinePlateOSC_01_D.png new file mode 100644 index 000000000..d3cbb7c2b Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_FrolicsomeFelinePlateOSC_01_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_FrolicsomeFelinePlateOStFC_01_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_FrolicsomeFelinePlateOStFC_01_D.png new file mode 100644 index 000000000..3e62bc60b Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_FrolicsomeFelinePlateOStFC_01_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_FrolicsomeFelinePlateYStK_01_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_FrolicsomeFelinePlateYStK_01_D.png new file mode 100644 index 000000000..3a9559c3d Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_FrolicsomeFelinePlateYStK_01_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_Helen_Neck_Slash_01_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_Helen_Neck_Slash_01_D.png new file mode 100644 index 000000000..8c4b0f3f2 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_Helen_Neck_Slash_01_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_LavaDecal_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_LavaDecal_D.png new file mode 100644 index 000000000..6e05dd44e Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_LavaDecal_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_ScorchBlack_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_ScorchBlack_D.png new file mode 100644 index 000000000..868be2b34 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_ScorchBlack_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_Scorch_Black_Expell_Test_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_Scorch_Black_Expell_Test_D.png new file mode 100644 index 000000000..02898ef51 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_Scorch_Black_Expell_Test_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_ShatterdGlass_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_ShatterdGlass_D.png new file mode 100644 index 000000000..bbffb8696 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_ShatterdGlass_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_Splatter_Decals_2_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_Splatter_Decals_2_D.png new file mode 100644 index 000000000..c83e5bc54 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/Decal/VFX_T_Splatter_Decals_2_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/T_FX_Decal_Dirt_Med_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/T_FX_Decal_Dirt_Med_N.png new file mode 100644 index 000000000..336878e7f Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/T_FX_Decal_Dirt_Med_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/T_FX_Decal_Rock_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/T_FX_Decal_Rock_N.png new file mode 100644 index 000000000..89cfe683f Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/T_FX_Decal_Rock_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/T_FX_Decal_Water_Large_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/T_FX_Decal_Water_Large_N.png new file mode 100644 index 000000000..3305945ed Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/T_FX_Decal_Water_Large_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/T_FX_Decal_Water_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/T_FX_Decal_Water_N.png new file mode 100644 index 000000000..4651d20ae Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/T_FX_Decal_Water_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/T_FX_Decal_claw_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/T_FX_Decal_claw_N.png new file mode 100644 index 000000000..a58febfcd Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/T_FX_Decal_claw_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/T_FX_Decal_claw_Soft_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/T_FX_Decal_claw_Soft_N.png new file mode 100644 index 000000000..d5f44bca8 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/T_FX_Decal_claw_Soft_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/VFX_T_AMFireball02Impact01_Decal_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/VFX_T_AMFireball02Impact01_Decal_N.png new file mode 100644 index 000000000..89370e94a Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/VFX_T_AMFireball02Impact01_Decal_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/VFX_T_Blast_Packed_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/VFX_T_Blast_Packed_N.png new file mode 100644 index 000000000..0f3872008 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/VFX_T_Blast_Packed_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/VFX_T_LavaDecal_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/VFX_T_LavaDecal_N.png new file mode 100644 index 000000000..4d65d1c59 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/VFX_T_LavaDecal_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/VFX_T_ShatterdGlass_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/VFX_T_ShatterdGlass_N.png new file mode 100644 index 000000000..ab26bb8c6 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/VFX_T_ShatterdGlass_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/VFX_T_Slythern_Tree_01_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/VFX_T_Slythern_Tree_01_N.png new file mode 100644 index 000000000..6672318a7 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/VFX_T_Slythern_Tree_01_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/VFX_T_Splatter_Decals_2_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/VFX_T_Splatter_Decals_2_N.png new file mode 100644 index 000000000..7c17c323e Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Effect/DecalNormal/VFX_T_Splatter_Decals_2_N.png differ diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index 8cdbd6e10..d51883785 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -211,8 +211,11 @@ call Update_Shaders.bat + + + @@ -479,8 +482,11 @@ call Update_Shaders.bat + + + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index 743514c2f..e9f8aad21 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -670,6 +670,9 @@ {cfd0b003-cc18-48cf-a881-94e137b5dadc} + + {935b6ab0-e01b-4b4b-80d0-649a507d21c8} + {cbb99946-a4d6-4ad8-842c-e67ca5de3f3a} @@ -736,6 +739,12 @@ {1402a2f4-a28b-4f95-b4ec-249a840fa819} + + {189b5f72-c985-4bf8-a33e-4257f6d74d25} + + + {c9d234fd-d9dc-4740-9e9e-32b986335ee7} + @@ -1461,6 +1470,9 @@ 50.UI\GamePlay_Canvas\Broom_Panel\Broom_Record + + 02.GameObjects\Layer_Effect\Effect\Monster_Effect\Ranrok\Pulse + 50.UI\GamePlay_Canvas\Broom_Panel\Broom_Trophy @@ -1491,6 +1503,12 @@ 02.GameObjects\Env\06.InstancedProp\Light + + 02.GameObjects\RaceRing + + + 02.GameObjects\Layer_Effect\Effect\Monster_Effect\Ranrok\Charge + @@ -2224,6 +2242,9 @@ 50.UI\GamePlay_Canvas\Broom_Panel\Broom_Record + + 02.GameObjects\Layer_Effect\Effect\Monster_Effect\Ranrok\Pulse + 50.UI\GamePlay_Canvas\Broom_Panel\Broom_Trophy @@ -2254,6 +2275,12 @@ 02.GameObjects\Env\06.InstancedProp\Light + + 02.GameObjects\RaceRing + + + 02.GameObjects\Layer_Effect\Effect\Monster_Effect\Ranrok\Charge + diff --git a/Jusin154_Team3D/Editor/Private/Camera_Debug.cpp b/Jusin154_Team3D/Editor/Private/Camera_Debug.cpp index a796ec039..b34a27319 100644 --- a/Jusin154_Team3D/Editor/Private/Camera_Debug.cpp +++ b/Jusin154_Team3D/Editor/Private/Camera_Debug.cpp @@ -62,6 +62,14 @@ void CCamera_Debug::Priority_Update(_float fTimeDelta) Set_InitialPos(); } + _long LWheel = m_pGameInstance->Get_DIMouseMove(MOUSEMOVESTATE::W); + if (LWheel > 0) + { + m_pTransformCom->Add_SpeedPerSec(0.5f); + } + else if (LWheel < 0) + m_pTransformCom->Add_SpeedPerSec(-0.5f); + #pragma endregion #pragma region Angle diff --git a/Jusin154_Team3D/Editor/Private/EditEffect.cpp b/Jusin154_Team3D/Editor/Private/EditEffect.cpp index 4e70debfd..2cef4533e 100644 --- a/Jusin154_Team3D/Editor/Private/EditEffect.cpp +++ b/Jusin154_Team3D/Editor/Private/EditEffect.cpp @@ -130,7 +130,7 @@ void CEditEffect::Reference_Mat_For_EditEffect() const char* pCompute[] = { "DIFFUSE" , "MASK", "NOISE", "DISSOLVE" , "DISTORTION" , "EMISSIVE"}; - if (ImGui::Combo("OPTION", &m_iSelectTextureNum, pCompute, 6)) + if (GUI::Combo("OPTION", &m_iSelectTextureNum, pCompute, 6)) { } switch (m_iSelectTextureNum) @@ -329,8 +329,8 @@ HRESULT CEditEffect::Save_Effect(const _char* pPath) if (m_EffectInfo.isNomalMap) { - size_t iComponentLength = m_strNomalMapName.length(); - const _char* pFileComponentPath = m_strNomalMapName.c_str(); + size_t iComponentLength = m_strNormalMapName.length(); + const _char* pFileComponentPath = m_strNormalMapName.c_str(); if (!WriteFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) { return E_FAIL; @@ -457,7 +457,7 @@ void CEditEffect::Describe_Entity() const char* pEffectType[] = { "EFFECT" , "TRAIL" }; const char* pShaderPass[] = { "DEFAULT" , "NON_NOMALMAP" , "BLUR" , "WEIGHTBLEND" , "NON_WORLD" , "NON_WORLD_BLUR", "BLEND", "BLEND_NOWORLD", "BLOOM" ,"BLOOM_NOWORLD" ,"BLUR_NO_EMMISVE", "BLUR_NO_WORLD_NO_EMISSIVE","WEIGHTBLEND_FOR_BLEND" , "DEPTH_STOP" , "WB_CULLING", "SCREEN_FX" , "DISTORTION" ,"NONPOS" , "NONPOS_BLUR" , "BULR_MESH" , "BLUR_CULLING" ,"BLUR_CULLING_NO_EMISSIVE" , - "BLOOM_CULLING" , "DEFAULT_NONPOS" , "NONWB_NONPOS", "DECAL", "DECAL_WB" , "DECAL_BLUR"}; + "BLOOM_CULLING" , "DEFAULT_NONPOS" , "NONWB_NONPOS", "DECAL", "DECAL_WB" , "DECAL_BLUR", "BLEND_CULLING"}; const char* pBloomType[] = { "NONE" , "BASIC" , "MUILTY"}; _int iCurrentItem = static_cast<_int>(m_EffectInfo.eRenderOrder); @@ -481,18 +481,18 @@ void CEditEffect::Describe_Entity() } - if (ImGui::Combo("Render Order", &iCurrentItem, pRenderNames, ENUM_CLASS(RENDER::END))) + if (GUI::Combo("Render Order", &iCurrentItem, pRenderNames, ENUM_CLASS(RENDER::END))) { m_EffectInfo.eRenderOrder = static_cast(iCurrentItem); } - if (ImGui::Combo("Effect Type", &iCurrentType, pEffectType, ENUM_CLASS(EFFECT_TYPE::END))) + if (GUI::Combo("Effect Type", &iCurrentType, pEffectType, ENUM_CLASS(EFFECT_TYPE::END))) { m_EffectInfo.eEffectType = static_cast(iCurrentType); } - if (ImGui::Combo("Shader Pass", &iCurrentPass, pShaderPass, ENUM_CLASS(SHADER_PASS_INSTANCE_MODEL::END))) + if (GUI::Combo("Shader Pass", &iCurrentPass, pShaderPass, ENUM_CLASS(SHADER_PASS_INSTANCE_MODEL::END))) { m_EffectInfo.eShaderPass = static_cast(iCurrentPass); } @@ -522,11 +522,11 @@ void CEditEffect::Describe_Entity() GUI::ColorEdit4("MixColor", (_float*)&m_EffectInfo.vColor); - ImGui::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); m_pShaderCom->Describe_Entity(); - ImGui::PopItemWidth(); + GUI::PopItemWidth(); @@ -539,13 +539,13 @@ void CEditEffect::Describe_Entity() GUI::Checkbox("BlurNoEmissive", &m_EffectInfo.isBlurNoEmissive); GUI::Checkbox("BlurDissolve", &m_EffectInfo.isBlurDissolve); - ImGui::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); GUI::DragFloat("BlurIntensity", &m_EffectInfo.fBlurIntensity, 0.005f, 0.f, 1.f); GUI::DragInt("BlurWeight", &m_EffectInfo.iBlurWeight, 2.f, 0, 128); GUI::Checkbox("BlurColor", &m_EffectInfo.isBlurColor); - ImGui::PopItemWidth(); + GUI::PopItemWidth(); GUI::ColorEdit4("BlurColor", (_float*)&m_EffectInfo.vBlurColor); GUI::TreePop(); @@ -564,7 +564,7 @@ void CEditEffect::Describe_Entity() { if (GUI::TreeNode("BLOOM")) { - if (ImGui::Combo("Bloom Type", &iCurrentBloomType, pBloomType, ENUM_CLASS(BLOOM_TYPE::END))) + if (GUI::Combo("Bloom Type", &iCurrentBloomType, pBloomType, ENUM_CLASS(BLOOM_TYPE::END))) { m_EffectInfo.eBloomType = static_cast(iCurrentBloomType); } @@ -572,9 +572,9 @@ void CEditEffect::Describe_Entity() GUI::Checkbox("BloomDissolve", &m_EffectInfo.isBloomDissolve); GUI::Checkbox("BloomReverseDissolve", &m_EffectInfo.isBloomReverseDissolve); - ImGui::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); GUI::DragFloat("fBloomStrength", &m_EffectInfo.fBloomStrength, 0.001f, 0.f); - ImGui::PopItemWidth(); + GUI::PopItemWidth(); GUI::TreePop(); } @@ -589,7 +589,7 @@ void CEditEffect::Describe_Entity() if (GUI::TreeNode("EMISSIVE")) { - ImGui::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); GUI::DragFloat("EmissiveStrength", &m_EffectInfo.fEmissiveStrength, 0.005f, 0.f, 1.f); GUI::DragFloat("Radius", &m_EffectInfo.fRadius, 0.005f , 0.f); GUI::DragFloat("CoreBoost", &m_EffectInfo.fCoreBoost, 0.005f , 0.f); @@ -597,7 +597,7 @@ void CEditEffect::Describe_Entity() GUI::DragFloat("SoftenExp", &m_EffectInfo.fSoftenExp, 0.005f , 0.f); GUI::DragFloat("EmissiveColorCut", &m_EffectInfo.fEmissiveColorCut, 0.005f , 0.f); - ImGui::PopItemWidth(); + GUI::PopItemWidth(); GUI::ColorEdit4("Emissive", (_float*)&m_EffectInfo.vEmissive); @@ -731,7 +731,7 @@ void CEditEffect::Describe_Entity() GUI::DragFloat("Diffuse Alpha", &m_EffectInfo.fDiffuseAlpha , 0.01f, 0.f, 1.f); - ImGui::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); GUI::Checkbox("DiffuseUVMove", &m_EffectInfo.isDiffuseUVMove); GUI::InputFloat2("DiffuseUVCutting", (_float*)&m_EffectInfo.vUVCutting); @@ -743,14 +743,14 @@ void CEditEffect::Describe_Entity() _int iDiffuseMoveLerpOption = (_int)m_EffectInfo.iDiffuseMoveLerpOption; - if (ImGui::Combo("Lerp DiffuseMove Option", &iDiffuseMoveLerpOption, pLerp, 9)) + if (GUI::Combo("Lerp DiffuseMove Option", &iDiffuseMoveLerpOption, pLerp, 9)) { m_EffectInfo.iDiffuseMoveLerpOption = iDiffuseMoveLerpOption; } GUI::Spacing(); - ImGui::PopItemWidth(); + GUI::PopItemWidth(); if (GUI::TreeNode("DIFFUSE_TEX")) { @@ -763,6 +763,17 @@ void CEditEffect::Describe_Entity() GUI::Spacing(); GUI::Spacing(); } + if (GUI::TreeNode("DECAL TEX")) + { + _string strName = m_pGameInstance->Asset_Description(ENUM_CLASS(LEVEL::EFFECT), "NORMAL_TEXTURE", (CComponent**)&m_pDiffuse_TextureCom, nullptr, this, L"DECAL"); + + if (strName != "") { + m_strDiffuseName = strName; + } + + GUI::TreePop(); + } + _string strName = m_pGameInstance->Asset_Description(ENUM_CLASS(LEVEL::EFFECT), "DIFFUSE_TEXTURE", (CComponent**)&m_pDiffuse_TextureCom, nullptr, this); @@ -794,14 +805,14 @@ void CEditEffect::Describe_Entity() GUI::Checkbox("MaskUVMove", &m_EffectInfo.isMaskUVMove); GUI::Checkbox("MaskClampSample", &m_EffectInfo.isMaskClampSample); - ImGui::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); GUI::DragFloat2("MaskOffset", (_float*)&m_EffectInfo.vMaskOffset, 0.01f); GUI::DragFloat2("MaskingUVGainAmount", (_float*)&m_EffectInfo.vMaskingUVGainAmount, 0.01f); GUI::Spacing(); GUI::DragFloat("SoftMask", &m_EffectInfo.fSoftMask, 0.01f, 0.f); GUI::DragFloat("fSoftMaskEdge", &m_EffectInfo.fSoftMaskEdge, 0.01f, 0.f); - ImGui::PopItemWidth(); + GUI::PopItemWidth(); GUI::Spacing(); @@ -809,7 +820,7 @@ void CEditEffect::Describe_Entity() _int iMaskMoveLerpOption = (_int)m_EffectInfo.iMaskMoveLerpOption; - if (ImGui::Combo("Lerp MaskMove Option", &iMaskMoveLerpOption, pLerp, 9)) + if (GUI::Combo("Lerp MaskMove Option", &iMaskMoveLerpOption, pLerp, 9)) { m_EffectInfo.iMaskMoveLerpOption = iMaskMoveLerpOption; } @@ -828,6 +839,18 @@ void CEditEffect::Describe_Entity() GUI::Spacing(); GUI::Spacing(); } + if (GUI::TreeNode("DECAL TEX")) + { + _string strName = m_pGameInstance->Asset_Description(ENUM_CLASS(LEVEL::EFFECT), "NORMAL_TEXTURE", (CComponent**)&m_pMasking_TextureCom, nullptr, this, L"DECAL"); + + if (strName != "") { + m_strMaskingName = strName; + } + + GUI::TreePop(); + } + + string strName = m_pGameInstance->Asset_Description(ENUM_CLASS(LEVEL::EFFECT), "MASKING_TEXTURE", (CComponent**)&m_pMasking_TextureCom, nullptr, this); if (strName != "") { @@ -856,7 +879,7 @@ void CEditEffect::Describe_Entity() GUI::Checkbox("StopDissolveSmoothStep", &m_EffectInfo.isNoDissolveSmoothStep); - ImGui::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); GUI::Spacing(); GUI::Checkbox("DissolveMove", &m_EffectInfo.isDissolveMove); GUI::DragFloat2("DissolveUVGainAmount", (_float*)&m_EffectInfo.vDissolveUVGainAmount, 0.01f); @@ -873,7 +896,7 @@ void CEditEffect::Describe_Entity() GUI::Spacing(); - ImGui::PopItemWidth(); + GUI::PopItemWidth(); if (GUI::TreeNode("DISSOLV_TEX")) { @@ -904,7 +927,7 @@ void CEditEffect::Describe_Entity() { if (GUI::TreeNode("DISTORTION")) { - ImGui::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); GUI::DragFloat("DistortionIntensity", &m_EffectInfo.fNoiseDistortionIntensity, 0.005f, 0.f, 1.f); @@ -914,7 +937,7 @@ void CEditEffect::Describe_Entity() _int iDiffuseNoiseMoveLerpOption = (_int)m_EffectInfo.iDiffuseDistortionMoveLerpOption; - if (ImGui::Combo("LerpDiffuseDistortionMove Option", &iDiffuseNoiseMoveLerpOption, pLerp, 9)) + if (GUI::Combo("LerpDiffuseDistortionMove Option", &iDiffuseNoiseMoveLerpOption, pLerp, 9)) { m_EffectInfo.iDiffuseDistortionMoveLerpOption = iDiffuseNoiseMoveLerpOption; } @@ -925,14 +948,14 @@ void CEditEffect::Describe_Entity() _int iMaskNoiseMoveLerpOption = (_int)m_EffectInfo.iMaskDistortionMoveLerpOption; - if (ImGui::Combo("Lerp MaskDistortionMove Option", &iMaskNoiseMoveLerpOption, pLerp, 9)) + if (GUI::Combo("Lerp MaskDistortionMove Option", &iMaskNoiseMoveLerpOption, pLerp, 9)) { m_EffectInfo.iMaskDistortionMoveLerpOption = iMaskNoiseMoveLerpOption; } GUI::Spacing(); - ImGui::PopItemWidth(); + GUI::PopItemWidth(); if (GUI::TreeNode("DISTORTION_TEX")) { @@ -977,11 +1000,11 @@ void CEditEffect::Describe_Entity() GUI::ColorEdit4("NoiseColor", (_float*)&m_EffectInfo.vNoiseColor); - ImGui::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); GUI::DragFloat2("NoiseUVGainAmount", (_float*)&m_EffectInfo.vNoiseUVGainAmount, 0.01f); GUI::DragFloat2("UVNoiseCutting", (_float*)&m_EffectInfo.vUVNoiseCutting, 0.01f); - ImGui::PopItemWidth(); + GUI::PopItemWidth(); GUI::Spacing(); @@ -989,7 +1012,7 @@ void CEditEffect::Describe_Entity() _int iNoiseMoveLerpOption = (_int)m_EffectInfo.iNoiseMoveLerpOption; - if (ImGui::Combo("Lerp NoiseMove Option", &iNoiseMoveLerpOption, pLerp, 9)) + if (GUI::Combo("Lerp NoiseMove Option", &iNoiseMoveLerpOption, pLerp, 9)) { m_EffectInfo.iNoiseMoveLerpOption = iNoiseMoveLerpOption; } @@ -1005,12 +1028,25 @@ void CEditEffect::Describe_Entity() GUI::Spacing(); GUI::Spacing(); } + if (GUI::TreeNode("DECAL TEX")) + { + _string strName = m_pGameInstance->Asset_Description(ENUM_CLASS(LEVEL::EFFECT), "NORMAL_TEXTURE", (CComponent**)&m_pNoise_TextureCom, nullptr, this, L"DECAL"); + + if (strName != "") { + m_strNoiseName = strName; + } + + GUI::TreePop(); + } + _string strName = m_pGameInstance->Asset_Description(ENUM_CLASS(LEVEL::EFFECT), "NOISE_TEXTURE", (CComponent**)&m_pNoise_TextureCom, nullptr, this); if (strName != "") { m_strNoiseName = strName; } + + GUI::TreePop(); } @@ -1020,7 +1056,7 @@ void CEditEffect::Describe_Entity() if (m_EffectInfo.isNomalMap == true) { - if (GUI::TreeNode("NOMAL_TEX")) + if (GUI::TreeNode("NORMAL_TEX")) { if (m_pNormal_TextureCom != nullptr) { @@ -1031,12 +1067,32 @@ void CEditEffect::Describe_Entity() GUI::Spacing(); GUI::Spacing(); } - _string strName = m_pGameInstance->Asset_Description(ENUM_CLASS(LEVEL::EFFECT), "NOMAL_TEXTURE", (CComponent**)&m_pNormal_TextureCom, nullptr, this , L"NOMAL"); + if (GUI::TreeNode("NORMAL")) + { + _string strName = m_pGameInstance->Asset_Description(ENUM_CLASS(LEVEL::EFFECT), "NORMAL_TEXTURE", (CComponent**)&m_pNormal_TextureCom, nullptr, this, L"NORMAL"); - if (strName != "") { - m_strNomalMapName = strName; + if (strName != "") { + m_strNormalMapName = strName; + } + + GUI::TreePop(); } + if (GUI::TreeNode("DECAL NORMAL")) + { + _string strName = m_pGameInstance->Asset_Description(ENUM_CLASS(LEVEL::EFFECT), "NORMAL_TEXTURE", (CComponent**)&m_pNormal_TextureCom, nullptr, this, L"DECALNORMAL"); + + if (strName != "") { + m_strNormalMapName = strName; + } + + GUI::TreePop(); + } + + + + + GUI::TreePop(); } } diff --git a/Jusin154_Team3D/Editor/Private/EffectObject.cpp b/Jusin154_Team3D/Editor/Private/EffectObject.cpp index 26b7114a7..bc6338a28 100644 --- a/Jusin154_Team3D/Editor/Private/EffectObject.cpp +++ b/Jusin154_Team3D/Editor/Private/EffectObject.cpp @@ -42,8 +42,8 @@ HRESULT CEffectObject::Render() return E_FAIL; } - if (FAILED(m_pGameInstance->Bind_DepthStencil(m_pShaderCom, "g_DepthStencilTexture"))) - return E_FAIL; + //if (FAILED(m_pGameInstance->Bind_DepthStencil(m_pShaderCom, "g_DepthStencilTexture"))) + // return E_FAIL; if (FAILED(m_pInstance_ModelCom->Bind_CS_Output(5, 1))) return E_FAIL; @@ -104,7 +104,7 @@ HRESULT CEffectObject::Render_Blur() || m_EffectInfo.eShaderPass == SHADER_PASS_INSTANCE_MODEL::NONWB_NONPOS) BlurPass = SHADER_PASS_INSTANCE_MODEL::NONPOS_BLUR; - if (m_EffectInfo.eShaderPass == SHADER_PASS_INSTANCE_MODEL::WB_CULLING) + if (m_EffectInfo.eShaderPass == SHADER_PASS_INSTANCE_MODEL::WB_CULLING || m_EffectInfo.eShaderPass == SHADER_PASS_INSTANCE_MODEL::BLEND_CULLING) { if (m_EffectInfo.isBlurNoEmissive == false) { @@ -477,9 +477,9 @@ HRESULT CEffectObject::Load(const _char* pFilePath , LEVEL eLevel) return E_FAIL; } - m_strNomalMapName = szName; + m_strNormalMapName = szName; - if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strNomalMapName), + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strNormalMapName), reinterpret_cast(&m_pNormal_TextureCom)))) return E_FAIL; } @@ -757,9 +757,9 @@ HRESULT CEffectObject::LoadPre(const _char* pFilePath, LEVEL eLevel) return E_FAIL; } - m_strNomalMapName = szName; + m_strNormalMapName = szName; - if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strNomalMapName), + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strNormalMapName), reinterpret_cast(&m_pNormal_TextureCom)))) return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/EffectPool.cpp b/Jusin154_Team3D/Editor/Private/EffectPool.cpp index 353bcba2a..26d560a46 100644 --- a/Jusin154_Team3D/Editor/Private/EffectPool.cpp +++ b/Jusin154_Team3D/Editor/Private/EffectPool.cpp @@ -24,6 +24,9 @@ #include "Ranrok_FireBall.h" #include "Ranrok_Breath.h" #include "Ranrok_Point.h" +#include "Ranrok_Pulse.h" +#include "Ranrok_Charge.h" + CEffectPool::CEffectPool(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CGameObject(pDevice, pContext) @@ -343,6 +346,26 @@ HRESULT CEffectPool::Ready_MonsterEffect() return pEffect; } ))) return E_FAIL; + if (FAILED(Create_Effect(SKILL_TYPE::RANROK_PURSE, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + + CRanrok_Pulse* pEffect = nullptr; + + pEffect = m_pGameInstance->Clone_Prototype(iPrototypeLevel, nullptr); + + return pEffect; } + ))) return E_FAIL; + + + if (FAILED(Create_Effect(SKILL_TYPE::RANROK_CHARGE, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + + CRanrok_Charge* pEffect = nullptr; + + pEffect = m_pGameInstance->Clone_Prototype(iPrototypeLevel, nullptr); + + return pEffect; } + ))) return E_FAIL; + + return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp b/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp index 6ab24f334..38e34822b 100644 --- a/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp +++ b/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp @@ -58,7 +58,7 @@ HRESULT CEffect_Editor::Initialize(void* pArg) return E_FAIL; - m_pEffectPool = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_EffectPool"))->Get_Object(); + m_pEffectPool = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Z_Layer_EffectPool"))->Get_Object(); SAFE_ADDREF(m_pEffectPool); return S_OK; @@ -551,7 +551,7 @@ void CEffect_Editor::Free() void CEffect_Editor::Describe_Entity() { - ImGui::Begin("Effect Editor"); + GUI::Begin("Effect Editor"); GUI::TextColored(ImVec4(1.f, 0.f, 1.f, 1.f), m_strCurrentEffectName.c_str()); @@ -566,27 +566,27 @@ void CEffect_Editor::Describe_Entity() GUI::Checkbox("TRAIL WAND POS", &m_isWandPos); } - ImGui::End(); + GUI::End(); - ImGui::Begin("Reference Material"); + GUI::Begin("Reference Material"); if (m_pEditEffect != nullptr) m_pEditEffect->Reference_Mat_For_EditEffect(); - ImGui::End(); + GUI::End(); - ImGui::Begin("Effect Hierarchy"); + GUI::Begin("Effect Hierarchy"); #pragma region PopUp - if (ImGui::IsItemClicked(ImGuiMouseButton_Right)) - ImGui::OpenPopup("Effect Hierarchy"); + if (GUI::IsItemClicked(ImGuiMouseButton_Right)) + GUI::OpenPopup("Effect Hierarchy"); - if (ImGui::BeginPopup("Effect Hierarchy")) + if (GUI::BeginPopup("Effect Hierarchy")) { - if (ImGui::MenuItem("Create Effect")) + if (GUI::MenuItem("Create Effect")) { CPartObject::PARTOBJECT_DESC PartsDesc{}; @@ -595,12 +595,12 @@ void CEffect_Editor::Describe_Entity() if (FAILED(Add_PartObject("EffectObject" + to_string(m_iNumPart++), ENUM_CLASS(LEVEL::EFFECT), nullptr, &PartsDesc))) { - ImGui::EndPopup(); + GUI::EndPopup(); return; } } - if (ImGui::MenuItem("Create Trail")) + if (GUI::MenuItem("Create Trail")) { if (m_pTrailObject == nullptr) @@ -612,7 +612,7 @@ void CEffect_Editor::Describe_Entity() if (FAILED(Add_PartObject("TrailObject", ENUM_CLASS(LEVEL::EFFECT), &m_pTrailObject, &PartsDesc))) { - ImGui::EndPopup(); + GUI::EndPopup(); } CTrailObject* pTrailObject = m_pTrailObject; @@ -622,7 +622,13 @@ void CEffect_Editor::Describe_Entity() } } + if (GUI::Button("Reset Hierarchy")) + { + Reset_EditEffect(); + } + ImGui::EndPopup(); + } #pragma endregion @@ -650,7 +656,7 @@ void CEffect_Editor::Describe_Entity() if (GUI::BeginPopup(strName.c_str())) { - if (ImGui::MenuItem("Delete Effect")) + if (GUI::MenuItem("Delete Effect")) { auto iter = m_PartObjects.begin(); advance(iter, iIndex); // 이터레이터를 증가시킨다 @@ -708,9 +714,9 @@ void CEffect_Editor::Describe_Entity() - ImGui::End(); + GUI::End(); - ImGui::Begin("Effect Save"); + GUI::Begin("Effect Save"); GUI::InputTextMultiline("FILE PATH", m_szBuffer, sizeof(m_szBuffer), ImVec2(250, 25)); @@ -803,7 +809,8 @@ void CEffect_Editor::Describe_Entity() m_pEffectPool->Describe_Entity(); - ImGui::End(); + GUI::End(); + } diff --git a/Jusin154_Team3D/Editor/Private/InstancedProp.cpp b/Jusin154_Team3D/Editor/Private/InstancedProp.cpp index 9bc25c074..df2bb1763 100644 --- a/Jusin154_Team3D/Editor/Private/InstancedProp.cpp +++ b/Jusin154_Team3D/Editor/Private/InstancedProp.cpp @@ -333,10 +333,10 @@ void CInstancedProp::Describe_Entity() #endif // _DEBUG _float3 vMove = {}; - ImGui::Text("----- Transfrom ----"); - ImGui::InputFloat("Right", &vMove.x, 0.05f, 0.1f); - ImGui::InputFloat("Up", &vMove.y, 0.05f, 0.1f); - ImGui::InputFloat("Look", &vMove.z, 0.05f, 0.1f); + GUI::Text("----- Transfrom ----"); + GUI::InputFloat("Right", &vMove.x, 0.05f, 0.1f); + GUI::InputFloat("Up", &vMove.y, 0.05f, 0.1f); + GUI::InputFloat("Look", &vMove.z, 0.05f, 0.1f); m_pTransformCom->Move_Right(vMove.x); m_pTransformCom->Move_Up(vMove.y); diff --git a/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp index b5df7e337..42c20ca28 100644 --- a/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp @@ -66,19 +66,18 @@ HRESULT CLevel_EffectViewer::Initialize() // return E_FAIL; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_EffectPool")))) //플레이어보다 먼저 생성해야함! + /* 논 블랜드 중에서도 최 하단으로 들어가야함 */ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Z_Layer_EffectPool")))) //플레이어보다 먼저 생성해야함! { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::EFFECT), NEXT_LEVEL, TEXT("Layer_Editor")))){ + + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::EFFECT), NEXT_LEVEL, TEXT("Z_Layer_Editor")))){ return E_FAIL; } - //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::EFFECT), NEXT_LEVEL, LAYER_CUBE))){ - // return E_FAIL; - //} - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_PLAYER))){ return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp index af7fb8fda..33d66d872 100644 --- a/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp @@ -64,21 +64,21 @@ HRESULT CLevel_MapViewer::Initialize() return E_FAIL; } - //if (FAILED(Ready_Layer_Land(TEXT("Layer_Land")))) { - // return E_FAIL; - //} - - if (FAILED(Ready_Layer_InstanceProp(TEXT("Layer_InstanceProp")))) { + if (FAILED(Ready_Layer_Land(TEXT("Layer_Land")))) { return E_FAIL; } + /*if (FAILED(Ready_Layer_InstanceProp(TEXT("Layer_InstanceProp")))) { + return E_FAIL; + }*/ + //if (FAILED(Ready_Layer_BuildingContainer(TEXT("Layer_Building")))) { // return E_FAIL; //} - //if (FAILED(Ready_Layer_Unified(TEXT("Layer_Unified")))) { - // return E_FAIL; - //} + if (FAILED(Ready_Layer_Unified(TEXT("Layer_Unified")))) { + return E_FAIL; + } /*if (FAILED(Ready_Layer_Door(TEXT("Layer_Door")))) { return E_FAIL; @@ -427,27 +427,27 @@ HRESULT CLevel_MapViewer::Ready_Layer_InstanceProp(const _wstring& strLayerTag) CInstancedProp_Light::INSTANCE_PROP_LIGHT_DESC LightDesc = {}; - /* LightPost */ - LightDesc.bEditMode = false; - LightDesc.isShake = false; - LightDesc.iGlassMeshIndex = 0; - LightDesc.vRadius = _float2(0.f, 0.f); - LightDesc.vSpeed = _float2(0.f, 0.f); - LightDesc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_LightPost"; - LightDesc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Light_Post_Floating.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &LightDesc))) - return E_FAIL; + ///* LightPost */ + //LightDesc.bEditMode = false; + //LightDesc.isShake = false; + //LightDesc.iGlassMeshIndex = 0; + //LightDesc.vRadius = _float2(0.f, 0.f); + //LightDesc.vSpeed = _float2(0.f, 0.f); + //LightDesc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_LightPost"; + //LightDesc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Light_Post_Floating.bin"; + //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &LightDesc))) + // return E_FAIL; - /* LightPost_Floating */ - LightDesc.bEditMode = false; - LightDesc.isShake = false; - LightDesc.iGlassMeshIndex = 1; - LightDesc.vRadius = _float2(0.f, 0.f); - LightDesc.vSpeed = _float2(0.f, 0.f); - LightDesc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_Light_Post_Floating"; - LightDesc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/LightPost.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &LightDesc))) - return E_FAIL; + ///* LightPost_Floating */ + //LightDesc.bEditMode = false; + //LightDesc.isShake = false; + //LightDesc.iGlassMeshIndex = 1; + //LightDesc.vRadius = _float2(0.f, 0.f); + //LightDesc.vSpeed = _float2(0.f, 0.f); + //LightDesc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_Light_Post_Floating"; + //LightDesc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/LightPost.bin"; + //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, &LightDesc))) + // return E_FAIL; return S_OK; } @@ -569,8 +569,8 @@ HRESULT CLevel_MapViewer::Ready_Layer_Player_And_Ranrok() } - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Monster")))) - return E_FAIL; + /*if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Monster")))) + return E_FAIL;*/ return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp index d84838442..cf04a01cb 100644 --- a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp @@ -451,25 +451,25 @@ void CLevel_ObjectViewer::Dummy_Object_Setting() _bool isSelected = (m_SelectedKey == keyName); - if (ImGui::Selectable(keyName.c_str(), isSelected)) + if (GUI::Selectable(keyName.c_str(), isSelected)) { m_SelectedKey = keyName; } if (isSelected) { - ImGui::Indent(); + GUI::Indent(); - ImGui::DragFloat("KeyFrame", &iter.second, 0.01f); + GUI::DragFloat("KeyFrame", &iter.second, 0.01f); - if (ImGui::Button("Delete KeyFrame")) + if (GUI::Button("Delete KeyFrame")) { m_KeyFrames.erase(keyName); m_SelectedKey.clear(); break; } - ImGui::Unindent(); + GUI::Unindent(); } } @@ -563,8 +563,8 @@ void CLevel_ObjectViewer::Parts_Object_Setting() } for (auto& iter : m_KeyFrames) { - ImDrawList* draw = ImGui::GetForegroundDrawList(); - ImVec2 center = ImGui::GetMainViewport()->GetCenter(); + ImDrawList* draw = GUI::GetForegroundDrawList(); + ImVec2 center = GUI::GetMainViewport()->GetCenter(); float scale = 50.f; GUI::DragFloat(iter.first.c_str(), &iter.second); @@ -759,13 +759,14 @@ HRESULT CLevel_ObjectViewer::Ready_Layer_UI(const _wstring& strLayerTag) HRESULT CLevel_ObjectViewer::Ready_Layer_Dummy(const _wstring& strLayerTag) { - //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_EffectPool")))) //플레이어보다 먼저 생성해야함! - //{ - // return E_FAIL; - //} - //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, nullptr, nullptr, &m_Test))) - // return E_FAIL; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_EffectPool")))) //플레이어보다 먼저 생성해야함! + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, nullptr, nullptr, &m_Test))) + return E_FAIL; if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE))) return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 38a5aa8c7..bda56e76a 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -176,6 +176,8 @@ #include "MapElement_Chest.h" #include "MapElement_Chest_Lid.h" #include "LightSpawner.h" +#include "RaceRing.h" + #pragma endregion @@ -215,6 +217,8 @@ #include "Ranrok_FireBall.h" #include "Ranrok_Breath.h" #include "Ranrok_Point.h" +#include "Ranrok_Pulse.h" +#include "Ranrok_Charge.h" #pragma endregion #pragma region PHYSX_HEADER @@ -1459,7 +1463,38 @@ HRESULT CLoader::Loading_For_Effect() if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::EFFECT), wstrFileName, - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0 , L"NOMAL")))) { + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0 , L"NORMAL")))) { + return E_FAIL; + } + + return S_OK; + + }); + + + Asset_FileLoad("../Bin/Resources/Textures/Effect/Decal", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) { + + _string strFilePath = pFilePath; + _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); + + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::EFFECT), wstrFileName, + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0, L"DECAL")))) { + return E_FAIL; + } + + return S_OK; + + }); + + Asset_FileLoad("../Bin/Resources/Textures/Effect/DecalNormal", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) { + + _string strFilePath = pFilePath; + _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); + + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::EFFECT), wstrFileName, + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0, L"DECALNORMAL")))) { return E_FAIL; } @@ -1675,6 +1710,12 @@ HRESULT CLoader::Loading_For_Effect() return E_FAIL; } + /* For.Prototype_Component_Collider */ + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_Collider"), + CCollider::Create(m_pDevice, m_pContext)))) + return E_FAIL; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_VTXPOS, CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxPos.hlsl"), VTXPOS::Elements, VTXPOS::iNumElements)))) { @@ -1910,6 +1951,14 @@ HRESULT CLoader::Loading_For_Effect() return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CRanrok_Pulse::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CRanrok_Charge::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; @@ -2454,10 +2503,10 @@ HRESULT CLoader::Loading_For_MapViewer() 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; + //} 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())))) { @@ -2706,6 +2755,7 @@ HRESULT CLoader::Loading_For_MapViewer() vector<_wstring> ModelPrototypeTags = {}; vector ModelPrototypePath = {}; + #pragma region HOGSMEADE /* Hogsmead LOD */ if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\HogsmeadeLOD\\ProxyAssets", @@ -2895,108 +2945,106 @@ HRESULT CLoader::Loading_For_MapViewer() //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_J\\Collision", // ".fbx", false, ModelPrototypeTags, ModelPrototypePath))) // return E_FAIL; - - #pragma endregion - +_bool bLoadHogsmeade = false; + if (bLoadHogsmeade) + { #pragma region HOGSMEADE_OBJECT + /* Light */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\LightPosts", + ".bin", false, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; -// /* Fences */ -//if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\fences", -// ".fbx", false, ModelPrototypeTags, ModelPrototypePath))) -// return E_FAIL; + /* Doors */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Doors", + ".bin", false, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; -/* Light */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\LightPosts", - ".bin", false, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; + /* Step */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\GroundSurfaces", + ".bin", false, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; -/* Doors */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Doors", - ".bin", false, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\GroundSurfaces", + ".bin", false, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; -/* Step */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\GroundSurfaces", - ".bin", false, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; + /* Box */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\MiscProps", + ".bin", false, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\GroundSurfaces", - ".bin", false, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; + /* TeaShop Table */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Tables", + ".bin", false, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; -/* Box */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\MiscProps", - ".bin", false, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; - -/* TeaShop Table */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Tables", - ".bin", false, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; - -/* TeaShop Chair*/ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Chairs", - ".bin", false, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; + /* TeaShop Chair*/ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Chairs", + ".bin", false, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; -/* Barrel */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Objects\\Meshes", - ".bin", false, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; + /* Barrel */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Objects\\Meshes", + ".bin", false, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; -/* Object Interactables */ -/* Chest */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Objects\\Interactables", - ".bin", false, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; + /* Object Interactables */ + /* Chest */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Objects\\Interactables", + ".bin", false, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; #pragma endregion #pragma region HOGSMEADE_LOD -/* SUB_HogsHead */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_HogsHead\\SUB_HogsHead_EXTLOD\\ProxyAssets", - ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; -/* SUB_PippensPotions */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_PippensPotions\\SUB_Pippens_EXTLOD\\ProxyAssets", - ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; -/* GEN_E_LOD */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_GEN_E\\SUB_GEN_E_EXTLOD\\ProxyAssets", - ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; -/* GEN_F_LOD */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_GEN_F\\SUB_GEN_F_EXTLOD\\ProxyAssets", - ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; -/* GEN_G_LOD */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_GEN_G\\SUB_GEN_G_EXTLOD\\ProxyAssets", - ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; -/* GEN_H_LOD */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_GEN_H\\SUB_GEN_H_EXTLOD\\ProxyAssets", - ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; -/* GEN_J_LOD */ -if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_GEN_J\\SUB_GEN_J_EXTLOD\\ProxyAssets", - ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) - return E_FAIL; + /* SUB_HogsHead */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_HogsHead\\SUB_HogsHead_EXTLOD\\ProxyAssets", + ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; + /* SUB_PippensPotions */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_PippensPotions\\SUB_Pippens_EXTLOD\\ProxyAssets", + ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; + /* GEN_E_LOD */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_GEN_E\\SUB_GEN_E_EXTLOD\\ProxyAssets", + ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; + /* GEN_F_LOD */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_GEN_F\\SUB_GEN_F_EXTLOD\\ProxyAssets", + ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; + /* GEN_G_LOD */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_GEN_G\\SUB_GEN_G_EXTLOD\\ProxyAssets", + ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; + /* GEN_H_LOD */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_GEN_H\\SUB_GEN_H_EXTLOD\\ProxyAssets", + ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; + /* GEN_J_LOD */ + if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\SUB_GEN_J\\SUB_GEN_J_EXTLOD\\ProxyAssets", + ".fbx", true, ModelPrototypeTags, ModelPrototypePath))) + return E_FAIL; #pragma endregion - + } #pragma region HOGWART -_bool bHogwartLoad = { false }; +_bool bHogwartLoad = { true }; /* Hogwart LOD */ if (FAILED(MapFolderLoad("../Bin/Resources/Models/MapMesh/Game/Environment/Hogwarts/HogwartsLOD", ".bin", false, ModelPrototypeTags, ModelPrototypePath))) return E_FAIL; +if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_RaceRing_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Object/RaceRing/SM_BRR_RaceRing_01.bin", XMMatrixRotationX(XMConvertToRadians(90.f)) * XMMatrixIdentity())))) + return E_FAIL; + if(bHogwartLoad) { /* QuidditchPitch */ @@ -3290,7 +3338,7 @@ vector> jobFutures; _uint iLoadCount = 46; vector*> Contents(iLoadCount); -_bool isLoad_Map = { true }; +_bool isLoad_Map = { false }; if(isLoad_Map) { { /* Terrain */ @@ -3895,6 +3943,10 @@ if(isLoad_Map) if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummyDecal::Create(m_pDevice, m_pContext)))) return E_FAIL; + /* For.Prototype_GameObject_RaceRing */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CRaceRing::Create(m_pDevice, m_pContext)))) + return E_FAIL; + /* For.Prototype_GameObject_MapObject_Manager */ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CMapObject_Manager::Create(m_pDevice, m_pContext, ModelPrototypeTags, ModelPrototypePath)))) return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Private/Loader_ObjectViewer.cpp b/Jusin154_Team3D/Editor/Private/Loader_ObjectViewer.cpp index b2a988d02..8c26560ec 100644 --- a/Jusin154_Team3D/Editor/Private/Loader_ObjectViewer.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader_ObjectViewer.cpp @@ -91,6 +91,11 @@ HRESULT CLoader::Loading_For_ObjectViewer() TEXT("Prototype_Component_SK_GOB_M_Assassin_Master_Model") )); + futures.emplace_back(Deferred_ModelLoad( + MODEL::ANIM, "../Bin/Resources/Models/Monster/Goblin_Assassin/SK_GOB_M_Assassin_Master_Tumble.fbx", 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; diff --git a/Jusin154_Team3D/Editor/Private/MainApp.cpp b/Jusin154_Team3D/Editor/Private/MainApp.cpp index a95b5be6b..2cd68b340 100644 --- a/Jusin154_Team3D/Editor/Private/MainApp.cpp +++ b/Jusin154_Team3D/Editor/Private/MainApp.cpp @@ -200,13 +200,13 @@ HRESULT CMainApp::Ready_Prototypes() HRESULT CMainApp::Ready_IMGUI() { IMGUI_CHECKVERSION(); - ImGui::CreateContext(); - ImGuiIO& io = ImGui::GetIO(); (void)io; + GUI::CreateContext(); + ImGuiIO& io = GUI::GetIO(); (void)io; ImFont* font = nullptr; io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; - ImGui::StyleColorsDark(); + GUI::StyleColorsDark(); ImGui_ImplWin32_Init(g_hWnd); ImGui_ImplDX11_Init(m_pDevice, m_pContext); @@ -233,7 +233,7 @@ HRESULT CMainApp::Release_IMGUI() { ImGui_ImplDX11_Shutdown(); ImGui_ImplWin32_Shutdown(); - ImGui::DestroyContext(); + GUI::DestroyContext(); return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/MapObject_Collision.cpp b/Jusin154_Team3D/Editor/Private/MapObject_Collision.cpp index e772c0722..a0837beac 100644 --- a/Jusin154_Team3D/Editor/Private/MapObject_Collision.cpp +++ b/Jusin154_Team3D/Editor/Private/MapObject_Collision.cpp @@ -230,14 +230,14 @@ void CMapObject_Collision::Describe_Entity() if (nullptr == m_pGameInstance) return; - //ImGui::Text(CMyTools::ToString(m_strModelPrototypeTag).c_str()); + //GUI::Text(CMyTools::ToString(m_strModelPrototypeTag).c_str()); GUI::Checkbox("Visible", &m_bVisible); _float3 vMove = {}; - ImGui::Text("----- Transfrom ----"); - ImGui::InputFloat("Right", &vMove.x, 0.05f, 0.1f); - ImGui::InputFloat("Up", &vMove.y, 0.05f, 0.1f); - ImGui::InputFloat("Look", &vMove.z, 0.05f, 0.1f); + GUI::Text("----- Transfrom ----"); + GUI::InputFloat("Right", &vMove.x, 0.05f, 0.1f); + GUI::InputFloat("Up", &vMove.y, 0.05f, 0.1f); + GUI::InputFloat("Look", &vMove.z, 0.05f, 0.1f); m_pTransformCom->Move_Right(vMove.x); m_pTransformCom->Move_Up(vMove.y); @@ -254,22 +254,22 @@ void CMapObject_Collision::Describe_Entity() m_pTransformCom->Set_State(STATE::POSITION, XMLoadFloat3(&m_vPosition)); } } - ImGui::Text("----- Rotation ----"); - ImGui::InputFloat("X##Rotation", &m_vRotation.x, 10.f, 45.f); - ImGui::InputFloat("Y##Rotation", &m_vRotation.y, 10.f, 45.f); - ImGui::InputFloat("Z##Rotation", &m_vRotation.z, 10.f, 45.f); + GUI::Text("----- Rotation ----"); + GUI::InputFloat("X##Rotation", &m_vRotation.x, 10.f, 45.f); + GUI::InputFloat("Y##Rotation", &m_vRotation.y, 10.f, 45.f); + GUI::InputFloat("Z##Rotation", &m_vRotation.z, 10.f, 45.f); - ImGui::Text("----- Scale ----"); - ImGui::InputFloat("X##Scale", &m_vScale.x, 0.1f, 1.f); - ImGui::InputFloat("Y##Scale", &m_vScale.y, 0.1f, 1.f); - ImGui::InputFloat("Z##Scale", &m_vScale.z, 0.1f, 1.f); + GUI::Text("----- Scale ----"); + GUI::InputFloat("X##Scale", &m_vScale.x, 0.1f, 1.f); + GUI::InputFloat("Y##Scale", &m_vScale.y, 0.1f, 1.f); + GUI::InputFloat("Z##Scale", &m_vScale.z, 0.1f, 1.f); m_vScale.x = max(0.01f, m_vScale.x); m_vScale.y = max(0.01f, m_vScale.y); m_vScale.z = max(0.01f, m_vScale.z); - if (ImGui::Button("Delete")) + if (GUI::Button("Delete")) m_bDead = true; if (GUI::Button("Bake_StaticPhysXMesh")) { diff --git a/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp b/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp index 24e4c9338..e543244bb 100644 --- a/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp +++ b/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp @@ -15,6 +15,7 @@ #include "MapElement_Lake.h" #include "LightSpawner.h" #include "DummyDecal.h" +#include "RaceRing.h" CMapObject_Manager::CMapObject_Manager(ID3D11Device * pDevice, ID3D11DeviceContext * pContext) @@ -93,6 +94,10 @@ HRESULT CMapObject_Manager::Initialize(void* pArg) //m_pInfoInstance->Load_Decal("Duengon_Decal_Data"); //m_pInfoInstance->Load_PointLights("Duengon_PointLight_Data"); #pragma endregion + if (FAILED(Load_MapData("Hogwart_MapContainer_Data", LAYER_HOGWART))) + return E_FAIL; + if (FAILED(Load_MapData("HogwartMap1221", LAYER_HOGWART))) + return E_FAIL; #pragma region Light @@ -206,8 +211,9 @@ void CMapObject_Manager::Update(_float fTimeDelta) Update_Edit(); - Update_LightSpawer(); + //Update_LightSpawer(); //Update_Decal(); + Update_RaceRing(); Update_Unified(); @@ -1945,6 +1951,51 @@ HRESULT CMapObject_Manager::Save_Decal(const _char* pFileName) return S_OK; } +HRESULT CMapObject_Manager::Save_RaceRing(const _char* pFileName) +{ + CLayer* pLayer = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_RaceRing")); + + if (nullptr == pLayer) + return S_OK; + + tinyxml2::XMLDocument doc; + string strPath = "../Bin/Resources/Data/Map/RaceRing/" + string(pFileName) + ".xml"; + + tinyxml2::XMLError loadResult = doc.LoadFile(strPath.c_str()); + + doc.Clear(); + doc.InsertFirstChild(doc.NewDeclaration()); + + tinyxml2::XMLElement* root = doc.NewElement("Ring"); + doc.InsertEndChild(root); + + if (nullptr != pLayer) + { + const list* pList = pLayer->Get_Objects(); + + for (auto pGamObject : *pList) + { + CRaceRing* pRaceRing = dynamic_cast(pGamObject); + + if (nullptr == pRaceRing) + return E_FAIL; + + if (FAILED(pRaceRing->Save_XML(doc, root))) + return E_FAIL; + } + } + + if (doc.SaveFile(strPath.c_str()) != tinyxml2::XML_SUCCESS) { + MSG_BOX("Failed to Save File"); + } + else + { + MSG_BOX("Succeed to Save DummyDecals"); + } + + return S_OK; +} + void CMapObject_Manager::Update_PrototypeList() { GUI::Begin("Model Prototype List"); @@ -1958,7 +2009,7 @@ void CMapObject_Manager::Update_PrototypeList() continue; } - if (ImGui::Button(CMyTools::ToString(Tag).c_str())) + if (GUI::Button(CMyTools::ToString(Tag).c_str())) { if (ADD_TYPE::CONTAINER == m_eType) Create_PartObject(Tag); @@ -1978,7 +2029,7 @@ void CMapObject_Manager::Update_PrototypeList() auto& Tag = m_ModelPrototypeTags[i]; if (_wstring::npos != Tag.find(L"COL") && _wstring::npos == Tag.find(L"Lod")) { - if (ImGui::Button(CMyTools::ToString(Tag).c_str())) + if (GUI::Button(CMyTools::ToString(Tag).c_str())) { vector<_uint> LodModelIndices; @@ -2033,7 +2084,7 @@ void CMapObject_Manager::Update_ObjectList() if (ADD_TYPE::CONTAINER == m_eType) { - if (ImGui::CollapsingHeader("Map Objects", ImGuiTreeNodeFlags_DefaultOpen)) + if (GUI::CollapsingHeader("Map Objects", ImGuiTreeNodeFlags_DefaultOpen)) { if (false == m_MapObjects.empty()) { @@ -2048,7 +2099,7 @@ void CMapObject_Manager::Update_ObjectList() strSrc = CMyTools::ToString(strPrototypeTag) + to_string(iObjectIndex) + "##" + to_string(iObjectIndex++); - if (ImGui::Button(strSrc.c_str())) + if (GUI::Button(strSrc.c_str())) { m_pSelectObject = pCurrentMapObject; } @@ -2056,7 +2107,7 @@ void CMapObject_Manager::Update_ObjectList() } } - if (ImGui::CollapsingHeader("COL", ImGuiTreeNodeFlags_DefaultOpen)) + if (GUI::CollapsingHeader("COL", ImGuiTreeNodeFlags_DefaultOpen)) { for (auto pMapObject : m_Collision) { @@ -2069,7 +2120,7 @@ void CMapObject_Manager::Update_ObjectList() strSrc = CMyTools::ToString(strPrototypeTag) + to_string(iObjectIndex) + "##" + to_string(iObjectIndex++); - if (ImGui::Button(strSrc.c_str())) + if (GUI::Button(strSrc.c_str())) { m_pSelectObject = pCurrentMapObject; } @@ -2104,7 +2155,7 @@ void CMapObject_Manager::Update_ObjectList() strSrc = CMyTools::ToString(strPrototypeTag) + to_string(iObjectIndex) + "##" + to_string(iObjectIndex++); - if (ImGui::Button(strSrc.c_str())) + if (GUI::Button(strSrc.c_str())) { m_pSelectElemnt = pCurrentMapObject; } @@ -2282,6 +2333,40 @@ void CMapObject_Manager::Update_Decal() GUI::End(); } +void CMapObject_Manager::Update_RaceRing() +{ + GUI::Begin("RaceRing Editor"); + if (GUI::Button("Save RaceRings")) + { + Save_RaceRing("RaceRing_Data"); + } + if (GUI::Button("Load Ring")) + { + //m_pInfoInstance->Load_Decal("Duengon_Decal_Data"); + } + if (GUI::Button("Add Ring")) + { + m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_RaceRing")); + } + + GUI::InputInt("Index : ", (_int*)&m_iSelectedIndex); + CLayer* pLayer = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_RaceRing")); + + if (nullptr != pLayer) + { + _uint iIndex = {}; + for (auto& pObject : *pLayer->Get_Objects()) + { + if (m_iSelectedIndex == iIndex) + pObject->Describe_Entity(); + + ++iIndex; + } + } + + GUI::End(); +} + void CMapObject_Manager::Create_PartObject(_wstring& strPrototypeTag) { vector<_uint> LodModelIndices; diff --git a/Jusin154_Team3D/Editor/Private/Monster.cpp b/Jusin154_Team3D/Editor/Private/Monster.cpp index ff37c3cef..9fa34eb91 100644 --- a/Jusin154_Team3D/Editor/Private/Monster.cpp +++ b/Jusin154_Team3D/Editor/Private/Monster.cpp @@ -172,11 +172,11 @@ void CMonster::Free() void CMonster::Describe_Entity() { - if (ImGui::TreeNode("ANIM STATE")) { + if (GUI::TreeNode("ANIM STATE")) { for (auto& pState : m_States) { - if (ImGui::Button(to_string(pState.first).c_str())) + if (GUI::Button(to_string(pState.first).c_str())) { m_pFSM->Change_State(pState.first); } @@ -185,7 +185,7 @@ void CMonster::Describe_Entity() GUI::Text(to_string(m_pModelCom->Get_CurrentTrackProgressRatio()).c_str()); - ImGui::TreePop(); + GUI::TreePop(); } } diff --git a/Jusin154_Team3D/Editor/Private/Player.cpp b/Jusin154_Team3D/Editor/Private/Player.cpp index 1c5dcdc1c..8f08c573e 100644 --- a/Jusin154_Team3D/Editor/Private/Player.cpp +++ b/Jusin154_Team3D/Editor/Private/Player.cpp @@ -77,7 +77,7 @@ HRESULT CPlayer::Initialize(void* pArg) m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody); m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody); - m_pEffectPool = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_EffectPool"))->Get_Object(); + m_pEffectPool = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Z_Layer_EffectPool"))->Get_Object(); SAFE_ADDREF(m_pEffectPool); m_pInfoInstance->Regist_PlayerAlly(this); @@ -98,7 +98,7 @@ HRESULT CPlayer::Initialize(void* pArg) #endif // _DEBUG // UI 연동 추가 - m_pModelCom->Set_Temp(true); + m_pModelCom->Set_DisableRootMotionScale(true); #ifdef gimch m_pCharacter_Controller->Set_GravityAmount(0.f); @@ -109,7 +109,8 @@ HRESULT CPlayer::Initialize(void* pArg) void CPlayer::Priority_Update(_float fTimeDelta) { ReLockOnTarget(); - SetGravity(); + if (m_pCharacter_Controller->Get_GravityAmount() > 0.f) + SetGravity(); m_pTransformCom->RewindMomentum(); __super::Priority_Update(fTimeDelta); @@ -497,6 +498,13 @@ void CPlayer::Describe_Entity() { GUI::Begin("PLAYER_DESC"); m_pCharacter_Controller->Describe_Entity(); + + if (m_pGameInstance->Key_Up(DIK_HOME)) + { + m_pCharacter_Controller->Set_GravityAmount(0.f); + m_pCharacter_Controller->Set_Position(XMVectorSet(m_pGameInstance->Get_CamPosition()->x, m_pGameInstance->Get_CamPosition()->y, m_pGameInstance->Get_CamPosition()->z, 1.f)); + } + _float4 vMomentum = {}; XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum()); GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w); @@ -563,8 +571,9 @@ void CPlayer::Describe_Entity() m_pLightCom->Describe_Entity(); -#ifdef gimch +#ifdef _DEBUG +#if gimchi || 진우 if(m_pGameInstance->Key_Down(DIK_K)) { _float3 vPos; @@ -573,7 +582,8 @@ void CPlayer::Describe_Entity() m_pCharacter_Controller->Set_Position(XMVectorSetW(XMLoadFloat3(&vPos),1.f)); } } - +#endif + #endif // diff --git a/Jusin154_Team3D/Editor/Private/RaceRing.cpp b/Jusin154_Team3D/Editor/Private/RaceRing.cpp new file mode 100644 index 000000000..c84d9945d --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/RaceRing.cpp @@ -0,0 +1,218 @@ +#include "pch.h" +#include "RaceRing.h" + +#include "GameInstance.h" + +CRaceRing::CRaceRing(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CGameObject(pDevice, pContext) +{ +} + +CRaceRing::CRaceRing(const CRaceRing& Prototype) + : CGameObject(Prototype) +{ +} + +HRESULT CRaceRing::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CRaceRing::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) { + return E_FAIL; + } + + if (FAILED(Ready_Components())) { + return E_FAIL; + } + + m_iIndex = 0; + + return S_OK; +} + +void CRaceRing::Priority_Update(_float fTimeDelta) +{ +#ifdef _DEBUG + +#endif // _DEBUG +} + +void CRaceRing::Update(_float fTimeDelta) +{ + m_pModelCom->Combined_BoneMatrix(); +} + +void CRaceRing::Late_Update(_float fTimeDelta) +{ + m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); +} + +HRESULT CRaceRing::Render() +{ + if (!m_pModelCom) + return S_OK; + + 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->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Render(i))) { + return E_FAIL; + } + } + + + return S_OK; +} + +HRESULT CRaceRing::Ready_Components() +{ + __super::Ready_Components(nullptr); + + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_RaceRing_Model"), + 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 CRaceRing::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; +} + +CRaceRing* CRaceRing::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CRaceRing* pInstance = new CRaceRing(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CRaceRing"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CRaceRing::Clone(void* pArg, CGameObject* pOwner) +{ + CRaceRing* pInstance = new CRaceRing(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CRaceRing"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CRaceRing::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pModelCom); + +} +#ifdef _DEBUG + +void CRaceRing::Describe_Entity() +{ + m_pTransformCom->Describe_Entity(); + + if (m_pGameInstance->Mouse_Down(DIM_LBUTTON) && m_pGameInstance->Key_Pressing(DIK_LSHIFT)) + { + _float3 vPosition = {}; + if (m_pGameInstance->isPicking(&vPosition)) + { + vPosition.y += 20.7f; + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&vPosition), 1.f)); + } + } +} + +HRESULT CRaceRing::Save_XML(tinyxml2::XMLDocument& doc, tinyxml2::XMLElement* root) +{ + tinyxml2::XMLElement* object = doc.NewElement("Object"); + object->SetAttribute("Type", 0); + root->InsertEndChild(object); + +#pragma region TRANSFORM + _float3 vPosition = {}; + XMStoreFloat3(&vPosition, m_pTransformCom->Get_State(STATE::POSITION)); + + _float3 vScale = m_pTransformCom->Get_Scale(); + + _float3 vRotation = m_pTransformCom->Get_Rotation(); + + tinyxml2::XMLElement* Position = doc.NewElement("Position"); + Position->SetAttribute("x", vPosition.x); + Position->SetAttribute("y", vPosition.y); + Position->SetAttribute("z", vPosition.z); + object->InsertEndChild(Position); + + tinyxml2::XMLElement* Scale = doc.NewElement("Scale"); + Scale->SetAttribute("x", vScale.x); + Scale->SetAttribute("y", vScale.y); + Scale->SetAttribute("z", vScale.z); + object->InsertEndChild(Scale); + + tinyxml2::XMLElement* Rotation = doc.NewElement("Rotation"); + Rotation->SetAttribute("x", vRotation.x); + Rotation->SetAttribute("y", vRotation.y); + Rotation->SetAttribute("z", vRotation.z); + object->InsertEndChild(Rotation); +#pragma endregion + + return S_OK; +} + +#endif // _DEBUG diff --git a/Jusin154_Team3D/Editor/Private/Ranrok.cpp b/Jusin154_Team3D/Editor/Private/Ranrok.cpp index 5a646c65a..859453ce2 100644 --- a/Jusin154_Team3D/Editor/Private/Ranrok.cpp +++ b/Jusin154_Team3D/Editor/Private/Ranrok.cpp @@ -63,7 +63,7 @@ HRESULT CRanrok::Initialize(void* pArg) m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody); m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody,&m_bCollisionPlayer); - m_pEffectPool = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_EffectPool"))->Get_Object(); + m_pEffectPool = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Z_Layer_EffectPool"))->Get_Object(); SAFE_ADDREF(m_pEffectPool); m_pCharacter_Controller->Set_Position(XMVectorSet(3.f, -75.f, -15.f, 1.f)); @@ -532,10 +532,11 @@ void CRanrok::MoveTo(_float fTimeDelta) _vector CurPos = m_pCharacter_Controller->Get_Position(); _vector vLook = XMVector3Normalize(m_pTransformCom->Get_State(STATE::LOOK)); + _vector toTarget = Target - CurPos; _float fDist = XMVectorGetX(XMVector3Length(toTarget)); - if (m_iCurrentPoint + 1 < m_Points[m_iCurrentFlow].size() && fDist < 30.f) + if (m_iCurrentPoint + 1 < m_Points[m_iCurrentFlow].size() && fDist < 15.f) { NextTarget = m_Points[m_iCurrentFlow][m_iCurrentPoint + 1]; } @@ -545,7 +546,7 @@ void CRanrok::MoveTo(_float fTimeDelta) if (m_iCurrentPoint == m_Points[m_iCurrentFlow].size() - 1) { - if (fDist < 20.f) + if (fDist < 5.f) { if (m_iCurrentPoint == m_Points[m_iCurrentFlow].size() - 1) { @@ -557,7 +558,7 @@ void CRanrok::MoveTo(_float fTimeDelta) return; } } - else if (fDist < 20.f) + else if (fDist < 10.f) { if (m_iCurrentPoint == m_Points[m_iCurrentFlow].size() - 1) { @@ -571,7 +572,7 @@ void CRanrok::MoveTo(_float fTimeDelta) _vector LerpTarget = XMVectorLerp(Target, NextTarget, 0.5f); - m_pTransformCom->LookAt_Lerp(LerpTarget, fTimeDelta, 2.5f); + m_pTransformCom->LookAt_Lerp(LerpTarget, fTimeDelta, 5.f); m_pCharacter_Controller->Set_Position(CurPos + vLook * m_fTuckedSpeed * fTimeDelta); } @@ -671,6 +672,54 @@ void CRanrok::Describe_Entity() m_pCharacter_Controller->Set_Position(XMVectorSet(m_pGameInstance->Get_CamPosition()->x, m_pGameInstance->Get_CamPosition()->y, m_pGameInstance->Get_CamPosition()->z, 1.f)); } + GUI::DragFloat("Tucked Speed", &m_fTuckedSpeed); + + for (_uint i = 0; i < m_Points.size(); ++i) + { + GUI::Separator(); + + if (GUI::TreeNode(("Points " + to_string(i)).c_str())) + { + GUI::Text("Points[%d] Count : %d", i, (_int)m_Points[i].size()); + + for (_uint j = 0; j < m_Points[i].size(); ) + { + _float3 p; + XMStoreFloat3(&p, m_Points[i][j]); + + GUI::PushID((int)(i * 10000 + j)); + + GUI::Text("[%d] (%.2f, %.2f, %.2f)", j, p.x, p.y, p.z); + GUI::SameLine(); + + if (GUI::SmallButton("Move")) + { + m_pCharacter_Controller->Set_Position( + XMVectorSet(p.x, p.y, p.z, 1.f)); + } + + GUI::SameLine(); + + if (GUI::SmallButton("X")) + { + m_Points[i].erase(m_Points[i].begin() + j); + GUI::PopID(); + continue; + } + + GUI::PopID(); + ++j; + } + + if (GUI::SmallButton(("Clear##" + to_string(i)).c_str())) + { + m_Points[i].clear(); + } + GUI::TreePop(); + } + + } + #ifdef gimch if (m_pGameInstance->Key_Down(DIK_L)) @@ -686,7 +735,7 @@ void CRanrok::Describe_Entity() m_pTransformCom->Describe_Entity(); - GUI::DragFloat("Tucked Speed", &m_fTuckedSpeed); + } #endif // _DEBUG diff --git a/Jusin154_Team3D/Editor/Private/Ranrok_Breath.cpp b/Jusin154_Team3D/Editor/Private/Ranrok_Breath.cpp index 65bd4dde9..3f4a53017 100644 --- a/Jusin154_Team3D/Editor/Private/Ranrok_Breath.cpp +++ b/Jusin154_Team3D/Editor/Private/Ranrok_Breath.cpp @@ -55,35 +55,6 @@ HRESULT CRanrok_Breath::Initialize(void* pArg) m_fDuration = 5.f; - m_Events.emplace(0.5f, [&]() { - m_isStartRayCast = true; - }); - - - m_Events.emplace(3.f, [&]() { - - // 파티클 제어 - m_isParticleEnd = true; - - CEditEffect* pRock_PT = Get_PartObject("Rock_PT"); - CEditEffect* pBottomFire = Get_PartObject("BottomFire"); - CEditEffect* pSplatterBottom0 = Get_PartObject("SplatterBottom0"); - - m_pMouthFire->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(0.f, -500.f, 0.f, 1.f)); - - pRock_PT->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(0.f, -500.f, 0.f, 1.f)); - pBottomFire->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(0.f, -500.f, 0.f, 1.f)); - pSplatterBottom0->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(0.f, -500.f, 0.f, 1.f)); - - m_pBreath->Get_Component()->Set_Loop(false); - m_pBreath->Get_Effect_Info()->isDissolve = true; - - m_pBreath_Black->Get_Component()->Set_Loop(false); - m_pBreath_Black->Get_Effect_Info()->isDissolve = true; - - m_pBreathSlog->Set_Visible(false); - - }); return S_OK; } @@ -155,6 +126,12 @@ HRESULT CRanrok_Breath::Pre_Setting(CGameObject* pObject, void* pArg) return E_FAIL; + /* 브레스 시간 제어 */ + + _float fBreathTime = *static_cast<_float*>(pArg); + + Set_BreathTime(fBreathTime); + /* 초기 객체 비지블*/ CEditEffect* pBlurMesh = Get_PartObject("BlurMesh"); @@ -279,6 +256,42 @@ void CRanrok_Breath::OnCollision(CGameObject* pOther, void* pDesc) XMStoreFloat4(&m_vPreCollisionPos, vPos); } +void CRanrok_Breath::Set_BreathTime(_float fTime) +{ + m_Events.clear(); + + m_Events.emplace(fTime, [&]() { + + m_pBreath->Get_Component()->Set_Loop(false); + m_pBreath->Get_Effect_Info()->isDissolve = true; + + m_pBreath_Black->Get_Component()->Set_Loop(false); + m_pBreath_Black->Get_Effect_Info()->isDissolve = true; + + m_pBreathSlog->Set_Visible(false); + + }); + + m_Events.emplace(fTime + 0.5f, [&]() { + // 파티클 제어 + m_isParticleEnd = true; + + CEditEffect* pRock_PT = Get_PartObject("Rock_PT"); + CEditEffect* pBottomFire = Get_PartObject("BottomFire"); + CEditEffect* pSplatterBottom0 = Get_PartObject("SplatterBottom0"); + + m_pMouthFire->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(0.f, -500.f, 0.f, 1.f)); + + pRock_PT->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(0.f, -500.f, 0.f, 1.f)); + pBottomFire->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(0.f, -500.f, 0.f, 1.f)); + pSplatterBottom0->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(0.f, -500.f, 0.f, 1.f)); + }); + + m_Events.emplace(0.25f, [&]() { + m_isStartRayCast = true; + }); +} + void CRanrok_Breath::Free() { __super::Free(); diff --git a/Jusin154_Team3D/Editor/Private/Ranrok_Charge.cpp b/Jusin154_Team3D/Editor/Private/Ranrok_Charge.cpp new file mode 100644 index 000000000..f45abcfa2 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Ranrok_Charge.cpp @@ -0,0 +1,185 @@ +#include "pch.h" +#include "Ranrok_Charge.h" + +#include "GameInstance.h" +#include "EditEffect.h" +#include "Wand.h" +#include "Player.h" +#include "InfoInstance.h" + +CRanrok_Charge::CRanrok_Charge(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CEffect_Container{ pDevice, pContext } +{ +} + +CRanrok_Charge::CRanrok_Charge(const CRanrok_Charge& rhs) + : CEffect_Container(rhs), + m_pInfoInstance(CInfoInstance::GetInstance()) +{ + SAFE_ADDREF(m_pInfoInstance); +} + +HRESULT CRanrok_Charge::Initialize_Prototype() +{ + + + return S_OK; + +} + +HRESULT CRanrok_Charge::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components(pArg))) + return E_FAIL; + + + if (FAILED(Load_Package("../Bin/Resources/Data/Effect/MonsterPackage/Ranrok/RanrokCharge"))) + return E_FAIL; + + m_wstrEffectName = L"RanrokCharge"; + + + + m_fDuration = 4.f; + + + + + return S_OK; +} + +void CRanrok_Charge::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); + +} + +void CRanrok_Charge::Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Update(fTimeDelta); + + Update_Event(fTimeDelta); + + + + + +} + +void CRanrok_Charge::Late_Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Late_Update(fTimeDelta); + + +} + +HRESULT CRanrok_Charge::Pre_Setting(CGameObject* pObject, void* pArg) +{ + if (FAILED(__super::Pre_Setting(pObject, nullptr))) + return E_FAIL; + + + /* 초기 객체 비지블*/ + + CEditEffect* pCharge_Goo = Get_PartObject("Charge_Goo"); + CEditEffect* pCombinedPT = Get_PartObject("CombinedPT"); + + pCharge_Goo->Set_Visible(true); + pCombinedPT->Set_Visible(true); + + /* 초기 객체 위치 초기화*/ + + _vector vOwnerPos = m_pOwner->Get_Component()->Get_Position(); + + + pCharge_Goo->Get_Component()->Set_State(STATE::POSITION, vOwnerPos); + pCombinedPT->Get_Component()->Set_State(STATE::POSITION, vOwnerPos); + + + + return S_OK; +} + +HRESULT CRanrok_Charge::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CRanrok_Charge::Ready_Child() +{ + return S_OK; +} + +CRanrok_Charge* CRanrok_Charge::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CRanrok_Charge* pInstance = new CRanrok_Charge(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CRanrok_Charge"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + + +CGameObject* CRanrok_Charge::Clone(void* pArg, CGameObject* pOwner) +{ + CRanrok_Charge* pInstance = new CRanrok_Charge(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CRanrok_Charge"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CRanrok_Charge::OnCollision(CGameObject* pOther, void* pDesc) +{ + if (m_bHit == false) + return; + + ON_COLLISION_INFO CollisionDesc = *static_cast(pDesc); + + _vector vPos = XMLoadFloat4(&CollisionDesc.vWorldPos); + + +} + +void CRanrok_Charge::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pInfoInstance); + + +} +#ifdef _DEBUG +void CRanrok_Charge::Describe_Entity() +{ + +} +#endif + +HRESULT CRanrok_Charge::Bind_ShaderResources() +{ + return S_OK; +} + + diff --git a/Jusin154_Team3D/Editor/Private/Ranrok_Pulse.cpp b/Jusin154_Team3D/Editor/Private/Ranrok_Pulse.cpp new file mode 100644 index 000000000..b23b94b51 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Ranrok_Pulse.cpp @@ -0,0 +1,208 @@ +#include "pch.h" +#include "Ranrok_Pulse.h" + +#include "GameInstance.h" +#include "EditEffect.h" +#include "Wand.h" +#include "Player.h" +#include "InfoInstance.h" + +CRanrok_Pulse::CRanrok_Pulse(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CEffect_Container{ pDevice, pContext } +{ +} + +CRanrok_Pulse::CRanrok_Pulse(const CRanrok_Pulse& rhs) + : CEffect_Container(rhs), + m_pInfoInstance(CInfoInstance::GetInstance()) +{ + SAFE_ADDREF(m_pInfoInstance); +} + +HRESULT CRanrok_Pulse::Initialize_Prototype() +{ + + + return S_OK; + +} + +HRESULT CRanrok_Pulse::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components(pArg))) + return E_FAIL; + + + if (FAILED(Load_Package("../Bin/Resources/Data/Effect/MonsterPackage/Ranrok/RanrokPulse"))) + return E_FAIL; + + m_wstrEffectName = L"RanrokPulse"; + + + + m_fDuration = 15.f; + + + return S_OK; +} + +void CRanrok_Pulse::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); + +} + +void CRanrok_Pulse::Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Update(fTimeDelta); + + Update_Event(fTimeDelta); + + + + + +} + +void CRanrok_Pulse::Late_Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Late_Update(fTimeDelta); + + +} + +HRESULT CRanrok_Pulse::Pre_Setting(CGameObject* pObject, void* pArg) +{ + if (FAILED(__super::Pre_Setting(pObject, nullptr))) + return E_FAIL; + + + /* 초기 객체 비지블*/ + + CEditEffect* pBottomDecal = Get_PartObject("Bottom_Decal"); + CEditEffect* pBottomSplatter = Get_PartObject("BottomSplatter"); + CEditEffect* pBottomSplatter2 = Get_PartObject("BottomSplatter2"); + CEditEffect* pRed_Sphere = Get_PartObject("Red_Sphere"); + CEditEffect* pRock_PT = Get_PartObject("Rock_PT"); + CEditEffect* pSmoke = Get_PartObject("Smoke"); + + pBottomDecal->Set_Visible(true); + pBottomSplatter->Set_Visible(true); + pBottomSplatter2->Set_Visible(true); + pRock_PT->Set_Visible(true); + pSmoke->Set_Visible(true); + + pRed_Sphere->Set_Visible(true); + + + /* 초기 객체 위치 초기화*/ + + _vector vOwnerPos = m_pOwner->Get_Component()->Get_Position(); + + pRed_Sphere->Get_Component()->Set_WorldMatrix(m_pOwner->Get_Component()->Get_XMWorldMatrix()); + pRed_Sphere->Get_Component()->Set_State(STATE::POSITION, vOwnerPos); + + CUnit* pPlayer = m_pInfoInstance->Get_NearestPlayerAlly(m_pOwner->Get_WorldPostion()).first; + + if (pPlayer == nullptr) + return E_FAIL; + + _vector vPlayer_FootPos = pPlayer->Get_Component()->Get_FootPosition(); + + XMStoreFloat4(&m_vTargetPos, vPlayer_FootPos); + + _vector vCompute_Pos = XMVectorSetY(vOwnerPos, XMVectorGetY(vPlayer_FootPos)); + + pBottomDecal->Get_Component()->Set_State(STATE::POSITION, vCompute_Pos); + pBottomSplatter->Get_Component()->Set_State(STATE::POSITION, vCompute_Pos); + pBottomSplatter2->Get_Component()->Set_State(STATE::POSITION, vCompute_Pos); + pRock_PT->Get_Component()->Set_State(STATE::POSITION, vCompute_Pos); + pSmoke->Get_Component()->Set_State(STATE::POSITION, vCompute_Pos); + + + return S_OK; +} + +HRESULT CRanrok_Pulse::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CRanrok_Pulse::Ready_Child() +{ + return S_OK; +} + +CRanrok_Pulse* CRanrok_Pulse::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CRanrok_Pulse* pInstance = new CRanrok_Pulse(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CRanrok_Pulse"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + + +CGameObject* CRanrok_Pulse::Clone(void* pArg, CGameObject* pOwner) +{ + CRanrok_Pulse* pInstance = new CRanrok_Pulse(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CRanrok_Pulse"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CRanrok_Pulse::OnCollision(CGameObject* pOther, void* pDesc) +{ + if (m_bHit == false) + return; + + ON_COLLISION_INFO CollisionDesc = *static_cast(pDesc); + + _vector vPos = XMLoadFloat4(&CollisionDesc.vWorldPos); + + +} + +void CRanrok_Pulse::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pInfoInstance); + + +} +#ifdef _DEBUG +void CRanrok_Pulse::Describe_Entity() +{ + +} +#endif + +HRESULT CRanrok_Pulse::Bind_ShaderResources() +{ + return S_OK; +} + + diff --git a/Jusin154_Team3D/Editor/Private/Ranrok_States.cpp b/Jusin154_Team3D/Editor/Private/Ranrok_States.cpp index 1c78059e1..589c09a29 100644 --- a/Jusin154_Team3D/Editor/Private/Ranrok_States.cpp +++ b/Jusin154_Team3D/Editor/Private/Ranrok_States.cpp @@ -303,9 +303,14 @@ void CRanrok::Behavior_FireBreathEnter() m_bLookAt = true; },0.95f); + Add_Event(m_Animation[STATEANIM::FIREBREATH_A].first, [this]() { - m_pEffectPool->Use_Skill(SKILL_TYPE::RANROK_BREATH, this); + + _float fBreathTime = 1.f; + + m_pEffectPool->Use_Skill(SKILL_TYPE::RANROK_BREATH, this , &fBreathTime); + }, 0.1f); } @@ -368,7 +373,11 @@ void CRanrok::Behavior_FireSweepEnter() Add_Event(m_Animation[STATEANIM::FIRESWEEP_A].first, [this]() { - m_pEffectPool->Use_Skill(SKILL_TYPE::RANROK_BREATH, this); + + _float fBreathTime = 3.f; + + m_pEffectPool->Use_Skill(SKILL_TYPE::RANROK_BREATH, this, &fBreathTime); + }, 0.08f); } else if (m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_GROUND)) @@ -622,9 +631,17 @@ 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, - [this]() { CameraShake(10.f, 2.f, 5.f, 1.2f); }, - 0.39f);*/ + + Add_Event(pairAnimInfo.first, + [this]() { + m_pEffectPool->Use_Skill(SKILL_TYPE::RANROK_CHARGE, this); + }, 0.f); + + Add_Event(pairAnimInfo.first, + [this]() { + + m_pEffectPool->Use_Skill(SKILL_TYPE::RANROK_PURSE, this); + },0.39f); } HRESULT CRanrok::Behavior_PulseExitCheck(_float fTimeDelta) diff --git a/Jusin154_Team3D/Editor/Private/TrailObject.cpp b/Jusin154_Team3D/Editor/Private/TrailObject.cpp index 3190708db..0482bfd7f 100644 --- a/Jusin154_Team3D/Editor/Private/TrailObject.cpp +++ b/Jusin154_Team3D/Editor/Private/TrailObject.cpp @@ -534,11 +534,11 @@ void CTrailObject::Describe_Entity() if (GUI::TreeNode("TRAIL")) { - if (ImGui::Combo("Render Order", &iCurrentItem, pRenderNames, ENUM_CLASS(RENDER::END))) + if (GUI::Combo("Render Order", &iCurrentItem, pRenderNames, ENUM_CLASS(RENDER::END))) { m_TrailInfo.eRenderOrder = static_cast(iCurrentItem); } - if (ImGui::Combo("Shader Pass", &iCurrentPass, pShaderPass, ENUM_CLASS(SHADER_PASS_POSTEX::END))) + if (GUI::Combo("Shader Pass", &iCurrentPass, pShaderPass, ENUM_CLASS(SHADER_PASS_POSTEX::END))) { m_TrailInfo.eShaderPass = static_cast(iCurrentPass); } @@ -586,10 +586,10 @@ void CTrailObject::Describe_Entity() GUI::Checkbox("Blur", &m_TrailInfo.isBlur); GUI::Checkbox("OnlyBlur", &m_TrailInfo.isOnlyBlur); - ImGui::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); GUI::DragFloat("BlurIntensity", &m_TrailInfo.fBlurIntensity, 0.005f, 0.f, 1.f); GUI::DragInt("BlurWeight", &m_TrailInfo.iBlurWeight, 2.f, 0, 128); - ImGui::PopItemWidth(); + GUI::PopItemWidth(); GUI::TreePop(); } @@ -599,7 +599,7 @@ void CTrailObject::Describe_Entity() { GUI::ColorEdit4("MixColor", (_float*)&m_TrailInfo.vEmissive); - ImGui::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); GUI::DragFloat("EmissiveStrength", &m_TrailInfo.fEmissiveStrength, 0.01f, 0.f); GUI::DragFloat("SoftenExp", &m_TrailInfo.fSoftenExp, 0.01f, 0.f); @@ -607,7 +607,7 @@ void CTrailObject::Describe_Entity() GUI::DragFloat("CoreBoost", &m_TrailInfo.fCoreBoost, 0.01f, 0.f); GUI::DragFloat("Radius", &m_TrailInfo.fRadius, 0.01f, 0.f , 1.f); - ImGui::PopItemWidth(); + GUI::PopItemWidth(); GUI::TreePop(); } @@ -616,7 +616,7 @@ void CTrailObject::Describe_Entity() { if (GUI::TreeNode("BLOOM")) { - if (ImGui::Combo("Bloom Type", &iCurrentBloomType, pBloomType, ENUM_CLASS(BLOOM_TYPE::END))) + if (GUI::Combo("Bloom Type", &iCurrentBloomType, pBloomType, ENUM_CLASS(BLOOM_TYPE::END))) { m_TrailInfo.eBloomType = static_cast(iCurrentBloomType); } @@ -624,7 +624,7 @@ void CTrailObject::Describe_Entity() GUI::Checkbox("BloomDissolve", &m_TrailInfo.isBloomDissolve); GUI::Checkbox("BloomReverseDissolve", &m_TrailInfo.isBloomReverseDissolve); - ImGui::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); GUI::DragFloat("fBloomStrength", &m_TrailInfo.fBloomStrength, 0.001f, 0.f); GUI::DragFloat2("fBloomTime", (_float*)&m_TrailInfo.vBloomTime, 0.001f, 0.f); @@ -639,9 +639,9 @@ void CTrailObject::Describe_Entity() { _string strName = {}; - ImGui::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); GUI::DragFloat("Diffuse Alpha", &m_TrailInfo.fDiffuseAlpha, 0.01f, 0.f, 1.f); - ImGui::PopItemWidth(); + GUI::PopItemWidth(); if (GUI::TreeNode("DIFFUSE TEX")) { @@ -666,10 +666,10 @@ void CTrailObject::Describe_Entity() { _string strName = {}; - ImGui::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); GUI::DragFloat("SoftMask", &m_TrailInfo.fSoftMask, 0.01f, 0.f); GUI::DragFloat("fSoftMaskEdge", &m_TrailInfo.fSoftMaskEdge, 0.01f, 0.f); - ImGui::PopItemWidth(); + GUI::PopItemWidth(); if (GUI::TreeNode("MASK TEX")) { @@ -693,11 +693,11 @@ void CTrailObject::Describe_Entity() { _string strName = {}; - ImGui::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); GUI::Checkbox("NoiseColor", &m_TrailInfo.isNoiseColor); GUI::Checkbox("NoiseAlpha", &m_TrailInfo.isNoiseAlpha); GUI::DragFloat("NoiseStrength", &m_TrailInfo.fNoiseStrength, 0.01f, 0.f); - ImGui::PopItemWidth(); + GUI::PopItemWidth(); if (GUI::TreeNode("NOISE TEX")) { @@ -725,14 +725,14 @@ void CTrailObject::Describe_Entity() _float2 vDiffuseDistortioUVAmount = {}; _float2 vMaskDistortionUVAmount = {}; - ImGui::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); GUI::DragFloat("DistortionIntensity", &m_TrailInfo.fDistortionIntensity, 0.005f, 0.f, 1.f); GUI::InputFloat("DistortionTime", &m_TrailInfo.vDistortionTime.y, 0.1f, 0.f); GUI::DragFloat2("DiffuseDistortionUVAmount", (_float*)&m_TrailInfo.vDiffuseDistortioUVAmount, 0.1f); GUI::DragFloat2("MaskDistortionUVAmount", (_float*)&m_TrailInfo.vMaskDistortionUVAmount, 0.1f); - ImGui::PopItemWidth(); + GUI::PopItemWidth(); if (GUI::TreeNode("DISTORTION TEX")) { diff --git a/Jusin154_Team3D/Editor/Private/Troll.cpp b/Jusin154_Team3D/Editor/Private/Troll.cpp index 361d1ed97..7119fd54f 100644 --- a/Jusin154_Team3D/Editor/Private/Troll.cpp +++ b/Jusin154_Team3D/Editor/Private/Troll.cpp @@ -65,7 +65,7 @@ HRESULT CTroll::Initialize(void* pArg) m_pCharacter_Controller->Set_Position(XMVectorSet(3.f, 5.f, -20.f, 1.f)); - m_pEffectPool = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_EffectPool"))->Get_Object(); + m_pEffectPool = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Z_Layer_EffectPool"))->Get_Object(); SAFE_ADDREF(m_pEffectPool); m_pLeftHand_BoneMat = m_pModelCom->Get_BoneMatrixPtr("LeftHand"); diff --git a/Jusin154_Team3D/Editor/Public/Editor_Define.h b/Jusin154_Team3D/Editor/Public/Editor_Define.h index 034647049..78263bcfb 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Define.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Define.h @@ -41,7 +41,7 @@ namespace Editor FLAGWAVE, BROOMCIRCLE, RIDE_INFO_KEY, RIDE_INFO, RIDE_HPSLOT, ENEMY_DETECTION, INTERACTION_OBJECT, INTERACTION_NPC, BROOMTARGETGATE, END }; - enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, NON_WORLD_BLUR, BLEND, BLEND_NOWORLD, BLOOM, BLOOM_NOWORLD, BLUR_NO_EMMISVE, BLUR_NO_WORLD_NO_EMISSIVE, WEIGHTBLEND_FOR_BLEND, DEPTH_STOP, WB_CULLING, SCREEN_FX , DISTORTION , NONPOS , NONPOS_BLUR, BLUR_MESH, BLUR_CULLING , BLUR_CULLING_NO_EMISSIVE, BLOOM_CULLING , DEFAULT_NONPOS , NONWB_NONPOS, DECAL, DECAL_WB, DECAL_BLUR, END}; + enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, NON_WORLD_BLUR, BLEND, BLEND_NOWORLD, BLOOM, BLOOM_NOWORLD, BLUR_NO_EMMISVE, BLUR_NO_WORLD_NO_EMISSIVE, WEIGHTBLEND_FOR_BLEND, DEPTH_STOP, WB_CULLING, SCREEN_FX , DISTORTION , NONPOS , NONPOS_BLUR, BLUR_MESH, BLUR_CULLING , BLUR_CULLING_NO_EMISSIVE, BLOOM_CULLING , DEFAULT_NONPOS , NONWB_NONPOS, DECAL, DECAL_WB, DECAL_BLUR, BLEND_CULLING, END}; enum class SHADER_PASS_UIINTANCE { DEFAULT, ALPHABLEND, UVALPHABLEND, MAGIC_METER, SPELL_LIST, EESSENTIAL_SPELL_SOLT, EESSENTIAL_SPELL, COLOR, SPELL_HOVER, SPELL_SLOT_EFFECT, SPELL_SLOT, SPELL_LOCK, QUEST_SLOT, END }; @@ -61,7 +61,7 @@ namespace Editor JAP_SIDE, BOMBARDA_SIDE, DESCENDO_SIDE, LEVIOSO_SIDE, STUN, - TROLL_ATTACK, TROLL_RUSH_HIT, TROLL_NOMAL_SMOKE, BLINK, RANROK_FIREBALL, RANROK_BREATH, RANROK_POINT, + TROLL_ATTACK, TROLL_RUSH_HIT, TROLL_NOMAL_SMOKE, BLINK, RANROK_FIREBALL, RANROK_BREATH, RANROK_POINT, RANROK_PURSE, RANROK_CHARGE, END }; diff --git a/Jusin154_Team3D/Editor/Public/EffectObject.h b/Jusin154_Team3D/Editor/Public/EffectObject.h index 56e92ac57..5af11f695 100644 --- a/Jusin154_Team3D/Editor/Public/EffectObject.h +++ b/Jusin154_Team3D/Editor/Public/EffectObject.h @@ -307,7 +307,7 @@ class CEffectObject abstract : public CPartObject _string m_strModelName = {}; _string m_strEmissiveName = {}; _string m_strDistortionName = {}; - _string m_strNomalMapName = {}; + _string m_strNormalMapName = {}; _string m_strPath = {}; _string m_strName = {}; diff --git a/Jusin154_Team3D/Editor/Public/MapObject_Manager.h b/Jusin154_Team3D/Editor/Public/MapObject_Manager.h index b52048882..b6b1686eb 100644 --- a/Jusin154_Team3D/Editor/Public/MapObject_Manager.h +++ b/Jusin154_Team3D/Editor/Public/MapObject_Manager.h @@ -84,6 +84,10 @@ class CMapObject_Manager final : public CGameObject HRESULT Save_PointLightObject(const _char* pFileName); HRESULT Save_Decal(const _char* pFileName); + + HRESULT Save_RaceRing(const _char* pFileName); + + #pragma endregion void Update_PrototypeList(); @@ -93,6 +97,7 @@ class CMapObject_Manager final : public CGameObject void Update_Unified(); void Update_LightSpawer(); void Update_Decal(); + void Update_RaceRing(); void Create_PartObject(_wstring& strPrototypeTag); void Create_Elemnt(_wstring& strPrototypeTag); diff --git a/Jusin154_Team3D/Editor/Public/RaceRing.h b/Jusin154_Team3D/Editor/Public/RaceRing.h new file mode 100644 index 000000000..445b1a9ac --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/RaceRing.h @@ -0,0 +1,45 @@ +#pragma once + +#include "Editor_Define.h" +#include "PartObject.h" + +NS_BEGIN(Editor) + +class CRaceRing final : public CGameObject +{ +private: + CRaceRing(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CRaceRing(const CRaceRing& Prototype); + virtual ~CRaceRing() = 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; + void Set_Target(_bool bTarget) { m_bTarget = bTarget; } + +private: + CShader* m_pShaderCom = { nullptr }; + CModel* m_pModelCom = { nullptr }; + _bool m_bTarget = { false }; + _int m_iIndex = {}; + +private: + HRESULT Ready_Components(); + HRESULT Bind_ShaderResources(); + +public: + static CRaceRing* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr)override; + virtual void Free() override; + +#ifdef _DEBUG + void Describe_Entity() override; + HRESULT Save_XML(tinyxml2::XMLDocument& doc, tinyxml2::XMLElement* root); +#endif // _DEBUG +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Ranrok_Breath.h b/Jusin154_Team3D/Editor/Public/Ranrok_Breath.h index 86cfe5099..dc8a7e008 100644 --- a/Jusin154_Team3D/Editor/Public/Ranrok_Breath.h +++ b/Jusin154_Team3D/Editor/Public/Ranrok_Breath.h @@ -30,6 +30,8 @@ class CRanrok_Breath final : public CEffect_Container HRESULT Ready_Child(); HRESULT Bind_ShaderResources() override; virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; + void Set_BreathTime(_float fTime); + private: _wstring m_wstrEffectName = {}; diff --git a/Jusin154_Team3D/Editor/Public/Ranrok_Charge.h b/Jusin154_Team3D/Editor/Public/Ranrok_Charge.h new file mode 100644 index 000000000..aade59309 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Ranrok_Charge.h @@ -0,0 +1,56 @@ +#pragma once + +#include "Editor_Define.h" +#include "Effect_Container.h" + +NS_BEGIN(Engine) +NS_END + +NS_BEGIN(Editor) + +class CRanrok_Charge final : public CEffect_Container +{ +private: + CRanrok_Charge(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CRanrok_Charge(const CRanrok_Charge& rhs); + virtual ~CRanrok_Charge() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + +public: + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + HRESULT Ready_Child(); + HRESULT Bind_ShaderResources() override; + virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; +private: + _wstring m_wstrEffectName = {}; + + _bool m_isParticleEnd = {}; + + _float3 m_vLook = {}; + _float m_fLinearSpeed = 0.8f; + + _float4 m_vStartPos = { 0.f, 0.f, 0.f, 1.f }; + _float4 m_vTargetPos = { 0.f, 0.f, 10.f, 1.f }; +private: + class CInfoInstance* m_pInfoInstance = { nullptr }; +public: + static CRanrok_Charge* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual void Free() override; + CGameObject* Clone(void* pArg, CGameObject* pOwner) override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // DEBUG + + +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Ranrok_Pulse.h b/Jusin154_Team3D/Editor/Public/Ranrok_Pulse.h new file mode 100644 index 000000000..97659df47 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Ranrok_Pulse.h @@ -0,0 +1,55 @@ +#pragma once + +#include "Editor_Define.h" +#include "Effect_Container.h" + +NS_BEGIN(Engine) +NS_END + +NS_BEGIN(Editor) + +class CRanrok_Pulse final : public CEffect_Container +{ +private: + CRanrok_Pulse(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CRanrok_Pulse(const CRanrok_Pulse& rhs); + virtual ~CRanrok_Pulse() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + +public: + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + HRESULT Ready_Child(); + HRESULT Bind_ShaderResources() override; + virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; +private: + _wstring m_wstrEffectName = {}; + + + _float3 m_vLook = {}; + _float m_fLinearSpeed = 0.8f; + + _float4 m_vStartPos = { 0.f, 0.f, 0.f, 1.f }; + _float4 m_vTargetPos = { 0.f, 0.f, 10.f, 1.f }; +private: + class CInfoInstance* m_pInfoInstance = { nullptr }; +public: + static CRanrok_Pulse* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual void Free() override; + CGameObject* Clone(void* pArg, CGameObject* pOwner) override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // DEBUG + + +}; + +NS_END diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index 2b88a9ed5..34f87bd19 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -88,6 +88,7 @@ float g_fMBSampleBias; vector g_vLightDiffuse; vector g_vLightAmbient; vector g_vLightSpecular; +float g_fLightSpecularMaximum; float g_fFogDensity; float g_fFogPow; @@ -483,7 +484,7 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) float3 vAmbient = g_vLightAmbient.rgb * fTotalOcclusion * fAttenuation; float3 vFinalDiffuse = PBR_Out.vShade + vAmbient; - float3 vFinalSpecular = PBR_Out.vSpecular * g_vLightSpecular.rgb; + float3 vFinalSpecular = clamp(PBR_Out.vSpecular, 0.f, g_fLightSpecularMaximum) * g_vLightSpecular.rgb; Out.vShade = float4(vFinalDiffuse, 1.f); Out.vSpecular = float4(vFinalSpecular, 0.f); @@ -569,7 +570,7 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In) float3 vAmbient = g_vLightAmbient.rgb * fTotalOcclusion * fAttenuation; float3 vFinalDiffuse = PBR_Out.vShade + vAmbient; - float3 vFinalSpecular = PBR_Out.vSpecular * g_vLightSpecular.rgb; + float3 vFinalSpecular = clamp(PBR_Out.vSpecular, 0.f, g_fLightSpecularMaximum) * g_vLightSpecular.rgb; Out.vShade = float4(vFinalDiffuse, 1.f); Out.vSpecular = float4(vFinalSpecular, 0.f); @@ -670,7 +671,7 @@ PS_OUT_LIGHT PS_MAIN_SPOT(PS_IN In) float3 vAmbient = g_vLightAmbient.rgb * fTotalOcclusion * fAttenuation; float3 vFinalDiffuse = PBR_Out.vShade + vAmbient; - float3 vFinalSpecular = PBR_Out.vSpecular * g_vLightSpecular.rgb; + float3 vFinalSpecular = clamp(PBR_Out.vSpecular, 0.f, g_fLightSpecularMaximum) * g_vLightSpecular.rgb; Out.vShade = float4(vFinalDiffuse, 1.f); Out.vSpecular = float4(vFinalSpecular, 0.f); 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 6e54e5656..3cf999034 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl @@ -54,7 +54,7 @@ void CS_MAIN(uint3 DTid : SV_DispatchThreadID) int p = g_ParentBuffer[global]; while (p != -1) { - combined = mul(combined,g_LocalMatIn[p]); + combined = mul(combined, g_LocalMatIn[p]); p = g_ParentBuffer[p]; } diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl index 3762ddc67..d9811a801 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl @@ -59,6 +59,11 @@ struct ParticleValue float3 vWolrdOffset; float fLoopCount; /* 현재 몇번째 루프중인지 */ + float fRoundRangeLength; + float fAzimuthAngle; + float fPolarAngle; + float fRoundLengthLerpSpeed; + row_major matrix PreWorldMatrix; row_major matrix LocalMatrixInv; }; @@ -99,7 +104,7 @@ cbuffer g_ConstantBuffer : register(b0) // b0 << 이 숫자와 컨스턴트 쉐 bool isNoResetTime; bool isLocal_Located_Not_TakeDelay; bool isCompute_LocalInverse; - bool isPadding2; + bool isRoundLengthLerp; float fTimeDelta; float fSizeLerpOption; // 반드시 상수버퍼는 16바이트 배수로 만들어져야 한다. @@ -160,6 +165,7 @@ void CS_MAIN( if (isNoPos) { + particle.vTranslation.xyz += WorldMatrix[3].xyz; /* 월드 오프셋 */ @@ -170,6 +176,21 @@ void CS_MAIN( } } + if (isRoundLengthLerp == true) + { + if (particleValue.vDelay.x < particleValue.vDelay.y) + { + float3 vRoundRange = float3( + particleValue.fRoundRangeLength * cos(particleValue.fAzimuthAngle) * sin(particleValue.fPolarAngle), + particleValue.fRoundRangeLength * sin(particleValue.fAzimuthAngle) * sin(particleValue.fPolarAngle), + particleValue.fRoundRangeLength * cos(particleValue.fPolarAngle)); + + + particleValue.vOriginTranslation.xyz += particleValue.fRoundLengthLerpSpeed * vRoundRange * fTimeDelta; + particle.vTranslation.xyz += particleValue.fRoundLengthLerpSpeed * vRoundRange * fTimeDelta; + + } + } particleValue.vDelay.x += fTimeDelta; if (particleValue.vDelay.x < particleValue.vDelay.y) @@ -271,6 +292,7 @@ void CS_MAIN( return ; } + if (isDrop == true) { diff --git a/Jusin154_Team3D/Engine/Private/Character_Controller.cpp b/Jusin154_Team3D/Engine/Private/Character_Controller.cpp index e5d350063..7a353902f 100644 --- a/Jusin154_Team3D/Engine/Private/Character_Controller.cpp +++ b/Jusin154_Team3D/Engine/Private/Character_Controller.cpp @@ -451,7 +451,7 @@ void CCharacter_Controller::Free() #ifdef _DEBUG void CCharacter_Controller::Describe_Entity() { - GUI::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); if (GUI::CollapsingHeader("Character_Controller") ){ GUI::Text("Gravity : %d ", m_bGravity); m_pTransform->Describe_Entity(); diff --git a/Jusin154_Team3D/Engine/Private/Collider.cpp b/Jusin154_Team3D/Engine/Private/Collider.cpp index d90884c65..41e264c14 100644 --- a/Jusin154_Team3D/Engine/Private/Collider.cpp +++ b/Jusin154_Team3D/Engine/Private/Collider.cpp @@ -28,10 +28,14 @@ CCollider::CCollider(const CCollider& rhs) #endif } +#ifdef _DEBUG void CCollider::Set_Desc(void* pDesc) { m_pBounding->Set_Desc(pDesc); } +#endif // _DEBUG + + HRESULT CCollider::Initialize_Prototype() { diff --git a/Jusin154_Team3D/Engine/Private/ComputeShader.cpp b/Jusin154_Team3D/Engine/Private/ComputeShader.cpp index 9c5ea8a5c..0b0e9bfee 100644 --- a/Jusin154_Team3D/Engine/Private/ComputeShader.cpp +++ b/Jusin154_Team3D/Engine/Private/ComputeShader.cpp @@ -51,6 +51,7 @@ HRESULT CComputeShader::Initialize_Prototype(const _tchar* pShaderFilePath, cons #else HLSLFlags = D3DCOMPILE_OPTIMIZATION_LEVEL1; #endif // _DEBUG + ID3DBlob* pErrorBlob = nullptr; HRESULT hr = D3DCompileFromFile(pShaderFilePath, nullptr, @@ -60,7 +61,18 @@ HRESULT CComputeShader::Initialize_Prototype(const _tchar* pShaderFilePath, cons HLSLFlags, 0, &m_pCSBlob, - nullptr); + &pErrorBlob); + + if (FAILED(hr)) + { +#ifdef _DEBUG + + if (pErrorBlob) + OutputDebugStringA((char*)pErrorBlob->GetBufferPointer()); +#endif // DEBUG + + return E_FAIL; + } return S_OK; diff --git a/Jusin154_Team3D/Engine/Private/Dynamic_D6Joint.cpp b/Jusin154_Team3D/Engine/Private/Dynamic_D6Joint.cpp index 3d27eb965..59fcb6f7c 100644 --- a/Jusin154_Team3D/Engine/Private/Dynamic_D6Joint.cpp +++ b/Jusin154_Team3D/Engine/Private/Dynamic_D6Joint.cpp @@ -20,7 +20,7 @@ HRESULT CDynamic_D6Joint::Initialize_Prototype() HRESULT CDynamic_D6Joint::Initialize(void* pArg) { DYNAMICJOINT_DESC* pDesc = static_cast(pArg); - m_pJoint = m_pGameInstance->Create_PxD6Joint(pDesc->pActor0, pDesc->pActor1, *pDesc->pxJointWorldPos); + m_pJoint = m_pGameInstance->Create_BasicPxD6Joint(pDesc->pActor0, pDesc->pActor1, *pDesc->pxJointWorldPos); return S_OK; } #ifdef _DEBUG diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index c0c93c7f2..b19fbb64d 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -53,7 +53,7 @@ HRESULT CGameInstance::Initialize_Engine(const ENGINE_DESC& EngineDesc, ID3D11De } #ifdef _DEBUG #ifdef 기무리 - m_pThreadHolder = CThreadHolder::Create(12); + m_pThreadHolder = CThreadHolder::Create(8); #elif Bin m_pThreadHolder = CThreadHolder::Create(8); #else @@ -396,7 +396,7 @@ void CGameInstance::Compute_FrameCount() #endif // _DEBUG } -void CGameInstance::Present_TimeCost() const +void CGameInstance::Present_TimeCost() { #pragma region TimeCost #ifdef _DEBUG @@ -409,7 +409,7 @@ void CGameInstance::Present_TimeCost() const + m_fTimer_PhysX + m_fTimer_Level; - GUI::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); GUI::Begin("Previous_Frame_Timer", 0, IMGUI_GLOBAL_BEGIN_FLAG); if (GUI::CollapsingHeader("Detail")) @@ -444,138 +444,148 @@ void CGameInstance::Present_TimeCost() const GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); GUI::Text("Level %d", int(m_fTimer_Level / fTotal * 100.f)); } - if (GUI::IsPopupOpen("Renderer_Timer")) + if (GUI::Button("Renderer_Timer")) { - if (GUI::BeginPopup("Renderer_Timer")) { - _float fRenderer_Total = m_fTimer_Render_Priority - + m_fTimer_Render_Shadow - + m_fTimer_Render_NonBlend - + m_fTimer_Render_SSAO - + m_fTimer_Render_SSAO_BLUR - + m_fTimer_Render_LightAcc - + m_fTimer_Render_Blur - + m_fTimer_Render_Combined - + m_fTimer_Render_Occlusion - + m_fTimer_Render_EnvironmentPostProcess - + m_fTimer_Render_Fog - + m_fTimer_Render_Effect - + m_fTimer_Render_NonLight - + m_fTimer_Render_Blend - + m_fTimer_Render_WeightBlend - + m_fTimer_Render_PostProcessing - + m_fTimer_Render_LastColor - + m_fTimer_Render_Tone_Mapping - + m_fTimer_Render_UI - + m_fTimer_Render_UI_Overley; + m_bRendererTimerOpen = !m_bRendererTimerOpen; + } + if (m_bRendererTimerOpen) + { + GUI::SetNextWindowSize(ImVec2(320.f, 0.f), ImGuiCond_FirstUseEver); + + if (GUI::Begin("Renderer_Timer", &m_bRendererTimerOpen, ImGuiWindowFlags_AlwaysAutoResize)) { - GUI::ProgressBar(m_fTimer_Render_Priority / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_Priority %d", int(m_fTimer_Render_Priority / fRenderer_Total * 100.f)); + _float fRenderer_Total = m_fTimer_Render_Priority + + m_fTimer_Render_Shadow + + m_fTimer_Render_NonBlend + + m_fTimer_Render_SSAO + + m_fTimer_Render_SSAO_BLUR + + m_fTimer_Render_LightAcc + + m_fTimer_Render_Blur + + m_fTimer_Render_Combined + + m_fTimer_Render_Occlusion + + m_fTimer_Render_EnvironmentPostProcess + + m_fTimer_Render_Fog + + m_fTimer_Render_Effect + + m_fTimer_Render_NonLight + + m_fTimer_Render_Blend + + m_fTimer_Render_WeightBlend + + m_fTimer_Render_PostProcessing + + m_fTimer_Render_LastColor + + m_fTimer_Render_Tone_Mapping + + m_fTimer_Render_UI + + m_fTimer_Render_UI_Overley; + + // 0으로 나눔 방지 + if (fRenderer_Total <= FLT_EPSILON) + fRenderer_Total = 1.f; + + { + GUI::ProgressBar(m_fTimer_Render_Priority / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_Priority %d", int(m_fTimer_Render_Priority / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_Shadow / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_Shadow %d", int(m_fTimer_Render_Shadow / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_NonBlend / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_NonBlend %d", int(m_fTimer_Render_NonBlend / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_SSAO / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_SSAO %d", int(m_fTimer_Render_SSAO / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_SSAO_BLUR / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_SSAO_BLUR %d", int(m_fTimer_Render_SSAO_BLUR / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_LightAcc / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_LightAcc %d", int(m_fTimer_Render_LightAcc / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_Blur / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_Blur %d", int(m_fTimer_Render_Blur / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_Combined / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_Combined %d", int(m_fTimer_Render_Combined / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_Occlusion / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_Occlusion %d", int(m_fTimer_Render_Occlusion / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_EnvironmentPostProcess / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_EnvironmentPostProcess %d", int(m_fTimer_Render_EnvironmentPostProcess / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_Fog / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_Fog %d", int(m_fTimer_Render_Fog / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_Effect / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_Effect %d", int(m_fTimer_Render_Effect / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_NonLight / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_NonLight %d", int(m_fTimer_Render_NonLight / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_Blend / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_Blend %d", int(m_fTimer_Render_Blend / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_WeightBlend / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_WeightBlend %d", int(m_fTimer_Render_WeightBlend / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_PostProcessing / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_PostProcessing %d", int(m_fTimer_Render_PostProcessing / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_LastColor / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_LastColor %d", int(m_fTimer_Render_LastColor / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_Tone_Mapping / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_Tone_Mapping %d", int(m_fTimer_Render_Tone_Mapping / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_UI / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_UI %d", int(m_fTimer_Render_UI / fRenderer_Total * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Render_UI_Overley / fRenderer_Total, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Render_UI_Overley %d", int(m_fTimer_Render_UI_Overley / fRenderer_Total * 100.f)); + } } - { - GUI::ProgressBar(m_fTimer_Render_Shadow / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_Shadow %d", int(m_fTimer_Render_Shadow / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_NonBlend / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_NonBlend %d", int(m_fTimer_Render_NonBlend / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_SSAO / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_SSAO %d", int(m_fTimer_Render_SSAO / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_SSAO_BLUR / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_SSAO_BLUR %d", int(m_fTimer_Render_SSAO_BLUR / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_LightAcc / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_LightAcc %d", int(m_fTimer_Render_LightAcc / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_Blur / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_Blur %d", int(m_fTimer_Render_Blur / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_Combined / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_Combined %d", int(m_fTimer_Render_Combined / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_Occlusion / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_Occlusion %d", int(m_fTimer_Render_Occlusion / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_EnvironmentPostProcess / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_EnvironmentPostProcess %d", int(m_fTimer_Render_EnvironmentPostProcess / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_Fog / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_Fog %d", int(m_fTimer_Render_Fog / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_Effect / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_Effect %d", int(m_fTimer_Render_Effect / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_NonLight / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_NonLight %d", int(m_fTimer_Render_NonLight / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_Blend / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_Blend %d", int(m_fTimer_Render_Blend / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_WeightBlend / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_WeightBlend %d", int(m_fTimer_Render_WeightBlend / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_PostProcessing / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_PostProcessing %d", int(m_fTimer_Render_PostProcessing / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_LastColor / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_LastColor %d", int(m_fTimer_Render_LastColor / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_Tone_Mapping / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_Tone_Mapping %d", int(m_fTimer_Render_Tone_Mapping / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_UI / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_UI %d", int(m_fTimer_Render_UI / fRenderer_Total * 100.f)); - } - { - GUI::ProgressBar(m_fTimer_Render_UI_Overley / fRenderer_Total, ImVec2(200.f, 0.f)); - GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); - GUI::Text("Render_UI_Overley %d", int(m_fTimer_Render_UI_Overley / fRenderer_Total * 100.f)); - } - GUI::EndPopup(); - } + + GUI::End(); + } { GUI::ProgressBar(m_fTimer_DrawCall / fTotal, ImVec2(200.f, 0.f)); - GUI::SameLine(); - if (GUI::SmallButton("Renderer_Timer")) { - GUI::OpenPopup("Renderer_Timer"); - } GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); GUI::Text("DrawCall %d", int(m_fTimer_DrawCall / fTotal * 100.f)); } @@ -1059,9 +1069,9 @@ PSX::PxJoint* CGameInstance::Create_PxJoint(PHYSX_JOINT eType, PSX::PxRigidActor { 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) +PSX::PxD6Joint* CGameInstance::Create_BasicPxD6Joint(PSX::PxRigidDynamic* pActor0, PSX::PxRigidDynamic* pActor1, const PSX::PxTransform& pxJointWorldPos) { - return m_pPhysX_Manager->Create_PxD6Joint(pActor0, pActor1, pxJointWorldPos); + return m_pPhysX_Manager->Create_BasicPxD6Joint(pActor0, pActor1, pxJointWorldPos); } _bool CGameInstance::SphereCast(_float fRadius, _float3 vStartPos, _float3 vDir, _float fDistance, PSX::PxHitFlags flagHitsData, PSX::PxQueryFlags flagQuery, PSX::PxSweepBuffer& hitBuffer) { diff --git a/Jusin154_Team3D/Engine/Private/GameObject.cpp b/Jusin154_Team3D/Engine/Private/GameObject.cpp index 1066bd828..62e6697a1 100644 --- a/Jusin154_Team3D/Engine/Private/GameObject.cpp +++ b/Jusin154_Team3D/Engine/Private/GameObject.cpp @@ -60,6 +60,9 @@ void CGameObject::OnCollision(CGameObject* pOther , void* pDesc) void CGameObject::OnHit(CGameObject* pOther, CGameObject* pCaller) { } +void CGameObject::OnRayCollision(CGameObject* pCaster, _uint iCastedOrder, _float fDistance, _float3 vCastedWorldPos) +{ +} _vector CGameObject::Get_WorldPostion() { return m_pTransformCom->Get_State(STATE::POSITION); diff --git a/Jusin154_Team3D/Engine/Private/Instance_Model.cpp b/Jusin154_Team3D/Engine/Private/Instance_Model.cpp index 7b026d367..066d8fb4b 100644 --- a/Jusin154_Team3D/Engine/Private/Instance_Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Instance_Model.cpp @@ -581,18 +581,17 @@ void CInstance_Model::Compute_CS(_float fTimeDelta) pDesc->isNoResetTime = m_InstanceDesc.isNoResetTime; pDesc->isLocal_Located_Not_TakeDelay = m_InstanceDesc.isLocal_Located_Not_TakeDelay; pDesc->isCompute_LocalInverse = m_InstanceDesc.isCompute_LocalInverse; - - - pDesc->WorldMatrix = *m_pOwner->Get_Component()->Get_WorldMatrixPtr(); + pDesc->isRoundLengthLerp = m_InstanceDesc.isRoundLengthLerp; + pDesc->fSizeLerpOption = m_InstanceDesc.fSizeLerpOption; pDesc->fMoveLerpOption = m_InstanceDesc.fMoveLerpOption; - pDesc->ViewMatrix = *m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW); - pDesc->ProjMatrix = *m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ); pDesc->fFar = *m_pGameInstance->Get_CurrentCameraFar(); pDesc->vScreenSize = m_pGameInstance->Get_ViewPortSize(); - + memcpy(&pDesc->WorldMatrix, m_pOwner->Get_Component()->Get_WorldMatrixPtr(), sizeof(_float4x4)); + memcpy(&pDesc->ViewMatrix, m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW), sizeof(_float4x4)); + memcpy(&pDesc->ProjMatrix, m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ), sizeof(_float4x4)); m_pContext->Unmap(m_pConstantBuffer, 0); } @@ -697,6 +696,12 @@ void CInstance_Model::Instane_Buffer_ReStruct() + fRoundRange * cosf(XMConvertToRadians(fPolarAngle)), 1.f); + + pParticleValues[i].fRoundRangeLength = fRoundRange; + pParticleValues[i].fAzimuthAngle = XMConvertToRadians(fAzimuthAngle); + pParticleValues[i].fPolarAngle = XMConvertToRadians(fPolarAngle); + pParticleValues[i].fRoundLengthLerpSpeed = m_InstanceDesc.fRoundLengthLerpSpeed; + _float3 vSinAmount = _float3( m_pGameInstance->Random_Float(m_InstanceDesc.vSinMinAmount.x, m_InstanceDesc.vSinMaxAmount.x), @@ -876,14 +881,14 @@ void CInstance_Model::Free() void CInstance_Model::Describe_Entity() { - if (ImGui::TreeNode("Model Option")) + if (GUI::TreeNode("Model Option")) { const char* pLerp[] = { "Linear" , "EaseInQuad", "EaseOutQuad", "EaseInCubic" , "EaseOutCubic" , "EaseInOutSin" , "EaseInBack" , "Expo" , "Circle" }; - ImGui::Separator(); ImGui::Spacing(); - ImGui::PushItemWidth(120); + GUI::Separator(); GUI::Spacing(); + GUI::PushItemWidth(120); - if (ImGui::InputInt("NumInstance", &m_InstanceDesc.iNumInstance)) + if (GUI::InputInt("NumInstance", &m_InstanceDesc.iNumInstance)) { Change_NumInstance(); } @@ -922,65 +927,100 @@ void CInstance_Model::Describe_Entity() } - if (GUI::TreeNode("Transform")) { - if (ImGui::DragFloat3("Center", reinterpret_cast<_float*>(&m_InstanceDesc.vCenter))) + if (GUI::DragFloat3("Center", reinterpret_cast<_float*>(&m_InstanceDesc.vCenter))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat3("Range", reinterpret_cast<_float*>(&m_InstanceDesc.vRange))) + if (GUI::DragFloat3("Range", reinterpret_cast<_float*>(&m_InstanceDesc.vRange))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat3("SizeMin", reinterpret_cast<_float*>(&m_InstanceDesc.vSizeMin))) + if (GUI::DragFloat3("SizeMin", reinterpret_cast<_float*>(&m_InstanceDesc.vSizeMin))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat3("SizeMax", reinterpret_cast<_float*>(&m_InstanceDesc.vSizeMax))) + if (GUI::DragFloat3("SizeMax", reinterpret_cast<_float*>(&m_InstanceDesc.vSizeMax))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat3("RotationMin", reinterpret_cast<_float*>(&m_InstanceDesc.vRotationAngleMin))) + if (GUI::DragFloat3("RotationMin", reinterpret_cast<_float*>(&m_InstanceDesc.vRotationAngleMin))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat3("RotationMax", reinterpret_cast<_float*>(&m_InstanceDesc.vRotationAngleMax))) + if (GUI::DragFloat3("RotationMax", reinterpret_cast<_float*>(&m_InstanceDesc.vRotationAngleMax))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat2("RoundRangeLength", reinterpret_cast<_float*>(&m_InstanceDesc.vRoundRangeLength))) + + if (GUI::DragFloat2("RoundRangeLength", reinterpret_cast<_float*>(&m_InstanceDesc.vRoundRangeLength))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat2("AzimuthAngle", reinterpret_cast<_float*>(& m_InstanceDesc.vAzimuthAngle))) + if (GUI::DragFloat2("AzimuthAngle", reinterpret_cast<_float*>(& m_InstanceDesc.vAzimuthAngle))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat2("PolarAngle", reinterpret_cast<_float*>(&m_InstanceDesc.vPolarAngle))) + if (GUI::DragFloat2("PolarAngle", reinterpret_cast<_float*>(&m_InstanceDesc.vPolarAngle))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat3("WolrdOffsetMin", reinterpret_cast<_float*>(&m_InstanceDesc.vWolrdOffsetMin))) + + if (GUI::DragFloat3("WolrdOffsetMin", reinterpret_cast<_float*>(&m_InstanceDesc.vWolrdOffsetMin))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat3("WolrdOffsetMax", reinterpret_cast<_float*>(&m_InstanceDesc.vWolrdOffsetMax))) + if (GUI::DragFloat3("WolrdOffsetMax", reinterpret_cast<_float*>(&m_InstanceDesc.vWolrdOffsetMax))) { Instane_Buffer_ReStruct(); } + + if (GUI::TreeNode("Round Range")) + { + + + if (ImGui::DragFloat2("RoundRangeLength", reinterpret_cast<_float*>(&m_InstanceDesc.vRoundRangeLength))) + { + Instane_Buffer_ReStruct(); + } + + if (ImGui::DragFloat2("AzimuthAngle", reinterpret_cast<_float*>(&m_InstanceDesc.vAzimuthAngle))) + { + Instane_Buffer_ReStruct(); + } + + if (ImGui::DragFloat2("PolarAngle", reinterpret_cast<_float*>(&m_InstanceDesc.vPolarAngle))) + { + Instane_Buffer_ReStruct(); + } + + if (GUI::Checkbox("RoundLengthLerp", &m_InstanceDesc.isRoundLengthLerp)) + { + Instane_Buffer_ReStruct(); + } + + + if (ImGui::DragFloat("fRoundLengthLerpSpeed", reinterpret_cast<_float*>(&m_InstanceDesc.fRoundLengthLerpSpeed))) + { + Instane_Buffer_ReStruct(); + } + + GUI::TreePop(); + } + GUI::TreePop(); } @@ -989,34 +1029,34 @@ void CInstance_Model::Describe_Entity() { _int iMoveLerpOption = (_int)m_InstanceDesc.fMoveLerpOption; - if (ImGui::Combo("Move Lerp Option", &iMoveLerpOption, pLerp, 9)) + if (GUI::Combo("Move Lerp Option", &iMoveLerpOption, pLerp, 9)) { Instane_Buffer_ReStruct(); m_InstanceDesc.fMoveLerpOption = (_float)iMoveLerpOption; } - if (ImGui::DragFloat2("Speed", reinterpret_cast<_float*>(&m_InstanceDesc.vSpeed))) + if (GUI::DragFloat2("Speed", reinterpret_cast<_float*>(&m_InstanceDesc.vSpeed))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat2("Drag", reinterpret_cast<_float*>(&m_InstanceDesc.vDrag))) + if (GUI::DragFloat2("Drag", reinterpret_cast<_float*>(&m_InstanceDesc.vDrag))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat2("Acceleration", reinterpret_cast<_float*>(&m_InstanceDesc.vAcceleration))) + if (GUI::DragFloat2("Acceleration", reinterpret_cast<_float*>(&m_InstanceDesc.vAcceleration))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat3("VelocityMin", reinterpret_cast<_float*>(&m_InstanceDesc.vVelocityMin))) + if (GUI::DragFloat3("VelocityMin", reinterpret_cast<_float*>(&m_InstanceDesc.vVelocityMin))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat3("VelocityMax", reinterpret_cast<_float*>(&m_InstanceDesc.vVelocityMax))) + if (GUI::DragFloat3("VelocityMax", reinterpret_cast<_float*>(&m_InstanceDesc.vVelocityMax))) { Instane_Buffer_ReStruct(); } @@ -1057,12 +1097,12 @@ void CInstance_Model::Describe_Entity() Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat3("PivotMin", reinterpret_cast<_float*>(&m_InstanceDesc.vPivotMin))) + if (GUI::DragFloat3("PivotMin", reinterpret_cast<_float*>(&m_InstanceDesc.vPivotMin))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat3("PivotMax", reinterpret_cast<_float*>(&m_InstanceDesc.vPivotMax))) + if (GUI::DragFloat3("PivotMax", reinterpret_cast<_float*>(&m_InstanceDesc.vPivotMax))) { Instane_Buffer_ReStruct(); } @@ -1078,12 +1118,12 @@ void CInstance_Model::Describe_Entity() Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat2("Gravity", reinterpret_cast<_float*>(&m_InstanceDesc.vGravity))) + if (GUI::DragFloat2("Gravity", reinterpret_cast<_float*>(&m_InstanceDesc.vGravity))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat2("DropAttenuation", reinterpret_cast<_float*>(&m_InstanceDesc.vDropAttenuation))) + if (GUI::DragFloat2("DropAttenuation", reinterpret_cast<_float*>(&m_InstanceDesc.vDropAttenuation))) { Instane_Buffer_ReStruct(); } @@ -1097,17 +1137,17 @@ void CInstance_Model::Describe_Entity() if (GUI::TreeNode("Rotate")) { - if (ImGui::DragFloat2("RotationSpeed", reinterpret_cast<_float*>(&m_InstanceDesc.vRotationSpeed))) + if (GUI::DragFloat2("RotationSpeed", reinterpret_cast<_float*>(&m_InstanceDesc.vRotationSpeed))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat2("RotateAttenuation", reinterpret_cast<_float*>(&m_InstanceDesc.vRotateAttenuation))) + if (GUI::DragFloat2("RotateAttenuation", reinterpret_cast<_float*>(&m_InstanceDesc.vRotateAttenuation))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat2("RotateAttDelay", reinterpret_cast<_float*>(&m_InstanceDesc.vRotateAttDelay))) + if (GUI::DragFloat2("RotateAttDelay", reinterpret_cast<_float*>(&m_InstanceDesc.vRotateAttDelay))) { Instane_Buffer_ReStruct(); } @@ -1121,12 +1161,12 @@ void CInstance_Model::Describe_Entity() Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat3("DeltaAngleMin", reinterpret_cast<_float*>(&m_InstanceDesc.vDeltaAngleMin))) + if (GUI::DragFloat3("DeltaAngleMin", reinterpret_cast<_float*>(&m_InstanceDesc.vDeltaAngleMin))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat3("DeltaAngleMax", reinterpret_cast<_float*>(&m_InstanceDesc.vDeltaAngleMax))) + if (GUI::DragFloat3("DeltaAngleMax", reinterpret_cast<_float*>(&m_InstanceDesc.vDeltaAngleMax))) { Instane_Buffer_ReStruct(); } @@ -1146,12 +1186,12 @@ void CInstance_Model::Describe_Entity() - if (ImGui::DragFloat3("DeltaAxisAngleMin", reinterpret_cast<_float*>(&m_InstanceDesc.vDeltaAxisAngleMin))) + if (GUI::DragFloat3("DeltaAxisAngleMin", reinterpret_cast<_float*>(&m_InstanceDesc.vDeltaAxisAngleMin))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat3("DeltaAxisAngleMax", reinterpret_cast<_float*>(&m_InstanceDesc.vDeltaAxisAngleMax))) + if (GUI::DragFloat3("DeltaAxisAngleMax", reinterpret_cast<_float*>(&m_InstanceDesc.vDeltaAxisAngleMax))) { Instane_Buffer_ReStruct(); } @@ -1169,12 +1209,12 @@ void CInstance_Model::Describe_Entity() Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat3("SinWaveMin", reinterpret_cast<_float*>(&m_InstanceDesc.vSinMinAmount))) + if (GUI::DragFloat3("SinWaveMin", reinterpret_cast<_float*>(&m_InstanceDesc.vSinMinAmount))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat3("SinWaveMax", reinterpret_cast<_float*>(&m_InstanceDesc.vSinMaxAmount))) + if (GUI::DragFloat3("SinWaveMax", reinterpret_cast<_float*>(&m_InstanceDesc.vSinMaxAmount))) { Instane_Buffer_ReStruct(); } @@ -1197,19 +1237,19 @@ void CInstance_Model::Describe_Entity() _int iSizeLerpOption = (_int)m_InstanceDesc.fSizeLerpOption; - if (ImGui::Combo("Size Lerp Option", &iSizeLerpOption, pLerp, 9)) + if (GUI::Combo("Size Lerp Option", &iSizeLerpOption, pLerp, 9)) { Instane_Buffer_ReStruct(); m_InstanceDesc.fSizeLerpOption = (_float)iSizeLerpOption; } - if (ImGui::DragFloat3("LerpSizeAmount", reinterpret_cast<_float*>(&m_InstanceDesc.vDeltaSize))) + if (GUI::DragFloat3("LerpSizeAmount", reinterpret_cast<_float*>(&m_InstanceDesc.vDeltaSize))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat2("Size Drag", reinterpret_cast<_float*>(&m_InstanceDesc.vSizeDrag))) + if (GUI::DragFloat2("Size Drag", reinterpret_cast<_float*>(&m_InstanceDesc.vSizeDrag))) { Instane_Buffer_ReStruct(); } @@ -1227,53 +1267,53 @@ void CInstance_Model::Describe_Entity() Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat("TimeMult", reinterpret_cast<_float*>(&m_InstanceDesc.fTimeMult))) + if (GUI::DragFloat("TimeMult", reinterpret_cast<_float*>(&m_InstanceDesc.fTimeMult))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat2("LifeTime", reinterpret_cast<_float*>(&m_InstanceDesc.vLifeTime))) + if (GUI::DragFloat2("LifeTime", reinterpret_cast<_float*>(&m_InstanceDesc.vLifeTime))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat2("Delay", reinterpret_cast<_float*>(&m_InstanceDesc.vDelay))) + if (GUI::DragFloat2("Delay", reinterpret_cast<_float*>(&m_InstanceDesc.vDelay))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat2("DiffuseUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vDiffuseUVMoveTime))) + if (GUI::DragFloat2("DiffuseUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vDiffuseUVMoveTime))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat2("MaskingUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vMaskingUVMoveTime))) + if (GUI::DragFloat2("MaskingUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vMaskingUVMoveTime))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat2("DistortionUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vDistortionUVMoveTime))) + if (GUI::DragFloat2("DistortionUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vDistortionUVMoveTime))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat2("NoiseUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vNoiseUVMoveTime))) + if (GUI::DragFloat2("NoiseUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vNoiseUVMoveTime))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat2("DissolveUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vDissolveUVMoveTime))) + if (GUI::DragFloat2("DissolveUVMoveTime", reinterpret_cast<_float*>(&m_InstanceDesc.vDissolveUVMoveTime))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat2("AniTime", reinterpret_cast<_float*>(&m_InstanceDesc.vAniTime))) + if (GUI::DragFloat2("AniTime", reinterpret_cast<_float*>(&m_InstanceDesc.vAniTime))) { Instane_Buffer_ReStruct(); } - if (ImGui::DragFloat2("AniIndex", reinterpret_cast<_float*>(&m_InstanceDesc.vAniIndex))) + if (GUI::DragFloat2("AniIndex", reinterpret_cast<_float*>(&m_InstanceDesc.vAniIndex))) { Instane_Buffer_ReStruct(); } @@ -1302,11 +1342,11 @@ void CInstance_Model::Describe_Entity() - ImGui::PopItemWidth(); - ImGui::TreePop(); + GUI::PopItemWidth(); + GUI::TreePop(); } - ImGui::Separator(); + GUI::Separator(); } #endif // _DEBUG diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index 3d85f02d5..d491281dc 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -229,6 +229,25 @@ _bool CModel::Play_Anim(_float fTimeDelta, CTransform* pTransform) } } + if (m_bQueuedAnim) + { + if (m_fRatio >= 1.f) + { + m_fRatio = 1.f; + m_iPreAnimIndex = m_iCurrentAnimIndex; + m_fBlendTime = 0.f; + + if (m_iQueuedAnimIndex != -1) + { + _int next = m_iQueuedAnimIndex; + _bool loop = m_bQueuedLoop; + m_iQueuedAnimIndex = -1; + + Set_AnimationIndex(next, loop,m_fAmount,m_bRatio,1.f,false); + } + } + } + return m_bIsFinishedAnim; } @@ -362,11 +381,28 @@ _bool CModel::Play_Dual_Anim(_float fTimeDelta, CTransform* pTransform) return m_bIsFinishedAnim; } -void CModel::Set_AnimationIndex(_uint iIndex, _bool isLoop, _float fAmount, _bool bRatio, _float fAnimSpeed,_bool bRootBone) +_bool CModel::IsBlending() const { + return m_iPreAnimIndex != m_iCurrentAnimIndex && + m_fRatio < 1.f; +} + + +void CModel::Set_AnimationIndex(_uint iIndex, _bool isLoop, _float fAmount, _bool bRatio, _float fAnimSpeed,_bool bRootBone,_bool bQueuedAnim) +{ + m_bQueuedAnim = bQueuedAnim; if (m_iCurrentAnimIndex == iIndex) return; + if (bQueuedAnim) { + if (IsBlending()) + { + m_iQueuedAnimIndex = iIndex; + m_bQueuedLoop = isLoop; + return; + } + } + if (iIndex >= 0 && iIndex < m_iNumAnimations) { m_vPrevRootPos = { 0.f, 0.f, 0.f }; @@ -459,14 +495,16 @@ void CModel::Update_RootBone(_float Amount) _vector vDeltaWorld = vRight * dx + (vUp * dz) + (-vLook * dy); - if(!m_bTemp) + if (!m_bDisableRootMotionScale) { vDeltaWorld *= 0.01f; + } vDeltaWorld *= Amount; vDeltaWorld = XMVectorSetW(vDeltaWorld, 1.f); - if(m_bRootBone) + if (m_bRootBone) { m_pTransform->AccumulateMomentum(vDeltaWorld); + } m_vPrevRootPos = vCurRootPos; @@ -497,9 +535,9 @@ void CModel::Update_RootBone(_float Amount) XMStoreFloat4(&axis, axisWorld); swap(axis.z, axis.y); - if (m_bRootBone) + if (m_bRootBone) { m_pTransform->TurnAngle(XMLoadFloat4(&axis), angle); - + } } XMStoreFloat4(&m_vPrevRootRot, qCur); @@ -568,8 +606,8 @@ void CModel::Apply_CPU_HeadAim() m_Bones[headIdx]->Set_TransformationMatrix(newLocal); - Mark_CPUChain(headIdx); - Apply_CPUMask_ToBones(); + //Mark_CPUChain(headIdx); + //Apply_CPUMask_ToBones(); } @@ -1458,7 +1496,7 @@ void CModel::InItialize_BoneIndex() { m_iBoneIndex[ENUM_CLASS(BLEND_BONE::NECK)] = i; } - if (m_Bones[i]->Compare_Name("head")) + if (m_Bones[i]->Compare_Name("neck_06")) { m_iBoneIndex[ENUM_CLASS(BLEND_BONE::HEAD)] = i; } @@ -1892,6 +1930,8 @@ void CModel::ComputeAnimation(_uint AnimIndex,_uint MeshIndex) void CModel::ComputeLocal(_uint AnimIndex, _uint MeshIndex) { + if (m_iPreAnimIndex < 0 || m_iPreAnimIndex >= (_int)m_iNumAnimations) + m_iPreAnimIndex = m_iCurrentAnimIndex; D3D11_MAPPED_SUBRESOURCE ConstantSubResource = {}; diff --git a/Jusin154_Team3D/Engine/Private/Mouse_Manager.cpp b/Jusin154_Team3D/Engine/Private/Mouse_Manager.cpp index f4acfb16b..49140c5c8 100644 --- a/Jusin154_Team3D/Engine/Private/Mouse_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/Mouse_Manager.cpp @@ -205,13 +205,13 @@ void CMouse_Manager::Free() void CMouse_Manager::Describe_Entity() { GUI::Begin("SYSTEM", 0, IMGUI_GLOBAL_BEGIN_FLAG); - GUI::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); if (GUI::CollapsingHeader("Mouse_Manager")) { GUI::Text("AccumulateMomentum %.2f, %.2f", m_vMove.x, m_vMove.y); GUI::Text("CurPos %d, %d", m_ptCurrentMouseCur.x, m_ptCurrentMouseCur.y); GUI::Text("Lock %d", m_bLockMouseToCenter); POINT pt = Get_MouseViewPortPos(); - ImGuiIO& io = ImGui::GetIO(); + ImGuiIO& io = GUI::GetIO(); GUI::Text("IMGUI MousePos: %.1f, %.1f", io.MousePos.x, io.MousePos.y); //io.MousePos = ImVec2((float)pt.x, (float)pt.y); GUI::Text("VPPOS: %d, %d", pt.x, pt.y); diff --git a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp index 36d6242da..a6a4cc748 100644 --- a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp @@ -177,7 +177,7 @@ PSX::PxJoint* CPhysX_Manager::Create_PxJoint(PHYSX_JOINT eType, PSX::PxRigidActo return pOut; } -PSX::PxD6Joint* CPhysX_Manager::Create_PxD6Joint(PSX::PxRigidDynamic* pActor0, PSX::PxRigidDynamic* pActor1, const PSX::PxTransform& pxJointWorldPos) +PSX::PxD6Joint* CPhysX_Manager::Create_BasicPxD6Joint(PSX::PxRigidDynamic* pActor0, PSX::PxRigidDynamic* pActor1, const PSX::PxTransform& pxJointWorldPos) { const PSX::PxTransform pxWorldParentPos = pActor0->getGlobalPose(); const PSX::PxTransform pxWorldChildPos = pActor1->getGlobalPose(); @@ -206,12 +206,11 @@ PSX::PxD6Joint* CPhysX_Manager::Create_PxD6Joint(PSX::PxRigidDynamic* pActor0, P 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->setTwistLimit(PSX::PxJointAngularLimitPair(-XMConvertToRadians(1.f), XMConvertToRadians(1.f))); // 20도 + pJoint->setSwingLimit(PSX::PxJointLimitCone(XMConvertToRadians(1.f), XMConvertToRadians(1.f))); - pJoint->setDrive(PSX::PxD6Drive::eSLERP, PSX::PxD6JointDrive(50.0f, 10.0f, FLT_MAX, true)); + pJoint->setDrive(PSX::PxD6Drive::eSLERP, PSX::PxD6JointDrive(50.0f, 100.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); diff --git a/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp b/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp index ed23bf69d..b43dd1d2c 100644 --- a/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/RenderTarget_Manager.cpp @@ -584,7 +584,7 @@ void CRenderTarget_Manager::RenderTarget_Debuger() GUI::Spacing(); - GUI::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); if (GUI::Button("ToggleAll")) { Toggle_RT_Debugger(); } diff --git a/Jusin154_Team3D/Engine/Private/Renderer.cpp b/Jusin154_Team3D/Engine/Private/Renderer.cpp index fd84aed39..15917002a 100644 --- a/Jusin154_Team3D/Engine/Private/Renderer.cpp +++ b/Jusin154_Team3D/Engine/Private/Renderer.cpp @@ -248,11 +248,11 @@ void CRenderer::Render_Shadow() m_pContext->RSSetViewports(1, &ViewPortDesc); for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::SHADOW_NEAR)]) { - if (nullptr != pRenderObject) { - if (FAILED(pRenderObject->Render_Shadow(SHADOW::SHADOW_NEAR))) { - assert(false); - } - } + //if (nullptr != pRenderObject) { + // if (FAILED(pRenderObject->Render_Shadow(SHADOW::SHADOW_NEAR))) { + // assert(false); + // } + //} SAFE_RELEASE(pRenderObject); } @@ -282,11 +282,11 @@ void CRenderer::Render_Shadow() m_pContext->RSSetViewports(1, &ViewPortDesc); for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::SHADOW_MIDDLE)]) { - if (nullptr != pRenderObject) { - if (FAILED(pRenderObject->Render_Shadow(SHADOW::SHADOW_MIDDLE))) { - assert(false); - } - } + //if (nullptr != pRenderObject) { + // if (FAILED(pRenderObject->Render_Shadow(SHADOW::SHADOW_MIDDLE))) { + // assert(false); + // } + //} SAFE_RELEASE(pRenderObject); } @@ -307,6 +307,7 @@ void CRenderer::Render_NonBlend() COMPUTE_TIMEDELTA("Timer_Render_NonBlend"); EVENTSCOPE_("Render_NonBlend"); m_eType = RENDER::NONBLEND; + if (FAILED(m_pGameInstance->Begin_MRT(TEXT("MRT_GameObjects")))) { return; } @@ -372,6 +373,7 @@ void CRenderer::Render_LightAcc() m_pShader->Bind_Matrix("g_invmatProj", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ_INV)); m_pShader->Bind_RawValue("g_vCamPosition", m_pGameInstance->Get_CamPosition(), sizeof(_float4)); m_pShader->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)); + m_pShader->Bind_RawValue("g_fLightSpecularMaximum", &m_fLightSpecularMaximum, sizeof(_float)); if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Diffuse"), m_pShader, "g_DiffuseTexture"))) { return; @@ -569,6 +571,7 @@ void CRenderer::Render_Fog() if (FAILED(m_pGameInstance->Bind_RenderTarget(TEXT("Target_Fog"), m_pShader, "g_Texture"))) { return; } + m_pShader->Begin(ENUM_CLASS(SHADER_PASS_DEFERRED::PRINT_BACKBUFFER)); m_pVIBuffer->Bind_Resources(); @@ -586,6 +589,7 @@ void CRenderer::Render_Fog() } m_pShader->Begin(ENUM_CLASS(SHADER_PASS_DEFERRED::FOG)); + m_pVIBuffer->Bind_Resources(); m_pVIBuffer->Render(); diff --git a/Jusin154_Team3D/Engine/Private/Renderer_Declare.cpp b/Jusin154_Team3D/Engine/Private/Renderer_Declare.cpp index 473dac100..58550a186 100644 --- a/Jusin154_Team3D/Engine/Private/Renderer_Declare.cpp +++ b/Jusin154_Team3D/Engine/Private/Renderer_Declare.cpp @@ -633,6 +633,9 @@ void CRenderer::Describe_Entitiy() { GUI::Begin("SYSTEM", 0, IMGUI_GLOBAL_BEGIN_FLAG); if (GUI::CollapsingHeader("RENDERER")) { + if (GUI::CollapsingHeader("Variable")) { + GUI::DragFloat("SpecularMaximum", &m_fLightSpecularMaximum, 0.01f, 0.0f, 2.f, "%.3f"); + } if (GUI::CollapsingHeader("PostProcessing_Bloom")) { GUI::BeginChild("PostProcessing_Bloom"); diff --git a/Jusin154_Team3D/Engine/Private/Resource_Manager.cpp b/Jusin154_Team3D/Engine/Private/Resource_Manager.cpp index 1dde43fa0..e6493be60 100644 --- a/Jusin154_Team3D/Engine/Private/Resource_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/Resource_Manager.cpp @@ -127,24 +127,24 @@ HRESULT CResource_Manager::Replacer_SrcFilePath(filesystem::path& pathFile) { if (true == pathFile.is_absolute()) { - const std::filesystem::path inputRootPath = pathFile.root_path(); - const std::filesystem::path inputRelativePath = pathFile.relative_path(); - auto relativePathIterator = inputRelativePath.begin(); - if (relativePathIterator == inputRelativePath.end()){ + filesystem::path pathRoot = pathFile.root_path(); + filesystem::path pathReleative = pathFile.relative_path(); + auto iterPath = pathReleative.begin(); + if (iterPath == pathReleative.end()){ return E_FAIL; } - else if ("MeshTable" != (*relativePathIterator).string()) { + else if ("MeshTable" != (*iterPath).string()) { return E_FAIL; } - ++relativePathIterator; + ++iterPath; - std::filesystem::path outputPath = inputRootPath / "MeshTableTexture"; - for (; relativePathIterator != inputRelativePath.end(); ++relativePathIterator) + filesystem::path pathOutPut = pathRoot / "MeshTableTexture_512"; + for (; iterPath != pathReleative.end(); ++iterPath) { - outputPath /= *relativePathIterator; + pathOutPut /= *iterPath; } - pathFile = outputPath; + pathFile = pathOutPut; } else { return E_FAIL; @@ -192,7 +192,7 @@ void CResource_Manager::Free() void CResource_Manager::Describe_Entity() { GUI::Begin("SYSTEM", 0, IMGUI_GLOBAL_BEGIN_FLAG); - GUI::PushItemWidth(80); + GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); if (GUI::CollapsingHeader("ResourceManager")) { static vector> vecHit = {}; static vector> vecMiss = {}; diff --git a/Jusin154_Team3D/Engine/Private/RigidBody.cpp b/Jusin154_Team3D/Engine/Private/RigidBody.cpp index 210fdac13..0ded70713 100644 --- a/Jusin154_Team3D/Engine/Private/RigidBody.cpp +++ b/Jusin154_Team3D/Engine/Private/RigidBody.cpp @@ -20,6 +20,13 @@ CRigidBody::CRigidBody(const CRigidBody& rhs) : { } +void CRigidBody::OnRayCollision(CGameObject* pCaster, _uint iCastedOrder, _float fDistance, _float3 vCastedWorldPos) +{ + if (nullptr != m_pOwner) { + m_pOwner->OnRayCollision(pCaster, iCastedOrder, fDistance, vCastedWorldPos); + } +} + HRESULT CRigidBody::Initialize(void* pArg) { RIGIDBODY_DESC* pDesc = (RIGIDBODY_DESC*)pArg; diff --git a/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic.cpp b/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic.cpp index f76ae0d29..1fbf4d9bf 100644 --- a/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic.cpp +++ b/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic.cpp @@ -127,7 +127,7 @@ void CRigidBody_Dynamic::Move_LocalPos(_fvector vNewRotQ, _gvector vNewTranslati XMStoreFloat3(&m_vLocalTranslation, vNewTranslation); PSX::PxShape* pShape = { nullptr }; m_pRigidBody->getShapes(&pShape, m_pRigidBody->getNbShapes()); - 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))); + pShape->setLocalPose(PSX::PxTransform(PSX::PxVec3(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 @@ -359,7 +359,7 @@ HRESULT CRigidBody_Dynamic::Initialize_Prototype(RIGIDBODY_PROTOTYPE_DYNAMIC_DES m_eLockFlag = Desc.eLockFlag; m_PxMassCenter = Desc.pxMassCenter; m_vDamping = Desc.vAutoDamping; - m_vLocalRotQ = Desc.vLocalRotQ; + m_vLocalRotQ = Desc.vLocalRotQ; m_vLocalTranslation = Desc.vLocalTranslation; return S_OK; @@ -482,30 +482,27 @@ void CRigidBody_Dynamic::Describe_Entity() Set_HalfGeometryInfo(m_vhalfGeometryInfo); } GUI::Text("Translation"); GUI::SameLine(); - if (GUI::DragFloat3("##LocalPos", (_float*)&m_vLocalTranslation, 0.125f, -10.f, 10.f, "%.4f")) { - Move_LocalPos(m_vLocalRotQ, m_vLocalTranslation); + _float3 vLocalTranslation = m_vLocalTranslation; + if (GUI::DragFloat3("##LocalPos", (_float*)&vLocalTranslation, 0.125f, -10.f, 10.f, "%.4f")) { + Move_LocalPos(m_vLocalRotQ, vLocalTranslation); } _vector q = XMLoadFloat4(&m_vLocalRotQ); - // 기본 방향벡터 (엔진 기준) _vector forward = XMVector3Rotate(XMVectorSet(0, 0, 1, 0), q); _vector right = XMVector3Rotate(XMVectorSet(1, 0, 0, 0), q); _vector up = XMVector3Rotate(XMVectorSet(0, 1, 0, 0), q); - // --- RPY 계산 --- _float fYaw = atan2f(XMVectorGetX(forward), XMVectorGetZ(forward)); _float fPitch = asinf(-XMVectorGetY(forward)); - _float fRoll = atan2f(XMVectorGetY(right), XMVectorGetY(up)); // 수정된 Roll 계산 + _float fRoll = atan2f(XMVectorGetY(right), XMVectorGetY(up)); - _float3 vRPY = { fRoll, fPitch, fYaw }; // Roll-Pitch-Yaw 순서 정렬 + _float3 vRPY = { fRoll, fPitch, fYaw }; - // --- GUI 편집 --- GUI::Text("Rotation (Roll Pitch Yaw)"); GUI::SameLine(); if (GUI::DragFloat3("##LocalRotq", (_float*)&vRPY, XMConvertToRadians(0.5f), -XM_2PI, XM_2PI, "%.5f")) { - // XMQuaternionRotationRollPitchYaw는 (Yaw→Pitch→Roll) 순서 _vector vRotq = XMQuaternionRotationRollPitchYaw(vRPY.z, vRPY.y, vRPY.x); XMStoreFloat4(&m_vLocalRotQ, vRotq); Move_LocalPos(m_vLocalRotQ, m_vLocalTranslation); diff --git a/Jusin154_Team3D/Engine/Private/Shader.cpp b/Jusin154_Team3D/Engine/Private/Shader.cpp index 2a7f912f7..22b936404 100644 --- a/Jusin154_Team3D/Engine/Private/Shader.cpp +++ b/Jusin154_Team3D/Engine/Private/Shader.cpp @@ -1,6 +1,20 @@ #include "pch.h" #include "Shader.h" +constexpr uint64_t FNV1A64_OFFSET = 14695981039346656037ull; +constexpr uint64_t FNV1A64_PRIME = 1099511628211ull; + +constexpr uint64_t Hash_FNV1a64(const char* str) +{ + uint64_t hash = FNV1A64_OFFSET; + while (*str) + { + hash ^= static_cast(*str++); + hash *= FNV1A64_PRIME; + } + return hash; +} + CShader::CShader(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CComponent{ pDevice, pContext } { @@ -12,6 +26,7 @@ CShader::CShader(const CShader& rhs) , m_pEffect{ rhs.m_pEffect } , m_iNumPasses{ rhs.m_iNumPasses } , m_InputLayouts{ rhs.m_InputLayouts } + , m_umapShaderRawVariables{ rhs.m_umapShaderRawVariables } #ifdef _DEBUG , m_strShaderPath { rhs.m_strShaderPath } @@ -30,7 +45,7 @@ HRESULT CShader::Initialize_Prototype(const _tchar* pShaderFilePath, const D3D11 #ifdef _DEBUG - m_strShaderPath = pShaderFilePath; + m_strShaderPath = pShaderFilePath; m_pElements = pElements; m_iNumElements = iNumElements; #endif @@ -52,79 +67,62 @@ HRESULT CShader::Initialize(void* pArg) HRESULT CShader::Bind_RawValue(const _char* pConstantName, const void* pData, _uint iLength) { - ID3DX11EffectVariable* pVariable = m_pEffect->GetVariableByName(pConstantName); - if (nullptr == pVariable) + SHADERVARIABLE* pTagVariable = Find_VariableByName(pConstantName); + if (nullptr == pTagVariable){ return E_FAIL; + } - return pVariable->SetRawValue(pData, 0, iLength); + return pTagVariable->pVariable->SetRawValue(pData, 0, iLength); } HRESULT CShader::Bind_Matrix(const _char* pConstantName, const _float4x4* pMatrix) { - ID3DX11EffectVariable* pVariable = m_pEffect->GetVariableByName(pConstantName); - if (nullptr == pVariable) + SHADERVARIABLE* pTagVariable = Find_VariableByName(pConstantName); + if (nullptr == pTagVariable) { return E_FAIL; + } - ID3DX11EffectMatrixVariable* pMatrixVariable = pVariable->AsMatrix(); - if (nullptr == pMatrixVariable) - return E_FAIL; - - return pMatrixVariable->SetMatrix(reinterpret_cast(pMatrix)); + return pTagVariable->pMatrix->SetMatrix(reinterpret_cast(pMatrix)); } HRESULT CShader::Bind_Matrices(const _char* pConstantName, const _float4x4* pMatrix, _uint iNumMatrices) { - ID3DX11EffectVariable* pVariable = m_pEffect->GetVariableByName(pConstantName); - if (nullptr == pVariable) + SHADERVARIABLE* pTagVariable = Find_VariableByName(pConstantName); + if (nullptr == pTagVariable) { return E_FAIL; + } - ID3DX11EffectMatrixVariable* pMatrixVariable = pVariable->AsMatrix(); - if (nullptr == pMatrixVariable) - return E_FAIL; - - return pMatrixVariable->SetMatrixArray(reinterpret_cast(pMatrix), 0, iNumMatrices); + return pTagVariable->pMatrix->SetMatrixArray(reinterpret_cast(pMatrix), 0, iNumMatrices); } HRESULT CShader::Bind_SRV(const _char* pConstantName, ID3D11ShaderResourceView* pSRV) { - ID3DX11EffectVariable* pVariable = m_pEffect->GetVariableByName(pConstantName); - if (nullptr == pVariable) + SHADERVARIABLE* pTagVariable = Find_VariableByName(pConstantName); + if (nullptr == pTagVariable) { return E_FAIL; + } - ID3DX11EffectShaderResourceVariable* pSRVariable = pVariable->AsShaderResource(); - if (nullptr == pSRVariable) - return E_FAIL; - - return pSRVariable->SetResource(pSRV); + return pTagVariable->pSRV->SetResource(pSRV); } HRESULT CShader::Bind_SRVs(const _char* pConstantName, ID3D11ShaderResourceView** ppSRV, _uint iNumSRVs) { - ID3DX11EffectVariable* pVariable = m_pEffect->GetVariableByName(pConstantName); - if (nullptr == pVariable) + SHADERVARIABLE* pTagVariable = Find_VariableByName(pConstantName); + if (nullptr == pTagVariable) { return E_FAIL; + } - ID3DX11EffectShaderResourceVariable* pSRVariable = pVariable->AsShaderResource(); - if (nullptr == pSRVariable) - return E_FAIL; - - return pSRVariable->SetResourceArray(ppSRV, 0, iNumSRVs); + return pTagVariable->pSRV->SetResourceArray(ppSRV, 0, iNumSRVs); } HRESULT CShader::Bind_IntArray(const _char* pConstantName, const int* pData, _uint elementCount) { - if (m_pEffect == nullptr || pConstantName == nullptr || pData == nullptr || elementCount == 0) { + SHADERVARIABLE* pTagVariable = Find_VariableByName(pConstantName); + if (nullptr == pTagVariable) { return E_FAIL; } - ID3DX11EffectScalarVariable* effectScalarVariable = - m_pEffect->GetVariableByName(pConstantName)->AsScalar(); - - if (effectScalarVariable == nullptr || effectScalarVariable->IsValid() == false) { - return E_FAIL; - } - - return effectScalarVariable->SetIntArray(pData, 0, elementCount); + return pTagVariable->pScalar->SetIntArray(pData, 0, elementCount); } @@ -134,9 +132,9 @@ HRESULT CShader::CreateShader(const _tchar* pShaderFilePath, const D3D11_INPUT_E _uint iHlslFlag = {}; #ifdef _DEBUG - iHlslFlag = D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION; + iHlslFlag = D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION | D3DCOMPILE_PACK_MATRIX_ROW_MAJOR | D3DCOMPILE_DEBUG_NAME_FOR_SOURCE; #else - iHlslFlag = D3DCOMPILE_OPTIMIZATION_LEVEL1; + iHlslFlag = D3DCOMPILE_OPTIMIZATION_LEVEL1 | D3DCOMPILE_PACK_MATRIX_ROW_MAJOR ; #endif ID3DBlob* pBlob; @@ -183,9 +181,121 @@ HRESULT CShader::CreateShader(const _tchar* pShaderFilePath, const D3D11_INPUT_E m_InputLayouts.push_back(pInputLayout); } + if (FAILED(Hash_Variables())) { + return E_FAIL; + } return S_OK; } +HRESULT CShader::Hash_Variables() +{ + if (nullptr == m_pEffect) { + return E_FAIL; + } + Safe_Delete(m_umapShaderRawVariables); + m_umapShaderRawVariables = new unordered_map; + HRESULT hr = m_pEffect->GetDesc(&m_EffectDesc); + if (FAILED(hr)) + return hr; + m_umapShaderRawVariables->clear(); + m_umapShaderRawVariables->reserve(m_EffectDesc.GlobalVariables); + + for (_uint iIndexVariable = 0; iIndexVariable < m_EffectDesc.GlobalVariables; ++iIndexVariable) { + ID3DX11EffectVariable* pVariable = m_pEffect->GetVariableByIndex(iIndexVariable); + if (pVariable == nullptr || pVariable->IsValid() != true) { + assert(false); // 불완전한 변수선언 + continue; + } + + D3DX11_EFFECT_VARIABLE_DESC variableDesc{}; + hr = pVariable->GetDesc(&variableDesc); + if (FAILED(hr) || variableDesc.Name == nullptr) { + assert(false); + continue; + } + SHADERVARIABLE* pTagVariable = Find_VariableByName(variableDesc.Name); + if (nullptr != pTagVariable) { + assert(false); // 중복된 변수정의 + continue; + } + + LPD3D11EFFECTTYPE VariableType = pVariable->GetType(); + D3DX11_EFFECT_TYPE_DESC VariableTypeDesc = {}; + VariableType->GetDesc(&VariableTypeDesc); + CShader::SHADERVARIABLE TagVariable = {}; + TagVariable.pVariable = pVariable; + TagVariable.eType = VariableTypeDesc.Type; + TagVariable.eClass = VariableTypeDesc.Class; + TagVariable.iNumElement = VariableTypeDesc.Elements; + TagVariable.iNumMember = VariableTypeDesc.Members; + switch (TagVariable.eClass) + { + case D3D_SVC_SCALAR: + TagVariable.pScalar = pVariable->AsScalar(); + if (TagVariable.pScalar && !TagVariable.pScalar->IsValid()) { + TagVariable.pScalar = nullptr; + } + break; + + case D3D_SVC_VECTOR: + TagVariable.pVector = pVariable->AsVector(); + if (TagVariable.pVector && !TagVariable.pVector->IsValid()) { + TagVariable.pVector = nullptr; + } + break; + + case D3D_SVC_MATRIX_ROWS: + case D3D_SVC_MATRIX_COLUMNS: + TagVariable.pMatrix = pVariable->AsMatrix(); + if (TagVariable.pMatrix && !TagVariable.pMatrix->IsValid()) { + TagVariable.pMatrix = nullptr; + } + break; + + case D3D_SVC_OBJECT: + if (TagVariable.eType == D3D_SVT_SAMPLER || + TagVariable.eType == D3D_SVT_SAMPLER1D || + TagVariable.eType == D3D_SVT_SAMPLER2D || + TagVariable.eType == D3D_SVT_SAMPLER3D || + TagVariable.eType == D3D_SVT_SAMPLERCUBE) + { + TagVariable.pSampler = pVariable->AsSampler(); + if (TagVariable.pSampler && !TagVariable.pSampler->IsValid()) { + TagVariable.pSampler = nullptr; + } + } + else + { + TagVariable.pSRV = pVariable->AsShaderResource(); + if (TagVariable.pSRV && !TagVariable.pSRV->IsValid()) { + TagVariable.pSRV = nullptr; + } + } + break; + + default: + assert(false); + break; + } + + m_umapShaderRawVariables->insert({ Hash_FNV1a64(variableDesc.Name), TagVariable }); + } + + + return S_OK; +} + +CShader::SHADERVARIABLE* CShader::Find_VariableByName(const _char* pConstantName) +{ + CShader::SHADERVARIABLE* pResult = { nullptr }; + + unordered_map::iterator iter = m_umapShaderRawVariables->find(Hash_FNV1a64(pConstantName)); + if (m_umapShaderRawVariables->end() != iter) { + pResult = &(*iter).second; + } + return pResult; +} + #ifdef _DEBUG HRESULT CShader::Shader_Refresh() @@ -258,6 +368,10 @@ void CShader::Free() { __super::Free(); + if (false == m_bCloned) { + Safe_Delete(m_umapShaderRawVariables); + } + SAFE_RELEASE(m_pEffect); for (auto& pInputLayout : m_InputLayouts) diff --git a/Jusin154_Team3D/Engine/Private/Unit.cpp b/Jusin154_Team3D/Engine/Private/Unit.cpp index 9dc13de85..ef0e4abc1 100644 --- a/Jusin154_Team3D/Engine/Private/Unit.cpp +++ b/Jusin154_Team3D/Engine/Private/Unit.cpp @@ -162,6 +162,11 @@ void CUnit::Add_Event(_uint AnimIndex, function Callback, _float fRatio, m_PendingEvents.push_back(Desc); } +void CUnit::Reset_Event() +{ + m_PendingEvents.clear(); +} + void CUnit::Check_HitAngle(_vector ProjectileDir) { _vector vProjectileDir = ProjectileDir; @@ -217,6 +222,11 @@ STATEANIM::ESTATE CUnit::StringToStateAnim(const string& s) { "IDLE_BREAK5", IDLE_BREAK5 }, { "IDLE_BREAK6", IDLE_BREAK6 }, { "IDLE_BREAK7", IDLE_BREAK7 }, + { "IDLE_TURN_180_L", IDLE_TURN_180_L }, { "IDLE_TURN_180_R", IDLE_TURN_180_R }, + { "IDLE_TURN_45_L", IDLE_TURN_45_L }, { "IDLE_TURN_45_R", IDLE_TURN_45_R }, + { "IDLE_TURN_90_L", IDLE_TURN_90_L }, { "IDLE_TURN_90_R", IDLE_TURN_90_R }, + + // MOVE { "MOVE", MOVE }, diff --git a/Jusin154_Team3D/Engine/Public/Engine_Enum.h b/Jusin154_Team3D/Engine/Public/Engine_Enum.h index 1000992b4..1d2b86cca 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Enum.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Enum.h @@ -191,6 +191,7 @@ enum class PXOBJECT : _uint { #pragma region NPC NPC = 500, OLLIVANDER, + ELEAZARFIG, #pragma endregion #pragma region ITEM @@ -225,12 +226,13 @@ enum class PXOBJECT : _uint { END = 999 }; -enum class HIT_TYPE : _ubyte +enum class HIT_TYPE { HIT_NONE = 0, // 히트모션 없음 - HIT_PROJECTILE = 1 << 0, // 발사체 - HIT_MEDIUM = 1 << 1, // 적당한 공격 - HIT_HEAVY = 1 << 2, // 강공격 + HIT_PROJECTILE, // 발사체 + HIT_MEDIUM, // 적당한 공격 + HIT_HEAVY, // 강공격 + END }; diff --git a/Jusin154_Team3D/Engine/Public/Engine_Macro.h b/Jusin154_Team3D/Engine/Public/Engine_Macro.h index e0d665689..b5be38386 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Macro.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Macro.h @@ -21,11 +21,12 @@ #define ASSERT_JINHO(expression) #define ASSERT_HYUNBIN(expression) #define ASSERT_INHYUK(expression) +#define IMGUI_GLOBAL_ITEM_WIDTH 160 #define OPTIONAL_TRUE_KEYINPUTGUICHECK -#define USE_LOWTEXTURE -#ifndef _DEBUG +#define USE_LOWTEXTURE +#ifndef _DEBUG // 릴리즈 모드일 때는 고해상도 유지 #undef USE_LOWTEXTURE #endif // !_DEBUG @@ -34,31 +35,31 @@ #undef ASSERT_NURI #define ASSERT_NURI(expression) assert(expression) #define MSG_BOX(_message) MessageBox(NULL, TEXT(_message), L"System Message", MB_OK); assert(false); -//#undef USE_LOWTEXTURE +//#undef USE_LOWTEXTURE // 매크로 옵션으로 해상도 조절, 주석 걸면 디버그모드에서 저해상도 유지 //#undef OPTIONAL_TRUE_KEYINPUTGUICHECK //#define OPTIONAL_TRUE_KEYINPUTGUICHECK true|| #elif 진우 #undef ASSERT_JINWOO #define ASSERT_JINWOO(expression) assert(expression) -#undef USE_LOWTEXTURE +#undef USE_LOWTEXTURE // 매크로 옵션으로 해상도 조절, 주석 걸면 디버그모드에서 저해상도 유지 //#undef OPTIONAL_TRUE_KEYINPUTGUICHECK //#define OPTIONAL_TRUE_KEYINPUTGUICHECK true|| #elif gimch #undef ASSERT_JINHO #define ASSERT_JINHO(expression) assert(expression) -#undef USE_LOWTEXTURE +#undef USE_LOWTEXTURE // 매크로 옵션으로 해상도 조절, 주석 걸면 디버그모드에서 저해상도 유지 #undef OPTIONAL_TRUE_KEYINPUTGUICHECK #define OPTIONAL_TRUE_KEYINPUTGUICHECK true|| #elif Bin #undef ASSERT_HYUNBIN #define ASSERT_HYUNBIN(expression) assert(expression) -#undef USE_LOWTEXTURE +#undef USE_LOWTEXTURE // 매크로 옵션으로 해상도 조절, 주석 걸면 디버그모드에서 저해상도 유지 //#undef OPTIONAL_TRUE_KEYINPUTGUICHECK //#define OPTIONAL_TRUE_KEYINPUTGUICHECK ||true #elif 나 #undef ASSERT_INHYUK #define ASSERT_INHYUK(expression) assert(expression) -#undef USE_LOWTEXTURE +#undef USE_LOWTEXTURE // 매크로 옵션으로 해상도 조절, 주석 걸면 디버그모드에서 저해상도 유지 //#undef OPTIONAL_TRUE_KEYINPUTGUICHECK //#define OPTIONAL_TRUE_KEYINPUTGUICHECK || true #endif diff --git a/Jusin154_Team3D/Engine/Public/Engine_Struct.h b/Jusin154_Team3D/Engine/Public/Engine_Struct.h index e9528790d..a4c17238a 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Struct.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Struct.h @@ -390,9 +390,185 @@ typedef struct tagPHYSX_USERDATA { }PHYSX_USERDATA; -typedef struct tagD6JointDesc { +typedef struct tagD6JointDesc +{ // 0: Locked + // 1: Limited + // 2: Free + int iMotionX = 0; + int iMotionY = 0; + int iMotionZ = 0; + int iMotionTwist = 0; + int iMotionSwing1 = 0; + int iMotionSwing2 = 0; + + float fLinearLimit = 0.f; + float fSwingDeg = 0.f; + float fTwistAbsDeg = 0.f; + + bool bEnableSlerpDrive = false; + float fSlerpStiffness = 0.f; + float fSlerpDamping = 0.f; + float fSlerpForceLimit = 0.f; + bool bSlerpAccel = false; + + bool bEnableLinearDrive = false; + float fLinearStiffness = 0.f; + float fLinearDamping = 0.f; + float fLinearForceLimit = 0.f; + bool bLinearAccel = false; + + tagD6JointDesc() { + iMotionX = 0; + iMotionY = 0; + iMotionZ = 0; + iMotionTwist = 0; + iMotionSwing1 = 0; + iMotionSwing2 = 0; + fLinearLimit = 0.f; + fSwingDeg = 0.f; + fTwistAbsDeg = 0.f; + bEnableSlerpDrive = false; + fSlerpStiffness = 0.f; + fSlerpForceLimit = 0.f; + fSlerpDamping = 0.f; + bSlerpAccel = false; + bEnableLinearDrive = false; + fLinearStiffness = 0.f; + fLinearDamping = 0.f; + bLinearAccel = false; + } + + static int MotionToIndex(PSX::PxD6Motion::Enum motion) + { + if (motion == PSX::PxD6Motion::eLOCKED) return 0; + if (motion == PSX::PxD6Motion::eLIMITED) return 1; + return 2; // eFREE + } + + static PSX::PxD6Motion::Enum IndexToMotion(int index) + { + return (index == 0) ? PSX::PxD6Motion::eLOCKED : + (index == 1) ? PSX::PxD6Motion::eLIMITED : + PSX::PxD6Motion::eFREE; + } + + static bool HasAccelFlag(const PSX::PxD6JointDrive& drive) + { + return (drive.flags & PSX::PxD6JointDriveFlag::eACCELERATION) != 0; + } + + static PSX::PxD6JointDrive MakeDrive(float stiffness, float damping, float forceLimit, bool accel) + { + PSX::PxD6JointDrive drive(stiffness, damping, forceLimit, accel); + return drive; + } + + void InitFromJoint(const PSX::PxD6Joint& joint) + { + iMotionX = MotionToIndex(joint.getMotion(PSX::PxD6Axis::eX)); + iMotionY = MotionToIndex(joint.getMotion(PSX::PxD6Axis::eY)); + iMotionZ = MotionToIndex(joint.getMotion(PSX::PxD6Axis::eZ)); + iMotionTwist = MotionToIndex(joint.getMotion(PSX::PxD6Axis::eTWIST)); + iMotionSwing1 = MotionToIndex(joint.getMotion(PSX::PxD6Axis::eSWING1)); + iMotionSwing2 = MotionToIndex(joint.getMotion(PSX::PxD6Axis::eSWING2)); + + { + PSX::PxJointLinearLimit pxLimit = joint.getLinearLimit(); + fLinearLimit = pxLimit.value; + } + + { + PSX::PxJointLimitCone pxSwing = joint.getSwingLimit(); + fSwingDeg = XMConvertToDegrees(pxSwing.yAngle); // 대칭 cone 기준 + + PSX::PxJointAngularLimitPair pxTwist = joint.getTwistLimit(); + const float fAbsRad = PSX::PxMax(PSX::PxAbs(pxTwist.lower), PSX::PxAbs(pxTwist.upper)); + fTwistAbsDeg = XMConvertToDegrees(fAbsRad); + } + + { + PSX::PxD6JointDrive pxDrive = joint.getDrive(PSX::PxD6Drive::eSLERP); + bEnableSlerpDrive = (pxDrive.stiffness > 0.f) || (pxDrive.damping > 0.f) || (pxDrive.forceLimit > 0.f); + fSlerpStiffness = pxDrive.stiffness; + fSlerpDamping = pxDrive.damping; + fSlerpForceLimit = pxDrive.forceLimit; + bSlerpAccel = HasAccelFlag(pxDrive); + } + + { + PSX::PxD6JointDrive pxDriveX = joint.getDrive(PSX::PxD6Drive::eX); + bEnableLinearDrive = (pxDriveX.stiffness > 0.f) || (pxDriveX.damping > 0.f) || (pxDriveX.forceLimit > 0.f); + fLinearStiffness = pxDriveX.stiffness; + fLinearDamping = pxDriveX.damping; + fLinearForceLimit = pxDriveX.forceLimit; + bLinearAccel = HasAccelFlag(pxDriveX); + } + } + + void ApplyToJoint(PSX::PxD6Joint& joint) const + { + joint.setMotion(PSX::PxD6Axis::eX, IndexToMotion(iMotionX)); + joint.setMotion(PSX::PxD6Axis::eY, IndexToMotion(iMotionY)); + joint.setMotion(PSX::PxD6Axis::eZ, IndexToMotion(iMotionZ)); + joint.setMotion(PSX::PxD6Axis::eTWIST, IndexToMotion(iMotionTwist)); + joint.setMotion(PSX::PxD6Axis::eSWING1, IndexToMotion(iMotionSwing1)); + joint.setMotion(PSX::PxD6Axis::eSWING2, IndexToMotion(iMotionSwing2)); + + { + PSX::PxJointLinearLimit pxLimit = joint.getLinearLimit(); + pxLimit.value = PSX::PxMax(0.f, fLinearLimit); + joint.setLinearLimit(pxLimit); + } + + { + PSX::PxJointLimitCone pxSwing = joint.getSwingLimit(); + const float swingRad = XMConvertToRadians(PSX::PxClamp(fSwingDeg, 0.f, 180.f)); + pxSwing.yAngle = swingRad; + pxSwing.zAngle = swingRad; + joint.setSwingLimit(pxSwing); + } + { + PSX::PxJointAngularLimitPair pxTwist = joint.getTwistLimit(); + const float twistRad = XMConvertToRadians(PSX::PxClamp(fTwistAbsDeg, FLT_EPSILON, 180.f)); + pxTwist.lower = -twistRad; + pxTwist.upper = +twistRad; + + joint.setTwistLimit(pxTwist); + } + + if (!bEnableSlerpDrive) + { + joint.setDrive(PSX::PxD6Drive::eSLERP, MakeDrive(0.f, 0.f, 0.f, bSlerpAccel)); + } + else + { + joint.setDrive(PSX::PxD6Drive::eSLERP, MakeDrive(fSlerpStiffness, fSlerpDamping, fSlerpForceLimit, bSlerpAccel)); + } + + if (!bEnableLinearDrive) + { + const PSX::PxD6JointDrive off = MakeDrive(0.f, 0.f, 0.f, bLinearAccel); + joint.setDrive(PSX::PxD6Drive::eX, off); + joint.setDrive(PSX::PxD6Drive::eY, off); + joint.setDrive(PSX::PxD6Drive::eZ, off); + } + else + { + const PSX::PxD6JointDrive on = MakeDrive(fLinearStiffness, fLinearDamping, fLinearForceLimit, bLinearAccel); + joint.setDrive(PSX::PxD6Drive::eX, on); + joint.setDrive(PSX::PxD6Drive::eY, on); + joint.setDrive(PSX::PxD6Drive::eZ, on); + } + } +}D6JOINTDESC; + +static D6JOINTDESC MakeD6JointUIState(const PSX::PxD6Joint& joint) +{ + D6JOINTDESC state; + state.InitFromJoint(joint); + return state; +} -}PHYSX_JOINT_D6Desc; typedef struct tagOnCollsionInfo { diff --git a/Jusin154_Team3D/Engine/Public/Engine_Typedef.h b/Jusin154_Team3D/Engine/Public/Engine_Typedef.h index dd7629714..f9c7840b1 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Typedef.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Typedef.h @@ -12,6 +12,9 @@ typedef unsigned short _ushort; typedef signed int _int; typedef unsigned int _uint; +typedef XMUINT2 _uint2; +typedef XMUINT3 _uint3; +typedef XMUINT4 _uint4; typedef signed long _long; typedef unsigned long _ulong; diff --git a/Jusin154_Team3D/Engine/Public/GameInstance.h b/Jusin154_Team3D/Engine/Public/GameInstance.h index cc51669be..748f6d6e3 100644 --- a/Jusin154_Team3D/Engine/Public/GameInstance.h +++ b/Jusin154_Team3D/Engine/Public/GameInstance.h @@ -41,7 +41,7 @@ class ENGINE_DLL CGameInstance final : public CBase HRESULT Add_Timer(const _wstring& strTimerTag); void Compute_TimeDelta(const _wstring& strTimerTag); void Compute_FrameCount(); - void Present_TimeCost() const; + void Present_TimeCost() ; #pragma endregion #pragma region LEVEL_MANAGER @@ -133,27 +133,27 @@ class ENGINE_DLL CGameInstance final : public CBase #pragma endregion #pragma region PIPELINE - 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); - _bool IsIn_WorldFrustum(_fvector vWorldPos, _float fRadius); - _bool IsIn_LocalFrustum(_fvector vLocalPos, _float fRadius); - pair<_bool, _ubyte> IsIn_ShadowViewFrustum(_fvector vWorldCenter, _float fRadius); - HRESULT Bind_CascadeSplitRatio(class CShader* pShader, const _char* pConstantName, _bool bNear); - HRESULT Bind_CascadeBias(class CShader* pShader, const _char* pConstantName); - HRESULT Bind_GlobalSRV(class CShader* pShader, const _tchar* wszKeyGlobalSRV, const _char* pConstantName); - HRESULT Load_GlobalSRV(const _tchar* wszKeyGlobalSRV, filesystem::path pathSRVFolder); + 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); + _bool IsIn_WorldFrustum(_fvector vWorldPos, _float fRadius); + _bool IsIn_LocalFrustum(_fvector vLocalPos, _float fRadius); + pair<_bool, _ubyte> IsIn_ShadowViewFrustum(_fvector vWorldCenter, _float fRadius); + HRESULT Bind_CascadeSplitRatio(class CShader* pShader, const _char* pConstantName, _bool bNear); + HRESULT Bind_CascadeBias(class CShader* pShader, const _char* pConstantName); + HRESULT Bind_GlobalSRV(class CShader* pShader, const _tchar* wszKeyGlobalSRV, const _char* pConstantName); + HRESULT Load_GlobalSRV(const _tchar* wszKeyGlobalSRV, filesystem::path pathSRVFolder); - 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); - _float Get_ShadowBoxFar(_uint iShadowBoxIndex); - HRESULT Begin_OutLine_Write(_uint iDSSMask); - 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); + _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); @@ -219,7 +219,7 @@ class ENGINE_DLL CGameInstance final : public CBase PSX::PxRigidDynamic* Add_DynamicActor(CRigidBody_Dynamic& RigidBody, _uint iLevel); PSX::PxRigidStatic* Add_StaticActor(CRigidBody_Static& RigidBody, _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); + PSX::PxD6Joint* Create_BasicPxD6Joint(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); @@ -331,6 +331,8 @@ class ENGINE_DLL CGameInstance final : public CBase _float m_fSlowIntense = {}; #ifdef _DEBUG private: + _bool m_bRendererTimerOpen = false; + _float m_fTimer_PriorityUpdate = { 0.f }; _float m_fTimer_Update = { 0.f }; _float m_fTimer_LateUpdate = { 0.f }; @@ -362,6 +364,7 @@ class ENGINE_DLL CGameInstance final : public CBase _float m_fTimer_Render_UI = { 0.f }; _float m_fTimer_Render_UI_Overley = { 0.f }; + vector m_FilePaths = {}; map m_ModelMap; diff --git a/Jusin154_Team3D/Engine/Public/GameObject.h b/Jusin154_Team3D/Engine/Public/GameObject.h index 154ffb507..9f508e946 100644 --- a/Jusin154_Team3D/Engine/Public/GameObject.h +++ b/Jusin154_Team3D/Engine/Public/GameObject.h @@ -28,11 +28,9 @@ class ENGINE_DLL CGameObject abstract virtual _float Get_Depth(); // z 소팅 할 때 쓰시면 됨 - // 내가 맞음 ( Collider_Manager가 부름 ) virtual void OnCollision(CGameObject* pOther = nullptr ,void* pDesc = nullptr); - - // 내가 때림 ( 히트박스가 부름 ) virtual void OnHit(CGameObject* pOther, CGameObject* pCaller = nullptr); + virtual void OnRayCollision(CGameObject* pCaster, _uint iCastedOrder, _float fDistance, _float3 vCastedWorldPos); virtual _vector Get_WorldPostion(); diff --git a/Jusin154_Team3D/Engine/Public/Instance_Model.h b/Jusin154_Team3D/Engine/Public/Instance_Model.h index 3283a824e..d57be0e28 100644 --- a/Jusin154_Team3D/Engine/Public/Instance_Model.h +++ b/Jusin154_Team3D/Engine/Public/Instance_Model.h @@ -78,15 +78,15 @@ class ENGINE_DLL CInstance_Model final : public CComponent _bool isNoResetTime = {}; _bool isLocal_Located_Not_TakeDelay = {}; _bool isCompute_LocalInverse = {}; - _bool isPadding3 = {}; + _bool isRoundLengthLerp = {}; _float fTimeMult = { 1.f }; _float2 vRoundRangeLength = {}; _float2 vAzimuthAngle = {}; _float2 vPolarAngle = {}; + _float fRoundLengthLerpSpeed = {}; - - _float4 vPadding6 = {}; + _float3 vPadding6 = {}; _bool isRandomAniIndex = {}; _bool isMoveUp = {}; @@ -193,7 +193,7 @@ class ENGINE_DLL CInstance_Model final : public CComponent _int isNoResetTime = {}; _int isLocal_Located_Not_TakeDelay = {}; _int isCompute_LocalInverse = {}; - _int isPadding2 = {}; + _int isRoundLengthLerp = {}; _float fTimeDelta = {}; _float fSizeLerpOption = {}; @@ -254,6 +254,11 @@ class ENGINE_DLL CInstance_Model final : public CComponent _float3 vWolrdOffset = {}; _float fLoopCount = {}; + _float fRoundRangeLength = {}; + _float fAzimuthAngle = {}; + _float fPolarAngle = {}; + _float fRoundLengthLerpSpeed = {}; + _float4x4 PreWorldMatrix = {}; _float4x4 LocalMatrixInv = {}; diff --git a/Jusin154_Team3D/Engine/Public/Model.h b/Jusin154_Team3D/Engine/Public/Model.h index 7f6ef92b9..501e18d52 100644 --- a/Jusin154_Team3D/Engine/Public/Model.h +++ b/Jusin154_Team3D/Engine/Public/Model.h @@ -58,11 +58,12 @@ class ENGINE_DLL CModel final : public CComponent virtual HRESULT Render(_uint iMeshIndex); 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_DisableRootMotionScale(_bool Disable) { m_bDisableRootMotionScale = Disable; } 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; } + _float Get_HeadAimWeight() { return m_fHeadAimWeight; } _bool Get_PlayHeadBone() const { return m_bHeadBone; } _int Get_SkipBoneIndex(_int Index) { return m_SkipBoneindex[Index]; } vector<_uint> Get_BoneMask(_int iIndex){ return m_BoneMask[iIndex]; } @@ -71,7 +72,8 @@ class ENGINE_DLL CModel final : public CComponent _bool Play_Animation(_float fTimeDelta, class CTransform* pTransform = nullptr); // 애니메이션에 델타타임을 넣어줌 _bool Play_Anim(_float fTimeDelta, CTransform* pTransform); _bool Play_Dual_Anim(_float fTimeDelta, CTransform* pTransform); - void Set_AnimationIndex(_uint iIndex, _bool isLoop = true, _float fAmount = 1.f, _bool bRatio = false,_float fAnimSpeed = 1.f,_bool bRootBone = true); + _bool IsBlending() const; + void Set_AnimationIndex(_uint iIndex, _bool isLoop = true, _float fAmount = 1.f, _bool bRatio = false,_float fAnimSpeed = 1.f,_bool bRootBone = true, _bool bQueuedAnim = false); void Set_Second_AnimationIndex(_uint BoneIndex, _uint iIndex, _bool isLoop = false); _bool IsFinishedAnim() const { return m_bIsFinishedAnim; } _bool IsFinishedSecondAnim() const { return m_bIsSecondFinishedAnim; } @@ -163,7 +165,7 @@ class ENGINE_DLL CModel final : public CComponent _float4x4 m_PreTransformMatrix = {}; // 사전에 루트본에 곱해줄 매트릭스 vector m_Meshes; // 메쉬의 벡터 - vector m_TriMeshes = {}; // 피직스 메쉬의 갯수 + vectorm_TriMeshes = {}; // 피직스 메쉬의 갯수 _uint m_iNumPhysXMeshes = {}; // 피직스 메쉬의 갯수 _uint m_iNumMeshes = {}; // 메쉬의 갯수 _uint m_iNumMaterials = {}; // 머테리얼의 갯수 @@ -193,7 +195,7 @@ class ENGINE_DLL CModel final : public CComponent _matrix m_PrevAnimationMatrix = XMMatrixIdentity(); // 루트본의 이전 위치 _matrix m_DeltaAnimationMatrix = {}; // 루트본의 델타애니메이션 - class CTransform* m_pTransform = { nullptr }; // 모델 대상의 트랜스폼 + class CTransform* m_pTransform = { nullptr }; // 모델 대상의 트랜스폼 _float m_fRatio = {}; _int m_iCurrSecondAnimIndex = { -1 }; @@ -218,22 +220,25 @@ class ENGINE_DLL CModel final : public CComponent _uint m_iIndexAnimPlayableMesh = { 0 }; _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 m_vTargetPos = XMVectorZero(); - _vector m_vHeadPos = XMVectorZero(); - _bool m_bHeadBone = { false }; - _float m_fHeadAimWeight = { 0.f }; - _int m_iSkipBoneCount = {}; - vector<_int> m_SkipBoneindex = {}; + 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_bDisableRootMotionScale = {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 = {}; + _int m_iQueuedAnimIndex = -1; + _bool m_bQueuedLoop = false; + _bool m_bQueuedAnim = { false }; private: diff --git a/Jusin154_Team3D/Engine/Public/MyTools.h b/Jusin154_Team3D/Engine/Public/MyTools.h index c47ac63bd..e2fb89155 100644 --- a/Jusin154_Team3D/Engine/Public/MyTools.h +++ b/Jusin154_Team3D/Engine/Public/MyTools.h @@ -326,7 +326,7 @@ class CMyTools { return hitLeft.distance < hitRight.distance; }); } - + inline static _uint AlphabetToInt(_tchar Alphabet) { @@ -337,24 +337,197 @@ class CMyTools { return (Alphabet - 'A'); } +#ifdef _DEBUG - inline static PSX::PxTransform MakeJointWorldPoseFromRouteEnd(PSX::PxRigidActor* routeRigidActor, _float3 vCapsuleHalfLengths, bool isHeadEnd) + inline static _bool DescribePxTransform(PSX::PxTransform& pxTransform, size_t iID) + { + PSX::PxVec3 vAxis = {}; + _float fAngle = {}; + pxTransform.q.toRadiansAndUnitAxis(fAngle, vAxis); + GUI::Text((to_string((_int)iID) + "Pos : %.2f %.2f %.2f").c_str(), pxTransform.p.x, pxTransform.p.y, pxTransform.p.z); + GUI::Text((to_string((_int)iID) + "fAngle vAxis : %.2f %.2f %.2f %.2f").c_str(), fAngle, vAxis.x, vAxis.y, vAxis.z); + if (GUI::DragFloat3((to_string((_int)iID) + " Pos").c_str(), (_float*)&pxTransform.p, 0.01f, -2.f, 2.f, "%.2f")) { + return true; + } + if (GUI::DragFloat((to_string((_int)iID) + " fAngle").c_str(), &fAngle, XMConvertToRadians(1.f), XMConvertToRadians(0.1f), 2.f * XM_2PI, "%.2f")) { + pxTransform.q = PSX::PxQuat(fAngle, vAxis); + return true; + } + return false; + } + +#endif // _DEBUG + + // 루트의 끝에 있는 조인트 위치를 구함 + inline static PSX::PxTransform Calc_JointPosFromRoute(PSX::PxRigidActor* pRouteActor, _float3 vCapsuleHalfLengths, bool bIsHead) { PSX::PxShape* shapeArray[1] = {}; - routeRigidActor->getShapes(shapeArray, 1); + pRouteActor->getShapes(shapeArray, 1); PSX::PxShape* routeShape = shapeArray[0]; + PSX::PxTransform pxRouteWorld = PSX::PxShapeExt::getGlobalPose(*routeShape, *pRouteActor); + PSX::PxVec3 capsuleAxisWorld = pxRouteWorld.q.rotate(PSX::PxVec3(1.f, 0.f, 0.f)); - const PSX::PxTransform pxRouteWorldTransfom = PSX::PxShapeExt::getGlobalPose(*routeShape, *routeRigidActor); + PSX::PxTransform pxResult; + pxResult.q = pxRouteWorld.q; + pxResult.p = pxRouteWorld.p + (bIsHead ? 1.f : -1.f) * capsuleAxisWorld * (vCapsuleHalfLengths.y + vCapsuleHalfLengths.x); - 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; + return pxResult; } + static _bool Modify_D6Joint(PSX::PxD6Joint& joint, _uint iID) + { + _bool bIsModified = false; + + const char* motionItems[] = { "Locked", "Limited", "Free" }; + + struct AxisRow { PSX::PxD6Axis::Enum axis; const char* label; }; + const AxisRow axisRows[] = + { + { PSX::PxD6Axis::eX, "X Motion" }, + { PSX::PxD6Axis::eY, "Y Motion" }, + { PSX::PxD6Axis::eZ, "Z Motion" }, + { PSX::PxD6Axis::eTWIST, "Twist Motion" }, + { PSX::PxD6Axis::eSWING1, "Swing1 Motion" }, + { PSX::PxD6Axis::eSWING2, "Swing2 Motion" }, + }; + + for (const AxisRow& row : axisRows) + { + const PSX::PxD6Motion::Enum pxCurMotion = joint.getMotion(row.axis); + + int iCurIndex = 0; + if (pxCurMotion == PSX::PxD6Motion::eLOCKED) iCurIndex = 0; + else if (pxCurMotion == PSX::PxD6Motion::eLIMITED) iCurIndex = 1; + else iCurIndex = 2; // eFREE + + int iNewIndex = iCurIndex; + std::string uiId = std::string(row.label) + " ##" + std::to_string(iID); + + if (GUI::Combo(uiId.c_str(), &iNewIndex, motionItems, IM_ARRAYSIZE(motionItems)) && iNewIndex != iCurIndex) + { + PSX::PxD6Motion::Enum pxNewMotion = + (iNewIndex == 0) ? PSX::PxD6Motion::eLOCKED : + (iNewIndex == 1) ? PSX::PxD6Motion::eLIMITED : + PSX::PxD6Motion::eFREE; + + joint.setMotion(row.axis, pxNewMotion); + bIsModified = true; + } + } + + const _bool bIsLinearLimited = + (joint.getMotion(PSX::PxD6Axis::eX) == PSX::PxD6Motion::eLIMITED) || + (joint.getMotion(PSX::PxD6Axis::eY) == PSX::PxD6Motion::eLIMITED) || + (joint.getMotion(PSX::PxD6Axis::eZ) == PSX::PxD6Motion::eLIMITED); + + const _bool bIsSwingLimited = + (joint.getMotion(PSX::PxD6Axis::eSWING1) == PSX::PxD6Motion::eLIMITED) || + (joint.getMotion(PSX::PxD6Axis::eSWING2) == PSX::PxD6Motion::eLIMITED); + + const _bool bIsTwistLimited = + (joint.getMotion(PSX::PxD6Axis::eTWIST) == PSX::PxD6Motion::eLIMITED); + + PSX::PxJointLinearLimit pxLinearLimit = joint.getLinearLimit(); + _float fLinearLimit = pxLinearLimit.value; + + if (GUI::DragFloat((std::string("LinearLimit ##") + std::to_string(iID)).c_str(), &fLinearLimit, 0.01f, 0.f, 10.f, "%.3f")) + bIsModified = true; + + PSX::PxJointLimitCone pxSwingLimit = joint.getSwingLimit(); + PSX::PxJointAngularLimitPair pxTwistLimit = joint.getTwistLimit(); + + _float fSwingDeg = XMConvertToDegrees(pxSwingLimit.yAngle); + _float fTwistAbsDeg = XMConvertToDegrees(PSX::PxMax(PSX::PxAbs(pxTwistLimit.lower), PSX::PxAbs(pxTwistLimit.upper))); + + if (GUI::DragFloat((std::string("SwingDeg ##") + std::to_string(iID)).c_str(), &fSwingDeg, 1.f, 0.f, 180.f, "%.2f")) + bIsModified = true; + + if (GUI::DragFloat((std::string("TwistAbsDeg ##") + std::to_string(iID)).c_str(), &fTwistAbsDeg, 1.f, 0.f, 180.f, "%.2f")) + bIsModified = true; + + PSX::PxD6JointDrive pxSlerpDrive = joint.getDrive(PSX::PxD6Drive::eSLERP); + _bool bIsSlerpDriveEnabled = (pxSlerpDrive.stiffness > 0.f) || (pxSlerpDrive.damping > 0.f) || (pxSlerpDrive.forceLimit > 0.f); + + if (GUI::Checkbox((std::string("Enable SLERP Drive ##") + std::to_string(iID)).c_str(), &bIsSlerpDriveEnabled)) + bIsModified = true; + + if (GUI::SliderFloat((std::string("SLERP stiffness ##") + std::to_string(iID)).c_str(), &pxSlerpDrive.stiffness, 0.f, 100.f, "%.2f")) + bIsModified = true; + + GUI::SameLine(); + + if (GUI::SliderFloat((std::string("SLERP damping ##") + std::to_string(iID)).c_str(), &pxSlerpDrive.damping, 0.f, 100.f, "%.2f")) + bIsModified = true; + + PSX::PxD6JointDrive pxLinearDriveX = joint.getDrive(PSX::PxD6Drive::eX); + _bool bIsLinearDriveEnabled = (pxLinearDriveX.stiffness > 0.f) || (pxLinearDriveX.damping > 0.f) || (pxLinearDriveX.forceLimit > 0.f); + + if (GUI::Checkbox((std::string("Enable Linear Drive(XYZ) ##") + std::to_string(iID)).c_str(), &bIsLinearDriveEnabled)) + bIsModified = true; + + if (GUI::SliderFloat((std::string("Linear stiffness ##") + std::to_string(iID)).c_str(), &pxLinearDriveX.stiffness, 0.f, 100.f, "%.2f")) + bIsModified = true; + + GUI::SameLine(); + + if (GUI::SliderFloat((std::string("Linear damping ##") + std::to_string(iID)).c_str(), &pxLinearDriveX.damping, 0.f, 100.f, "%.2f")) + bIsModified = true; + + if (bIsModified) + { + pxLinearLimit.value = PSX::PxMax(0.f, fLinearLimit); + joint.setLinearLimit(pxLinearLimit); + + const _float fSwingRad = XMConvertToRadians(fSwingDeg); + pxSwingLimit.yAngle = fSwingRad; + pxSwingLimit.zAngle = fSwingRad; + joint.setSwingLimit(pxSwingLimit); + + const _float fTwistAbsRad = XMConvertToRadians(fTwistAbsDeg); + pxTwistLimit.lower = -fTwistAbsRad; + pxTwistLimit.upper = +fTwistAbsRad; + joint.setTwistLimit(pxTwistLimit); + + if (!bIsSlerpDriveEnabled) + joint.setDrive(PSX::PxD6Drive::eSLERP, PSX::PxD6JointDrive(0.f, 0.f, 0.f, pxSlerpDrive.flags & PSX::PxD6JointDriveFlag::eACCELERATION)); + else + joint.setDrive(PSX::PxD6Drive::eSLERP, pxSlerpDrive); + + if (!bIsLinearDriveEnabled) + { + const PSX::PxD6JointDrive pxOff(0.f, 0.f, 0.f, pxLinearDriveX.flags & PSX::PxD6JointDriveFlag::eACCELERATION); + joint.setDrive(PSX::PxD6Drive::eX, pxOff); + joint.setDrive(PSX::PxD6Drive::eY, pxOff); + joint.setDrive(PSX::PxD6Drive::eZ, pxOff); + } + else + { + joint.setDrive(PSX::PxD6Drive::eX, pxLinearDriveX); + joint.setDrive(PSX::PxD6Drive::eY, pxLinearDriveX); + joint.setDrive(PSX::PxD6Drive::eZ, pxLinearDriveX); + } + } + + return bIsModified; + } + + + // 힌지 월드축을 가져와서 레볼루트 조인트의 회전 쿼터니언을 구함 + inline static PSX::PxQuat Calc_RevJointPosFromWorldHingeAxis(const PSX::PxVec3& pxHingeWorldAxis) + { + PSX::PxVec3 pxBasicAxis = PSX::PxVec3(0.f, 1.f, 0.f); + if (PSX::PxAbs(pxHingeWorldAxis.dot(pxBasicAxis)) > 0.99f) + { + pxBasicAxis = PSX::PxVec3(0.f, 0.f, 1.f); + } + + PSX::PxVec3 zAxis = pxHingeWorldAxis.cross(pxBasicAxis).getNormalized(); + PSX::PxVec3 yAxis = zAxis.cross(pxHingeWorldAxis).getNormalized(); + + PSX::PxMat33 pxResultMatrix(pxHingeWorldAxis, yAxis, zAxis); + return PSX::PxQuat(pxResultMatrix); + } + #pragma endregion #pragma region FileSystem //static void Folder_Func(/* 재귀적으로 탐색할지 */ _In_ _bool bRecursive, diff --git a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxJointLimit.h b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxJointLimit.h index bb36b6a48..ac1eb487f 100644 --- a/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxJointLimit.h +++ b/Jusin154_Team3D/Engine/Public/PhysX/extensions/PxJointLimit.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 a9593b3b4..2d2d57264 100644 --- a/Jusin154_Team3D/Engine/Public/PhysX_Manager.h +++ b/Jusin154_Team3D/Engine/Public/PhysX_Manager.h @@ -36,7 +36,7 @@ class CPhysX_Manager final : public CBase // 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); + PSX::PxD6Joint* Create_BasicPxD6Joint(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); diff --git a/Jusin154_Team3D/Engine/Public/Prototype_Manager.h b/Jusin154_Team3D/Engine/Public/Prototype_Manager.h index 13526382b..cbd646c3b 100644 --- a/Jusin154_Team3D/Engine/Public/Prototype_Manager.h +++ b/Jusin154_Team3D/Engine/Public/Prototype_Manager.h @@ -134,13 +134,13 @@ class CPrototype_Manager final : public CBase return strName; } - if (ImGui::IsItemHovered()) { + if (GUI::IsItemHovered()) { - ImGui::BeginTooltip(); // 툴팁 창 시작 + GUI::BeginTooltip(); // 툴팁 창 시작 - ImGui::TextUnformatted(CMyTools::ToString(wstrComponentName).c_str()); // 텍스트 출력 (Text 대신 Unformatted 추천) + GUI::TextUnformatted(CMyTools::ToString(wstrComponentName).c_str()); // 텍스트 출력 (Text 대신 Unformatted 추천) - ImGui::EndTooltip(); // 툴팁 창 종료 + GUI::EndTooltip(); // 툴팁 창 종료 }; if ((iIndex++ + 1) % 4 != 0) @@ -159,9 +159,9 @@ class CPrototype_Manager final : public CBase if(GUI::BeginCombo(pComponentName, (s_iCurrentItem >= 0 && s_iCurrentItem < pComponentNames.size()) ? pComponentNames[s_iCurrentItem] : "NONE")) { - if (ImGui::IsWindowAppearing()) + if (GUI::IsWindowAppearing()) { - ImGui::SetKeyboardFocusHere(); + GUI::SetKeyboardFocusHere(); filter.Clear(); } @@ -184,7 +184,7 @@ class CPrototype_Manager final : public CBase if (is_selected) { - ImGui::SetItemDefaultFocus(); + GUI::SetItemDefaultFocus(); } } diff --git a/Jusin154_Team3D/Engine/Public/Renderer.h b/Jusin154_Team3D/Engine/Public/Renderer.h index b7e6f2267..8ebd8d1cf 100644 --- a/Jusin154_Team3D/Engine/Public/Renderer.h +++ b/Jusin154_Team3D/Engine/Public/Renderer.h @@ -73,6 +73,8 @@ class CRenderer final : public CBase #pragma region TunningParameters /* TunningParam */ + // Variable + _float m_fLightSpecularMaximum = { 1.f }; // MotionBlur _float m_fMBBlurRadius = { 28.f }; diff --git a/Jusin154_Team3D/Engine/Public/RigidBody.h b/Jusin154_Team3D/Engine/Public/RigidBody.h index b1028e9dd..ec73daac3 100644 --- a/Jusin154_Team3D/Engine/Public/RigidBody.h +++ b/Jusin154_Team3D/Engine/Public/RigidBody.h @@ -39,7 +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; }; + PHYSX_USERDATA* Get_UserDataPtr() { return &m_tagData; }; + void OnRayCollision(class CGameObject* pCaster, _uint iCastedOrder, _float fDistance, _float3 vCastedWorldPos); protected: ACTOR m_eActorType = ACTOR::END; @@ -53,6 +54,7 @@ class ENGINE_DLL CRigidBody abstract : public CComponent CTransform* m_pTransform = { nullptr }; PHYSX_USERDATA m_tagData = {}; + protected: virtual HRESULT Initialize(void* pArg); diff --git a/Jusin154_Team3D/Engine/Public/Shader.h b/Jusin154_Team3D/Engine/Public/Shader.h index 30fe92cce..f445a4b04 100644 --- a/Jusin154_Team3D/Engine/Public/Shader.h +++ b/Jusin154_Team3D/Engine/Public/Shader.h @@ -6,6 +6,21 @@ NS_BEGIN(Engine) class ENGINE_DLL CShader final : public CComponent { + typedef struct tagShaderGlobalVariable { + D3D_SHADER_VARIABLE_CLASS eClass = D3D_SVC_FORCE_DWORD; + D3D_SHADER_VARIABLE_TYPE eType = D3D_SVT_FORCE_DWORD; + _uint iNumElement; + _uint iNumMember; + union { + ID3DX11EffectVariable* pVariable = { nullptr }; + ID3DX11EffectScalarVariable* pScalar; + ID3DX11EffectVectorVariable* pVector; + ID3DX11EffectMatrixVariable* pMatrix; + ID3DX11EffectShaderResourceVariable* pSRV; + ID3DX11EffectSamplerVariable* pSampler; + }; + }SHADERVARIABLE; + private: CShader(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CShader(const CShader& rhs); @@ -24,8 +39,15 @@ class ENGINE_DLL CShader final : public CComponent HRESULT Bind_SRVs(const _char* pConstantName, ID3D11ShaderResourceView** ppSRV, _uint iNumSRVs); HRESULT Bind_IntArray(const _char* pConstantName, const _int* pData, _uint elementCount); +private: + D3DX11_EFFECT_DESC m_EffectDesc = {}; + unordered_map* m_umapShaderRawVariables = {}; + private: HRESULT CreateShader(const _tchar* pShaderFilePath, const D3D11_INPUT_ELEMENT_DESC* pElements, _uint iNumElements); + HRESULT Hash_Variables(); + + SHADERVARIABLE* Find_VariableByName(const _char* pConstantName); #ifdef _DEBUG public: diff --git a/Jusin154_Team3D/Engine/Public/State.h b/Jusin154_Team3D/Engine/Public/State.h index 90f5b6623..b6752fccc 100644 --- a/Jusin154_Team3D/Engine/Public/State.h +++ b/Jusin154_Team3D/Engine/Public/State.h @@ -4,12 +4,12 @@ NS_BEGIN(STATEANIM) enum ESTATE { - IDLE, IDLE_G,IDLE_AIM, IDLE_TURN_L, IDLE_TURN_R, IDLE_TURN_BWD, IDLE_COMBAT_TURN_BWD_L, IDLE_COMBAT_TURN_BWD_R, IDLE_COMBAT_TURN_90_L, IDLE_COMBAT_TURN_90_R,IDLE_BREAK1,IDLE_BREAK2,IDLE_BREAK3,IDLE_BREAK4, IDLE_BREAK5, IDLE_BREAK6, IDLE_BREAK7, - MOVE, - WALK, WALK_FWD,WALK_RIGHT,WALK_LEFT, WALK_BWD,WALK_START, WALK_STOP,WALK_STOP_L, WALK_STOP_R, - JOG,JOG_START, JOG_FWD, JOG_RIGHT, JOG_LEFT, JOG_BWD, JOG_STOP, JOG_AIM_LEFT, JOG_AIM_RIGHT, JOG_AIM_BWD, JOG_AIM_STOP_L, JOG_AIM_STOP_R, JOG_AIM_STOP_BWD,JOG_LEFT_TURN,JOG_RIGHT_TURN,JOG_112_L,JOG_112_R,JOG_90_L,JOG_90_R, - SPRINT, - SLIDE_START_R,SLIDE_LOOP_R,SLIDE_STOP_R, + IDLE, IDLE_G,IDLE_AIM, IDLE_TURN_L, IDLE_TURN_R, IDLE_TURN_BWD, IDLE_COMBAT_TURN_BWD_L, IDLE_COMBAT_TURN_BWD_R, IDLE_COMBAT_TURN_90_L, IDLE_COMBAT_TURN_90_R,IDLE_BREAK1,IDLE_BREAK2,IDLE_BREAK3,IDLE_BREAK4, IDLE_BREAK5, IDLE_BREAK6, IDLE_BREAK7,IDLE_TURN_180_L, IDLE_TURN_180_R, IDLE_TURN_45_L, IDLE_TURN_45_R, IDLE_TURN_90_L, IDLE_TURN_90_R, + MOVE, + WALK, WALK_FWD,WALK_RIGHT,WALK_LEFT, WALK_BWD,WALK_START, WALK_STOP,WALK_STOP_L, WALK_STOP_R, + JOG,JOG_START, JOG_FWD, JOG_RIGHT, JOG_LEFT, JOG_BWD, JOG_STOP, JOG_AIM_LEFT, JOG_AIM_RIGHT, JOG_AIM_BWD, JOG_AIM_STOP_L, JOG_AIM_STOP_R, JOG_AIM_STOP_BWD,JOG_LEFT_TURN,JOG_RIGHT_TURN,JOG_112_L,JOG_112_R,JOG_90_L,JOG_90_R, + SPRINT, + SLIDE_START_R,SLIDE_LOOP_R,SLIDE_STOP_R, JUMP,JUMP_JOG,JUMP_SPRINT,FALL_LOOP, LAND,LAND_TO_JOG,LAND_TO_SPRINT,LAND_HARD,LAND_MID,LAND_SOFT, DODGE,DODGE_BLINK, DODGE_LEFT, DODGE_RIGHT,DODGE_ATTACK, diff --git a/Jusin154_Team3D/Engine/Public/Unit.h b/Jusin154_Team3D/Engine/Public/Unit.h index 22fcfd6e9..e814ef13a 100644 --- a/Jusin154_Team3D/Engine/Public/Unit.h +++ b/Jusin154_Team3D/Engine/Public/Unit.h @@ -93,6 +93,7 @@ class ENGINE_DLL CUnit abstract : public CContainerObject HRESULT Ready_Components(void*pArg); void Play_Event(); void Add_Event(_uint AnimIndex, function Callback, _float fRatio = 0.f, _bool bKeep = false); + void Reset_Event(); void Check_HitAngle(_vector ProjectileDir); void Load_AnimXML(const string& path); STATEANIM::ESTATE StringToStateAnim(const string& s);