diff --git a/Jusin154_Team3D/Client/Default/Broom_States.cpp b/Jusin154_Team3D/Client/Default/Broom_States.cpp index df3d7351c..c9b3f3450 100644 --- a/Jusin154_Team3D/Client/Default/Broom_States.cpp +++ b/Jusin154_Team3D/Client/Default/Broom_States.cpp @@ -5,12 +5,7 @@ #pragma region STATE #include "State_Idle.h" -#include "State_Dodge.h" -#include "State_Jump.h" -#include "State_Land.h" #include "State_Move.h" -#include "State_Combat.h" -#include "State_Broom_Ride.h" #pragma endregion #pragma region States @@ -102,10 +97,11 @@ HRESULT CBroom::Behavior_IdleExitCheck(_float fTimeDelta) if (m_pGameInstance->Key_Down(DIK_B)) { pairAnimInfo = m_Animation[STATEANIM::BROOM_MOUNT_B]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + m_pFSM->Enable_State(FSMSTATE::MOUNT_B); } } - if (SUCCEEDED(InputMove())) + if (SUCCEEDED(InputMove()) && m_pFSM->IsEnable(FSMSTATE::MOUNT_B)) { m_pFSM->Change_State(FSMSTATE::MOVE); return E_FAIL; @@ -116,7 +112,7 @@ HRESULT CBroom::Behavior_IdleExitCheck(_float fTimeDelta) void CBroom::Behavior_IdleExit() { - m_pFSM->Disable_State(FSMSTATE::IDLE); + m_pFSM->Disable_State(FSMSTATE::IDLE | FSMSTATE::MOUNT_B); } void CBroom::Behavior_MoveEnter() diff --git a/Jusin154_Team3D/Client/Default/Client.cpp b/Jusin154_Team3D/Client/Default/Client.cpp index 803e283b6..774dc7394 100644 --- a/Jusin154_Team3D/Client/Default/Client.cpp +++ b/Jusin154_Team3D/Client/Default/Client.cpp @@ -53,8 +53,9 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, MSG msg; pMainApp = CMainApp::Create(); - if (nullptr == pMainApp) + if (nullptr == pMainApp){ return FALSE; + } CGameInstance* pGameInstance = CGameInstance::GetInstance(); SAFE_ADDREF(pGameInstance); @@ -94,8 +95,9 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, { if (PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE)) { - if (WM_QUIT == msg.message) + if (WM_QUIT == msg.message){ break; + } if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) { TranslateMessage(&msg); diff --git a/Jusin154_Team3D/Client/Private/Action_Panel.cpp b/Jusin154_Team3D/Client/Private/Action_Panel.cpp index 397ed394d..ccc5aea7d 100644 --- a/Jusin154_Team3D/Client/Private/Action_Panel.cpp +++ b/Jusin154_Team3D/Client/Private/Action_Panel.cpp @@ -126,10 +126,12 @@ void CAction_Panel::Magic_Meter_Visible(_uint iIndex, _bool bVisible) default: return; } - if (bVisible) + if (bVisible){ m_iMagic_Meter_Count++; - else + } + else{ m_iMagic_Meter_Count--; + } } void CAction_Panel::Magic_Meter_UV() diff --git a/Jusin154_Team3D/Client/Private/Bombard.cpp b/Jusin154_Team3D/Client/Private/Bombard.cpp index 0d6897a7b..9a5536b42 100644 --- a/Jusin154_Team3D/Client/Private/Bombard.cpp +++ b/Jusin154_Team3D/Client/Private/Bombard.cpp @@ -57,8 +57,9 @@ void CBombard::Priority_Update(_float fTimeDelta) void CBombard::Update(_float fTimeDelta) { - if (m_bVisible == false) + if (m_bVisible == false){ return; + } __super::Update(fTimeDelta); @@ -71,8 +72,9 @@ void CBombard::Update(_float fTimeDelta) void CBombard::Late_Update(_float fTimeDelta) { - if (m_bVisible == false) + if (m_bVisible == false){ return; + } __super::Late_Update(fTimeDelta); @@ -215,9 +217,9 @@ void CBombard::Free() { __super::Free(); - if (m_pPhysHitBox != nullptr) + if (m_pPhysHitBox != nullptr){ SAFE_RELEASE(m_pPhysHitBox); - + } SAFE_RELEASE(m_pLight_Projectile); } diff --git a/Jusin154_Team3D/Client/Private/Broom.cpp b/Jusin154_Team3D/Client/Private/Broom.cpp index f6cb448d4..aeed59356 100644 --- a/Jusin154_Team3D/Client/Private/Broom.cpp +++ b/Jusin154_Team3D/Client/Private/Broom.cpp @@ -42,7 +42,6 @@ HRESULT CBroom::Initialize(void* pArg) m_pFSM->Change_State(FSMSTATE::IDLE); } - return S_OK; } @@ -64,8 +63,9 @@ void CBroom::Late_Update(_float fTimeDelta) HRESULT CBroom::Render() { - if (!m_pModelCom) + if (!m_pModelCom){ return S_OK; + } if (FAILED(Bind_ShaderResources())) { return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/CamPosition_Shoulder.cpp b/Jusin154_Team3D/Client/Private/CamPosition_Shoulder.cpp index f32d2487b..447eca4d8 100644 --- a/Jusin154_Team3D/Client/Private/CamPosition_Shoulder.cpp +++ b/Jusin154_Team3D/Client/Private/CamPosition_Shoulder.cpp @@ -88,10 +88,10 @@ void CCamPosition_Shoulder::Priority_Update(_float fTimeDelta) void CCamPosition_Shoulder::Update(_float fTimeDelta) { - GUI::DragFloat3("Camera Shoulder Position",(_float*)&m_vShoulderPosRatio,0.01f); GUI::DragFloat("Camera Shoulder Length",&m_fCameraFocalLength, 0.01f); - if (m_pGameInstance->Key_Up(DIK_O)) { + if (m_pGameInstance->Key_Up(DIK_INSERT)) { + m_pBinded_Camera->Toggle_Priority(); } if (FAILED(m_pGameInstance->IsBinded_Camera(CAMERA_SHOULDER))) { diff --git a/Jusin154_Team3D/Client/Private/Decendo.cpp b/Jusin154_Team3D/Client/Private/Decendo.cpp index 0f2d27a51..3332dbdb1 100644 --- a/Jusin154_Team3D/Client/Private/Decendo.cpp +++ b/Jusin154_Team3D/Client/Private/Decendo.cpp @@ -73,17 +73,18 @@ void CDecendo::Update(_float fTimeDelta) Update_Event(fTimeDelta); - m_pProjectile_Blur->Get_Component()->Translation(m_vOwnerLook * 0.5f); - m_pProjectile->Get_Component()->Translation(m_vOwnerLook * 0.5f); + m_pProjectile_Blur->Get_Component()->Translation(m_vCameraLook * 0.5f); + m_pProjectile->Get_Component()->Translation(m_vCameraLook * 0.5f); if (nullptr != m_pPhysHitBox) { - m_pPhysHitBox->Get_Component()->AccumulateMomentum(m_vOwnerLook * 0.5f); + m_pPhysHitBox->Get_Component()->AccumulateMomentum(m_vCameraLook * 0.5f); } - if (m_fAccTime > XM_2PI) + if (m_fAccTime > XM_2PI){ return; + } m_fAccTime += fTimeDelta * 7.5f; @@ -97,8 +98,9 @@ void CDecendo::Update(_float fTimeDelta) void CDecendo::Late_Update(_float fTimeDelta) { - if (m_bVisible == false) + if (m_bVisible == false){ return; + } Get_PartObject()->Trail_Update(m_pProjectile->Get_Component()->Get_XMWorldMatrix(), fTimeDelta); @@ -144,11 +146,11 @@ HRESULT CDecendo::Pre_Setting(CGameObject* pObject) //나아가는 벡터와 한점을 가져와 수직인 평면상에 하나의 점으로 DIR 을 만듬 - m_vOwnerLook = XMVector3Normalize(m_pOwner->Get_Component()->Get_State(STATE::LOOK)); + m_vCameraLook = XMVector3Normalize(m_pOwner->Get_Component()->Get_State(STATE::LOOK)); _vector vUp = XMVectorSet(0.f, 1.f, 0.f, 0.f); - _vector vQuaternion = XMQuaternionRotationAxis(m_vOwnerLook, m_pGameInstance->Random_Float(0.f, XM_PIDIV2)); + _vector vQuaternion = XMQuaternionRotationAxis(m_vCameraLook, m_pGameInstance->Random_Float(0.f, XM_PIDIV2)); m_vRotateUp = XMVector3Rotate(vUp, vQuaternion); m_vRotateUp = XMVector3Normalize(m_vRotateUp); diff --git a/Jusin154_Team3D/Client/Private/EffectObject.cpp b/Jusin154_Team3D/Client/Private/EffectObject.cpp index ee704f414..d1cd063f9 100644 --- a/Jusin154_Team3D/Client/Private/EffectObject.cpp +++ b/Jusin154_Team3D/Client/Private/EffectObject.cpp @@ -160,8 +160,9 @@ HRESULT CEffectObject::Load(const _char* pFilePath, LEVEL eLevel) SAFE_RELEASE(m_pInstance_ModelCom); - if (m_pLightCom != nullptr) + if (m_pLightCom != nullptr){ SAFE_RELEASE(m_pLightCom); + } _string strPerfectFilePath = pFilePath; @@ -730,8 +731,9 @@ void CEffectObject::Free() SAFE_RELEASE(m_pShaderCom); SAFE_RELEASE(m_pInstance_ModelCom); - if (m_pLightCom != nullptr) + if (m_pLightCom != nullptr){ SAFE_RELEASE(m_pLightCom); + } } diff --git a/Jusin154_Team3D/Client/Private/EffectParts.cpp b/Jusin154_Team3D/Client/Private/EffectParts.cpp index 7baa44447..c94f801eb 100644 --- a/Jusin154_Team3D/Client/Private/EffectParts.cpp +++ b/Jusin154_Team3D/Client/Private/EffectParts.cpp @@ -47,10 +47,7 @@ void CEffectParts::Update(_float fTimeDelta) if (m_pInstance_ModelCom == nullptr) return; - m_pInstance_ModelCom->Drop(fTimeDelta); - if (m_EffectInfo.isBillboard) - m_pGameInstance->BillBoard(m_pTransformCom); } @@ -64,6 +61,9 @@ void CEffectParts::Late_Update(_float fTimeDelta) if (m_pInstance_ModelCom == nullptr) return; + m_pInstance_ModelCom->Drop(fTimeDelta); + + if (m_EffectInfo.isBillboard) m_pGameInstance->BillBoard(m_pTransformCom); diff --git a/Jusin154_Team3D/Client/Private/EffectPool.cpp b/Jusin154_Team3D/Client/Private/EffectPool.cpp index 67eceabf3..9b57619ff 100644 --- a/Jusin154_Team3D/Client/Private/EffectPool.cpp +++ b/Jusin154_Team3D/Client/Private/EffectPool.cpp @@ -47,6 +47,7 @@ void CEffectPool::Priority_Update(_float fTimeDelta) { //SAFE_RELEASE(*iter); //iter = m_ActiveEffectList.erase(iter); + ++iter; } else { @@ -64,6 +65,7 @@ void CEffectPool::Update(_float fTimeDelta) { //SAFE_RELEASE(*iter); //iter = m_ActiveEffectList.erase(iter); + ++iter; } else { diff --git a/Jusin154_Team3D/Client/Private/Effect_Container.cpp b/Jusin154_Team3D/Client/Private/Effect_Container.cpp index 47e284b23..33ee16f68 100644 --- a/Jusin154_Team3D/Client/Private/Effect_Container.cpp +++ b/Jusin154_Team3D/Client/Private/Effect_Container.cpp @@ -146,8 +146,9 @@ HRESULT CEffect_Container::Reset_EffectParts() { CInstance_Model* pInstanceModel = iter.second->Get_Component(); - if (pInstanceModel == nullptr) + if (pInstanceModel == nullptr){ continue; + } pInstanceModel->Instane_Buffer_ReStruct(); } diff --git a/Jusin154_Team3D/Client/Private/InfoInstance.cpp b/Jusin154_Team3D/Client/Private/InfoInstance.cpp index 5e955fb4d..ae68827d5 100644 --- a/Jusin154_Team3D/Client/Private/InfoInstance.cpp +++ b/Jusin154_Team3D/Client/Private/InfoInstance.cpp @@ -63,9 +63,12 @@ HRESULT CInfoInstance::Deregist_ActiveMonster(CMonster* pUnit) return m_pMonsterInfo->Deregist_ActiveMonster(pUnit); } -CMonster* CInfoInstance::Get_LockOnMonster() +CUnit* CInfoInstance::Get_LockOnUnit() { - return m_pMonsterInfo->Get_LockOnMonster(); + CUnit* pUnit = { nullptr }; + pUnit = m_pMonsterInfo->Get_LockOnUnit(); + // pUnit = m_pInfo->Get_LockOnUnit(); + return pUnit; } pair CInfoInstance::Get_NearestPlayerAlly(_fvector vPos) diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index ee647b69d..1e30d6175 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -63,9 +63,11 @@ HRESULT CLevel_GamePlay::Initialize() void CLevel_GamePlay::Update(_float fTimeDelta) { - if (m_pGameInstance->Key_Up(DIK_ADD)) - { - m_pGameInstance->Set_LevelToChange(); + if (m_pGameInstance->Key_Pressing(DIK_0)) { + if (m_pGameInstance->Key_Up(DIK_1)) + { + m_pGameInstance->Set_LevelToChange(); + } } m_pInfoInstance->Update(fTimeDelta); diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index b514c45cf..343d25dc8 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -64,6 +64,8 @@ #include "Trail.h" #include "EffectPool.h" + + #pragma endregion #pragma region MAP @@ -559,7 +561,7 @@ HRESULT CLoader::Loading_For_GamePlay() return E_FAIL; if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Wand_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Wand/Wand.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity())))) + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Wand/Wand.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixRotationX(XMConvertToRadians(-90.f)) * XMMatrixIdentity())))) return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/MonsterInfo.cpp b/Jusin154_Team3D/Client/Private/MonsterInfo.cpp index e3339ea97..9b674760d 100644 --- a/Jusin154_Team3D/Client/Private/MonsterInfo.cpp +++ b/Jusin154_Team3D/Client/Private/MonsterInfo.cpp @@ -77,7 +77,7 @@ HRESULT CMonsterInfo::Deregist_ActiveMonster(CMonster* pUnit) return E_FAIL; } -CMonster* CMonsterInfo::Get_LockOnMonster() +CUnit* CMonsterInfo::Get_LockOnUnit() { return m_pLockOnMonster; } diff --git a/Jusin154_Team3D/Client/Private/NomalJap.cpp b/Jusin154_Team3D/Client/Private/NomalJap.cpp index 288e74f50..26129b989 100644 --- a/Jusin154_Team3D/Client/Private/NomalJap.cpp +++ b/Jusin154_Team3D/Client/Private/NomalJap.cpp @@ -1,6 +1,8 @@ #include "pch.h" #include "NomalJap.h" +#include "Unit.h" +#include "InfoInstance.h" #include "GameInstance.h" #include "EffectParts.h" #include "PhysXEffectHitBox.h" @@ -13,7 +15,8 @@ CNomalJap::CNomalJap(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) } CNomalJap::CNomalJap(const CNomalJap& rhs) - : CEffect_Container(rhs) + : CEffect_Container(rhs), + m_pInfoInstance(CInfoInstance::GetInstance()) { } @@ -47,8 +50,8 @@ HRESULT CNomalJap::Initialize(void* pArg) SAFE_ADDREF(m_pProjectile); SAFE_ADDREF(m_pProjectile_Side); - m_fDuration = 5.f; - + m_fDuration = 1.f; + assert(m_fDuration > 0.f); return S_OK; } @@ -71,27 +74,48 @@ void CNomalJap::Update(_float fTimeDelta) __super::Update(fTimeDelta); Update_Event(fTimeDelta); - - m_pProjectile_Side->Get_Component()->Translation(m_vOwnerLook * 1.2f); - m_pProjectile->Get_Component()->Translation(m_vOwnerLook * 1.2f); - - - if (nullptr != m_pPhysHitBox) { - m_pPhysHitBox->Get_Component()->AccumulateMomentum(m_vOwnerLook * 1.2f); + if (m_fAccTime > m_fDuration) { + SAFE_RELEASE(m_pTargetUnit); } + _vector vDirection = XMLoadFloat3(&m_vDirection); - if (m_fAccTime > XM_2PI) - return; - m_fAccTime += fTimeDelta * 15.f; - - m_pProjectile_Side->Get_Component()->Translation(m_vRotateUp * 0.6f * sinf(m_fAccTime)); - m_pProjectile->Get_Component()->Translation(m_vRotateUp * 0.6f * sinf(m_fAccTime)); + // 선속도 + m_pProjectile_Side->Get_Component()->Translation(vDirection * m_fLinearSpeed * fTimeDelta); + m_pProjectile->Get_Component()->Translation(vDirection * m_fLinearSpeed * fTimeDelta); if (nullptr != m_pPhysHitBox) { - m_pPhysHitBox->Get_Component()->AccumulateMomentum(m_vRotateUp * 0.6f * sinf(m_fAccTime)); + m_pPhysHitBox->Get_Component()->AccumulateMomentum(vDirection * m_fLinearSpeed * fTimeDelta); + } + + if (false == m_bTrailPulseEnded && m_fAccTime > m_fDuration * 0.3f) { + m_bTrailPulseEnded = true; + if (nullptr != m_pTargetUnit && false == m_pTargetUnit->isDead()) { + _vector vCurrentPos = m_pProjectile->Get_WorldPostion(); + _vector vTargetPos = m_pTargetUnit->Get_WorldPostion(); + XMStoreFloat4(&m_vTargetPos, vTargetPos); + XMStoreFloat3(&m_vDirection, XMVector4Normalize(vTargetPos - vCurrentPos)); + + _float fDistance = XMVectorGetX(XMVector3Length(vTargetPos - vCurrentPos)); + m_fLinearSpeed = fDistance / (m_fDuration - m_fAccTime) * 10 / 3; + SAFE_RELEASE(m_pTargetUnit); + } + return; + } + if (true == m_bTrailPulseEnded) { + return; + } + _vector vRotateUp = XMLoadFloat3(&m_vRotateUp); + m_fAccTime += fTimeDelta; + + // 각속도 + m_pProjectile_Side->Get_Component()->Translation(vRotateUp * 0.6f * sinf(m_fAngularSpeed * m_fAccTime)); + m_pProjectile->Get_Component()->Translation(vRotateUp * 0.6f * sinf(m_fAngularSpeed * m_fAccTime)); + + if (nullptr != m_pPhysHitBox) { + m_pPhysHitBox->Get_Component()->AccumulateMomentum(vRotateUp * 0.6f * sinf(m_fAngularSpeed * m_fAccTime)); } } @@ -124,11 +148,14 @@ HRESULT CNomalJap::Pre_Setting(CGameObject* pObject) m_fAccTime = 0.f; __super::m_fAccTime = 0.f; m_fPreAccTime = 0.f; + m_bTrailPulseEnded = false; /* 초기 객체 위치 초기화 */ - m_pProjectile->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); - m_pProjectile_Side->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + _vector vStartPos = m_pOwner->Get_WorldPostion(); + XMStoreFloat4(&m_vStartPos, vStartPos); + m_pProjectile->Get_Component()->Set_State(STATE::POSITION, vStartPos); + m_pProjectile_Side->Get_Component()->Set_State(STATE::POSITION, vStartPos); /* 초기 객체 비지블 */ m_pProjectile->Set_Visible(true); @@ -136,18 +163,38 @@ HRESULT CNomalJap::Pre_Setting(CGameObject* pObject) /*트레일 초기화 */ Get_PartObject()->Set_Visible(true); - Get_PartObject()->Get_Component()->Reset_Trail(); //나아가는 벡터와 한점을 가져와 수직인 평면상에 하나의 점으로 DIR 을 만듬 - m_vOwnerLook = XMVector3Normalize(m_pOwner->Get_Component()->Get_State(STATE::LOOK)); + pair<_float3, _float3> pairCameraLook = m_pInfoInstance->Get_CameraCoordinateSystem(); + _vector vDirection = XMVector3Normalize(XMLoadFloat3(&pairCameraLook.first)); _vector vUp = XMVectorSet(0.f, 1.f, 0.f, 0.f); + XMStoreFloat3(&m_vDirection, vDirection); - _vector vQuaternion = XMQuaternionRotationAxis(m_vOwnerLook, m_pGameInstance->Random_Float(0.f, XM_PIDIV2)); + _vector vQuaternion = XMQuaternionRotationAxis(vDirection, m_pGameInstance->Random_Float(0.f, XM_PIDIV2)); + + { /* 대상 위치 지정 */ + SAFE_RELEASE(m_pTargetUnit); + m_pTargetUnit = m_pInfoInstance->Get_LockOnUnit(); + if (nullptr != m_pTargetUnit) { + SAFE_ADDREF(m_pTargetUnit); // 타겟이 있다면 타겟 위치로 지정 + XMStoreFloat4(&m_vTargetPos, m_pTargetUnit->Get_WorldPostion()); + } + else { + // 타겟이 없다면 현재위치 -> 카메라 룩벡터 * duration간 예상 이동거리 를 대상으로 지정 + XMStoreFloat4(&m_vTargetPos, vStartPos + vDirection * m_pTransformCom->Get_Speed() * m_fDuration); + } + } + { /* 대상 거리 계산 */ + _float fDistance = XMVectorGetX(XMVector3Length(XMLoadFloat4(&m_vTargetPos) - XMLoadFloat4(&m_vStartPos))); + m_fLinearSpeed = fDistance / m_fDuration; - m_vRotateUp = XMVector3Rotate(vUp, vQuaternion); + // 전체 duration 의 0.3 지점에서 2π 회전하도록 각속도 설정 + _float fTargetRatio = 0.3f; + m_fAngularSpeed = m_pGameInstance->Random_Float(2.f, 2.8f) * XM_2PI / (m_fDuration * fTargetRatio); + } - m_vRotateUp = XMVector3Normalize(m_vRotateUp); + XMStoreFloat3(&m_vRotateUp, XMVector3Normalize(XMVector3Rotate(vUp, vQuaternion))); m_bVisible = true; @@ -226,6 +273,7 @@ void CNomalJap::OnCollision(CGameObject* pOther, void* pDesc) Get_PartObject("JapPT0")->Get_Component()->LookAt(m_pOwner->Get_WorldPostion()); + SAFE_RELEASE(m_pTargetUnit); m_pProjectile_Side->Set_Visible(false); m_pProjectile->Set_Visible(false); @@ -242,9 +290,11 @@ void CNomalJap::Free() { __super::Free(); - if (m_pPhysHitBox != nullptr) + if (m_pPhysHitBox != nullptr){ SAFE_RELEASE(m_pPhysHitBox); + } + SAFE_RELEASE(m_pTargetUnit); Safe_Release(m_pProjectile); Safe_Release(m_pProjectile_Side); diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index d7726e40b..4c6375854 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -59,8 +59,11 @@ HRESULT CPlayer::Initialize(void* pArg) Load_KeyFrame(); #endif // _DEBUG + m_pBroomModel = static_cast(pArg)->Get_Component(); + SAFE_ADDREF(m_pBroomModel); m_pBroomTransform = static_cast(pArg)->Get_Component(); + SAFE_ADDREF(m_pBroomTransform); Add_FSM(); @@ -115,8 +118,9 @@ void CPlayer::Update(_float fTimeDelta) m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); + Play_Event(); - __super::Update(fTimeDelta); +__super::Update(fTimeDelta); #ifdef _DEBUG Describe_Entity(); #endif // _DEBUG @@ -136,7 +140,7 @@ void CPlayer::Late_Update(_float fTimeDelta) __super::Late_Update(fTimeDelta); if (nullptr != m_pLockOnMonster && false == m_pLockOnMonster->isDead()) { - m_pLockOnMonster->Set_DrawOutLine(); + static_cast(m_pLockOnMonster)->Set_DrawOutLine(); } } @@ -186,7 +190,7 @@ void CPlayer::Render_CameraCoordinateSystem() const _float fArrowLength = 2.0f; _vector xmvLook = XMVector4Normalize(XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f)); _float2 vLook = { XMVectorGetX(xmvLook), XMVectorGetZ(xmvLook) }; - + GUI::Begin("Player_CAM_COOORD"); GUI::Text("%d", m_pLockOnMonster); GUI::Text("W : %.2f, %.2f, %.2f", m_vCameraLookDir.x, 0.f, m_vCameraLookDir.z); @@ -204,6 +208,7 @@ void CPlayer::Render_CameraCoordinateSystem() GUI::Button("##6", { fButtonSize, fButtonSize }); GUI::SameLine(); GUI::Button(("S : " + to_string(XMConvertToDegrees(CMyTools::Get_Direction2D(vLook, { -m_vCameraLookDir.x , -m_vCameraLookDir.z })))).c_str(), { fButtonSize, fButtonSize }); GUI::SameLine(); GUI::Button("##8", { fButtonSize, fButtonSize }); + GUI::End(); //W CMyTools::Get_Direction2D(vLook, { m_vCameraLookDir.x , m_vCameraLookDir.z }) //A CMyTools::Get_Direction2D(vLook, { -m_vCameraRightDir.x , - m_vCameraRightDir.z }) //S CMyTools::Get_Direction2D(vLook, { m_vCameraRightDir.x , m_vCameraRightDir.z }) @@ -331,7 +336,7 @@ HRESULT CPlayer::Bind_ShaderResources() } void CPlayer::ReLockOnTarget() { - m_pLockOnMonster = m_pInfoInstance->Get_LockOnMonster(); + m_pLockOnMonster = m_pInfoInstance->Get_LockOnUnit(); if (nullptr != m_pLockOnMonster) { if (true == m_pLockOnMonster->isDead()) { m_pLockOnMonster = nullptr; @@ -386,6 +391,34 @@ _matrix CPlayer::Get_WandPos() return BoneMatrix; } +void CPlayer::Play_Event() +{ + for (auto iter = m_PendingEvents.begin(); iter != m_PendingEvents.end(); ) + { + _float ratio = m_pModelCom->Get_CurrentTrackProgressRatio(); + _uint curAnim = m_pModelCom->Get_AnimIndex(); + + if (curAnim == iter->AnimIndex && ratio >= iter->fRatio) + { + iter->Callback(); + iter = m_PendingEvents.erase(iter); + } + else + { + ++iter; + } + } +} + +void CPlayer::Add_Event(_uint AnimIndex, function Callback, _float fRatio) +{ + PendingEvent Desc; + Desc.AnimIndex = AnimIndex; + Desc.fRatio = fRatio; + Desc.Callback = Callback; + m_PendingEvents.push_back(Desc); +} + CPlayer* CPlayer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { CPlayer* pInstance = new CPlayer(pDevice, pContext); @@ -435,6 +468,8 @@ void CPlayer::Free() SAFE_RELEASE(m_pCamPosition_TopDown_LookPart); SAFE_RELEASE(m_pCamPosition_ShoulderPart); SAFE_RELEASE(m_pEffectPool); + SAFE_RELEASE(m_pBroomModel); + SAFE_RELEASE(m_pBroomTransform); } #ifdef _DEBUG @@ -471,6 +506,8 @@ void CPlayer::Describe_Entity() string AnimList = m_pModelCom->Get_AnimList(m_pModelCom->Get_AnimIndex()); GUI::Text(AnimList.c_str()); + GUI::Text("AnimTrack %.2f", m_pModelCom->Get_CurrentTrackPosition()); + GUI::Checkbox("Render", &m_bVisible); GUI::Text("%d", m_iStateMask); diff --git a/Jusin154_Team3D/Client/Private/Player_States.cpp b/Jusin154_Team3D/Client/Private/Player_States.cpp index 48ca4a64b..c60e3ab57 100644 --- a/Jusin154_Team3D/Client/Private/Player_States.cpp +++ b/Jusin154_Team3D/Client/Private/Player_States.cpp @@ -23,6 +23,7 @@ #include "EffectPool.h" + #pragma region States void CPlayer::TestKeyInput(_float fTimeDelta) @@ -51,7 +52,10 @@ void CPlayer::TestKeyInput(_float fTimeDelta) { m_eSpell = STATEANIM::DISILLUSION_EXIT; } - + if (m_pGameInstance->Key_Down(DIK_F7)) + { + m_eSpell = STATEANIM::LUMOS; + } } HRESULT CPlayer::InputAction() @@ -303,10 +307,8 @@ void CPlayer::Behavior_MoveEnter() m_pFSM->Enable_State(FSMSTATE::JOG); m_bSprintToggle = false; m_bWalkToggle = false; - if (SUCCEEDED(InputMove())) - { - pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; - } + pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; + m_bRatio = true; } } else { // While Moving @@ -328,6 +330,7 @@ void CPlayer::Behavior_MoveEnter() m_bSprintToggle = false; m_bWalkToggle = false; pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; + m_bRatio = true; } } @@ -672,24 +675,28 @@ void CPlayer::Behavior_CombatEnter() pair<_uint, _bool> pairAnimInfo = {}; m_pFSM->Enable_State(FSMSTATE::COMBAT); + if (m_pModelCom->Get_SecondAnimIndex() == m_Animation[STATEANIM::LUMOS].first) + { + m_pModelCom->Set_Second_AnimationIndex(-1, ENUM_CLASS(BLEND_BONE::SHOULDER_R)); + m_eSpell = STATEANIM::END; + } if (m_pGameInstance->Key_Down(DIK_R)) { m_pFSM->Enable_State(FSMSTATE::SKILL); pairAnimInfo = m_Animation[STATEANIM::SKILL]; + + } else if (m_pGameInstance->Key_Down(DIK_Q)) { m_pFSM->Enable_State(FSMSTATE::SKILL2); pairAnimInfo = m_Animation[STATEANIM::SKILL2]; - - m_pEffectPool->Use_Skill(SKILL_TYPE::PROTEGO, this); + Add_Event(pairAnimInfo.first, + [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::PROTEGO, this); }, + 0.4f); } else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) { m_pFSM->Enable_State(FSMSTATE::LIGHT_ATTACK); pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK]; - m_pEffectPool->Use_Skill(SKILL_TYPE::JAP, this); - /*m_pModelCom->Anim_Event(0.1f, m_Animation[STATEANIM::LIGHT_ATTACK].first, [this]() { - m_pEffectPool->Use_Skill(SKILL_TYPE::JAP, this); - return E_FAIL; - });*/ + Add_Event(pairAnimInfo.first, [this]() { m_pEffectPool->Use_Skill(SKILL_TYPE::JAP, Get_PartObject()); }, 0.1f); } else if (SUCCEEDED(InputSpell())) { m_pFSM->Enable_State(FSMSTATE::SPELL); @@ -700,6 +707,7 @@ void CPlayer::Behavior_CombatEnter() case STATEANIM::DEPULSO: pairAnimInfo = m_Animation[STATEANIM::DEPULSO]; m_eSpell = STATEANIM::END; + break; case STATEANIM::DIFFINDO: pairAnimInfo = m_Animation[STATEANIM::DIFFINDO]; @@ -713,6 +721,47 @@ void CPlayer::Behavior_CombatEnter() pairAnimInfo = m_Animation[STATEANIM::DISILLUSION_EXIT]; m_eSpell = STATEANIM::END; break; + case STATEANIM::LUMOS: + if (m_pModelCom->Get_SecondAnimIndex() != m_Animation[STATEANIM::LUMOS].first) + { + if (SUCCEEDED(InputMove())) + { + if (m_bSprintToggle) { + pairAnimInfo = m_Animation[STATEANIM::SPRINT]; + } + else if (m_bWalkToggle) { + pairAnimInfo = m_Animation[STATEANIM::WALK_FWD]; + } + else { + pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; + } + } + else { + pairAnimInfo = m_Animation[STATEANIM::IDLE]; + } + m_pModelCom->Set_Second_AnimationIndex(m_Animation[STATEANIM::LUMOS].first, ENUM_CLASS(BLEND_BONE::SHOULDER_R), true); + } + else + { + if (SUCCEEDED(InputMove())) + { + if (m_bSprintToggle) { + pairAnimInfo = m_Animation[STATEANIM::SPRINT]; + } + else if (m_bWalkToggle) { + pairAnimInfo = m_Animation[STATEANIM::WALK_FWD]; + } + else { + pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; + } + } + else { + pairAnimInfo = m_Animation[STATEANIM::IDLE]; + } + m_pModelCom->Set_Second_AnimationIndex(m_Animation[STATEANIM::LUMOS_STOP].first, ENUM_CLASS(BLEND_BONE::SHOULDER_R)); + m_eSpell = STATEANIM::END; + } + break; default: pairAnimInfo = m_Animation[STATEANIM::SPELL]; break; @@ -731,7 +780,21 @@ void CPlayer::Behavior_CombatEnter() } else if (m_pGameInstance->Key_Down(DIK_G)) { m_pFSM->Enable_State(FSMSTATE::POTION); - pairAnimInfo = m_Animation[STATEANIM::POTION]; + if (SUCCEEDED(InputMove())) + { + if (m_bSprintToggle) + { + pairAnimInfo = m_Animation[STATEANIM::SPRINT]; + } + else if (m_bWalkToggle) + { + pairAnimInfo = m_Animation[STATEANIM::WALK_FWD]; + } + else { + pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; + } + } + m_pModelCom->Set_Second_AnimationIndex(m_Animation[STATEANIM::POTION].first,ENUM_CLASS(BLEND_BONE::SHOULDER_NECK_L)); } m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); @@ -740,6 +803,7 @@ void CPlayer::Behavior_CombatEnter() HRESULT CPlayer::Behavior_CombatExitCheck() { pair<_uint, _bool> pairAnimInfo; + if (SUCCEEDED(InputAction()) || SUCCEEDED(InputSpell())) { if (m_pGameInstance->Key_Down(DIK_R)) { @@ -761,9 +825,9 @@ HRESULT CPlayer::Behavior_CombatExitCheck() pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK]; pairAnimInfo.first = iIndex + 1; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); - - m_pEffectPool->Use_Skill(SKILL_TYPE::JAP, this); - + Add_Event(pairAnimInfo.first, + [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::JAP, this);}, + 0.1f); } } } @@ -793,8 +857,22 @@ HRESULT CPlayer::Behavior_CombatExitCheck() } else if (m_pGameInstance->Key_Down(DIK_G)) { m_pFSM->Enable_State(FSMSTATE::POTION); - pairAnimInfo = m_Animation[STATEANIM::POTION]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + if (SUCCEEDED(InputMove())) + { + if (m_bSprintToggle) + { + pairAnimInfo = m_Animation[STATEANIM::SPRINT]; + } + else if (m_bWalkToggle) + { + pairAnimInfo = m_Animation[STATEANIM::WALK_FWD]; + } + else { + pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; + } + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + } + m_pModelCom->Set_Second_AnimationIndex(m_Animation[STATEANIM::POTION].first, ENUM_CLASS(BLEND_BONE::SHOULDER_NECK_L)); } } @@ -807,31 +885,24 @@ HRESULT CPlayer::Behavior_CombatExitCheck() case STATEANIM::ACCIO: { pairAnimInfo = m_Animation[STATEANIM::ACCIO]; + Add_Event(pairAnimInfo.first, + [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::BOMBARD, this);m_eSpell = STATEANIM::END; }, + 0.25f); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } break; case STATEANIM::DESCENDO: + { pairAnimInfo = m_Animation[STATEANIM::DESCENDO]; - + Add_Event(pairAnimInfo.first, + [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::DESCENDO, this);m_eSpell = STATEANIM::END; }, + 0.1f); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + } break; default: break; } - - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); - - m_pModelCom->Anim_Event(0.f, m_Animation[STATEANIM::ACCIO].first, [this]() { - m_pEffectPool->Use_Skill(SKILL_TYPE::BOMBARDA, this); - - m_eSpell = STATEANIM::END; - return E_FAIL; - }); - - m_pModelCom->Anim_Event(0.f, m_Animation[STATEANIM::DESCENDO].first, [this]() { - m_pEffectPool->Use_Skill(SKILL_TYPE::DESCENDO, this); - - m_eSpell = STATEANIM::END; - return E_FAIL; - }); } } @@ -850,8 +921,12 @@ HRESULT CPlayer::Behavior_CombatExitCheck() } } - if (m_pModelCom->IsFinishedAnim()) { + if (SUCCEEDED(InputMove())) + { + m_pFSM->Change_State(FSMSTATE::MOVE); + return E_FAIL; + } m_pFSM->Change_State(FSMSTATE::IDLE); return E_FAIL; } @@ -991,8 +1066,12 @@ void CPlayer::Player_InterpTurn(_float fTimeDelta) _float angleDiff = degree - targetAngle; - if (angleDiff > 180.f) angleDiff -= 360.f; - if (angleDiff < -180.f) angleDiff += 360.f; + if (angleDiff > 180.f) { + angleDiff -= 360.f; + } + if (angleDiff < -180.f) { + angleDiff += 360.f; + } _float Offset = 2.f; @@ -1019,8 +1098,12 @@ void CPlayer::Add_FSM() { if (SUCCEEDED(InputAim())) { - _float3 fMove = m_pGameInstance->Get_MouseMove(); - m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta * fMove.x * 0.05f); + if (m_pGameInstance->Mouse_Pressing(DIM_RBUTTON)) + { + _float3 fMove = m_pGameInstance->Get_MouseMove(); + m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta * fMove.x * 0.03f); + } + } } }; @@ -1173,12 +1256,13 @@ void CPlayer::Set_Anim() m_Animation[STATEANIM::LIGHT_ATTACK] = { 413,false }; m_Animation[STATEANIM::SPELL] = { 772,false }; m_Animation[STATEANIM::MAPHELP] = { 122,false }; - m_Animation[STATEANIM::POTION] = { 114,false }; + m_Animation[STATEANIM::POTION] = { 114,false }; // 114 포션 // 909 루모스 m_Animation[STATEANIM::ACCIO] = { 417,false }; m_Animation[STATEANIM::DESCENDO] = { 857,false }; m_Animation[STATEANIM::DEPULSO] = { 858,false }; m_Animation[STATEANIM::DIFFINDO] = { 862,false }; - m_Animation[STATEANIM::LUMOS] = { 851,false }; + m_Animation[STATEANIM::LUMOS] = { 909,true }; + m_Animation[STATEANIM::LUMOS_STOP] = { 912,false }; m_Animation[STATEANIM::DISILLUSION_ENTER] = { 585,false }; m_Animation[STATEANIM::DISILLUSION_EXIT] = { 586,false }; m_Animation[STATEANIM::ANCIENT_THROW] = { 919,false }; @@ -1199,6 +1283,10 @@ void CPlayer::Set_Anim() m_Animation[STATEANIM::JOG_AIM_STOP_L] = { 295,false }; m_Animation[STATEANIM::JOG_AIM_STOP_R] = { 456,false }; m_Animation[STATEANIM::JOG_AIM_STOP_BWD] = { 444,false }; + + //루모스 스탑 912 } + + #pragma endregion State diff --git a/Jusin154_Team3D/Client/Private/Wand.cpp b/Jusin154_Team3D/Client/Private/Wand.cpp index 6c41aa709..5b8c9f71c 100644 --- a/Jusin154_Team3D/Client/Private/Wand.cpp +++ b/Jusin154_Team3D/Client/Private/Wand.cpp @@ -25,12 +25,19 @@ HRESULT CWand::Initialize(void* pArg) WAND_DESC* pDesc = static_cast (pArg); m_pSocketMatrices = pDesc->pSocketMatrices; - if (FAILED(__super::Initialize(pArg))) + if (FAILED(__super::Initialize(pArg))){ return E_FAIL; + } - if (FAILED(Ready_Components())) + if (FAILED(Ready_Components())){ return E_FAIL; + } + +#ifdef _DEBUG + m_pGripShape = (GeometricPrimitive::CreateSphere(m_pContext, 0.1f, 10, false, false)); + m_pSubShape = (GeometricPrimitive::CreateSphere(m_pContext, 0.1f, 10, false, false)); +#endif // _DEBUG return S_OK; } @@ -42,11 +49,12 @@ void CWand::Priority_Update(_float fTimeDelta) socketMatrix = XMLoadFloat4x4(m_pSocketMatrices); for (int i = 0; i < 3; ++i) { - socketMatrix.r[i] = XMVector3Normalize(socketMatrix.r[i]); + socketMatrix.r[i] = XMVector3Normalize(socketMatrix.r[i]); } m_pTransformCom->Set_WorldMatrix(socketMatrix * XMLoadFloat4x4(m_pParentTransformCom->Get_WorldMatrixPtr())); - + XMStoreFloat4x4(&m_pWandTipMatrix, XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("Effect")) * m_pTransformCom->Get_XMWorldMatrix()); + #ifdef _DEBUG Describe_Entity(); @@ -55,6 +63,7 @@ void CWand::Priority_Update(_float fTimeDelta) void CWand::Update(_float fTimeDelta) { + m_pModelCom->Combined_BoneMatrix(); } @@ -88,10 +97,19 @@ HRESULT CWand::Render() return E_FAIL; } } - +#ifdef _DEBUG + m_pGripShape->Draw(m_pTransformCom->Get_XMWorldMatrix(), m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW), m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ), DirectX::Colors::Green, nullptr, true); + m_pSubShape->Draw(XMLoadFloat4x4(&m_pWandTipMatrix), m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW), m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ), DirectX::Colors::Purple, nullptr, true); +#endif // _DEBUG + return S_OK; } +_vector CWand::Get_WorldPostion() +{ + return XMLoadFloat4((_float4*)&m_pWandTipMatrix.m[3][0]); +} + HRESULT CWand::Ready_Components() { @@ -170,6 +188,27 @@ void CWand::Free() void CWand::Describe_Entity() { + _float4 vPos; + _float4 vTipWorldPos; + + _float4 vTipRight; + _float4 vTipUp; + _float4 vTipLook; + _float4 vTipPos; + XMStoreFloat4(&vPos, m_pTransformCom->Get_State(STATE::POSITION)); + XMStoreFloat4(&vTipWorldPos, Get_WorldPostion()); + + XMStoreFloat4(&vTipRight, XMLoadFloat4((_float4*)&m_pWandTipMatrix.m[0][0])); + XMStoreFloat4(&vTipUp, XMLoadFloat4((_float4*)&m_pWandTipMatrix.m[1][0])); + XMStoreFloat4(&vTipLook, XMLoadFloat4((_float4*)&m_pWandTipMatrix.m[2][0])); + XMStoreFloat4(&vTipPos, XMLoadFloat4((_float4*)&m_pWandTipMatrix.m[3][0])); + + GUI::Text("vPos, %.2f, %.2f, %.2f, %.2f", vPos.x, vPos.y, vPos.z, vPos.w); + GUI::Text("vTipWorldPos, %.2f, %.2f, %.2f, %.2f", vTipWorldPos.x, vTipWorldPos.y, vTipWorldPos.z, vTipWorldPos.w); + GUI::Text("vTipRight, %.2f, %.2f, %.2f, %.2f", vTipRight.x, vTipRight.y, vTipRight.z, vTipRight.w); + GUI::Text("vTipUp, %.2f, %.2f, %.2f, %.2f", vTipUp.x, vTipUp.y, vTipUp.z, vTipUp.w); + GUI::Text("vTipLook, %.2f, %.2f, %.2f, %.2f", vTipLook.x, vTipLook.y, vTipLook.z, vTipLook.w); + GUI::Text("vTipPos, %.2f, %.2f, %.2f, %.2f", vTipPos.x, vTipPos.y, vTipPos.z, vTipPos.w); } #endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Public/Decendo.h b/Jusin154_Team3D/Client/Public/Decendo.h index 3454ccecc..e1bc2863a 100644 --- a/Jusin154_Team3D/Client/Public/Decendo.h +++ b/Jusin154_Team3D/Client/Public/Decendo.h @@ -40,7 +40,7 @@ class CDecendo final : public CEffect_Container _float m_fAccTime = {}; _float m_fLerpAmount = {}; _float m_fTurnValue = {}; - _vector m_vOwnerLook = {}; + _vector m_vCameraLook = {}; public: static CDecendo* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual void Free() override; diff --git a/Jusin154_Team3D/Client/Public/InfoInstance.h b/Jusin154_Team3D/Client/Public/InfoInstance.h index 0f7adec6e..8832eb433 100644 --- a/Jusin154_Team3D/Client/Public/InfoInstance.h +++ b/Jusin154_Team3D/Client/Public/InfoInstance.h @@ -35,7 +35,7 @@ class CInfoInstance final : public CBase HRESULT Regist_ActiveMonster(class CMonster* pUnit); HRESULT Deregist_ActiveMonster(class CMonster* pUnit); - class CMonster* Get_LockOnMonster(); + class CUnit* Get_LockOnUnit(); pair Get_NearestPlayerAlly(_fvector vPos); #pragma endregion #pragma region MAP_INFO diff --git a/Jusin154_Team3D/Client/Public/MonsterInfo.h b/Jusin154_Team3D/Client/Public/MonsterInfo.h index e16801af6..b45493079 100644 --- a/Jusin154_Team3D/Client/Public/MonsterInfo.h +++ b/Jusin154_Team3D/Client/Public/MonsterInfo.h @@ -25,7 +25,7 @@ class CMonsterInfo final : public CBase HRESULT Regist_ActiveMonster(class CMonster* pUnit); HRESULT Deregist_ActiveMonster(class CMonster* pUnit); - class CMonster* Get_LockOnMonster(); + CUnit* Get_LockOnUnit(); pair Get_NearestPlayerAlly(_fvector vPos); private: diff --git a/Jusin154_Team3D/Client/Public/NomalJap.h b/Jusin154_Team3D/Client/Public/NomalJap.h index 72ce0bae8..17dc6c3a7 100644 --- a/Jusin154_Team3D/Client/Public/NomalJap.h +++ b/Jusin154_Team3D/Client/Public/NomalJap.h @@ -32,16 +32,24 @@ class CNomalJap final : public CEffect_Container HRESULT Bind_ShaderResources() override; virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; private: + CInfoInstance* m_pInfoInstance = { nullptr }; _wstring m_wstrEffectName = {}; class CPartObject* m_pProjectile = {}; class CPartObject* m_pProjectile_Side = {}; - _vector m_vRotateUp = {}; + _float3 m_vRotateUp = {}; _float m_fAccTime = {}; _float m_fLerpAmount = {}; _float m_fTurnValue = {}; - _vector m_vOwnerLook = {}; + + CUnit* m_pTargetUnit = { nullptr }; // 발사될 당시 대상 + _float3 m_vDirection = { 0.f, 0.f, 1.f }; + _float4 m_vStartPos = { 0.f, 0.f, 0.f, 1.f }; // 현재 발사 된 위치 + _float4 m_vTargetPos = { 0.f, 0.f, 10.f, 1.f }; // 현재 타게팅 된 위치 + _float m_fAngularSpeed = XM_2PI / 0.3f; + _float m_fLinearSpeed = 1.f; + _bool m_bTrailPulseEnded = false; public: static CNomalJap* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual void Free() override; diff --git a/Jusin154_Team3D/Client/Public/Player.h b/Jusin154_Team3D/Client/Public/Player.h index f2b34928a..30f525fe1 100644 --- a/Jusin154_Team3D/Client/Public/Player.h +++ b/Jusin154_Team3D/Client/Public/Player.h @@ -7,6 +7,14 @@ NS_BEGIN(Client) class CPlayer final : public CUnit { +public: + struct PendingEvent + { + _float fRatio = 0.f; + _uint AnimIndex = 0; + function Callback; + }; + private: CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CPlayer(const CPlayer& Prototype); @@ -24,7 +32,7 @@ class CPlayer final : public CUnit _matrix Get_WandPos(); private: CInfoInstance* m_pInfoInstance = { nullptr }; - class CMonster* m_pLockOnMonster = { nullptr }; + CUnit* m_pLockOnMonster = { nullptr }; _float m_fDirectionRadian = 0.f; _bool m_bSprintToggle = { false }; @@ -33,7 +41,6 @@ class CPlayer final : public CUnit _float3 m_vCameraLookDir = { 0.f, 0.f, 1.f, }; _float3 m_vCameraRightDir = { 1.f, 0.f, 0.f }; - class CCamPosition_Socket* m_pCamPosition_TopDown_LookPart = { nullptr }; class CCamPosition_Arm* m_pCamPosition_TopDown_FollowPart = { nullptr }; class CCamPosition_Shoulder* m_pCamPosition_ShoulderPart = { nullptr }; @@ -83,6 +90,12 @@ class CPlayer final : public CUnit virtual void Add_FSM(); virtual void Set_Anim(); + void Play_Event(); + void Add_Event(_uint AnimIndex, function Callback, _float fRatio = 0.f); + + vector m_PendingEvents; + + _float m_fAmount = { 1.f }; _float m_fInputTime = {}; _bool m_bRatio = { false }; diff --git a/Jusin154_Team3D/Client/Public/Wand.h b/Jusin154_Team3D/Client/Public/Wand.h index fae9fb6e5..af48b0f61 100644 --- a/Jusin154_Team3D/Client/Public/Wand.h +++ b/Jusin154_Team3D/Client/Public/Wand.h @@ -24,6 +24,7 @@ class CWand final : public CPartObject virtual void Update(_float fTimeDelta) override; virtual void Late_Update(_float fTimeDelta) override; virtual HRESULT Render() override; + virtual _vector Get_WorldPostion() override; public: private: @@ -31,6 +32,13 @@ class CWand final : public CPartObject CShader* m_pShaderCom = { nullptr }; CModel* m_pModelCom = { nullptr }; + _float4x4 m_pWandTipMatrix = {}; + +#ifdef _DEBUG + unique_ptr m_pGripShape = { nullptr }; + unique_ptr m_pSubShape = { nullptr }; +#endif // _DEBUG + private: HRESULT Ready_Components(); HRESULT Bind_ShaderResources(); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_Circle1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_Circle1.bin index b10f481a1..245479070 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_Circle1.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_Circle1.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:553a743d2dec286f4a8e60f16234ee60a649ba11db65ce57d0a581076f51d46b +oid sha256:6d20b4f1e88798301e3cf0c99b841d1d29b6aa6001aa90196e5204470e7aff46 size 792 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_0.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_0.bin index 323ba9e67..795379321 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_0.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_0.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a7fe1f3eb2344e68a1e04d5a12b47e4cd6b34e132a94975a7ec57ea06630f4ce +oid sha256:b634351811718a4303a72b3467f33d655ef11852655a68d9254b9bd10a16a33d size 794 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_1.bin index 3e51743f6..c26a138e7 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_1.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_1.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:70670ea59ce71ddd5f8ed30d2685f21faf4dcb2ad060c2fc6e51d232eb1f0be3 +oid sha256:6efb883040983da9842d0d63d33d0beb1ac52c723a3341d2339e433eea0cf1a1 size 794 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_2.bin index 47b18c707..1c8ad4c1a 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_2.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_2.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3e717285622cd1a36fdc9434e8109aad9b83f11a753cf1cd811d836fe656ec2d +oid sha256:955eef7ca633e7f2fdbc15fd7c9fa790597514261ee6251e9b223188db2a088c size 786 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_3.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_3.bin index 6cbcb4034..428236f32 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_3.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_PT_3.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:71a50a5ab505d00b25c12abb86e883f2ef928bc2bc0fa43175aceb30d5b3d390 +oid sha256:60262a4c7b411a60a94f8d8ecb462c823392843a76b05cc45e60c2635f58dd1a size 786 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_Smoke.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_Smoke.bin index 22fab4b9b..befd7ad57 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_Smoke.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Bombard/Bombard_Smoke.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c0f0445b81bf913674d0a1c930e5a41c2f79559c2e72e479abb40fe1091fa34b -size 741 +oid sha256:eb72212ab3646a4c810c7e09a336ca47a6602bab438a008bcd06da9378b886cd +size 752 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_PT0.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_PT0.bin index 22cce70c5..836af987e 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_PT0.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_PT0.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4159ecd17d8841b5e4c65e68eeeb0ee1d6c5f8ea54f66197557fde5278cb7100 +oid sha256:833d0014fe0a82a96e996d9dc0cec076235b299b49d3900abc878cd1834c0449 size 790 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Smoke.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Smoke.bin index 203a6608e..a69543fd8 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Smoke.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Smoke.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1337e4494de24daa6fe06b8f1199ea2dd79117d57f18a2c547bf20f106bc36bf -size 743 +oid sha256:d3b8c8e33e690b492532fb02dab25682a7f88460c5667404fb3c59925498e529 +size 750 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Proj_Trail.trail b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Proj_Trail.trail index 01013bf3b..7351c6b10 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Proj_Trail.trail and b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Proj_Trail.trail differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapPT0.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapPT0.bin index 160a6ebab..bd668f84f 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapPT0.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapPT0.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:af517ebb169ff53865ede7d92fd067b9dcf957a065be6033e616feb32c11e94b +oid sha256:5a10c067013027c37e167061cb20fc6695c280fb058fa12f200acf8c9013c059 size 751 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapTrail.trail b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapTrail.trail index 65613e0ca..8b7c1bde9 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapTrail.trail and b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Jap/JapTrail.trail differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Levioso_PJ0.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Levioso_PJ0.bin new file mode 100644 index 000000000..09c99416b --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Levioso_PJ0.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b34c04715c99f1a0f19d85f2a7d13a17f4070c7ab3c472f5e5fe1fc89dd8a422 +size 753 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Levioso_PJ1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Levioso_PJ1.bin new file mode 100644 index 000000000..49f37bc02 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Levioso_PJ1.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7210948fd6db0bb88816e6a8b12d65d80f652df9a08c3ad0619491498a2833b7 +size 753 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Levioso_Rotate0.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Levioso_Rotate0.bin new file mode 100644 index 000000000..88df1c802 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Levioso_Rotate0.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5e336892c6c5d78c91c9ae24b4aea3c987be609861d57cfa0cdaabdc830e5778 +size 789 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Levioso_Rotate1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Levioso_Rotate1.bin new file mode 100644 index 000000000..1090c6917 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Levioso_Rotate1.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d6cfa5e6c66767b4919c915c6455f7d1765cd0ee7d59b1e7905d3616748f9003 +size 789 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Levioso_Trail.trail b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Levioso_Trail.trail new file mode 100644 index 000000000..ac9950a87 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Levioso_Trail.trail differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Levioso_Wand0.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Levioso_Wand0.bin new file mode 100644 index 000000000..c801ec930 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Levioso_Wand0.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:82a42de5c4b3cb91698a6d430d7912b2c53820a21e4db6dccd6dd10bfa15ed5b +size 792 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Levioso_Wand1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Levioso_Wand1.bin new file mode 100644 index 000000000..1b0d933ef --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Levioso_Wand1.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:150e241cbe575d683f005d868389c7cdca26d1d3fd76dc4fe7a5688fec2c7230 +size 795 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Trail_PT0.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Trail_PT0.bin new file mode 100644 index 000000000..cb42d5a41 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Trail_PT0.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd33f0220332dd3e3d1757bd84f9431c1b765231cd712ebf52a62fabf88b92ca +size 767 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Levioso.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Levioso.bin new file mode 100644 index 000000000..15d72f328 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Levioso.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df3c185b85b6beb78e13d90806d8330b3249b1613edf96ace5be5e4135ddfcca +size 250 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Revelio.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Revelio.bin new file mode 100644 index 000000000..4c8852970 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/Revelio.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:361c1b52fd37940363fcd6713e1d77401a655af5c27d3b9f4f47ea116cb5379d +size 240 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Revelio/Revelio_Ring.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Revelio/Revelio_Ring.bin new file mode 100644 index 000000000..517f86b0c --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Revelio/Revelio_Ring.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cabd9577d7053ac437a4132bdffdb7b6d89606aa6f6ab38eebf04ecc94f27e44 +size 821 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Revelio/WandPT_B.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Revelio/WandPT_B.bin new file mode 100644 index 000000000..30c3774c1 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Revelio/WandPT_B.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e7a71800b39699fa672419fa5c43899cca1661fe54968afbab03e10df6bf5d71 +size 767 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Revelio/WandPT_R.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Revelio/WandPT_R.bin new file mode 100644 index 000000000..acf55c7c4 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Revelio/WandPT_R.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cbd63053318fdc5dfbc052728618c89bb398b8b0c6a8e83b6139e2f653f2f769 +size 767 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Revelio/WandPT_Y.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Revelio/WandPT_Y.bin new file mode 100644 index 000000000..8f9738e55 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Revelio/WandPT_Y.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6b9594eb0d4d3f79df97e87c611a682c3f5c7be2fee0c0474a2e44a36e71f702 +size 767 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Test.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Test.bin index c8b2f5057..ba8e1b814 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Test.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Test.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ea853923b5a6bf95e8b9d6855f2aa3231df11341406c1d8c3315b14c9c218e04 -size 700 +oid sha256:8b272bfabd881500d3ed8cc900aa7667dac9b8ed7a5a84725ab29eabea0c7720 +size 834 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Trail/Bombard_Trail.trail b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Trail/Bombard_Trail.trail index de75d04c5..f093e1e8d 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Trail/Bombard_Trail.trail and b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Trail/Bombard_Trail.trail differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Wand/Wand.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Wand/Wand.bin index 84c1732c2..302d61b9f 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Wand/Wand.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Wand/Wand.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:30c393a0dcbcf5b6d34f3e8643bb0d8859e56f93ed9252d6071c6cf83edabbc8 +oid sha256:08c0e53542fa6f5b850e345c0df241aa59ddaa100415d6f2d9277c590f580671 size 68978 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Wand/Wand.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Wand/Wand.fbx index d56d7e953..4855fb9cd 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Wand/Wand.fbx +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Wand/Wand.fbx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:70aebae3fb159ea7acd1b8538427821827a7c6c011ed1921d09200707b431a1f -size 43612 +oid sha256:4d7813f0c76d9c94ab480f6583a3d94f8ce20cc903d4eaedeb104b055f555b98 +size 45100 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 91a72f9db..b669d3285 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl @@ -39,6 +39,7 @@ struct ParticleValue float fSizeDrag; float3 vDeltaSize; float2 vDelay; + }; @@ -101,7 +102,7 @@ void CS_MAIN( { if (isNoWorld) { - float4x4 CurMat = { particle.vRight, particle.vUp, particle.vLook, particle.vTranslation }; + row_major float4x4 CurMat = { particle.vRight, particle.vUp, particle.vLook, particle.vTranslation }; CurMat = mul(CurMat, WorldMatrix); @@ -112,6 +113,7 @@ void CS_MAIN( particle.vTranslation = CurMat[3].xyzw; } } + // 라이프타임 움직임 particle.vLifeTime.x += fTimeDelta; @@ -151,21 +153,26 @@ void CS_MAIN( if (particleValue.fDrag < FLT_EPSILON5) fDrag = 1; - float4 vVelocity = vector(normalize(particle.vLook.xyz) * particleValue.fSpeed, 1.f); + float4 vVelocity = vector(normalize(particle.vLook.xyz) * particleValue.fSpeed, 0.f); particle.vTranslation += vVelocity * fTimeDelta * fDrag; } if (isPivotMove) { + float fTime = (particle.vLifeTime.x / particle.vLifeTime.y); + float3 vDir = normalize(particleValue.vPivot - particleValue.vOriginTranslation.xyz); - float fDrag = particleValue.fDrag; + float fRatio = (1 - fTime * fTime); + float fDrag = particleValue.fDrag * fRatio; + + if (particleValue.fDrag < FLT_EPSILON5) fDrag = 1; - float4 vVelocity = vector(vDir * particleValue.fSpeed, 1.f); + float4 vVelocity = vector(vDir * particleValue.fSpeed , 0.f); particle.vTranslation += vVelocity * fTimeDelta * fDrag; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl index f3c86e997..9a1a6a4cd 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl @@ -64,7 +64,7 @@ int g_iDiffuseMoveLerpOption; int g_iNoiseMoveLerpOption; // -float2 g_vDiffuseDistortionUVGainAmount; +float2 g_vDistortionTime; float2 g_vMaskDistortionUVGainAmount; @@ -255,6 +255,7 @@ float4 DrawEffect(PS_IN In) float2 vDistortionUVMoveTime = g_ParticleValue[In.iGPUIndex].vDistortionUVMoveTime; float2 vDelay = g_ParticleValue[In.iGPUIndex].vDelay; + if (vDelay.x < vDelay.y) { discard; @@ -271,26 +272,6 @@ float4 DrawEffect(PS_IN In) UV += SelectLerpUV((g_vDiffuseUVGainAmount / g_vUVCutting), (vDiffuseTime.x / vDiffuseTime.y), g_iDiffuseMoveLerpOption); } - /* 디퓨즈 디스토션 */ - if (g_isDistortion == true) - { - - float2 vDistortion = In.vTexcoord + SelectLerpUV(g_vDiffuseDistortionUVGainAmount, (vDistortionUVMoveTime.x / vDistortionUVMoveTime.y), g_iDiffuseDistortionMoveLerpOption); - - vMtrlDistortion = g_DistortionTexture.Sample(DefaultSampler, vDistortion); - - //0.5f를 빼는 이유는 중심을 0으로 옮겨서 양음수 방향으로 offset을 줄수 있다. - vMtrlDistortion.rg -= 0.5f; - - //아마 분할되었다면 noise도 분할해야할듯 - vMtrlDistortion.rg /= g_vUVCutting; - - //디스토션(노이즈) 텍스쳐로 uv를 왜곡함 - - UV = UV + (vMtrlDistortion).rg * g_fNoiseDistortionIntensity; - - } - if (g_isDiffuseBlur) { float4 fAccDiffuse; @@ -373,8 +354,17 @@ float4 DrawEffect(PS_IN In) vMtrlDistortion = g_DistortionTexture.Sample(DefaultSampler, vDistortionUV); + + + float fDistortionIntensity = g_fNoiseDistortionIntensity; + + if (g_vDistortionTime.y != 0) + { + fDistortionIntensity = g_fNoiseDistortionIntensity * ((In.vLifeTime.x / In.vLifeTime.y)); + } + //디스토션(노이즈) 텍스쳐로 uv를 왜곡함 - vMaskTexcoord = vMaskTexcoord + (vMtrlDistortion - 0.5f).r * g_fNoiseDistortionIntensity; + vMaskTexcoord = vMaskTexcoord + (vMtrlDistortion - 0.5f).r * fDistortionIntensity; } @@ -588,14 +578,14 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In) vMtrlDiffuse = DrawEffect(In); - int2 iTexel = int2(In.vPosition.xy); + //int2 iTexel = int2(In.vPosition.xy); - float fDepthStencilValue = g_DepthStencilTexture.Load(int3(iTexel, 0)).r; + //float fDepthStencilValue = g_DepthStencilTexture.Load(int3(iTexel, 0)).r; - float fbias = 0.000005f; + //float fbias = 0.000005f; - if (fDepthStencilValue <= In.vProjPos.z / In.vProjPos.w + fbias) - discard; + //if (fDepthStencilValue <= In.vProjPos.z / In.vProjPos.w + fbias) + // discard; Out = BlendedWeight(vMtrlDiffuse, In.vProjPos.w); @@ -654,8 +644,6 @@ VS_OUT VS_BLUR_NOWORLD(VS_IN In, uint iGPUIndex : SV_InstanceID) return Out; } - - struct PS_BLUR_OUT { float4 vDiffuse : SV_TARGET0; @@ -700,12 +688,15 @@ PS_BLOOM_OUT PS_BLOOM(PS_IN In) vector vMtrlDiffuse; + float2 vDelay = g_ParticleValue[In.iGPUIndex].vDelay; + vMtrlDiffuse = DrawEffect(In); + //// 색깔 추가할 처리 (이미시브) - vMtrlDiffuse += EmissiveDraw(In); + vMtrlDiffuse += EmissiveDraw(In); float fBloomStrength = g_fBloomStrength; @@ -726,6 +717,32 @@ PS_BLOOM_OUT PS_BLOOM(PS_IN In) } +PS_BLOOM_OUT PS_BLEND(PS_IN In) +{ + PS_BLOOM_OUT Out; + + vector vMtrlDiffuse; + + vMtrlDiffuse = DrawEffect(In); + + + //int2 iTexel = int2(In.vPosition.xy); + + //float fDepthStencilValue = g_DepthStencilTexture.Load(int3(iTex el, 0)).r; + + //float fbias = 0.000005f; + + //if (fDepthStencilValue <= In.vProjPos.z / In.vProjPos.w + fbias) + // discard; + + //// 색깔 추가할 처리 (이미시브) + + vMtrlDiffuse.rgb += EmissiveDraw(In).rgb; + + Out.vDiffuse = vMtrlDiffuse; + + return Out; +} technique11 DefaultTechnique { @@ -752,7 +769,7 @@ technique11 DefaultTechnique pass Blur { SetRasterizerState(RS_Nocull); - SetDepthStencilState(DSS_None, 0); + SetDepthStencilState(DSS_Effect, 0); SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); VertexShader = compile vs_5_0 VS_BLUR(); GeometryShader = NULL; @@ -782,7 +799,7 @@ technique11 DefaultTechnique pass BLUR_NO_WORLD { SetRasterizerState(RS_Nocull); - SetDepthStencilState(DSS_None, 0); + SetDepthStencilState(DSS_Effect, 0); SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); VertexShader = compile vs_5_0 VS_BLUR_NOWORLD(); GeometryShader = NULL; @@ -790,14 +807,24 @@ technique11 DefaultTechnique } - pass ALPHA_BLEND + pass BLEND { SetRasterizerState(RS_Nocull); - SetDepthStencilState(DSS_None, 0); - SetBlendState(BS_Blend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); - VertexShader = compile vs_5_0 VS_BLUR(); + SetDepthStencilState(DSS_Effect, 0); + SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_MAIN(); GeometryShader = NULL; - PixelShader = compile ps_5_0 PS_BLUR(); + PixelShader = compile ps_5_0 PS_BLEND(); + } + + pass BLEND_NOWORLD + { + SetRasterizerState(RS_Nocull); + SetDepthStencilState(DSS_Effect, 0); + SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_NOWORLD(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_BLEND(); } pass BLOOM @@ -810,6 +837,16 @@ technique11 DefaultTechnique PixelShader = compile ps_5_0 PS_BLOOM(); } + pass BLOOM_NOWORLD + { + SetRasterizerState(RS_Nocull); + SetDepthStencilState(DSS_Default, 0); + SetBlendState(BS_Blend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff); + VertexShader = compile vs_5_0 VS_NOWORLD(); + GeometryShader = NULL; + PixelShader = compile ps_5_0 PS_BLOOM(); + } + } diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index 6e2b15c8c..79153e32b 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -253,6 +253,8 @@ + + @@ -408,6 +410,8 @@ + + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index b6dd9a4a4..f6fd869c1 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -364,6 +364,12 @@ {c7b1ffc6-548f-464c-8f19-8b6ff5913b06} + + {03dca491-c8d3-4204-b450-b6089287aa3d} + + + {c87ea325-8242-4bc4-aec7-b102a5b1c847} + {8d15e456-f0d7-45b6-b725-7f1a8c0f6b0f} @@ -804,6 +810,12 @@ 50.UI\Spell_Canvas\Spell_Panel\Current_Spell_Slot + + 02.GameObjects\Layer_Effect\Effect\09.Revelio + + + 02.GameObjects\Layer_Effect\Effect\10.Levioso + 50.UI\Spell_Canvas\Spell_Panel\Spell_List @@ -1216,6 +1228,12 @@ 50.UI\Spell_Canvas\Spell_Panel\Current_Spell_Slot + + 02.GameObjects\Layer_Effect\Effect\09.Revelio + + + 02.GameObjects\Layer_Effect\Effect\10.Levioso + 50.UI\Spell_Canvas\Spell_Panel\Spell_List diff --git a/Jusin154_Team3D/Editor/Private/Bombard.cpp b/Jusin154_Team3D/Editor/Private/Bombard.cpp index 03b5e16c8..55e19134d 100644 --- a/Jusin154_Team3D/Editor/Private/Bombard.cpp +++ b/Jusin154_Team3D/Editor/Private/Bombard.cpp @@ -73,7 +73,6 @@ void CBombard::Late_Update(_float fTimeDelta) __super::Late_Update(fTimeDelta); - } HRESULT CBombard::Pre_Setting(CGameObject* pObject) @@ -210,9 +209,8 @@ void CBombard::Free() { __super::Free(); - if(m_pPhysHitBox != nullptr) - if (m_pPhysHitBox->isDead() == false) - SAFE_RELEASE(m_pPhysHitBox); + if (m_pPhysHitBox != nullptr) + SAFE_RELEASE(m_pPhysHitBox); SAFE_RELEASE(m_pLight_Projectile); diff --git a/Jusin154_Team3D/Editor/Private/CamPosition_Shoulder.cpp b/Jusin154_Team3D/Editor/Private/CamPosition_Shoulder.cpp index 4dd3224c1..af9f8046e 100644 --- a/Jusin154_Team3D/Editor/Private/CamPosition_Shoulder.cpp +++ b/Jusin154_Team3D/Editor/Private/CamPosition_Shoulder.cpp @@ -88,7 +88,7 @@ void CCamPosition_Shoulder::Priority_Update(_float fTimeDelta) void CCamPosition_Shoulder::Update(_float fTimeDelta) { - if (m_pGameInstance->Key_Up(DIK_O)) { + if (m_pGameInstance->Key_Up(DIK_INSERT)) { m_pBinded_Camera->Toggle_Priority(); } if (FAILED(m_pGameInstance->IsBinded_Camera(CAMERA_SHOULDER))) { diff --git a/Jusin154_Team3D/Editor/Private/Decendo.cpp b/Jusin154_Team3D/Editor/Private/Decendo.cpp index 62354d060..1283712f9 100644 --- a/Jusin154_Team3D/Editor/Private/Decendo.cpp +++ b/Jusin154_Team3D/Editor/Private/Decendo.cpp @@ -69,12 +69,12 @@ void CDecendo::Update(_float fTimeDelta) Update_Event(fTimeDelta); - m_pProjectile_Blur->Get_Component()->Translation(m_vOwnerLook * 0.5f); - m_pProjectile->Get_Component()->Translation(m_vOwnerLook * 0.5f); + m_pProjectile_Blur->Get_Component()->Translation(m_vCameraLook * 0.5f); + m_pProjectile->Get_Component()->Translation(m_vCameraLook * 0.5f); if (nullptr != m_pPhysHitBox) { - m_pPhysHitBox->Get_Component()->AccumulateMomentum(m_vOwnerLook * 0.5f); + m_pPhysHitBox->Get_Component()->AccumulateMomentum(m_vCameraLook * 0.5f); } @@ -138,11 +138,11 @@ HRESULT CDecendo::Pre_Setting(CGameObject* pObject) //나아가는 벡터와 한점을 가져와 수직인 평면상에 하나의 점으로 DIR 을 만듬 - m_vOwnerLook = XMVector3Normalize(m_pOwner->Get_Component()->Get_State(STATE::LOOK)); + m_vCameraLook = XMVector3Normalize(m_pOwner->Get_Component()->Get_State(STATE::LOOK)); _vector vUp = XMVectorSet(0.f, 1.f, 0.f, 0.f); - _vector vQuaternion = XMQuaternionRotationAxis(m_vOwnerLook, m_pGameInstance->Random_Float(0.f, XM_PIDIV2)); + _vector vQuaternion = XMQuaternionRotationAxis(m_vCameraLook, m_pGameInstance->Random_Float(0.f, XM_PIDIV2)); m_vRotateUp = XMVector3Rotate(vUp, vQuaternion); m_vRotateUp = XMVector3Normalize(m_vRotateUp); @@ -249,9 +249,8 @@ void CDecendo::Free() { __super::Free(); - if(m_pPhysHitBox != nullptr) - if (m_pPhysHitBox->isDead() == false) - SAFE_RELEASE(m_pPhysHitBox); + if (m_pPhysHitBox != nullptr) + SAFE_RELEASE(m_pPhysHitBox); SAFE_RELEASE(m_pProjectile_Blur); SAFE_RELEASE(m_pProjectile); diff --git a/Jusin154_Team3D/Editor/Private/Dummy_Globe.cpp b/Jusin154_Team3D/Editor/Private/Dummy_Globe.cpp index ad4e239d6..30a4f77e1 100644 --- a/Jusin154_Team3D/Editor/Private/Dummy_Globe.cpp +++ b/Jusin154_Team3D/Editor/Private/Dummy_Globe.cpp @@ -43,7 +43,7 @@ void CDummy_Globe::Update(_float fTimeDelta) void CDummy_Globe::Late_Update(_float fTimeDelta) { if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) { - m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); + m_pGameInstance->Add_RenderGroup(RENDER::BLOOM, this); } } diff --git a/Jusin154_Team3D/Editor/Private/EditEffect.cpp b/Jusin154_Team3D/Editor/Private/EditEffect.cpp index 0b68db0f0..2854db2d5 100644 --- a/Jusin154_Team3D/Editor/Private/EditEffect.cpp +++ b/Jusin154_Team3D/Editor/Private/EditEffect.cpp @@ -46,8 +46,6 @@ void CEditEffect::Update(_float fTimeDelta) if (m_pInstance_ModelCom == nullptr) return; - m_pInstance_ModelCom->Drop(fTimeDelta); - } @@ -60,6 +58,10 @@ void CEditEffect::Late_Update(_float fTimeDelta) if (m_pInstance_ModelCom == nullptr) return; + + m_pInstance_ModelCom->Drop(fTimeDelta); + + if (m_EffectInfo.isBillboard) m_pGameInstance->BillBoard(m_pTransformCom); @@ -405,9 +407,9 @@ void CEditEffect::Describe_Entity() //여기서 모델, 텍스쳐, 선택할 수 있도록 함 const char* pLerp[] = { "Linear" , "EaseInQuad", "EaseOutQuad", "EaseInCubic" , "EaseOutCubic" , "EaseInOutSin" , "EaseInBack" , "Expo" , "Circle" }; - const char* pRenderNames[] = { "PRIORITY" , "SHADOW", "NONBLEND", "DECAL", "BLUR" , "NONLIGHT" ,"EFFECT", "BLEND" , "UI" }; + const char* pRenderNames[] = { "PRIORITY" , "SHADOW", "NONBLEND", "DECAL", "BLUR" , "NONLIGHT" ,"EFFECT", "BLEND" ,"BLOOM" , "UI", "OCCLUSION"}; const char* pEffectType[] = { "EFFECT" , "TRAIL" }; - const char* pShaderPass[] = { "DEFAULT" , "NON_NOMALMAP" , "BLUR" , "WEIGHTBLEND" , "NON_WORLD" , "NON_WORLD_BLUR", "ALPHA_BLEND", "BLOOM"}; + const char* pShaderPass[] = { "DEFAULT" , "NON_NOMALMAP" , "BLUR" , "WEIGHTBLEND" , "NON_WORLD" , "NON_WORLD_BLUR", "BLEND", "BLEND_NOWORLD", "BLOOM" ,"BLOOM_NOWORLD" }; const char* pBloomType[] = { "NONE" , "BASIC" , "MUILTY"}; _int iCurrentItem = static_cast<_int>(m_EffectInfo.eRenderOrder); @@ -735,7 +737,7 @@ void CEditEffect::Describe_Entity() GUI::Spacing(); - GUI::DragFloat2("DiffuseDistortionUVGainAmount", (_float*)&m_EffectInfo.vDiffuseDistortionUVGainAmount, 0.01f); + GUI::DragFloat2("vDistortionTime", (_float*)&m_EffectInfo.vDistortionTime, 0.01f); _int iDiffuseNoiseMoveLerpOption = (_int)m_EffectInfo.iDiffuseDistortionMoveLerpOption; diff --git a/Jusin154_Team3D/Editor/Private/EffectObject.cpp b/Jusin154_Team3D/Editor/Private/EffectObject.cpp index 6d249efa8..0b2a5f811 100644 --- a/Jusin154_Team3D/Editor/Private/EffectObject.cpp +++ b/Jusin154_Team3D/Editor/Private/EffectObject.cpp @@ -75,7 +75,7 @@ HRESULT CEffectObject::Render_Blur() SHADER_PASS_INSTANCE_MODEL BlurPass = {}; - if (m_EffectInfo.eShaderPass == SHADER_PASS_INSTANCE_MODEL::NON_WORLD) + if (m_EffectInfo.eShaderPass == SHADER_PASS_INSTANCE_MODEL::NON_WORLD || m_EffectInfo.eShaderPass == SHADER_PASS_INSTANCE_MODEL::BLEND_NOWORLD) { BlurPass = SHADER_PASS_INSTANCE_MODEL::NON_WORLD_BLUR; } @@ -132,10 +132,21 @@ HRESULT CEffectObject::Render_Bloom() return E_FAIL; } + SHADER_PASS_INSTANCE_MODEL BloomPass = {}; + + if (m_EffectInfo.eShaderPass == SHADER_PASS_INSTANCE_MODEL::NON_WORLD || m_EffectInfo.eShaderPass == SHADER_PASS_INSTANCE_MODEL::BLEND_NOWORLD) + { + BloomPass = SHADER_PASS_INSTANCE_MODEL::BLOOM_NOWORLD; + } + else + { + BloomPass = SHADER_PASS_INSTANCE_MODEL::BLOOM; + } + for (_uint i = 0; i < m_pInstance_ModelCom->Get_NumMeshes(); i++) { - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_INSTANCE_MODEL::BLOOM)))) { + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(BloomPass)))) { return E_FAIL; } @@ -808,7 +819,7 @@ HRESULT CEffectObject::Bind_ShaderResources() return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_vDiffuseDistortionUVGainAmount", &m_EffectInfo.vDiffuseDistortionUVGainAmount, sizeof(_float2)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_vDistortionTime", &m_EffectInfo.vDistortionTime, sizeof(_float2)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/EffectPool.cpp b/Jusin154_Team3D/Editor/Private/EffectPool.cpp index 38fff00a7..787968562 100644 --- a/Jusin154_Team3D/Editor/Private/EffectPool.cpp +++ b/Jusin154_Team3D/Editor/Private/EffectPool.cpp @@ -8,6 +8,8 @@ #include "NomalJap.h" #include "Decendo.h" #include "Protego.h" +#include "Revelio.h" +#include "Levioso.h" CEffectPool::CEffectPool(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -37,6 +39,7 @@ HRESULT CEffectPool::Initialize(void* pArg) if (FAILED(Ready_Effect())) return E_FAIL; + return S_OK; } @@ -46,8 +49,7 @@ void CEffectPool::Priority_Update(_float fTimeDelta) { if (false == (*iter)->Get_Visible()) { - //SAFE_RELEASE(*iter); - //iter = m_ActiveEffectList.erase(iter); + ++iter; } else { @@ -56,8 +58,7 @@ void CEffectPool::Priority_Update(_float fTimeDelta) } } - - (*m_EffectList[ENUM_CLASS(SKILL_TYPE::PROTEGO)].begin())->Describe_Entity(); + (*m_EffectList[ENUM_CLASS(SKILL_TYPE::LEVIOSO)].begin())->Describe_Entity(); } @@ -67,8 +68,7 @@ void CEffectPool::Update(_float fTimeDelta) { if (false == (*iter)->Get_Visible()) { - //SAFE_RELEASE(*iter); - //iter = m_ActiveEffectList.erase(iter); + ++iter; } else { @@ -155,6 +155,27 @@ HRESULT CEffectPool::Ready_Effect() ))) return E_FAIL; + if (FAILED(Create_Effect(SKILL_TYPE::REVELIO, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel)-> CEffect_Container* { + + CRevelio* pEffect = nullptr; + + pEffect = m_pGameInstance->Clone_Prototype(iPrototypeLevel, nullptr); + + return pEffect; } + ))) return E_FAIL; + + + if (FAILED(Create_Effect(SKILL_TYPE::LEVIOSO, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel)-> CEffect_Container* { + + CLevioso* pEffect = nullptr; + + pEffect = m_pGameInstance->Clone_Prototype(iPrototypeLevel, nullptr); + + return pEffect; } + ))) return E_FAIL; + + + return S_OK; } @@ -195,6 +216,33 @@ HRESULT CEffectPool::Use_Skill(SKILL_TYPE eType, CGameObject* pOwner) return S_OK; } +HRESULT CEffectPool::Reset_Pool() +{ + for (size_t i = 0; i < ENUM_CLASS(SKILL_TYPE::END); i++) + { + for (auto& pEffect : m_EffectList[i]) + { + SAFE_RELEASE(pEffect); + } + + m_EffectList[i].clear(); + } + + for (auto& pEffect : m_ActiveEffectList) + { + SAFE_RELEASE(pEffect); + } + + + m_ActiveEffectList.clear(); + + + if (FAILED(Ready_Effect())) + return E_FAIL; + + return S_OK; +} + CEffectPool* CEffectPool::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { @@ -234,14 +282,25 @@ void CEffectPool::Free() { SAFE_RELEASE(pEffect); } + + m_EffectList[i].clear(); } for (auto& pEffect : m_ActiveEffectList) { SAFE_RELEASE(pEffect); + + } + + m_ActiveEffectList.clear(); } void CEffectPool::Describe_Entity() { + if(GUI::Button("Reset Pool")) + { + Reset_Pool(); + } + } diff --git a/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp b/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp index b3271422f..b0e42dc62 100644 --- a/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp +++ b/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp @@ -4,6 +4,8 @@ #include "GameInstance.h" #include "EditEffect.h" #include "TrailObject.h" +#include "EffectPool.h" +#include "Layer.h" #include @@ -55,6 +57,8 @@ HRESULT CEffect_Editor::Initialize(void* pArg) return E_FAIL; + m_pEffectPool = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_EffectPool"))->Get_Object(); + SAFE_ADDREF(m_pEffectPool); return S_OK; } @@ -521,6 +525,7 @@ void CEffect_Editor::Free() SAFE_RELEASE(m_pEditEffect); SAFE_RELEASE(m_pTrailObject); + SAFE_RELEASE(m_pEffectPool); } void CEffect_Editor::Describe_Entity() @@ -770,6 +775,11 @@ void CEffect_Editor::Describe_Entity() } } + + + + m_pEffectPool->Describe_Entity(); + ImGui::End(); } diff --git a/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp index 1af33ee51..09ecf51ac 100644 --- a/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_EffectViewer.cpp @@ -42,14 +42,16 @@ HRESULT CLevel_EffectViewer::Initialize() 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(ENUM_CLASS(LEVEL::EFFECT), NEXT_LEVEL, TEXT("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, TEXT("Layer_EffectPool")))) //플레이어보다 먼저 생성해야함! - 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_ObjectViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp index 180c4356a..d409e9e40 100644 --- a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp @@ -96,7 +96,9 @@ void CLevel_ObjectViewer::Add_Parts() _bool bDisabled = {}; if (m_HumanRoot) bDisabled = (m_HumanRoot->Get_MainModel()); - if (!bDisabled) GUI::BeginDisabled(); + if (!bDisabled) { + GUI::BeginDisabled(); + } if (GUI::BeginTabItem("Head")) { Category_PartsModelList("Human/Head/Male", "Head"); @@ -113,7 +115,9 @@ void CLevel_ObjectViewer::Add_Parts() GUI::EndTabItem(); } - if (!bDisabled) GUI::EndDisabled(); + if (!bDisabled) { + GUI::EndDisabled(); + } GUI::EndTabBar(); } GUI::EndTabItem(); @@ -133,7 +137,9 @@ void CLevel_ObjectViewer::Add_Parts() _bool bDisabled = {}; if (m_HumanRoot) bDisabled = (m_HumanRoot->Get_MainModel()); - if (!bDisabled) GUI::BeginDisabled(); + if (!bDisabled) { + GUI::BeginDisabled(); + } if (GUI::BeginTabItem("Head")) { Category_PartsModelList("Human/Head/FeMale", "Head"); @@ -150,7 +156,9 @@ void CLevel_ObjectViewer::Add_Parts() GUI::EndTabItem(); } - if (!bDisabled) GUI::EndDisabled(); + if (!bDisabled) { + GUI::EndDisabled(); + } GUI::EndTabBar(); } GUI::EndTabItem(); @@ -390,9 +398,13 @@ void CLevel_ObjectViewer::Dummy_Object_Setting() _float AnimTrack = pModel->Get_CurrentTrackPosition(); if (GUI::DragFloat("AnimTrack", &AnimTrack)) { - pModel->Set_CurrentTrackPosition(AnimTrack); + if(AnimTrack>=0.f) + pModel->Set_CurrentTrackPosition(AnimTrack); } + _float AnimRatio = pModel->Get_CurrentTrackProgressRatio(); + GUI::DragFloat("AnimRatio", &AnimRatio); + _float AnimSpeed = pModel->Get_AnimSpeed(); GUI::DragFloat("AnimSpeed", &AnimSpeed, 0.1f); pModel->Set_AnimSpeed(AnimSpeed); @@ -524,7 +536,9 @@ void CLevel_ObjectViewer::Parts_Object_Setting() FILE* fp = nullptr; fopen_s(&fp, "../Bin/Resources/Models/Human/KeyFrame.bin", "wb"); - if (!fp) return; + if (!fp) { + return; + } _uint KeyFrameSize = (_uint)m_KeyFrames.size(); @@ -605,8 +619,9 @@ void CLevel_ObjectViewer::Load_KeyFrame(const _char* Name) } fopen_s(&fp, Path.c_str(), "rb"); - if (!fp) return; - + if (!fp) { + return; + } _uint KeyFrameSize = 0; fread(&KeyFrameSize, sizeof(_uint), 1, fp); @@ -678,7 +693,9 @@ void CLevel_ObjectViewer::Save_KeyFrame() FILE* fp = nullptr; fopen_s(&fp, Path.c_str(), "wb"); - if (!fp) return; + if (!fp) { + return; + } _uint KeyFrameSize = (_uint)m_KeyFrames.size(); @@ -740,8 +757,8 @@ 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, strLayerTag, nullptr, nullptr, &m_Test))) - 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/Levioso.cpp b/Jusin154_Team3D/Editor/Private/Levioso.cpp new file mode 100644 index 000000000..2ef230564 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Levioso.cpp @@ -0,0 +1,275 @@ +#include "pch.h" +#include "Levioso.h" + +#include "GameInstance.h" +#include "EditEffect.h" +#include "Player.h" +#include "TrailObject.h" +#include "Dummy_PhysXEffectHitBox.h" + + +CLevioso::CLevioso(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CEffect_Container{ pDevice, pContext } +{ +} + +CLevioso::CLevioso(const CLevioso& rhs) + : CEffect_Container(rhs) +{ +} + +HRESULT CLevioso::Initialize_Prototype() +{ + + return S_OK; + +} + +HRESULT CLevioso::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/Package/Levioso"))) + return E_FAIL; + + m_pLeviosoPJ_0 = Get_PartObject("Levioso_PJ0"); + m_pLeviosoPJ_1 = Get_PartObject("Levioso_PJ1"); + m_pLeviosoTrail = Get_PartObject("Levioso_Trail"); + m_pTrail_PT_0 = Get_PartObject("Trail_PT0"); + + SAFE_ADDREF(m_pLeviosoPJ_0); + SAFE_ADDREF(m_pLeviosoPJ_1); + SAFE_ADDREF(m_pLeviosoTrail); + SAFE_ADDREF(m_pTrail_PT_0); + + m_wstrEffectName = L"Levioso"; + + m_fTurnSpeed = 10.f; + m_fRange = 1.f; + + m_fDuration = 1.5f; + + return S_OK; +} + +void CLevioso::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); + + if (nullptr != m_pPhysHitBox) { + m_pPhysHitBox->Get_Component()->RewindMomentum(); + } +} + +void CLevioso::Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Update(fTimeDelta); + + Update_Event(fTimeDelta); + + + + m_pLeviosoPJ_0->Get_Component()->Translation(m_vOwnerLook * 0.25f); + m_pLeviosoPJ_1->Get_Component()->Translation(m_vOwnerLook * 0.25f); + + + m_pTrail_PT_0->Get_Component()->Translation(m_vOwnerLook * 0.25f); + + + + if (nullptr != m_pPhysHitBox) { + m_pPhysHitBox->Get_Component()->AccumulateMomentum(m_vOwnerLook * 0.25f); + } + + + _matrix WorldMat = m_pTrail_PT_0->Get_Component()->Get_XMWorldMatrix(); + + m_pLeviosoTrail->Trail_Update(WorldMat, fTimeDelta); + +} + +void CLevioso::Late_Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + CPlayer* pPlayer = static_cast(m_pOwner); + + if (pPlayer == nullptr) + return; + + _matrix WandWorld = pPlayer->Get_WandPos(); + + //m_pLeviosoTrail->Get_Component()->Fixed_Trail(WandWorld); + + + + __super::Late_Update(fTimeDelta); + + +} + +HRESULT CLevioso::Pre_Setting(CGameObject* pObject) +{ + if (pObject == nullptr) + return E_FAIL; + + m_pOwner = pObject; + + + Reset_EffectParts(); + + __super::m_fAccTime = 0.f; + m_fPreAccTime = 0.f; + + m_fAccRotateTime = 0.f; + + + + CPlayer* pPlayer = static_cast(m_pOwner); + + if (pPlayer == nullptr) + return E_FAIL; + + _vector WandPos = pPlayer->Get_WandPos().r[3]; + + m_pLeviosoPJ_0->Get_Component()->Set_WorldMatrix(m_pOwner->Get_Component()->Get_XMWorldMatrix()); + m_pLeviosoPJ_1->Get_Component()->Set_WorldMatrix(m_pOwner->Get_Component()->Get_XMWorldMatrix()); + m_pTrail_PT_0->Get_Component()->Set_WorldMatrix(m_pOwner->Get_Component()->Get_XMWorldMatrix()); + + m_pLeviosoPJ_0->Get_Component()->Set_State(STATE::POSITION, WandPos); + m_pLeviosoPJ_1->Get_Component()->Set_State(STATE::POSITION, WandPos); + m_pTrail_PT_0->Get_Component()->Set_State(STATE::POSITION, WandPos); + + + m_pLeviosoPJ_0 ->Set_Visible(true); + m_pLeviosoPJ_1->Set_Visible(true); + m_pTrail_PT_0->Set_Visible(true); + + m_pLeviosoTrail->Set_Visible(true); + m_pLeviosoTrail->Get_Component()->Reset_Trail(); + + m_vOwnerLook = XMVector3Normalize(m_pOwner->Get_Component()->Get_State(STATE::LOOK)); + + m_bVisible = true; + + return S_OK; +} + +HRESULT CLevioso::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CLevioso::Ready_Child() +{ + CDummy_PhysXEffectHitBox::PHYSXDUMMY_DESC Desc{}; + + m_pTransformCom->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + + XMStoreFloat3(&Desc.vPos, m_pOwner->Get_WorldPostion() + XMVectorSet(0.f, 0.f, 1.f, 0.f)); + + + Desc.vRotRPY = { 0.f, 0.f, 0.f }; + Desc.iSubKind = 70; + Desc.vDeltaPos = _float3(0.f, 0.f, 0.f); + Desc.vLifeTime = { 0.f, 1.5f }; + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, CURRENT_LEVEL, LAYER_HITBOX, &Desc, this, &m_pPhysHitBox))) { + assert(false); + return E_FAIL; + } + + SAFE_ADDREF(m_pPhysHitBox); + + return S_OK; +} + +CLevioso* CLevioso::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CLevioso* pInstance = new CLevioso(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CLevioso"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + + +CGameObject* CLevioso::Clone(void* pArg, CGameObject* pOwner) +{ + CLevioso* pInstance = new CLevioso(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CLevioso"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CLevioso::OnCollision(CGameObject* pOther, void* pDesc) +{ + //CTransform* pOtherTransform = p + ON_COLLISION_INFO* CollisionDesc = static_cast(pDesc); + + + + m_pLeviosoPJ_0->Set_Visible(false); + m_pLeviosoPJ_1->Set_Visible(false); + m_pTrail_PT_0->Set_Visible(false); + m_pLeviosoTrail->Set_Visible(false); + + m_pPhysHitBox->Set_Dead(); + SAFE_RELEASE(m_pPhysHitBox); + +} + +void CLevioso::Free() +{ + __super::Free(); + + if(m_pPhysHitBox != nullptr) + SAFE_RELEASE(m_pPhysHitBox); + + SAFE_RELEASE(m_pLeviosoPJ_0); + SAFE_RELEASE(m_pLeviosoPJ_1); + SAFE_RELEASE(m_pLeviosoTrail); + SAFE_RELEASE(m_pTrail_PT_0); +} +#ifdef _DEBUG + +void CLevioso::Describe_Entity() +{ + GUI::Begin("LEVIOSO"); + + GUI::DragFloat("TURN SPEED", &m_fTurnSpeed); + GUI::DragFloat("RANGE", &m_fRange); + GUI::End(); + +} + +#endif // _DEBUG + +HRESULT CLevioso::Bind_ShaderResources() +{ + return S_OK; +} + + diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index a8ca8dc16..e57f6280c 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -115,7 +115,8 @@ #include "Decendo.h" #include "Protego.h" #include "EffectPool.h" - +#include "Revelio.h" +#include "Levioso.h" #pragma endregion #pragma region PHYSX_HEADER @@ -1206,6 +1207,12 @@ HRESULT CLoader::Loading_For_Effect() if (FAILED(m_pGameInstance->Add_Prototype(ENUM_CLASS(LEVEL::EFFECT), CProtego::Create(m_pDevice, m_pContext)))) return E_FAIL; + if (FAILED(m_pGameInstance->Add_Prototype(ENUM_CLASS(LEVEL::EFFECT), CRevelio::Create(m_pDevice, m_pContext)))) + return E_FAIL; + + if (FAILED(m_pGameInstance->Add_Prototype(ENUM_CLASS(LEVEL::EFFECT), CLevioso::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)))) diff --git a/Jusin154_Team3D/Editor/Private/NomalJap.cpp b/Jusin154_Team3D/Editor/Private/NomalJap.cpp index aba06e4ab..e048357af 100644 --- a/Jusin154_Team3D/Editor/Private/NomalJap.cpp +++ b/Jusin154_Team3D/Editor/Private/NomalJap.cpp @@ -71,12 +71,12 @@ void CNomalJap::Update(_float fTimeDelta) Update_Event(fTimeDelta); - m_pProjectile_Side->Get_Component()->Translation(m_vOwnerLook * 1.2f); - m_pProjectile->Get_Component()->Translation(m_vOwnerLook * 1.2f); + m_pProjectile_Side->Get_Component()->Translation(m_vCameraLook * 1.2f); + m_pProjectile->Get_Component()->Translation(m_vCameraLook * 1.2f); if (nullptr != m_pPhysHitBox) { - m_pPhysHitBox->Get_Component()->AccumulateMomentum(m_vOwnerLook * 1.2f); + m_pPhysHitBox->Get_Component()->AccumulateMomentum(m_vCameraLook * 1.2f); } @@ -139,11 +139,11 @@ HRESULT CNomalJap::Pre_Setting(CGameObject* pObject) //나아가는 벡터와 한점을 가져와 수직인 평면상에 하나의 점으로 DIR 을 만듬 - m_vOwnerLook = XMVector3Normalize(m_pOwner->Get_Component()->Get_State(STATE::LOOK)); + m_vCameraLook = XMVector3Normalize(m_pOwner->Get_Component()->Get_State(STATE::LOOK)); _vector vUp = XMVectorSet(0.f, 1.f, 0.f, 0.f); - _vector vQuaternion = XMQuaternionRotationAxis(m_vOwnerLook, m_pGameInstance->Random_Float(0.f, XM_PIDIV2)); + _vector vQuaternion = XMQuaternionRotationAxis(m_vCameraLook, m_pGameInstance->Random_Float(0.f, XM_PIDIV2)); m_vRotateUp = XMVector3Rotate(vUp, vQuaternion); @@ -232,8 +232,12 @@ void CNomalJap::OnCollision(CGameObject* pOther , void* pDesc) Get_PartObject()->Set_Visible(false); Get_PartObject()->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(0.f, 0.f, 0.f, 1.f)); - m_pPhysHitBox->Set_Dead(); - SAFE_RELEASE(m_pPhysHitBox); + if (m_pPhysHitBox != nullptr) + { + m_pPhysHitBox->Set_Dead(); + SAFE_RELEASE(m_pPhysHitBox); + } + } void CNomalJap::Free() @@ -241,8 +245,7 @@ void CNomalJap::Free() __super::Free(); if(m_pPhysHitBox != nullptr) - if (m_pPhysHitBox->isDead() == false) - SAFE_RELEASE(m_pPhysHitBox); + SAFE_RELEASE(m_pPhysHitBox); Safe_Release(m_pProjectile); Safe_Release(m_pProjectile_Side); diff --git a/Jusin154_Team3D/Editor/Private/Player.cpp b/Jusin154_Team3D/Editor/Private/Player.cpp index 6fd9b7ec8..4523fce20 100644 --- a/Jusin154_Team3D/Editor/Private/Player.cpp +++ b/Jusin154_Team3D/Editor/Private/Player.cpp @@ -240,9 +240,9 @@ _matrix CPlayer::Get_WandPos() if (pWand == nullptr) return _matrix(); - _matrix BoneMatrix = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("root")); + _matrix BoneMatrix = XMLoadFloat4x4(pWand->Get_BoneMatrixPtr("root")); - BoneMatrix = BoneMatrix * m_pTransformCom->Get_XMWorldMatrix(); + BoneMatrix = BoneMatrix * Get_PartObject()->Get_Component()->Get_XMWorldMatrix(); _float3 vOffset = _float3(0.f, -0.27f, -0.32f); diff --git a/Jusin154_Team3D/Editor/Private/Player_States.cpp b/Jusin154_Team3D/Editor/Private/Player_States.cpp index d3aafb811..e314d77f8 100644 --- a/Jusin154_Team3D/Editor/Private/Player_States.cpp +++ b/Jusin154_Team3D/Editor/Private/Player_States.cpp @@ -21,7 +21,6 @@ #pragma endregion #include "EffectPool.h" -#include "Protego.h" #pragma region States void CPlayer::TestKeyInput(_float fTimeDelta) @@ -433,6 +432,8 @@ void CPlayer::Behavior_CombatEnter() 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->Enable_State(FSMSTATE::SKILL2); @@ -457,6 +458,10 @@ void CPlayer::Behavior_CombatEnter() case STATEANIM::DEPULSO: pairAnimInfo = m_Animation[STATEANIM::DEPULSO]; m_eSpell = STATEANIM::END; + + + m_pEffectPool->Use_Skill(SKILL_TYPE::LEVIOSO, this); + break; case STATEANIM::DIFFINDO: pairAnimInfo = m_Animation[STATEANIM::DIFFINDO]; @@ -661,18 +666,28 @@ void CPlayer::Add_FSM() void CPlayer::Set_Anim() { m_Animation[STATEANIM::IDLE] = { 266,true }; + m_Animation[STATEANIM::IDLE_AIM] = { 5,true }; m_Animation[STATEANIM::IDLE_TURN_L] = { 270,false }; m_Animation[STATEANIM::IDLE_TURN_R] = { 430,false }; m_Animation[STATEANIM::IDLE_TURN_BWD] = { 268,false }; m_Animation[STATEANIM::WALK_FWD] = { 625,true }; - m_Animation[STATEANIM::WALK_BWD] = { 166,true }; + m_Animation[STATEANIM::WALK_LEFT] = { 337,false }; + m_Animation[STATEANIM::WALK_RIGHT] = { 504,false }; + m_Animation[STATEANIM::WALK_BWD] = { 352,false }; + m_Animation[STATEANIM::WALK_STOP] = { 344,false }; m_Animation[STATEANIM::JOG_FWD] = { 167,true }; - m_Animation[STATEANIM::JOG_BWD] = { 154,false}; + m_Animation[STATEANIM::JOG_LEFT] = { 164,false }; // Turn + m_Animation[STATEANIM::JOG_RIGHT] = { 185,false };// Turn + m_Animation[STATEANIM::JOG_BWD] = { 154,false }; // Turn m_Animation[STATEANIM::JOG_STOP] = { 289,false }; + m_Animation[STATEANIM::JOG_AIM_LEFT] = { 171,true }; + m_Animation[STATEANIM::JOG_AIM_RIGHT] = { 175,true }; + m_Animation[STATEANIM::JOG_AIM_BWD] = { 166,true }; + m_Animation[STATEANIM::JUMP] = { 205,false }; m_Animation[STATEANIM::JUMP_JOG] = { 203,false }; m_Animation[STATEANIM::JUMP_SPRINT] = { 207,false }; @@ -681,21 +696,41 @@ void CPlayer::Set_Anim() m_Animation[STATEANIM::LAND] = { 259,false }; - m_Animation[STATEANIM::DODGE] = { 802,false }; - m_Animation[STATEANIM::DODGE_BLINK] = { 799,true }; + m_Animation[STATEANIM::DODGE] = { 878,false }; + m_Animation[STATEANIM::DODGE_BLINK] = { 876,true }; m_Animation[STATEANIM::SKILL] = { 593,false }; - m_Animation[STATEANIM::SKILL2] = { 915,false }; + m_Animation[STATEANIM::SKILL2] = { 991,false }; m_Animation[STATEANIM::LIGHT_ATTACK] = { 413,false }; - m_Animation[STATEANIM::SPELL] = { 696,false }; + m_Animation[STATEANIM::SPELL] = { 772,false }; m_Animation[STATEANIM::MAPHELP] = { 122,false }; + m_Animation[STATEANIM::POTION] = { 114,false }; // 114 포션 // 909 루모스 m_Animation[STATEANIM::ACCIO] = { 417,false }; - m_Animation[STATEANIM::DESCENDO] = { 418,false }; - m_Animation[STATEANIM::DEPULSO] = { 782,false }; - m_Animation[STATEANIM::DIFFINDO] = { 786,false }; - m_Animation[STATEANIM::LUMOS] = { 782,false }; + m_Animation[STATEANIM::DESCENDO] = { 857,false }; + m_Animation[STATEANIM::DEPULSO] = { 858,false }; + m_Animation[STATEANIM::DIFFINDO] = { 862,false }; + m_Animation[STATEANIM::LUMOS] = { 909,true }; + m_Animation[STATEANIM::LUMOS_STOP] = { 912,false }; m_Animation[STATEANIM::DISILLUSION_ENTER] = { 585,false }; m_Animation[STATEANIM::DISILLUSION_EXIT] = { 586,false }; + m_Animation[STATEANIM::ANCIENT_THROW] = { 919,false }; + + + m_Animation[STATEANIM::HIT_L] = { 1124,false }; + m_Animation[STATEANIM::HIT_R] = { 1125,false }; + + m_Animation[STATEANIM::BROOM_IDLE] = { 679,true }; + m_Animation[STATEANIM::BROOM_FWD] = { 680,true }; + + m_Animation[STATEANIM::BROOM_MOUNT] = { 734,false }; + m_Animation[STATEANIM::BROOM_MOUNT_END] = { 737,false }; + m_Animation[STATEANIM::BROOM_HOVER_START] = { 699,false }; + m_Animation[STATEANIM::BROOM_HOVER_IDLE] = { 703,true }; + + + m_Animation[STATEANIM::JOG_AIM_STOP_L] = { 295,false }; + m_Animation[STATEANIM::JOG_AIM_STOP_R] = { 456,false }; + m_Animation[STATEANIM::JOG_AIM_STOP_BWD] = { 444,false }; } #pragma endregion State diff --git a/Jusin154_Team3D/Editor/Private/Revelio.cpp b/Jusin154_Team3D/Editor/Private/Revelio.cpp new file mode 100644 index 000000000..b58b010f7 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Revelio.cpp @@ -0,0 +1,212 @@ +#include "pch.h" +#include "Revelio.h" + +#include "GameInstance.h" +#include "EditEffect.h" +#include "Player.h" + + +CRevelio::CRevelio(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CEffect_Container{ pDevice, pContext } +{ +} + +CRevelio::CRevelio(const CRevelio& rhs) + : CEffect_Container(rhs) +{ +} + +HRESULT CRevelio::Initialize_Prototype() +{ + + return S_OK; + +} + +HRESULT CRevelio::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/Package/Revelio"))) + return E_FAIL; + + m_pRevelioPT_Y = Get_PartObject("WandPT_Y"); + m_pRevelioPT_B = Get_PartObject("WandPT_B"); + m_pRevelioPT_R = Get_PartObject("WandPT_R"); + + SAFE_ADDREF(m_pRevelioPT_Y); + SAFE_ADDREF(m_pRevelioPT_B); + SAFE_ADDREF(m_pRevelioPT_R); + + m_wstrEffectName = L"Revelio"; + + + + m_fDuration = 3.f; + + return S_OK; +} + +void CRevelio::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); + +} + +void CRevelio::Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Update(fTimeDelta); + + Update_Event(fTimeDelta); + + CPlayer* pPlayer = static_cast(m_pOwner); + + if (pPlayer == nullptr) + return; + + _matrix WandWorld = pPlayer->Get_WandPos(); + + /*_vector pPos = pPlayer->Get_WandPos().r[3];*/ + + m_pRevelioPT_Y->Get_Component()->Set_WorldMatrix(WandWorld); + m_pRevelioPT_R->Get_Component()->Set_WorldMatrix(WandWorld); + m_pRevelioPT_B->Get_Component()->Set_WorldMatrix(WandWorld); + +} + +void CRevelio::Late_Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Late_Update(fTimeDelta); + + +} + +HRESULT CRevelio::Pre_Setting(CGameObject* pObject) +{ + if (pObject == nullptr) + return E_FAIL; + + m_pOwner = pObject; + + + Reset_EffectParts(); + + m_fAccTime = 0.f; + __super::m_fAccTime = 0.f; + m_fPreAccTime = 0.f; + + + CPlayer* pPlayer = static_cast(m_pOwner); + + if (pPlayer == nullptr) + return E_FAIL; + + _matrix WandWorld = pPlayer->Get_WandPos(); + + /*_vector pPos = pPlayer->Get_WandPos().r[3];*/ + + m_pRevelioPT_Y->Get_Component()->Set_WorldMatrix(WandWorld); + m_pRevelioPT_R->Get_Component()->Set_WorldMatrix(WandWorld); + m_pRevelioPT_B->Get_Component()->Set_WorldMatrix(WandWorld); + + m_pRevelioPT_Y->Set_Visible(true); + m_pRevelioPT_R->Set_Visible(true); + m_pRevelioPT_B->Set_Visible(true); + + + Get_PartObject("Revelio_Ring")->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + Get_PartObject("Revelio_Ring")->Set_Visible(true); + + m_bVisible = true; + + return S_OK; +} + +HRESULT CRevelio::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CRevelio::Ready_Child() +{ + return S_OK; +} + +CRevelio* CRevelio::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CRevelio* pInstance = new CRevelio(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CRevelio"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + + +CGameObject* CRevelio::Clone(void* pArg, CGameObject* pOwner) +{ + CRevelio* pInstance = new CRevelio(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CRevelio"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CRevelio::OnCollision(CGameObject* pOther, void* pDesc) +{ + //CTransform* pOtherTransform = p + ON_COLLISION_INFO* CollisionDesc = static_cast(pDesc); + +} + +void CRevelio::Free() +{ + __super::Free(); + + //if(m_pPhysHitBox != nullptr) + // if (m_pPhysHitBox->Get_Depth() == false) + // SAFE_RELEASE(m_pPhysHitBox); + + + SAFE_RELEASE(m_pRevelioPT_Y); + SAFE_RELEASE(m_pRevelioPT_B); + SAFE_RELEASE(m_pRevelioPT_R); + +} +#ifdef _DEBUG + +void CRevelio::Describe_Entity() +{ + +} + +#endif // _DEBUG + +HRESULT CRevelio::Bind_ShaderResources() +{ + return S_OK; +} + + diff --git a/Jusin154_Team3D/Editor/Private/RootModelPart.cpp b/Jusin154_Team3D/Editor/Private/RootModelPart.cpp index 489dd2283..60067d2dd 100644 --- a/Jusin154_Team3D/Editor/Private/RootModelPart.cpp +++ b/Jusin154_Team3D/Editor/Private/RootModelPart.cpp @@ -71,7 +71,7 @@ void CRootModelPart::Update_Anim(_float fTimeDelta) { pModel->Set_PlayAnim(m_pMainModel->Get_PlayAnim()); pModel->Set_AnimSpeed(m_pMainModel->Get_AnimSpeed()); - pModel->ComputeAnimation(); + //pModel->ComputeAnimation(); pModel->Play_Animation(fTimeDelta,m_pTransformCom); } } @@ -100,7 +100,7 @@ void CRootModelPart::Change_Model(_uint iIndex) pModel->Set_AnimationIndex(m_iAnimIndex); pModel->Set_CurrentTrackPosition(m_fTrackPosition); - pModel->ComputeAnimation(); + //pModel->ComputeAnimation(); pModel->Play_Animation(0.f, m_pTransformCom); if (iIndex == ENUM_CLASS(PARTSTYPE::BODY)) @@ -114,7 +114,7 @@ void CRootModelPart::Set_Animation(_uint iAnimIndex) { m_pMainModel->Set_AnimationIndex(iAnimIndex); m_pMainModel->Set_CurrentTrackPosition(0.f); - m_pMainModel->ComputeAnimation(); + //m_pMainModel->ComputeAnimation(); m_pMainModel->Play_Animation(0.f, m_pTransformCom); for (auto& PartObject : m_ModelParts) { @@ -123,7 +123,7 @@ void CRootModelPart::Set_Animation(_uint iAnimIndex) { pModel->Set_AnimationIndex(m_pMainModel->Get_AnimIndex()); pModel->Set_CurrentTrackPosition(m_pMainModel->Get_CurrentTrackPosition()); - pModel->ComputeAnimation(); + //pModel->ComputeAnimation(); pModel->Play_Animation(0.f, m_pTransformCom); } } diff --git a/Jusin154_Team3D/Editor/Private/TrailObject.cpp b/Jusin154_Team3D/Editor/Private/TrailObject.cpp index acdb0cdfa..8b6bd1053 100644 --- a/Jusin154_Team3D/Editor/Private/TrailObject.cpp +++ b/Jusin154_Team3D/Editor/Private/TrailObject.cpp @@ -326,6 +326,8 @@ HRESULT CTrailObject::Load_Trail(const _char* pPath, LEVEL eLevel) return E_FAIL; } + m_pTrailCom->ReStructVB(m_TrailInfo.iNumVertex); + CloseHandle(hFile); return S_OK; @@ -486,6 +488,12 @@ void CTrailObject::Describe_Entity() m_pShaderCom->Describe_Entity(); + if(GUI::InputInt("NumVertex", &m_TrailInfo.iNumVertex)) + { + m_pTrailCom->Reset_Trail(); + m_pTrailCom->ReStructVB(m_TrailInfo.iNumVertex); + } + GUI::Checkbox("Diffuse", &m_TrailInfo.isDiffuse); GUI::Checkbox("Masking", &m_TrailInfo.isMask); GUI::Checkbox("Noise", &m_TrailInfo.isNoise); diff --git a/Jusin154_Team3D/Editor/Private/Wand.cpp b/Jusin154_Team3D/Editor/Private/Wand.cpp index 77bb00bfd..23bc08d7f 100644 --- a/Jusin154_Team3D/Editor/Private/Wand.cpp +++ b/Jusin154_Team3D/Editor/Private/Wand.cpp @@ -53,26 +53,12 @@ void CWand::Priority_Update(_float fTimeDelta) void CWand::Update(_float fTimeDelta) { - - Describe_Entity(); - - //_matrix BoneMatrix = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("root")); - - //BoneMatrix = BoneMatrix * m_pTransformCom->Get_XMWorldMatrix(); - - - //BoneMatrix.r[3] += XMVector3Normalize(BoneMatrix.r[0]) * m_vOffset.x; - //BoneMatrix.r[3] += XMVector3Normalize(BoneMatrix.r[1]) * m_vOffset.y; - //BoneMatrix.r[3] += XMVector3Normalize(BoneMatrix.r[2]) * m_vOffset.z; - - //m_pEffectParts->Get_Component()->Set_WorldMatrix(BoneMatrix); - - //m_pTrail->Trail_Update(BoneMatrix, fTimeDelta); - + m_pModelCom->Combined_BoneMatrix(); } void CWand::Late_Update(_float fTimeDelta) { + m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this); } diff --git a/Jusin154_Team3D/Editor/Public/Decendo.h b/Jusin154_Team3D/Editor/Public/Decendo.h index 3e778f36c..40b02a92e 100644 --- a/Jusin154_Team3D/Editor/Public/Decendo.h +++ b/Jusin154_Team3D/Editor/Public/Decendo.h @@ -40,7 +40,7 @@ class CDecendo final : public CEffect_Container _float m_fAccTime = {}; _float m_fLerpAmount = {}; _float m_fTurnValue = {}; - _vector m_vOwnerLook = {}; + _vector m_vCameraLook = {}; public: static CDecendo* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual void Free() override; diff --git a/Jusin154_Team3D/Editor/Public/Dummy_Globe.h b/Jusin154_Team3D/Editor/Public/Dummy_Globe.h index 5ed94c890..cb77d502c 100644 --- a/Jusin154_Team3D/Editor/Public/Dummy_Globe.h +++ b/Jusin154_Team3D/Editor/Public/Dummy_Globe.h @@ -27,6 +27,7 @@ class CDummy_Globe final : public CGameObject virtual void Update(_float fTimeDelta) override; virtual void Late_Update(_float fTimeDelta) override; virtual HRESULT Render() override; + virtual HRESULT Render_Bloom() override { return Render(); }; private: CModel* m_pModelCom = { nullptr }; diff --git a/Jusin154_Team3D/Editor/Public/Editor_Define.h b/Jusin154_Team3D/Editor/Public/Editor_Define.h index 8f0685447..22c0c09d5 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Define.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Define.h @@ -26,7 +26,8 @@ namespace Editor enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, TRAIL_BLUR , TRAIL_BLOOM, END }; - enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, NON_WORLD_BLUR, ALPHA_BLEND, BLOOM, END }; + + enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, NON_WORLD_BLUR, BLEND, BLEND_NOWORLD, BLOOM, BLOOM_NOWORLD, END }; enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, SPELL_ANIM, NINECLICE, ROTATION, SLOT, TYPE, HPBAR, MAGIC_METER, MAGIC_ICON, REMOVEUV, REVELIO, POTION, MAGIC_ITEM, SPELL_PREVIEW, SPELL_HEADER, SPELL_HEADER_LINE, END }; enum class SHADER_PASS_UIINTANCE { DEFAULT, ALPHABLEND, MAGIC_METER, SPELL_LIST, EESSENTIAL_SPELL_SOLT, EESSENTIAL_SPELL, COLOR, SPELL_HOVER, SPELL_SLOT_EFFECT, END }; diff --git a/Jusin154_Team3D/Editor/Public/EffectObject.h b/Jusin154_Team3D/Editor/Public/EffectObject.h index f4d8dd844..f2a9cf81c 100644 --- a/Jusin154_Team3D/Editor/Public/EffectObject.h +++ b/Jusin154_Team3D/Editor/Public/EffectObject.h @@ -24,7 +24,7 @@ class CEffectObject abstract : public CPartObject _float2 vMaskingUVGainAmount = {}; _float2 vNoiseUVGainAmount = {}; - _float2 vDiffuseDistortionUVGainAmount = {}; + _float2 vDistortionTime = {}; _float2 vMaskDistortionUVGainAmount = {}; _float2 vUVCutting = { 1.f ,1.f }; diff --git a/Jusin154_Team3D/Editor/Public/EffectPool.h b/Jusin154_Team3D/Editor/Public/EffectPool.h index 2d74d706b..0a555cb30 100644 --- a/Jusin154_Team3D/Editor/Public/EffectPool.h +++ b/Jusin154_Team3D/Editor/Public/EffectPool.h @@ -27,6 +27,10 @@ class CEffectPool final : public CGameObject public: HRESULT Create_Effect(SKILL_TYPE eType, _uint iNumEffect, _uint iPrototypeLevel, _uint iCloneLevel , function AddPrototypeEvent); HRESULT Use_Skill(SKILL_TYPE eType , CGameObject* pOwner); +public: +#ifdef _DEBUG + HRESULT Reset_Pool(); +#endif private: list m_EffectList[ENUM_CLASS(SKILL_TYPE::END)] = {}; list m_ActiveEffectList = {}; diff --git a/Jusin154_Team3D/Editor/Public/Effect_Editor.h b/Jusin154_Team3D/Editor/Public/Effect_Editor.h index f0358252f..a0375761c 100644 --- a/Jusin154_Team3D/Editor/Public/Effect_Editor.h +++ b/Jusin154_Team3D/Editor/Public/Effect_Editor.h @@ -54,6 +54,9 @@ class CEffect_Editor final : public CEffect_Container _string m_strTrailSavePath = {}; _string m_strPackageSavePath = {}; +private: + class CEffectPool* m_pEffectPool = nullptr; + public: static CEffect_Editor* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Editor/Public/Levioso.h b/Jusin154_Team3D/Editor/Public/Levioso.h new file mode 100644 index 000000000..1b3fb48bf --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Levioso.h @@ -0,0 +1,55 @@ +#pragma once + +#include "Editor_Define.h" +#include "Effect_Container.h" + +NS_BEGIN(Engine) +NS_END + +NS_BEGIN(Editor) + +class CLevioso final : public CEffect_Container +{ +private: + CLevioso(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CLevioso(const CLevioso& rhs); + virtual ~CLevioso() = 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) 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 = {}; + class CPlayer* m_pPlayer = {}; + + class CEditEffect* m_pLeviosoPJ_0 = { nullptr }; + class CEditEffect* m_pLeviosoPJ_1 = { nullptr }; + class CTrailObject* m_pLeviosoTrail = { nullptr }; + class CEditEffect* m_pTrail_PT_0 = { nullptr }; + + _vector m_vOwnerLook = {}; + _float m_fAccRotateTime = {}; + _float m_fTurnSpeed = {}; + _float m_fRange = {}; +public: + static CLevioso* 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/NomalJap.h b/Jusin154_Team3D/Editor/Public/NomalJap.h index 8101aa3a9..70f9aa159 100644 --- a/Jusin154_Team3D/Editor/Public/NomalJap.h +++ b/Jusin154_Team3D/Editor/Public/NomalJap.h @@ -39,7 +39,7 @@ class CNomalJap final : public CEffect_Container _float m_fAccTime = {}; _float m_fLerpAmount = {}; _float m_fTurnValue = {}; - _vector m_vOwnerLook = {}; + _vector m_vCameraLook = {}; public: static CNomalJap* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual void Free() override; diff --git a/Jusin154_Team3D/Editor/Public/Player.h b/Jusin154_Team3D/Editor/Public/Player.h index 80bc9f88d..5c4c27ed7 100644 --- a/Jusin154_Team3D/Editor/Public/Player.h +++ b/Jusin154_Team3D/Editor/Public/Player.h @@ -17,7 +17,7 @@ class CPlayer final : public CUnit virtual void Update(_float fTimeDelta) override; virtual void Late_Update(_float fTimeDelta) override; virtual HRESULT Render() override; - _bool Set_Sprint(_bool bSprint) { m_bSprintToggle = bSprint; } + _bool Set_Sprint(_bool bSprint) { m_bSprintToggle = bSprint; } _matrix Get_WandPos(); private: _float m_fDirectionRadian = 0.f; diff --git a/Jusin154_Team3D/Editor/Public/Revelio.h b/Jusin154_Team3D/Editor/Public/Revelio.h new file mode 100644 index 000000000..e3b334bf6 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Revelio.h @@ -0,0 +1,49 @@ +#pragma once + +#include "Editor_Define.h" +#include "Effect_Container.h" + +NS_BEGIN(Engine) +NS_END + +NS_BEGIN(Editor) + +class CRevelio final : public CEffect_Container +{ +private: + CRevelio(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CRevelio(const CRevelio& rhs); + virtual ~CRevelio() = 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) 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 = {}; + class CPlayer* m_pPlayer = {}; + class CEditEffect* m_pRevelioPT_Y = { nullptr }; + class CEditEffect* m_pRevelioPT_B = { nullptr }; + class CEditEffect* m_pRevelioPT_R = { nullptr }; + +public: + static CRevelio* 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/TrailObject.h b/Jusin154_Team3D/Editor/Public/TrailObject.h index 6a7c16594..190930957 100644 --- a/Jusin154_Team3D/Editor/Public/TrailObject.h +++ b/Jusin154_Team3D/Editor/Public/TrailObject.h @@ -68,6 +68,8 @@ class CTrailObject final : public CPartObject BLOOM_TYPE eBloomType = {}; _float2 vBloomTime = {}; + _int iNumVertex = {}; + }TRAIL_INFO; private: CTrailObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); 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 91a72f9db..b669d3285 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl @@ -39,6 +39,7 @@ struct ParticleValue float fSizeDrag; float3 vDeltaSize; float2 vDelay; + }; @@ -101,7 +102,7 @@ void CS_MAIN( { if (isNoWorld) { - float4x4 CurMat = { particle.vRight, particle.vUp, particle.vLook, particle.vTranslation }; + row_major float4x4 CurMat = { particle.vRight, particle.vUp, particle.vLook, particle.vTranslation }; CurMat = mul(CurMat, WorldMatrix); @@ -112,6 +113,7 @@ void CS_MAIN( particle.vTranslation = CurMat[3].xyzw; } } + // 라이프타임 움직임 particle.vLifeTime.x += fTimeDelta; @@ -151,21 +153,26 @@ void CS_MAIN( if (particleValue.fDrag < FLT_EPSILON5) fDrag = 1; - float4 vVelocity = vector(normalize(particle.vLook.xyz) * particleValue.fSpeed, 1.f); + float4 vVelocity = vector(normalize(particle.vLook.xyz) * particleValue.fSpeed, 0.f); particle.vTranslation += vVelocity * fTimeDelta * fDrag; } if (isPivotMove) { + float fTime = (particle.vLifeTime.x / particle.vLifeTime.y); + float3 vDir = normalize(particleValue.vPivot - particleValue.vOriginTranslation.xyz); - float fDrag = particleValue.fDrag; + float fRatio = (1 - fTime * fTime); + float fDrag = particleValue.fDrag * fRatio; + + if (particleValue.fDrag < FLT_EPSILON5) fDrag = 1; - float4 vVelocity = vector(vDir * particleValue.fSpeed, 1.f); + float4 vVelocity = vector(vDir * particleValue.fSpeed , 0.f); particle.vTranslation += vVelocity * fTimeDelta * fDrag; diff --git a/Jusin154_Team3D/Engine/Private/Animation.cpp b/Jusin154_Team3D/Engine/Private/Animation.cpp index ab2984f7f..050b4a388 100644 --- a/Jusin154_Team3D/Engine/Private/Animation.cpp +++ b/Jusin154_Team3D/Engine/Private/Animation.cpp @@ -24,6 +24,8 @@ CAnimation::CAnimation(const CAnimation& rhs) , m_pSaveAnim{ rhs.m_pSaveAnim } , m_fAnimSpeed{rhs.m_fAnimSpeed } , m_iBoneCount{rhs.m_iBoneCount} + , m_fProgress{rhs.m_fProgress } + , m_fDurationSeconds{ rhs.m_fDurationSeconds } { memcpy_s(m_TickPerSeconds, sizeof(_float) * 2, rhs.m_TickPerSeconds, sizeof(_float) * 2); @@ -33,27 +35,29 @@ CAnimation::CAnimation(const CAnimation& rhs) SAFE_ADDREF(pChannel); } } -_bool CAnimation::Update_TransformationMatrices(const vector& Bones, const LOCALPOS_DESC* pLocalPosArray, _bool bIsLoop, _float fTimeDelta,_vector vector[3]) +_bool CAnimation::Update_TransformationMatrices(const vector& Bones, LOCALPOS_DESC** pLocalPosArray, _bool bIsLoop, _float fTimeDelta, _bool bIsSpine, vector<_uint> BoneMask,_vector vector[3]) { + m_fTempTrack += fTimeDelta * m_fAnimSpeed; m_fProgress = m_fTickPerSecond * fTimeDelta * m_fAnimSpeed; m_fCurrentTrackPosition += m_fProgress; if (m_fCurrentTrackPosition >= m_fDuration) { if (false == bIsLoop) { m_fCurrentTrackPosition = 0.f; // 루프 - m_fCurrentTrackPosition = m_fDuration; + m_fTempTrack = 0.f; return true; } else { Depart_Animation(); m_fCurrentTrackPosition = m_fProgress; + m_fTempTrack = 0.f; ResetRootMotion(); - ProgressAnimation(Bones, pLocalPosArray, vector); + ProgressAnimation(Bones, pLocalPosArray, bIsSpine, BoneMask, vector); return true; } } - ProgressAnimation(Bones, pLocalPosArray, vector); + ProgressAnimation(Bones, pLocalPosArray, bIsSpine, BoneMask, vector); return false; } @@ -256,6 +260,8 @@ HRESULT CAnimation::Initialize(const vector& Bones, const aiAnimation* p m_iNumChannels = pAIAnimation->mNumChannels; m_CurrentKeyFrameIndices.resize(m_iNumChannels); + m_fDurationSeconds = m_fDuration / m_fTickPerSecond; + for (_uint i = 0; i < m_iNumChannels; ++i) { CChannel* pChannel = CChannel::Create(Bones, pAIAnimation->mChannels[i]); if (nullptr == pChannel) { @@ -297,6 +303,8 @@ HRESULT CAnimation::Initialize(const vector& Bones, const CModel* pModel m_iBoneCount = (_uint)Bones.size(); + m_fDurationSeconds = m_fDuration / m_fTickPerSecond; + for (size_t i = 0; i < m_iNumChannels; i++) { CChannel* pChannel = CChannel::Create(pModel, &pSaveAnimation->Channels[i]); @@ -309,14 +317,14 @@ HRESULT CAnimation::Initialize(const vector& Bones, const CModel* pModel return S_OK; } -void CAnimation::ProgressAnimation(const vector& Bones, const LOCALPOS_DESC* pLocalPosArray,_vector vector[3]) +void CAnimation::ProgressAnimation(const vector& Bones, LOCALPOS_DESC** pLocalPosArray, _bool bIsSpine,vector<_uint>BoneMask,_vector vector[3]) { _uint iIndex = {}; if (m_vBoneTransformationMatrix.size() > 0) { m_vBoneTransformationMatrix.clear(); } for (auto& pChannel : m_Channels) { - pChannel->Update_TransformationMatirx(Bones, pLocalPosArray, m_fCurrentTrackPosition, &m_CurrentKeyFrameIndices[iIndex++], vector); + pChannel->Update_TransformationMatirx(Bones, pLocalPosArray, m_fCurrentTrackPosition, &m_CurrentKeyFrameIndices[iIndex++], bIsSpine, BoneMask, vector); m_vBoneTransformationMatrix.push_back(pChannel->Get_BoneTransformationMatrix()); } } diff --git a/Jusin154_Team3D/Engine/Private/Channel.cpp b/Jusin154_Team3D/Engine/Private/Channel.cpp index 4973e5c61..dbb3d388d 100644 --- a/Jusin154_Team3D/Engine/Private/Channel.cpp +++ b/Jusin154_Team3D/Engine/Private/Channel.cpp @@ -113,12 +113,23 @@ HRESULT CChannel::Initialize(const vector& Bones, _uint iIndex) void CChannel::Update_TransformationMatirx( const vector& Bones, - const LOCALPOS_DESC* pLocalPosArray, + LOCALPOS_DESC** pLocalPosArray, _float fCurrentTrackPosition, _uint* pCurrentKeyFrameIndex, + _bool bIsSpine, + vector<_uint> BoneMask, _vector vector[3]) { - const LOCALPOS_DESC& LocalPos = pLocalPosArray[m_iBoneIndex]; + if (!bIsSpine) + { + m_IsUpper = BoneMask[m_iBoneIndex]; + m_ilayerIndex = m_IsUpper ? 1 : 0; + LocalPos = pLocalPosArray[m_ilayerIndex][m_iBoneIndex]; + } + else + { + LocalPos = pLocalPosArray[0][m_iBoneIndex]; + } _vector vScale = XMLoadFloat3(&LocalPos.Scale); _vector vRotation = XMLoadFloat4(&LocalPos.Rotation); @@ -128,17 +139,32 @@ void CChannel::Update_TransformationMatirx( LocalPos.Translation.z, 1.f); - if (Bones[m_iBoneIndex]->Compare_Name("Reference")) + if (Bones[m_iBoneIndex]->Compare_Name("Reference") && vector) { vector[0] = vScale; vector[1] = vRotation; vector[2] = vTranslation; } - - m_BoneTransformationMatrix = - XMMatrixAffineTransformation(vScale, XMVectorSet(0.f, 0.f, 0.f, 1.f), vRotation, vTranslation); - Bones[m_iBoneIndex]->Set_TransformationMatrix(m_BoneTransformationMatrix); + if (bIsSpine) + { + m_BoneTransformationMatrix = + XMMatrixAffineTransformation(vScale, XMVectorSet(0.f, 0.f, 0.f, 1.f), vRotation, vTranslation); + + Bones[m_iBoneIndex]->Set_TransformationMatrix(m_BoneTransformationMatrix); + } + else + { + if (m_ilayerIndex == 1) + { + m_BoneTransformationMatrix = + XMMatrixAffineTransformation(vScale, XMVectorSet(0.f, 0.f, 0.f, 1.f), vRotation, vTranslation); + + Bones[m_iBoneIndex]->Set_TransformationMatrix(m_BoneTransformationMatrix); + } + } + + } void CChannel::ResetRootMotion() diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index 7539f7c80..5f44b7821 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -428,7 +428,7 @@ void CGameInstance::Clear_Objects_With_Layers(_uint iLevelIndex) } HRESULT CGameInstance::Add_RenderGroup(RENDER eRenderGroup, CGameObject* pRenderObject) -{ +{ return m_pRenderer->Add_RenderGroup(eRenderGroup, pRenderObject); } diff --git a/Jusin154_Team3D/Engine/Private/Graphic_Device.cpp b/Jusin154_Team3D/Engine/Private/Graphic_Device.cpp index 7bca5fe38..a8aed2001 100644 --- a/Jusin154_Team3D/Engine/Private/Graphic_Device.cpp +++ b/Jusin154_Team3D/Engine/Private/Graphic_Device.cpp @@ -260,7 +260,9 @@ void CGraphic_Device::Free() OutputDebugStringW(L" D3D11 Live Object ref Count Checker END \r "); OutputDebugStringW(L"----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- \r "); } - if (d3dDebug != nullptr) d3dDebug->Release(); + if (d3dDebug != nullptr) { + d3dDebug->Release(); + } #endif diff --git a/Jusin154_Team3D/Engine/Private/Instance_Model.cpp b/Jusin154_Team3D/Engine/Private/Instance_Model.cpp index 5f1e3ae15..f55b6737b 100644 --- a/Jusin154_Team3D/Engine/Private/Instance_Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Instance_Model.cpp @@ -173,7 +173,9 @@ HRESULT CInstance_Model::Ready_Meshes(MODEL eType, const aiScene* pAIScene, _fma #ifdef EDITOR_PROJECT _bool CInstance_Model::SaveAssimpModel(const _char* filename , const aiScene* pAIScene) { - if (!pAIScene) return false; + if (!pAIScene) { + return false; + } _char szModel[MAX_PATH] = {}; _char szExt[MAX_PATH] = {}; @@ -267,7 +269,9 @@ _bool CInstance_Model::SaveAssimpModel(const _char* filename , const aiScene* pA FILE* fp = nullptr; fopen_s(&fp, savePath.c_str(), "wb"); - if (!fp) return false; + if (!fp) { + return false; + } fwrite(&modelData.MeshCount, sizeof(_uint), 1, fp); @@ -349,7 +353,9 @@ bool CInstance_Model::LoadData(const _char* filename) { FILE* fp = nullptr; fopen_s(&fp, filename, "rb"); - if (!fp) return false; + if (!fp) { + return false; + } SaveModel NewModel = {}; diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index 819b9e4ef..8dd6614a6 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -113,25 +113,40 @@ _bool CModel::Play_Animation(_float fTimeDelta, CTransform* pTransform) if (m_iCurrentAnimIndex < 0 || m_iCurrentAnimIndex >= (_int)m_iNumAnimations) return false; + if (m_iCurrSecondAnimIndex >= 0) { + Play_Dual_Anim(fTimeDelta, pTransform); + } + else { + Play_Anim(fTimeDelta, pTransform); + } + + return m_bIsFinishedAnim; +} + +_bool CModel::Play_Anim(_float fTimeDelta, CTransform* pTransform) +{ if (m_bLoopRestarted) { m_vPrevRootPos = { 0,0,0 }; m_bLoopRestarted = false; } - ComputeAnimation(); + ComputeAnimation(m_iCurrentAnimIndex); if (m_iPreAnimIndex >= 0 && m_iPreAnimIndex != m_iCurrentAnimIndex) { m_fBlendTime += fTimeDelta; m_fRatio = (m_fBlendTime / m_fBlendDuration); - if (m_fRatio > 1.f) m_fRatio = 1.f; + if (m_fRatio > 1.f) { + m_fRatio = 1.f; + } CAnimation* pCurAnim = m_Animations[m_iCurrentAnimIndex]; CAnimation* pPreAnim = m_Animations[m_iPreAnimIndex]; - m_bIsFinishedAnim = pCurAnim->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, m_vector); - + m_bIsFinishedAnim = pCurAnim->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, true, m_iBoneMask, m_vector); + + pCurAnim->InterpAnim(pPreAnim, m_Bones, m_fRatio); if (m_fRatio >= 1.f) @@ -142,7 +157,7 @@ _bool CModel::Play_Animation(_float fTimeDelta, CTransform* pTransform) } else { - m_bIsFinishedAnim = m_Animations[m_iCurrentAnimIndex]->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, m_vector); + m_bIsFinishedAnim = m_Animations[m_iCurrentAnimIndex]->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, true, m_iBoneMask, m_vector); m_iPreAnimIndex = m_iCurrentAnimIndex; } @@ -177,6 +192,80 @@ _bool CModel::Play_Animation(_float fTimeDelta, CTransform* pTransform) return m_bIsFinishedAnim; } +_bool CModel::Play_Dual_Anim(_float fTimeDelta, CTransform* pTransform) +{ + if (m_bLoopRestarted) + { + m_vPrevRootPos = { 0,0,0 }; + m_bLoopRestarted = false; + } + + ComputeAnimation(m_iCurrentAnimIndex); + ComputeAnimation_Second(m_iCurrSecondAnimIndex); + + if (m_iPreAnimIndex >= 0 && m_iPreAnimIndex != m_iCurrentAnimIndex) + { + m_fBlendTime += fTimeDelta; + m_fRatio = (m_fBlendTime / m_fBlendDuration); + if (m_fRatio > 1.f) m_fRatio = 1.f; + + CAnimation* pCurAnim = m_Animations[m_iCurrentAnimIndex]; + CAnimation* pPreAnim = m_Animations[m_iPreAnimIndex]; + + CAnimation* pSecondAnim = m_Animations[m_iCurrSecondAnimIndex]; + + m_bIsFinishedAnim = pCurAnim->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, true, m_iBoneMask, m_vector); + + m_bIsSecondFinishedAnim = pSecondAnim->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsSecondLoop, fTimeDelta, false, m_iBoneMask); + //pCurAnim->InterpAnim(pPreAnim, m_Bones, m_fRatio); + if (m_fRatio >= 1.f) + { + m_iPreAnimIndex = m_iCurrentAnimIndex; + m_fBlendTime = 0.f; + } + } + else + { + m_bIsFinishedAnim = m_Animations[m_iCurrentAnimIndex]->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsLoop, fTimeDelta, true, m_iBoneMask, m_vector); + + m_bIsSecondFinishedAnim = m_Animations[m_iCurrSecondAnimIndex]->Update_TransformationMatrices(m_Bones, m_pLocalPos, m_bIsSecondLoop, fTimeDelta, false, m_iBoneMask); + m_iPreAnimIndex = m_iCurrentAnimIndex; + } + + if (m_bRatio) { + Update_RootBone(m_fAmount * m_fRatio); + } + else + { + Update_RootBone(); + } + + if (m_bIsFinishedAnim) + { + if (m_bIsLoop) + { + m_bLoopRestarted = true; + } + else + XMStoreFloat3(&m_vPrevRootPos, m_vector[2]); + + m_vPrevRootRot = { 0.f,0.f,0.f,0.f }; + m_bInitialRootRotSaved = false; + } + + if (!m_bIsSecondLoop && m_bIsSecondFinishedAnim) + { + m_iCurrSecondAnimIndex = -1; + } + + for (auto& pBone : m_Bones) + { + pBone->Update_CombinedTransformationMatrix(m_Bones, XMLoadFloat4x4(&m_PreTransformMatrix)); + } + + return m_bIsFinishedAnim; +} + void CModel::Set_AnimationIndex(_uint iIndex, _bool isLoop,_float fAmount,_bool bRatio) { if (m_iCurrentAnimIndex == iIndex){ @@ -201,6 +290,22 @@ void CModel::Set_AnimationIndex(_uint iIndex, _bool isLoop,_float fAmount,_bool } } +void CModel::Set_Second_AnimationIndex(_uint iIndex, _uint BoneIndex,_bool isLoop) +{ + if (m_iCurrSecondAnimIndex == iIndex) { + return; + } + if (iIndex >= 0 && iIndex < m_iNumAnimations) + { + m_iCurrSecondAnimIndex = iIndex; + m_bIsSecondLoop = isLoop; + m_iBoneMask = m_BoneMask[BoneIndex]; + } + else { + m_iCurrSecondAnimIndex = -1; + } +} + void CModel::Update_RootBone(_float Amount) { if (m_Bones[m_iRootBoneIndex]->Compare_Name("Reference") && m_pTransform != nullptr) @@ -366,6 +471,7 @@ HRESULT CModel::Anim_Event(_float fRatio,_uint AnimIndex,function Event) return E_FAIL; } + HRESULT CModel::Render(_uint iMeshIndex) { m_Meshes[iMeshIndex]->Bind_Resources(); @@ -568,7 +674,9 @@ HRESULT CModel::Ready_Bones(const aiNode* pAINode, _int iParentIndex) } _bool CModel::SaveAssimpModel(const _char* filename) { - if (!m_pAIScene) return false; + if (!m_pAIScene) { + return false; + } _char szModel[MAX_PATH] = {}; _char szExt[MAX_PATH] = {}; @@ -743,7 +851,9 @@ _bool CModel::SaveAssimpModel(const _char* filename) FILE* fp = nullptr; fopen_s(&fp, savePath.c_str(), "wb"); - if (!fp) return false; + if (!fp) { + return false; + } fwrite(&modelData.MeshCount, sizeof(_uint), 1, fp); fwrite(&modelData.MaterialCount, sizeof(_uint), 1, fp); @@ -933,11 +1043,12 @@ HRESULT CModel::Create_CS() _uint CS1_OutputStrides[] = { sizeof(LOCALPOS_DESC), + sizeof(LOCALPOS_DESC), }; m_pComputeShader = CComputeShader::Create(m_pDevice, m_pContext, L"../Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl", - "CS_LocalSRT", (_uint)m_Bones.size(), 0, 1, nullptr, CS1_OutputStrides + "CS_LocalSRT", (_uint)m_Bones.size(), 0, 2, nullptr, CS1_OutputStrides ); if (!m_pComputeShader) @@ -986,14 +1097,14 @@ void CModel::Create_Con() } -void CModel::UpdateAnimationCS() +void CModel::UpdateAnimationCS(_uint AnimIndex) { D3D11_MAPPED_SUBRESOURCE sub{}; if (SUCCEEDED(m_pContext->Map(m_pConstantBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &sub))) { ANIMSTATE_DESC* pDesc = (ANIMSTATE_DESC*)sub.pData; - CAnimation* pAnim = m_Animations[m_iCurrentAnimIndex]; + CAnimation* pAnim = m_Animations[AnimIndex]; pDesc->CurrentTime = pAnim->Get_CurrentTrackPosition(); pDesc->Duration = pAnim->Get_Duration(); pDesc->Speed = pAnim->Get_AnimSpeed(); @@ -1003,13 +1114,13 @@ void CModel::UpdateAnimationCS() } } -void CModel::ComputeAnimation() +void CModel::ComputeAnimation(_uint AnimIndex) { - UpdateAnimationCS(); + UpdateAnimationCS(AnimIndex); _uint iGroupCountX = ((_uint)m_Bones.size() + 255) / 256; - CAnimation* pAnim = m_Animations[m_iCurrentAnimIndex]; + CAnimation* pAnim = m_Animations[AnimIndex]; ID3D11ShaderResourceView* srvs[2] = { pAnim->Get_KeyFrameSrv(), pAnim->Get_ChannelSrv(), @@ -1025,20 +1136,96 @@ void CModel::ComputeAnimation() m_pContext->Dispatch(iGroupCountX, 1, 1); auto outSubs = m_pComputeShader->ReadBackOutputs(); - m_pLocalPos = static_cast(outSubs[0].pData); + m_pLocalPos[0] = static_cast(outSubs[0].pData); } -void CModel::InItialize_SpineIndex() +void CModel::ComputeAnimation_Second(_uint AnimIndex) +{ + UpdateAnimationCS(AnimIndex); + + _uint iGroupCountX = ((_uint)m_Bones.size() + 255) / 256; + + CAnimation* pAnim = m_Animations[AnimIndex]; + ID3D11ShaderResourceView* srvs[2] = { + pAnim->Get_KeyFrameSrv(), + pAnim->Get_ChannelSrv(), + }; + + m_pContext->CSSetShader(m_pComputeShader->Get_Compute(), nullptr, 0); + m_pContext->CSSetConstantBuffers(0, 1, &m_pConstantBuffer); + m_pContext->CSSetShaderResources(0, 2, srvs); + + ID3D11UnorderedAccessView* uavs[1] = { m_pComputeShader->GetOutputUAV(1) }; + m_pContext->CSSetUnorderedAccessViews(0, 1, uavs, nullptr); + + m_pContext->Dispatch(iGroupCountX, 1, 1); + + auto outSubs = m_pComputeShader->ReadBackOutputs(); + m_pLocalPos[1] = static_cast(outSubs[1].pData); +} + +void CModel::InItialize_BoneIndex() { for (_uint i = 0; i < (_uint)m_Bones.size(); i++) { if (m_Bones[i]->Compare_Name("Spine")) { - m_iSpineIndex = i; + m_iBoneIndex[ENUM_CLASS(BLEND_BONE::SPINE)] = i; + } + if (m_Bones[i]->Compare_Name("LeftShoulder")) + { + m_iBoneIndex[ENUM_CLASS(BLEND_BONE::SHOULDER_L)] = i; + } + if (m_Bones[i]->Compare_Name("RightShoulder")) + { + m_iBoneIndex[ENUM_CLASS(BLEND_BONE::SHOULDER_R)] = i; + } + if (m_Bones[i]->Compare_Name("Neck")) + { + m_iBoneIndex[ENUM_CLASS(BLEND_BONE::NECK)] = i; } } } +void CModel::Initialize_BoneMasks() +{ + m_BoneMask.resize((_int)BLEND_BONE::END); + for (auto& mask : m_BoneMask) + mask.resize(m_Bones.size(), false); + + auto BuildMask = [&](_int rootIndex, vector<_uint>& outMask) + { + if (rootIndex == -1) + return; + for (_uint i = 0; i < (_uint)m_Bones.size(); i++) + { + _int cur = i; + while (cur != -1) + { + if (cur == rootIndex) + { + outMask[i] = true; + break; + } + cur = m_Bones[cur]->Get_ParentBoneIndex(); + } + } + }; + + BuildMask(m_iBoneIndex[ENUM_CLASS(BLEND_BONE::SPINE)], m_BoneMask[ENUM_CLASS(BLEND_BONE::SPINE)]); + BuildMask(m_iBoneIndex[ENUM_CLASS(BLEND_BONE::SHOULDER_L)], m_BoneMask[ENUM_CLASS(BLEND_BONE::SHOULDER_L)]); + BuildMask(m_iBoneIndex[ENUM_CLASS(BLEND_BONE::SHOULDER_R)], m_BoneMask[ENUM_CLASS(BLEND_BONE::SHOULDER_R)]); + BuildMask(m_iBoneIndex[ENUM_CLASS(BLEND_BONE::NECK)], m_BoneMask[ENUM_CLASS(BLEND_BONE::NECK)]); + + for (_uint i = 0; i < m_Bones.size(); i++) + { + m_BoneMask[ENUM_CLASS(BLEND_BONE::SHOULDER_NECK_L)][i] = + m_BoneMask[ENUM_CLASS(BLEND_BONE::SHOULDER_L)][i] | m_BoneMask[ENUM_CLASS(BLEND_BONE::NECK)][i]; + + m_BoneMask[ENUM_CLASS(BLEND_BONE::SHOULDER_NECK_R)][i] = + m_BoneMask[ENUM_CLASS(BLEND_BONE::SHOULDER_R)][i] | m_BoneMask[ENUM_CLASS(BLEND_BONE::NECK)][i]; + } +} HRESULT CModel::Create_ParentVB() { @@ -1182,7 +1369,9 @@ _bool CModel::LoadData(const _char* filename) { FILE* fp = nullptr; fopen_s(&fp, filename, "rb"); - if (!fp) return false; + if (!fp) { + return false; + } SaveModel NewModel = {}; @@ -1319,7 +1508,9 @@ void CModel::LoadAnim(const _char* fileName) { FILE* fp = nullptr; fopen_s(&fp, fileName, "rb"); - if (!fp) return; + if (!fp) { + return; + } _uint MeshCount, MaterialCount, AnimationCount, NodeCount; @@ -1426,7 +1617,9 @@ HRESULT CModel::Initialize(void* pArg) if (m_eType == MODEL::ANIM) { Initialize_RootBone(); - InItialize_SpineIndex(); + InItialize_BoneIndex(); + Initialize_BoneMasks(); + Create_Temp(); m_Parent.resize(m_Bones.size()); for (size_t i = 0; i < (_uint)m_Bones.size(); i++) @@ -1485,8 +1678,9 @@ HRESULT CModel::Ready_Bones(const std::vector& allNodes, _int currentI CBone* pBone = CBone::Create(saveNode, parentIndex); - if (!pBone) return E_FAIL; - + if (!pBone) { + return E_FAIL; + } m_Bones.push_back(pBone); _int myIndex = _int(m_Bones.size() - 1); diff --git a/Jusin154_Team3D/Engine/Private/Renderer.cpp b/Jusin154_Team3D/Engine/Private/Renderer.cpp index bd2c1e2b1..70e8b59e1 100644 --- a/Jusin154_Team3D/Engine/Private/Renderer.cpp +++ b/Jusin154_Team3D/Engine/Private/Renderer.cpp @@ -534,70 +534,83 @@ void CRenderer::Render_Blend() void CRenderer::Render_Bloom() { - if (m_pGameInstance->Key_Up(DIK_HOME)) { - m_bPostProcessing_BLOOM = !m_bPostProcessing_BLOOM; + GUI::Begin("PostProcessing_Bloom"); + GUI::PushItemWidth(80); + GUI::DragFloat("g_fThreshold", &m_fThreshold, 0.01f, 0.02f, 100.f, "%.3f"); + GUI::SliderInt("g_iEmbossingPass", &m_iBloomEmbossingPass, 0, 2, "%d"); + GUI::End(); + + //{ // BackBuffer + // ID3D11Texture2D* pBackBuffer = nullptr; + // m_pGameInstance->Get_BackBufferPTR(&pBackBuffer); + // //m_pGameInstance->Copy_RenderTarget(TEXT("Target_Diffuse"), pBackBuffer); + // m_pGameInstance->Paste_RenderTarget(TEXT("Target_Bloom_Input"), pBackBuffer); + // SAFE_RELEASE(pBackBuffer); + //} + + // "Target_Bloom_Input" + // "Target_Bloom" + // "Target_Bloom_4x4" + // "Target_Bloom_8x8" + // "Target_Bloom_16x16" + // "Target_Bloom_16x16_X" + // "Target_Bloom_8x8_2" + // "Target_Bloom_4x4_2" + + if (FAILED(m_pGameInstance->Begin_MRT(TEXT("MRT_Bloom")))) { + return; } - if (true == m_bPostProcessing_BLOOM) { - //{ // BackBuffer - // ID3D11Texture2D* pBackBuffer = nullptr; - // m_pGameInstance->Get_BackBufferPTR(&pBackBuffer); - // //m_pGameInstance->Copy_RenderTarget(TEXT("Target_Diffuse"), pBackBuffer); - // m_pGameInstance->Paste_RenderTarget(TEXT("Target_Bloom_Input"), pBackBuffer); - // SAFE_RELEASE(pBackBuffer); + + for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::BLOOM)]) + { + if (nullptr != pRenderObject) + if (FAILED(pRenderObject->Render_Bloom())) { + assert(false); + } + + //if (true == m_bPostProcessing_BLOOM) { + // { // BackBuffer + // ID3D11Texture2D* pBackBuffer = nullptr; + // m_pGameInstance->Get_BackBufferPTR(&pBackBuffer); + // //m_pGameInstance->Copy_RenderTarget(TEXT("Target_Diffuse"), pBackBuffer); + // m_pGameInstance->Paste_RenderTarget(TEXT("Target_Bloom_Input"), pBackBuffer); + // SAFE_RELEASE(pBackBuffer); + // //} - // "Target_Bloom_Input" - // "Target_Bloom" - // "Target_Bloom_4x4" - // "Target_Bloom_8x8" - // "Target_Bloom_16x16" - // "Target_Bloom_16x16_X" - // "Target_Bloom_8x8_2" - // "Target_Bloom_4x4_2" - if (FAILED(m_pGameInstance->Begin_MRT(TEXT("MRT_Bloom")))) { - return; - } - - for (auto& pRenderObject : m_RenderObjects[ENUM_CLASS(RENDER::BLOOM)]) - { - if (nullptr != pRenderObject) - if (FAILED(pRenderObject->Render_Bloom())) { - assert(false); - } - - SAFE_RELEASE(pRenderObject); - } - - m_RenderObjects[ENUM_CLASS(RENDER::BLOOM)].clear(); - - if (FAILED(m_pGameInstance->End_MRT())) { - return; - } - - m_pShader->Bind_RawValue("g_fThreshold", &m_fThreshold, sizeof(_float)); - m_pShader->Bind_RawValue("g_iBloomEmbossingPass", &m_iBloomEmbossingPass, sizeof(_int)); - - m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_Input"), TEXT("Target_Bloom_4x4"), SHADER_PASS_DEFERRED::EMBOSSING); // 2 - m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_4x4"), TEXT("Target_Bloom_8x8"), SHADER_PASS_DEFERRED::REFIT); // 3 - m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_8x8"), TEXT("Target_Bloom_16x16"), SHADER_PASS_DEFERRED::REFIT); // 4 - - m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_16x16"), TEXT("Target_Bloom_16x16_X"), SHADER_PASS_DEFERRED::BLOOM_BLURX); - m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_16x16_X"), TEXT("Target_Bloom_16x16"), SHADER_PASS_DEFERRED::BLOOM_BLURY); // 5 - m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_16x16"), TEXT("Target_Bloom_8x8"), SHADER_PASS_DEFERRED::REFIT); // 6 - - m_pGameInstance->Accumulate_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_8x8"), TEXT("Target_Bloom_16x16"), TEXT("Target_Bloom_8x8_2"), SHADER_PASS_DEFERRED::BLOOM_ACCUM); - m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_8x8_2"), TEXT("Target_Bloom_8x8"), SHADER_PASS_DEFERRED::BLOOM_BLURX); - m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_8x8"), TEXT("Target_Bloom_8x8_2"), SHADER_PASS_DEFERRED::BLOOM_BLURY); // 7 - - m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_8x8_2"), TEXT("Target_Bloom_4x4"), SHADER_PASS_DEFERRED::REFIT); - m_pGameInstance->Accumulate_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_4x4"), TEXT("Target_Bloom_8x8_2"), TEXT("Target_Bloom_4x4_2"), SHADER_PASS_DEFERRED::BLOOM_ACCUM); - m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_4x4_2"), TEXT("Target_Bloom_4x4"), SHADER_PASS_DEFERRED::BLOOM_BLURX); - m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_4x4"), TEXT("Target_Bloom_4x4_2"), SHADER_PASS_DEFERRED::BLOOM_BLURY); // 8 - - m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_4x4_2"), TEXT("Target_Bloom"), SHADER_PASS_DEFERRED::REFIT); - m_pGameInstance->Finish_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_Input"), TEXT("Target_Bloom"), SHADER_PASS_DEFERRED::BLOOM_FINISH); // 9 + SAFE_RELEASE(pRenderObject); } + + m_RenderObjects[ENUM_CLASS(RENDER::BLOOM)].clear(); + + if (FAILED(m_pGameInstance->End_MRT())) { + return; + } + + m_pShader->Bind_RawValue("g_fThreshold", &m_fThreshold, sizeof(_float)); + m_pShader->Bind_RawValue("g_iBloomEmbossingPass", &m_iBloomEmbossingPass, sizeof(_int)); + + m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_Input"), TEXT("Target_Bloom_4x4"), SHADER_PASS_DEFERRED::EMBOSSING); // 2 + m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_4x4"), TEXT("Target_Bloom_8x8"), SHADER_PASS_DEFERRED::REFIT); // 3 + m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_8x8"), TEXT("Target_Bloom_16x16"), SHADER_PASS_DEFERRED::REFIT); // 4 + + m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_16x16"), TEXT("Target_Bloom_16x16_X"), SHADER_PASS_DEFERRED::BLOOM_BLURX); + m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_16x16_X"), TEXT("Target_Bloom_16x16"), SHADER_PASS_DEFERRED::BLOOM_BLURY); // 5 + m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_16x16"), TEXT("Target_Bloom_8x8"), SHADER_PASS_DEFERRED::REFIT); // 6 + + m_pGameInstance->Accumulate_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_8x8"), TEXT("Target_Bloom_16x16"), TEXT("Target_Bloom_8x8_2"), SHADER_PASS_DEFERRED::BLOOM_ACCUM); + m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_8x8_2"), TEXT("Target_Bloom_8x8"), SHADER_PASS_DEFERRED::BLOOM_BLURX); + m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_8x8"), TEXT("Target_Bloom_8x8_2"), SHADER_PASS_DEFERRED::BLOOM_BLURY); // 7 + + m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_8x8_2"), TEXT("Target_Bloom_4x4"), SHADER_PASS_DEFERRED::REFIT); + m_pGameInstance->Accumulate_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_4x4"), TEXT("Target_Bloom_8x8_2"), TEXT("Target_Bloom_4x4_2"), SHADER_PASS_DEFERRED::BLOOM_ACCUM); + m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_4x4_2"), TEXT("Target_Bloom_4x4"), SHADER_PASS_DEFERRED::BLOOM_BLURX); + m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_4x4"), TEXT("Target_Bloom_4x4_2"), SHADER_PASS_DEFERRED::BLOOM_BLURY); // 8 + + m_pGameInstance->Refit_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_4x4_2"), TEXT("Target_Bloom"), SHADER_PASS_DEFERRED::REFIT); + m_pGameInstance->Finish_RenderTarget(m_pVIBuffer, m_pShader, TEXT("Target_Bloom_Input"), TEXT("Target_Bloom"), SHADER_PASS_DEFERRED::BLOOM_FINISH); // 9 + } void CRenderer::Render_UI() diff --git a/Jusin154_Team3D/Engine/Private/Trail.cpp b/Jusin154_Team3D/Engine/Private/Trail.cpp index ae78708f1..fb8f83706 100644 --- a/Jusin154_Team3D/Engine/Private/Trail.cpp +++ b/Jusin154_Team3D/Engine/Private/Trail.cpp @@ -37,24 +37,8 @@ HRESULT CTrail::Initialize(void* pArg) m_pVertices = new VTXPOSTEX[m_iNumVertices]; -#pragma region VTX_BUFFER - D3D11_BUFFER_DESC VBDesc{}; - VBDesc.ByteWidth = m_iVertexStride * m_iNumVertices; - VBDesc.Usage = D3D11_USAGE_DYNAMIC; - VBDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; - VBDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; - VBDesc.MiscFlags = 0; - VBDesc.StructureByteStride = m_iVertexStride; - - VTXPOSTEX* pVertices = new VTXPOSTEX[m_iNumVertices]{}; - - D3D11_SUBRESOURCE_DATA InitialVBDate{}; - InitialVBDate.pSysMem = pVertices; - - if (FAILED(m_pDevice->CreateBuffer(&VBDesc, &InitialVBDate, &m_pVB))) { + if (FAILED(Create_VB())) return E_FAIL; - } - Safe_Delete_Array(pVertices); #pragma endregion @@ -84,9 +68,9 @@ HRESULT CTrail::Initialize(void* pArg) iStartIndex + 3 }; - pIndices[iIndex++] = Indicies[0]; pIndices[iIndex++] = Indicies[1]; pIndices[iIndex++] = Indicies[2]; + pIndices[iIndex++] = Indicies[0]; pIndices[iIndex++] = Indicies[1]; pIndices[iIndex++] = Indicies[3]; @@ -106,11 +90,47 @@ HRESULT CTrail::Initialize(void* pArg) return S_OK; } +HRESULT CTrail::Create_VB() +{ + + if (m_pVB != nullptr) + SAFE_RELEASE(m_pVB); + +#pragma region VTX_BUFFER + D3D11_BUFFER_DESC VBDesc{}; + VBDesc.ByteWidth = m_iVertexStride * m_iNumVertices; + VBDesc.Usage = D3D11_USAGE_DYNAMIC; + VBDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; + VBDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; + VBDesc.MiscFlags = 0; + VBDesc.StructureByteStride = m_iVertexStride; + + VTXPOSTEX* pVertices = new VTXPOSTEX[m_iNumVertices]{}; + + D3D11_SUBRESOURCE_DATA InitialVBDate{}; + InitialVBDate.pSysMem = pVertices; + + if (FAILED(m_pDevice->CreateBuffer(&VBDesc, &InitialVBDate, &m_pVB))) { + return E_FAIL; + } + Safe_Delete_Array(pVertices); + + return S_OK; +} + void CTrail::Trail_Update(_float fDeltaTime, _fmatrix WorldMatrix) { - _vector vLow = XMVector3TransformCoord(XMLoadFloat3(&m_TrailDesc.vLow), WorldMatrix); - _vector vHigh = XMVector3TransformCoord(XMLoadFloat3(&m_TrailDesc.vHigh), WorldMatrix); + + _matrix WorldMat = {}; + + WorldMat.r[0] = XMVector3Normalize(WorldMatrix.r[0]); + WorldMat.r[1] = XMVector3Normalize(WorldMatrix.r[1]); + WorldMat.r[2] = XMVector3Normalize(WorldMatrix.r[2]); + WorldMat.r[3] = WorldMatrix.r[3]; + + _vector vLow = XMVector3TransformCoord(XMLoadFloat3(&m_TrailDesc.vLow), WorldMat); + _vector vHigh = XMVector3TransformCoord(XMLoadFloat3(&m_TrailDesc.vHigh), WorldMat); //한칸씩 밀기 @@ -149,6 +169,21 @@ void CTrail::Trail_Update(_float fDeltaTime, _fmatrix WorldMatrix) } + if (m_isFixedTrail == true) + { + //만약 고정된 트레일을 켰다면 가장 마지막 부분을 항상 내 위치로 고정함 + _vector vFixedLow = XMVector3TransformCoord(XMLoadFloat3(&m_TrailDesc.vLow), m_FixedMat); + _vector vFixedHigh = XMVector3TransformCoord(XMLoadFloat3(&m_TrailDesc.vHigh), m_FixedMat); + + XMStoreFloat3(&m_pVertices[0].vPosition, vFixedLow); + XMStoreFloat3(&m_pVertices[1].vPosition, vFixedHigh); + + + + } + + Describe_Entity(); + //XMStoreFloat3(&m_pVertices[0].vPosition, vLow); //XMStoreFloat3(&m_pVertices[1].vPosition, vHigh); @@ -163,6 +198,8 @@ void CTrail::Trail_Update(_float fDeltaTime, _fmatrix WorldMatrix) m_pVertices[i].vTexcoord = _float2(u, 0); // Low m_pVertices[i + 1].vTexcoord = _float2(u, 1); // High + + } @@ -172,6 +209,8 @@ void CTrail::Trail_Update(_float fDeltaTime, _fmatrix WorldMatrix) { memcpy(VBResource.pData, m_pVertices, sizeof(VTXPOSTEX) * m_iNumVertices); + + VTXPOSTEX* pDebug = static_cast(VBResource.pData); m_pContext->Unmap(m_pVB, 0); } @@ -187,6 +226,16 @@ void CTrail::Reset_Trail() m_fAccTime = 0.f; } +HRESULT CTrail::ReStructVB(_uint iNumVertices) +{ + m_iNumVertices = iNumVertices; + + if (FAILED(Create_VB())) + return E_FAIL; + + return S_OK; +} + #ifdef _DEBUG HRESULT CTrail::Save_Trail(HANDLE hFile) { @@ -211,6 +260,21 @@ HRESULT CTrail::Load_Trail(HANDLE hFile) return S_OK; } +void CTrail::Fixed_Trail(_fmatrix WorldMatrix) +{ + _matrix WorldMat = {}; + + WorldMat.r[0] = XMVector3Normalize(WorldMatrix.r[0]); + WorldMat.r[1] = XMVector3Normalize(WorldMatrix.r[1]); + WorldMat.r[2] = XMVector3Normalize(WorldMatrix.r[2]); + WorldMat.r[3] = WorldMatrix.r[3]; + + m_isFixedTrail = true; + m_FixedMat = WorldMat; +} + + + HRESULT CTrail::Render() { if (m_iNumCount < 4) @@ -258,8 +322,10 @@ void CTrail::Free() void CTrail::Describe_Entity() { + GUI::InputFloat3("Low", (_float*)&m_TrailDesc.vLow); GUI::InputFloat3("High", (_float*)&m_TrailDesc.vHigh); + } diff --git a/Jusin154_Team3D/Engine/Private/Unit.cpp b/Jusin154_Team3D/Engine/Private/Unit.cpp index 296b99460..c4515e4c6 100644 --- a/Jusin154_Team3D/Engine/Private/Unit.cpp +++ b/Jusin154_Team3D/Engine/Private/Unit.cpp @@ -62,7 +62,9 @@ void CUnit::Load_KeyFrame() Path = _string(szDir) + "KeyFrame.bin"; fopen_s(&fp, Path.c_str(), "rb"); - if (!fp) return; + if (!fp) { + return; + } _uint KeyFrameSize = 0; fread(&KeyFrameSize, sizeof(_uint), 1, fp); diff --git a/Jusin154_Team3D/Engine/Private/VIBuffer_Model_Instance.cpp b/Jusin154_Team3D/Engine/Private/VIBuffer_Model_Instance.cpp index 65618d248..aeaf8abf5 100644 --- a/Jusin154_Team3D/Engine/Private/VIBuffer_Model_Instance.cpp +++ b/Jusin154_Team3D/Engine/Private/VIBuffer_Model_Instance.cpp @@ -286,7 +286,9 @@ HRESULT CVIBuffer_Model_Instance::Ready_Materials() HRESULT CVIBuffer_Model_Instance::SaveAssimpModel(const _char* pModelFilePath) { - if (!m_pAIScene) return E_FAIL; + if (!m_pAIScene) { + return E_FAIL; + } for (_uint i = 0; i < m_pAIScene->mNumMeshes; i++) { diff --git a/Jusin154_Team3D/Engine/Public/Animation.h b/Jusin154_Team3D/Engine/Public/Animation.h index 16018a045..b3121a195 100644 --- a/Jusin154_Team3D/Engine/Public/Animation.h +++ b/Jusin154_Team3D/Engine/Public/Animation.h @@ -11,8 +11,8 @@ class ENGINE_DLL CAnimation : public CBase CAnimation(const CAnimation& rhs); virtual ~CAnimation() = default; public: - _bool Update_TransformationMatrices(const vector& Bones, const LOCALPOS_DESC* pLocalPosArray, _bool bIsLoop, _float fTimeDelta, _vector vector[3]); - void ProgressAnimation(const vector& Bones, const LOCALPOS_DESC* pLocalPosArray, _vector vector[3]); + _bool Update_TransformationMatrices(const vector& Bones, LOCALPOS_DESC** pLocalPosArray, _bool bIsLoop, _float fTimeDelta, _bool bIsSpine, vector<_uint> BoneMask,_vector vector[3] = nullptr); + void ProgressAnimation(const vector& Bones,LOCALPOS_DESC** pLocalPosArray, _bool bIsSpine, vector<_uint> BoneMask, _vector vector[3]); void ResetRootMotion(); void Depart_Animation(); void Set_AnimPause(_bool bValue) { m_bPause = bValue; } @@ -34,7 +34,7 @@ class ENGINE_DLL CAnimation : public CBase const _char* Get_SZName() const { return m_szName; } void Set_CurrentTrackPosition(_float TrackPosition) { m_fCurrentTrackPosition = TrackPosition; } _float Get_CurrentTrackPosition() { return m_fCurrentTrackPosition; } - _float Get_CurrentTrackProgressRatio() { return m_fCurrentTrackPosition / m_fDuration; } + _float Get_CurrentTrackProgressRatio() { return m_fTempTrack / m_fDurationSeconds; } void Set_AnimSpeed(_float fSpeed) { m_fAnimSpeed = fSpeed; } _float Get_AnimSpeed() { return m_fAnimSpeed; } @@ -78,6 +78,8 @@ class ENGINE_DLL CAnimation : public CBase _float m_fDuration = {}; // 트랙의 전체 길이 _float m_TickPerSeconds[2] = { 0.f, 0.f }; // 초당 트랙 이동 거리 _uint m_iNumChannels = {}; // 영향을 받는 본의 수 + _float m_fTempTrack = {}; + _float m_fDurationSeconds = {}; vector m_Channels; // 이 애니메이션이 영향을 준 사전 계산된 본의 배열 vector<_uint> m_CurrentKeyFrameIndices; // 각 본이 현재 애니메이션에서 취해야할 키프레임 왼쪽 인덱스 diff --git a/Jusin154_Team3D/Engine/Public/Channel.h b/Jusin154_Team3D/Engine/Public/Channel.h index 5bd134a37..bcd6ca857 100644 --- a/Jusin154_Team3D/Engine/Public/Channel.h +++ b/Jusin154_Team3D/Engine/Public/Channel.h @@ -23,7 +23,7 @@ class ENGINE_DLL CChannel : public CBase CHANNEL_DESC Fill_GPU_ChannelDesc(); public: - void Update_TransformationMatirx(const vector& Bones, const LOCALPOS_DESC* pLocalPosArray, _float fCurrentTrackPosition, _uint* pCurrentKeyFrameIndex, _vector vector[3]); + void Update_TransformationMatirx(const vector& Bones, LOCALPOS_DESC** pLocalPosArray, _float fCurrentTrackPosition, _uint* pCurrentKeyFrameIndex, _bool bIsSpine, vector<_uint> BoneMask, _vector vector[3]); _int Get_BoneIndex() { return { m_iBoneIndex }; } void Set_BoneIndex(_int iBoneIndex) { m_iBoneIndex = iBoneIndex; } void ResetRootMotion(); @@ -63,6 +63,10 @@ class ENGINE_DLL CChannel : public CBase _bool m_bInitialRootRotSaved = {false}; _float4 m_vInitialRootRot = {}; + _bool m_IsUpper = false; + _int m_ilayerIndex = 0; + LOCALPOS_DESC LocalPos = {}; + vector m_KeyFrameDesc; public: // 바이너리 diff --git a/Jusin154_Team3D/Engine/Public/Engine_Enum.h b/Jusin154_Team3D/Engine/Public/Engine_Enum.h index bac13c485..47d674d4e 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Enum.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Enum.h @@ -5,9 +5,10 @@ NS_BEGIN(Engine) enum class STATE { RIGHT, UP, LOOK, POSITION, END }; enum class LIGHT { DIRECTIONAL, POINT, SPOT, END }; enum class COLLIDER { AABB, OBB, SPHERE, END }; -enum class RENDER { OCCLUSION, PRIORITY, SHADOW, NONBLEND, DECAL, BLUR, NONLIGHT, EFFECT ,BLEND, BLOOM, UI, END }; +enum class RENDER {PRIORITY, SHADOW, NONBLEND, DECAL, BLUR, NONLIGHT, EFFECT ,BLEND, BLOOM, UI, OCCLUSION, END }; enum class RAY { LOCAL, WORLD, END }; enum class ACTOR { BOX, CAPSULE, SPHERE, PLANE, TRIANGLEMESH, HEIGHTFIELD, END }; +enum class BLEND_BONE{SPINE,SHOULDER_L,SHOULDER_R,NECK,SHOULDER_NECK_L, SHOULDER_NECK_R,END}; enum class TEXTURE_LOAD_TYPE { diff --git a/Jusin154_Team3D/Engine/Public/FSM.h b/Jusin154_Team3D/Engine/Public/FSM.h index 906d0f98a..7833da79c 100644 --- a/Jusin154_Team3D/Engine/Public/FSM.h +++ b/Jusin154_Team3D/Engine/Public/FSM.h @@ -23,7 +23,8 @@ enum ESTATE : _u64Flag POTION = 1ULL << 16, STOP = 1ULL << 17, HIT = 1ULL << 18, - BROOM_RIDE = 1ULL << 19, + BROOM_RIDE = 1ULL << 19, + MOUNT_B = 1ULL << 20, END }; NS_END diff --git a/Jusin154_Team3D/Engine/Public/Model.h b/Jusin154_Team3D/Engine/Public/Model.h index 6b852dc2b..5a53a5718 100644 --- a/Jusin154_Team3D/Engine/Public/Model.h +++ b/Jusin154_Team3D/Engine/Public/Model.h @@ -33,8 +33,12 @@ class ENGINE_DLL CModel final : public CComponent #pragma endregion #pragma region Animation _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); + void Set_Second_AnimationIndex(_uint iIndex,_uint BoneIndex,_bool isLoop = false); _bool IsFinishedAnim() const { return m_bIsFinishedAnim; } + _bool IsFinishedSecondAnim() const { return m_bIsSecondFinishedAnim; } _bool IsLoopAnim() const { return m_bIsLoop; } void Set_CurrentTrackPosition(_float TrackPosition); const _char* Get_AnimList(_uint iIndex); @@ -45,6 +49,7 @@ class ENGINE_DLL CModel final : public CComponent void Set_PlayAnim(_bool bPlayAnim) { m_bPlayAnim = bPlayAnim; } _bool Get_PlayAnim() const { return m_bPlayAnim; } _int Get_AnimIndex() const { return m_iCurrentAnimIndex; } + _int Get_SecondAnimIndex() const { return m_iCurrSecondAnimIndex; } _float Get_AnimSpeed(); void Set_AnimSpeed(_float fSpeed); @@ -64,14 +69,18 @@ _int Get_BoneIndex(const _char* pBoneName) const; _matrix Get_BoneMatrix(_uint iBoneIndex); void Combined_BoneMatrix(); + #pragma endregion #pragma region Material HRESULT Bind_Material(_uint iMeshIndex, class CShader* pShader); #pragma endregion - void ComputeAnimation(); - void InItialize_SpineIndex(); + void ComputeAnimation(_uint AnimIndex); + void ComputeAnimation_Second(_uint AnimIndex); + void InItialize_BoneIndex(); + + void Initialize_BoneMasks(); public: #ifdef EDITOR_PROJECT @@ -135,7 +144,12 @@ void Combined_BoneMatrix(); class CTransform* m_pTransform = { nullptr }; // 모델 대상의 트랜스폼 _float m_fRatio = {}; - _int m_iSpineIndex = { -1 }; + _int m_iBoneIndex[ENUM_CLASS(BLEND_BONE::END)] = {-1,-1,-1,-1,-1,-1}; + _int m_iCurrSecondAnimIndex = { -1 }; + _bool m_bIsSecondFinishedAnim = { false }; + _bool m_bIsSecondLoop = { false }; + vector> m_BoneMask; + // 바이너리 SaveModel* m_pSaveModel = { nullptr }; @@ -153,7 +167,9 @@ void Combined_BoneMatrix(); _float4 m_vInitialRootRot = {}; _vector m_vector[3]; - _bool m_bLoopRestarted = false; + _bool m_bLoopRestarted = false; + + vector<_uint> m_iBoneMask; #pragma region Compute @@ -164,14 +180,14 @@ void Combined_BoneMatrix(); void Create_Temp(); void Create_LocalPosVB(); void Create_Con(); - void UpdateAnimationCS(); + void UpdateAnimationCS(_uint AnimIndex); _uint m_iNumBuffer = {}; vector m_Parent = {}; vector m_AnimRanges; - LOCALPOS_DESC* m_pLocalPos = { nullptr }; + LOCALPOS_DESC* m_pLocalPos[2] = {nullptr}; class CComputeShader* m_pComputeShader = nullptr; diff --git a/Jusin154_Team3D/Engine/Public/MyTools.h b/Jusin154_Team3D/Engine/Public/MyTools.h index 9ecc59ba6..a5e8e0cfc 100644 --- a/Jusin154_Team3D/Engine/Public/MyTools.h +++ b/Jusin154_Team3D/Engine/Public/MyTools.h @@ -83,7 +83,9 @@ class CMyTools { // value로 현재 ratio 가져오기 static _float InverseLerp_f1D(_float fA, _float fB, _float fValue) { - if (fA == fB) return 0.0f; + if (fA == fB) { + return 0.0f; + } return (fValue - fA) / (fB - fA); } @@ -116,10 +118,14 @@ class CMyTools { _vector tv = XMVectorSubtract(vPos, vertexA); u = XMVectorGetX(XMVector3Dot(tv, ray_cross_edge2)) * inverseDet; - if (u < 0.f || u > 1.f) return false; + if (u < 0.f || u > 1.f) { + return false; + } _vector q = XMVector3Cross(tv, edge1); v = XMVectorGetX(XMVector3Dot(vDir, q)) * inverseDet; - if (v < 0.f || u + v > 1.f) return false; + if (v < 0.f || u + v > 1.f) { + return false; + } t = XMVectorGetX(XMVector3Dot(edge2, q)) * inverseDet; return t >= 0.f; @@ -178,7 +184,9 @@ class CMyTools { // 입력라디안에서 출력라디안까지 로테이션 스피드만큼 돌려주고 보정해서 SrcRadian에 넣어줌 inline static void RotateRadianTowards(_float& fSrcRadian, const _float& fDstRadian, _float fRotateSpeed) { _float fDiffRadian = fmodf(fSrcRadian - fDstRadian, XM_2PI); - if (fDiffRadian < 0) fDiffRadian += XM_2PI; + if (fDiffRadian < 0) { + fDiffRadian += XM_2PI; + } if (fDiffRadian < (fRotateSpeed * XM_PI) / 180.f) { fSrcRadian = fDstRadian; diff --git a/Jusin154_Team3D/Engine/Public/Renderer.h b/Jusin154_Team3D/Engine/Public/Renderer.h index 4d07aa396..72fc175ce 100644 --- a/Jusin154_Team3D/Engine/Public/Renderer.h +++ b/Jusin154_Team3D/Engine/Public/Renderer.h @@ -44,8 +44,8 @@ class CRenderer final : public CBase SHADOW_LIGHT_DESC m_PreShadowDesc = {}; _float4x4 m_PreShadowMatrices[ENUM_CLASS(D3DTS::END)] = {}; - _bool m_bPostProcessing_BLOOM = { false }; - _bool m_bDOF_ENV = { false }; + _bool m_bPostProcessing_BLOOM = { true }; + _bool m_bDOF_ENV = { true }; _int m_iBloomEmbossingPass = { 0 }; _float m_fThreshold = { 1.26f }; _float m_fDOF_ENV_CutThreshold = { 0.1350f }; diff --git a/Jusin154_Team3D/Engine/Public/State.h b/Jusin154_Team3D/Engine/Public/State.h index b062a55eb..5263e6034 100644 --- a/Jusin154_Team3D/Engine/Public/State.h +++ b/Jusin154_Team3D/Engine/Public/State.h @@ -14,7 +14,7 @@ enum ESTATE DODGE,DODGE_BLINK, DODGE_LEFT, DODGE_RIGHT, COMBAT, LIGHT_ATTACK, SPELL, SKILL, SKILL2, MAPHELP,POTION, - ACCIO,DESCENDO,DIFFINDO,DEPULSO,LUMOS,DISILLUSION_ENTER,DISILLUSION_EXIT, ANCIENT_THROW, + ACCIO,DESCENDO,DIFFINDO,DEPULSO,LUMOS,LUMOS_STOP,DISILLUSION_ENTER,DISILLUSION_EXIT, ANCIENT_THROW, BROOM_IDLE,BROOM_FWD, BROOM_HOVER_IDLE, BROOM_HOVER_START,BROOM_MOUNT, BROOM_MOUNT_END, HIT, HIT_FWD, HIT_BWD, HIT_BWD2, HIT_BWD3, HIT_BWD4, HIT_L, HIT_R, KNOCKDOWN, KNOCKDOWN_FWD, KNOCKDOWN_FWD_SPLT, KNOCKDOWN_FWD_SPLT_HOLD, KNOCKDOWN_BWD, KNOCKDOWN_BWD_SPLT, KNOCKDOWN_BWD_SPLT_HOLD, diff --git a/Jusin154_Team3D/Engine/Public/Trail.h b/Jusin154_Team3D/Engine/Public/Trail.h index c578d7ec5..1f50da839 100644 --- a/Jusin154_Team3D/Engine/Public/Trail.h +++ b/Jusin154_Team3D/Engine/Public/Trail.h @@ -20,15 +20,20 @@ class ENGINE_DLL CTrail final : public: void Trail_Update(_float fDeltaTime, _fmatrix WorldMatrix); void Reset_Trail(); + HRESULT ReStructVB(_uint iNumVertices); #ifdef _DEBUG HRESULT Save_Trail(HANDLE hFile); #endif HRESULT Load_Trail(HANDLE hFile); +public: + void Fixed_Trail(_fmatrix WorldMatrix); + private: virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; + HRESULT Create_VB(); public: static CTrail* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); @@ -46,12 +51,18 @@ class ENGINE_DLL CTrail final : _vector m_PreHigh[2] = {}; _vector m_PreLow[2] = {}; + _vector m_PreFixedHigh[3] = {}; + _vector m_PreFixedLow[3] = {}; + VTXPOSTEX* m_pVertices = { nullptr }; _float m_fAccTime = {}; _float m_fTrailUpdateTime = {}; _uint m_iNumVerticesPerInstance = {}; + + _matrix m_FixedMat = {}; + _bool m_isFixedTrail = {}; }; NS_END