diff --git a/Jusin154_Team3D/Client/Private/BroomRacerAI.cpp b/Jusin154_Team3D/Client/Private/BroomRacerAI.cpp index 79377c264..ac5b9cdb7 100644 --- a/Jusin154_Team3D/Client/Private/BroomRacerAI.cpp +++ b/Jusin154_Team3D/Client/Private/BroomRacerAI.cpp @@ -109,7 +109,7 @@ HRESULT CBroomRacerAI::Initialize(void* pArg) void CBroomRacerAI::Priority_Update(_float fTimeDelta) { - m_pTransformCom->RewindMomentum(); + m_pTransformCom->ResetVelocityVector(); __super::Priority_Update(fTimeDelta); } diff --git a/Jusin154_Team3D/Client/Private/Camera_Model.cpp b/Jusin154_Team3D/Client/Private/Camera_Model.cpp index 5c7a52e09..3bdea8f5b 100644 --- a/Jusin154_Team3D/Client/Private/Camera_Model.cpp +++ b/Jusin154_Team3D/Client/Private/Camera_Model.cpp @@ -17,11 +17,11 @@ CCamera_Model::CCamera_Model(const CCamera_Model& rhs) void CCamera_Model::Priority_Update(_float fTimeDelta) { - m_pTransformCom->RewindMomentum(); + m_pTransformCom->ResetVelocityVector(); _float3 vCamPos = {}; _float3 vCamMomentum = {}; XMStoreFloat3(&vCamPos, m_pTransformCom->Get_State(STATE::POSITION)); - XMStoreFloat3(&vCamMomentum, m_pTransformCom->Get_CurrentMomentum()); + XMStoreFloat3(&vCamMomentum, m_pTransformCom->Get_CurrentVelocity()); #ifdef _DEBUG GUI::Text("Cam_Model Coord %.2f, %.2f, %.2f", vCamPos.x, vCamPos.y, vCamPos.z); GUI::Text("v %.2f, %.2f, %.2f", vCamPos.x, vCamPos.y, vCamPos.z); diff --git a/Jusin154_Team3D/Client/Private/EffectParts.cpp b/Jusin154_Team3D/Client/Private/EffectParts.cpp index 6243eced9..f62d1d88c 100644 --- a/Jusin154_Team3D/Client/Private/EffectParts.cpp +++ b/Jusin154_Team3D/Client/Private/EffectParts.cpp @@ -36,7 +36,7 @@ HRESULT CEffectParts::Initialize(void* pArg) void CEffectParts::Priority_Update(_float fTimeDelta) { if (m_EffectInfo.isMotionBlur == true) - m_pTransformCom->RewindMomentum(); + m_pTransformCom->ResetVelocityVector(); } void CEffectParts::Update(_float fTimeDelta) diff --git a/Jusin154_Team3D/Client/Private/Elf.cpp b/Jusin154_Team3D/Client/Private/Elf.cpp index 593ec9ae0..872e8cb69 100644 --- a/Jusin154_Team3D/Client/Private/Elf.cpp +++ b/Jusin154_Team3D/Client/Private/Elf.cpp @@ -57,7 +57,7 @@ HRESULT CElf::Initialize(void* pArg) void CElf::Priority_Update(_float fTimeDelta) { - m_pTransformCom->RewindMomentum(); + m_pTransformCom->ResetVelocityVector(); m_iEntered -= 1; if (m_iEntered < 0) { m_iEntered = 0; @@ -507,7 +507,7 @@ HRESULT CElf::Ready_Components(void* pArg) { // DO CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; Desc.iSubKind = ENUM_CLASS(PXOBJECT::OLLIVANDER); - Desc.bAutoOwnerTranslation = false; + Desc.bAutoTranslation = false; if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_NPC_HITBOX"), (CComponent**)&m_pRigidBody, &Desc))) { return E_FAIL; } @@ -580,7 +580,7 @@ void CElf::Describe_Entity() } _float4 vMomentum = {}; - XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum()); + XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentVelocity()); GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w); if (GUI::Button("Move To Player")) diff --git a/Jusin154_Team3D/Client/Private/Goblin.cpp b/Jusin154_Team3D/Client/Private/Goblin.cpp index 75b4a5094..e0f6b239d 100644 --- a/Jusin154_Team3D/Client/Private/Goblin.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin.cpp @@ -680,7 +680,7 @@ void CGoblin::Describe_Entity() GUI::Text("AnimRatio %.2f", m_pModelCom->Get_CurrentTrackProgressRatio()); _float4 vMomentum = {}; - XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum()); + XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentVelocity()); GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w); _float3 Pos; diff --git a/Jusin154_Team3D/Client/Private/Goblin_Assassin.cpp b/Jusin154_Team3D/Client/Private/Goblin_Assassin.cpp index 51baf1ce1..877fa0e91 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Assassin.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Assassin.cpp @@ -780,7 +780,7 @@ void CGoblin_Assassin::Describe_Entity() GUI::Text("AnimRatio %.2f", m_pModelCom->Get_CurrentTrackProgressRatio()); _float4 vMomentum = {}; - XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum()); + XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentVelocity()); GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w); _float3 Pos; diff --git a/Jusin154_Team3D/Client/Private/Goblin_Assassin_States.cpp b/Jusin154_Team3D/Client/Private/Goblin_Assassin_States.cpp index 65ab7a57a..0fc457b47 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Assassin_States.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Assassin_States.cpp @@ -375,7 +375,7 @@ HRESULT CGoblin_Assassin::Behavior_DashExitCheck(_float fTimeDelta) _float4 RootMomentum = m_pModelCom->Get_RootBoneMomentum(); _vector RootDelta = XMLoadFloat4(&RootMomentum); _float dashDist = XMVectorGetX(XMVector3Length(RootDelta)); - m_pTransformCom->AccumulateMomentum(XMLoadFloat4(&m_vDashDir) * dashDist * 1.5f); + m_pTransformCom->AccumulatevVelocity(XMLoadFloat4(&m_vDashDir) * dashDist * 1.5f); if (fRatio >= 0.7f) { @@ -974,7 +974,7 @@ void CGoblin_Assassin::HitState_Behavior(_float fTimeDelta) _float ease = 1.f - (t * t); _vector Force = vPlayerLook * fTimeDelta * 6.f * ease; - m_pTransformCom->AccumulateMomentum(Force); + m_pTransformCom->AccumulatevVelocity(Force); pairAnimInfo = m_Animation[STATEANIM::TUMBLE]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 0.6f, false, 0.8f); } diff --git a/Jusin154_Team3D/Client/Private/Goblin_BattleAxe.cpp b/Jusin154_Team3D/Client/Private/Goblin_BattleAxe.cpp index 036545324..02aaa8136 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_BattleAxe.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_BattleAxe.cpp @@ -50,7 +50,7 @@ void CGoblin_BattleAxe::Priority_Update(_float fTimeDelta) XMStoreFloat4(&m_vStartGripPos, Get_WorldPostion()); } - m_pTransformCom->RewindMomentum(); + m_pTransformCom->ResetVelocityVector(); m_pModelCom->Combined_BoneMatrix(); _matrix socketMatrix = {}; diff --git a/Jusin154_Team3D/Client/Private/Goblin_Dagger.cpp b/Jusin154_Team3D/Client/Private/Goblin_Dagger.cpp index 90a203c84..0da05919a 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Dagger.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Dagger.cpp @@ -38,7 +38,7 @@ HRESULT CGoblin_Dagger::Initialize(void* pArg) void CGoblin_Dagger::Priority_Update(_float fTimeDelta) { - m_pTransformCom->RewindMomentum(); + m_pTransformCom->ResetVelocityVector(); XMStoreFloat4(&m_vStartPos, m_pTransformCom->Get_State(STATE::POSITION)); m_pModelCom->Combined_BoneMatrix(); if (m_bAttach) diff --git a/Jusin154_Team3D/Client/Private/Goblin_Mage.cpp b/Jusin154_Team3D/Client/Private/Goblin_Mage.cpp index b7f05d80a..1e2821137 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Mage.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Mage.cpp @@ -563,7 +563,7 @@ void CGoblin_Mage::Describe_Entity() GUI::Text("AnimRatio %.2f", m_pModelCom->Get_CurrentTrackProgressRatio()); _float4 vMomentum = {}; - XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum()); + XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentVelocity()); GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w); _float3 Pos; diff --git a/Jusin154_Team3D/Client/Private/Goblin_Mage_States.cpp b/Jusin154_Team3D/Client/Private/Goblin_Mage_States.cpp index e38003bd7..cc5c47370 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Mage_States.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Mage_States.cpp @@ -859,7 +859,7 @@ void CGoblin_Mage::HitState_Behavior(_float fTimeDelta) _float ease = 1.f - (t * t); _vector Force = vPlayerLook * fTimeDelta * 6.f * ease; - m_pTransformCom->AccumulateMomentum(Force); + m_pTransformCom->AccumulatevVelocity(Force); pairAnimInfo = m_Animation[STATEANIM::TUMBLE]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 0.6f, false, 0.8f); } diff --git a/Jusin154_Team3D/Client/Private/Goblin_States.cpp b/Jusin154_Team3D/Client/Private/Goblin_States.cpp index e33892e34..01a066c24 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_States.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_States.cpp @@ -313,7 +313,7 @@ HRESULT CGoblin::Behavior_SwingExitCheck(_float fTimeDelta) vDistance = XMVector4Normalize(vDistance); _float step = dist - fDesiredRange; - m_pTransformCom->AccumulateMomentum(vDistance * step * fTimeDelta * 2.f); + m_pTransformCom->AccumulatevVelocity(vDistance * step * fTimeDelta * 2.f); } } @@ -938,7 +938,7 @@ void CGoblin::HitState_Behavior(_float fTimeDelta) _float ease = 1.f - (t * t); _vector Force = vPlayerLook * fTimeDelta * 6.f * ease; - m_pTransformCom->AccumulateMomentum(Force); + m_pTransformCom->AccumulatevVelocity(Force); pairAnimInfo = m_Animation[STATEANIM::TUMBLE]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 0.6f, false, 0.8f); } diff --git a/Jusin154_Team3D/Client/Private/Goblin_Sword.cpp b/Jusin154_Team3D/Client/Private/Goblin_Sword.cpp index 3bacf755c..f708d9768 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Sword.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Sword.cpp @@ -39,7 +39,7 @@ HRESULT CGoblin_Sword::Initialize(void* pArg) void CGoblin_Sword::Priority_Update(_float fTimeDelta) { - m_pTransformCom->RewindMomentum(); + m_pTransformCom->ResetVelocityVector(); m_pModelCom->Combined_BoneMatrix(); XMStoreFloat4(&m_vStartPos, m_pTransformCom->Get_State(STATE::POSITION)); diff --git a/Jusin154_Team3D/Client/Private/Human_Duelist.cpp b/Jusin154_Team3D/Client/Private/Human_Duelist.cpp index d915b7f03..76eb9f925 100644 --- a/Jusin154_Team3D/Client/Private/Human_Duelist.cpp +++ b/Jusin154_Team3D/Client/Private/Human_Duelist.cpp @@ -81,7 +81,7 @@ HRESULT CHuman_Duelist::Initialize(void* pArg) void CHuman_Duelist::Priority_Update(_float fTimeDelta) { - m_pTransformCom->RewindMomentum(); + m_pTransformCom->ResetVelocityVector(); __super::Priority_Update(fTimeDelta); @@ -641,7 +641,7 @@ void CHuman_Duelist::Describe_Entity() } m_pCharacter_Controller->Describe_Entity(); _float4 vMomentum = {}; - XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum()); + XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentVelocity()); GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w); _char label[256]; for (auto& iter : m_KeyFrames) diff --git a/Jusin154_Team3D/Client/Private/InfoInstance.cpp b/Jusin154_Team3D/Client/Private/InfoInstance.cpp index adc7c09d2..297422df6 100644 --- a/Jusin154_Team3D/Client/Private/InfoInstance.cpp +++ b/Jusin154_Team3D/Client/Private/InfoInstance.cpp @@ -31,7 +31,7 @@ void CInfoInstance::Update(_float fTimeDelta) m_pInteractiveInfo->Update(fTimeDelta); m_pEffectInfo->Update(fTimeDelta); m_pCutSceneInfo->Update(fTimeDelta); -} +} void CInfoInstance::Change_Level() { @@ -41,7 +41,6 @@ void CInfoInstance::Change_Level() m_pSkillInfo->Change_Level(); m_pInteractiveInfo->Change_Level(); m_pEffectInfo->Change_Level(); -// UI_Event.clear(); m_pCutSceneInfo->Clear_AllEvents(); } diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index 3b86bece7..4c08564f9 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -166,40 +166,6 @@ HRESULT CLevel_GamePlay::Initialize() void CLevel_GamePlay::Update(_float fTimeDelta) { - _bool bStartCinematic = { true }; -#ifdef _DEBUG -#ifdef 기무리 - bStartCinematic = false; -#elif 진우 - bStartCinematic = true; -#elif Bin - bStartCinematic = false; -#elif gimch - bStartCinematic = true; -#elif 나 - bStartCinematic = false; -#endif -#endif // _DEBUG - -#ifdef RELEASE_DEBUGGER - if (m_pGameInstance->Key_Down(DIK_F5)) { - m_pGameInstance->Toggle_RenderCollider(); - } -#endif - - if (bStartCinematic && false == m_bIntroCinematic) { - m_bIntroCinematic = true; - bStartCinematic = false; - _string strCutSceneName = "CarriageIntro"; - m_pInfoInstance->Active_Event(strCutSceneName); - } - if (m_pGameInstance->Key_Pressing(DIK_0)) { - if (m_pGameInstance->Key_Up(DIK_1)) - { - m_pGameInstance->Set_LevelToChange(); - } - } - m_pInfoInstance->Update(fTimeDelta); if (true == m_pGameInstance->Check_LevelShouldChange()) { @@ -208,7 +174,9 @@ void CLevel_GamePlay::Update(_float fTimeDelta) UI_STATE eState = UI_STATE::LEVELCHANGE; m_pInfoInstance->Event_CallBack(TEXT("Canvas_Change"), &eState); - if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::FIELD)))) { + if (FAILED(m_pGameInstance->Change_Level( + CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::FIELD) + ))) { return; } } diff --git a/Jusin154_Team3D/Client/Private/MapElement_Chest.cpp b/Jusin154_Team3D/Client/Private/MapElement_Chest.cpp index b473eb48f..aadf66390 100644 --- a/Jusin154_Team3D/Client/Private/MapElement_Chest.cpp +++ b/Jusin154_Team3D/Client/Private/MapElement_Chest.cpp @@ -236,7 +236,7 @@ HRESULT CMapElement_Chest::Ready_Components(void* pArg) // RIGID_BODY CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; Desc.iSubKind = ENUM_CLASS(PXOBJECT::BOX); - Desc.bAutoOwnerTranslation = true; + Desc.bAutoTranslation = true; if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_HIDDEN_BOX"), (CComponent**)&m_pRigidBody, &Desc))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Private/MapElement_Door.cpp b/Jusin154_Team3D/Client/Private/MapElement_Door.cpp index 53be26e21..49d75e4ae 100644 --- a/Jusin154_Team3D/Client/Private/MapElement_Door.cpp +++ b/Jusin154_Team3D/Client/Private/MapElement_Door.cpp @@ -179,7 +179,7 @@ HRESULT CMapElement_Door::Ready_Components(void* pArg) { // RIGID_BODY CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; Desc.iSubKind = ENUM_CLASS(PXOBJECT::DOOR); - Desc.bAutoOwnerTranslation = false; + Desc.bAutoTranslation = false; if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_DOOR"), (CComponent**)&m_pRigidBody, &Desc))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Private/Monster.cpp b/Jusin154_Team3D/Client/Private/Monster.cpp index 532dd84b9..e1d9525ef 100644 --- a/Jusin154_Team3D/Client/Private/Monster.cpp +++ b/Jusin154_Team3D/Client/Private/Monster.cpp @@ -34,7 +34,7 @@ HRESULT CMonster::Initialize(void* pArg) void CMonster::Priority_Update(_float fTimeDelta) { - m_pTransformCom->RewindMomentum(); + m_pTransformCom->ResetVelocityVector(); __super::Priority_Update(fTimeDelta); } diff --git a/Jusin154_Team3D/Client/Private/NPC_EleazarFig.cpp b/Jusin154_Team3D/Client/Private/NPC_EleazarFig.cpp index 27937aefa..587c457a9 100644 --- a/Jusin154_Team3D/Client/Private/NPC_EleazarFig.cpp +++ b/Jusin154_Team3D/Client/Private/NPC_EleazarFig.cpp @@ -51,7 +51,7 @@ HRESULT CNPC_EleazarFig::Initialize(void* pArg) void CNPC_EleazarFig::Priority_Update(_float fTimeDelta) { - m_pTransformCom->RewindMomentum(); + m_pTransformCom->ResetVelocityVector(); m_iEntered -= 1; if (m_iEntered < 0) { m_iEntered = 0; @@ -304,7 +304,7 @@ HRESULT CNPC_EleazarFig::Ready_Components(void* pArg) { // DO CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; Desc.iSubKind = ENUM_CLASS(PXOBJECT::ELEAZARFIG); - Desc.bAutoOwnerTranslation = false; + Desc.bAutoTranslation = false; if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_NPC_HITBOX"), (CComponent**)&m_pRigidBody, &Desc))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Private/NPC_Ollivander.cpp b/Jusin154_Team3D/Client/Private/NPC_Ollivander.cpp index 310e1b16a..7777357a1 100644 --- a/Jusin154_Team3D/Client/Private/NPC_Ollivander.cpp +++ b/Jusin154_Team3D/Client/Private/NPC_Ollivander.cpp @@ -21,7 +21,7 @@ CNPC_Ollivander::CNPC_Ollivander(const CNPC_Ollivander& Prototype) void CNPC_Ollivander::Priority_Update(_float fTimeDelta) { - m_pTransformCom->RewindMomentum(); + m_pTransformCom->ResetVelocityVector(); m_iEntered -= 1; if (m_iEntered < 0) { m_iEntered = 0; @@ -314,7 +314,7 @@ HRESULT CNPC_Ollivander::Ready_Components(void* pArg) { // DO CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; Desc.iSubKind = ENUM_CLASS(PXOBJECT::OLLIVANDER); - Desc.bAutoOwnerTranslation = false; + Desc.bAutoTranslation = false; if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_NPC_HITBOX"), (CComponent**)&m_pRigidBody, &Desc))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Private/PhysXEffectHitBox.cpp b/Jusin154_Team3D/Client/Private/PhysXEffectHitBox.cpp index 8d371593b..18977f62a 100644 --- a/Jusin154_Team3D/Client/Private/PhysXEffectHitBox.cpp +++ b/Jusin154_Team3D/Client/Private/PhysXEffectHitBox.cpp @@ -33,12 +33,12 @@ HRESULT CPhysXEffectHitBox::Initialize(void* pArg) void CPhysXEffectHitBox::Priority_Update(_float fTimeDelta) { - m_pTransformCom->RewindMomentum(); + m_pTransformCom->ResetVelocityVector(); } void CPhysXEffectHitBox::Update(_float fTimeDelta) { - m_pTransformCom->AccumulateMomentum(XMLoadFloat3(&m_vDeltaPos)); + m_pTransformCom->AccumulatevVelocity(XMLoadFloat3(&m_vDeltaPos)); } void CPhysXEffectHitBox::Late_Update(_float fTimeDelta) @@ -49,6 +49,7 @@ void CPhysXEffectHitBox::Late_Update(_float fTimeDelta) if (m_pGameInstance->IsIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) { m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this); } + Set_Shadow(m_pGameInstance->IsIn_ShadowViewFrustum(m_pTransformCom->Get_State(STATE::POSITION), m_pTransformCom->Get_Radius())); } HRESULT CPhysXEffectHitBox::Render() diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index 0d1e248f1..dec2d225b 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -141,7 +141,7 @@ void CPlayer::Priority_Update(_float fTimeDelta) { ReLockOnTarget(); SetGravity(); - m_pTransformCom->RewindMomentum(); + m_pTransformCom->ResetVelocityVector(); __super::Priority_Update(fTimeDelta); @@ -576,7 +576,7 @@ void CPlayer::Trigger(CTimeSocket& Socket) m_pTransformCom->Set_State(STATE::POSITION, vNewPos); m_pCharacter_Controller->Set_Position(vNewPos); m_pTransformCom->RotationQ(pContents->pxTransform.q); - m_pTransformCom->RewindMomentum(); + m_pTransformCom->ResetVelocityVector(); } break; case TIMESOCKET_FUNC::TRANSLATION_LERP: { @@ -1196,7 +1196,7 @@ void CPlayer::Describe_Entity() m_pCharacter_Controller->Describe_Entity(); GUI::Checkbox("Battle", &m_bDuel_ZOnlyMove); _float4 vMomentum = {}; - XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum()); + XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentVelocity()); GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w); _char label[256]; for (auto& iter : m_KeyFrames) diff --git a/Jusin154_Team3D/Client/Private/Player_States.cpp b/Jusin154_Team3D/Client/Private/Player_States.cpp index 8042a26dc..eee95f257 100644 --- a/Jusin154_Team3D/Client/Private/Player_States.cpp +++ b/Jusin154_Team3D/Client/Private/Player_States.cpp @@ -596,7 +596,7 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta) } _vector vLook = m_pTransformCom->Get_State(STATE::LOOK); vLook = XMVector3Normalize(vLook); - m_pTransformCom->AccumulateMomentum(vLook *fTimeDelta *0.8f); + m_pTransformCom->AccumulatevVelocity(vLook *fTimeDelta *0.8f); } else if (SUCCEEDED(InputMove())) { m_fMoveTime += fTimeDelta; diff --git a/Jusin154_Team3D/Client/Private/RandomNpc.cpp b/Jusin154_Team3D/Client/Private/RandomNpc.cpp index f7d0ffc8f..7481925e7 100644 --- a/Jusin154_Team3D/Client/Private/RandomNpc.cpp +++ b/Jusin154_Team3D/Client/Private/RandomNpc.cpp @@ -59,7 +59,7 @@ void CRandomNpc::Priority_Update(_float fTimeDelta) if (!m_pGameInstance->IsIn_WorldFrustum(m_pTransformCom->Get_State(STATE::POSITION), m_pTransformCom->Get_Radius())) { return; } - m_pTransformCom->RewindMomentum(); + m_pTransformCom->ResetVelocityVector(); m_iEntered -= 1; if (m_iEntered < 0) { m_iEntered = 0; @@ -448,7 +448,7 @@ HRESULT CRandomNpc::Ready_Components(void* pArg) { // DO CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; Desc.iSubKind = ENUM_CLASS(PXOBJECT::OLLIVANDER); - Desc.bAutoOwnerTranslation = false; + Desc.bAutoTranslation = false; if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_NPC_HITBOX"), (CComponent**)&m_pRigidBody, &Desc))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Private/Ranrok.cpp b/Jusin154_Team3D/Client/Private/Ranrok.cpp index 7a5915714..c54bff5fb 100644 --- a/Jusin154_Team3D/Client/Private/Ranrok.cpp +++ b/Jusin154_Team3D/Client/Private/Ranrok.cpp @@ -787,7 +787,7 @@ HRESULT CRanrok::Ready_SubParts() m_pRanrokCombinedBoneMatrices[ENUM_CLASS(RANROK_ENUM_BONEMATRICES::TAIL2)] = m_pTail2_BoneMat = m_pModelCom->Get_BoneMatrixPtr("tail_12"); CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; - Desc.bAutoOwnerTranslation = false; + Desc.bAutoTranslation = false; Desc.iSubKind = ENUM_CLASS(PXOBJECT::RANROK_BODY); for (_uint i = 0; i < ENUM_CLASS(RANROK_ENUM_BONEMATRICES::END); ++i) { if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_RANROK_BODY"), (CComponent**)&m_pTargetableDO[i], &Desc))) { diff --git a/Jusin154_Team3D/Client/Private/Ranrok_States.cpp b/Jusin154_Team3D/Client/Private/Ranrok_States.cpp index 7eeb69ae8..071575515 100644 --- a/Jusin154_Team3D/Client/Private/Ranrok_States.cpp +++ b/Jusin154_Team3D/Client/Private/Ranrok_States.cpp @@ -803,7 +803,7 @@ HRESULT CRanrok::Behavior_RushExitCheck(_float fTimeDelta) vLook = XMVector3Normalize(vLook); _vector vPos = m_pCharacter_Controller->Get_Position(); _vector vNextPos = vPos + vLook * 10.f * fTimeDelta; - m_pTransformCom->AccumulateMomentum(vLook * 10.f * fTimeDelta); + m_pTransformCom->AccumulatevVelocity(vLook * 10.f * fTimeDelta); return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Terrain.cpp b/Jusin154_Team3D/Client/Private/Terrain.cpp index 3a0e04240..c8ed792b1 100644 --- a/Jusin154_Team3D/Client/Private/Terrain.cpp +++ b/Jusin154_Team3D/Client/Private/Terrain.cpp @@ -52,7 +52,7 @@ HRESULT CTerrain::Initialize(void* pArg) void CTerrain::Priority_Update(_float fTimeDelta) { - m_pTransformCom->RewindMomentum(); + m_pTransformCom->ResetVelocityVector(); } void CTerrain::Update(_float fTimeDelta) diff --git a/Jusin154_Team3D/Client/Private/Troll_Weapon.cpp b/Jusin154_Team3D/Client/Private/Troll_Weapon.cpp index 51740bacc..1b540023c 100644 --- a/Jusin154_Team3D/Client/Private/Troll_Weapon.cpp +++ b/Jusin154_Team3D/Client/Private/Troll_Weapon.cpp @@ -55,7 +55,7 @@ HRESULT CTroll_Weapon::Initialize(void* pArg) void CTroll_Weapon::Priority_Update(_float fTimeDelta) { - m_pTransformCom->RewindMomentum(); + m_pTransformCom->ResetVelocityVector(); m_pModelCom->Combined_BoneMatrix(); _matrix socketMatrix = {}; diff --git a/Jusin154_Team3D/Client/Private/Wand.cpp b/Jusin154_Team3D/Client/Private/Wand.cpp index c1ab07d41..3155837b2 100644 --- a/Jusin154_Team3D/Client/Private/Wand.cpp +++ b/Jusin154_Team3D/Client/Private/Wand.cpp @@ -44,7 +44,7 @@ HRESULT CWand::Initialize(void* pArg) void CWand::Priority_Update(_float fTimeDelta) { - m_pTransformCom->RewindMomentum(); + m_pTransformCom->ResetVelocityVector(); m_pModelCom->Combined_BoneMatrix(); #ifdef _DEBUG Describe_Entity(); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli index 971157a81..069c932db 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Engine_Shader_Functions.hlsli @@ -322,37 +322,28 @@ float3 DecodeNormalFromRG(Texture2D NormalMap, SamplerState Samp, float2 uv) return normalize(n); } -// BackGround ForeGround 합은 1 float2 ComputeDepthWeights(float fCenterDepth, float fSampleDepth, float fDepthScale) { float delta = fSampleDepth - fCenterDepth; - // backgroundWeight: sample이 더 멀수록 증가 - float backgroundWeight = saturate(0.5f + fDepthScale * delta); - float foregroundWeight = 1.0f - backgroundWeight; + float fBackgroundWeight = saturate(0.5f + fDepthScale * delta); + float fForegroundWeight = 1.0f - fBackgroundWeight; - return float2(backgroundWeight, foregroundWeight); + return float2(fBackgroundWeight, fForegroundWeight); } -float ComputeSpreadWeight(float fOffsetLength, float fSpreadLength, float fPixelToSampleUnitsScale) +float ComputeSpreadWeight(float fStepOffset, float fSpreadLength, float fVelocityScale) { - return saturate(fPixelToSampleUnitsScale * fSpreadLength - fOffsetLength + 1.f); + return saturate(fVelocityScale * fSpreadLength - fStepOffset + 1.f); } -// fCenterDepth : 현재 중심 픽셀의 깊이 -// fSampleDepth : 샘플 픽셀의 깊이 -// fOffsetLength : 중심에서 샘플까지의 거리 -// fCenterSpreadLength : 중심 픽셀의 블러 반경 -// fSampleSpreadLength : 샘플 픽셀의 블러 반경 -// fPixelToSampleUnitsScale : spread/offset 단위 -// fDepthScale : 깊이 차이에 얼마나 민감하게 전경/배경을 나눌지 -float SampleWeight(float fCenterDepth, float fSampleDepth, float fOffsetLength, float fCenterSpreadLength, - float fSampleSpreadLength, float fPixelToSampleUnitsScale, float fDepthScale) +float SampleWeight(float fCenterDepth, float fSampleDepth, float fStepOffset, float fCenterSpreadLength, + float fSampleSpreadLength, float fVelocityScale, float fDepthScale) { float2 vDepthCompare = ComputeDepthWeights(fCenterDepth, fSampleDepth, fDepthScale); - float fSpreadCenter = ComputeSpreadWeight(fOffsetLength, fCenterSpreadLength, fPixelToSampleUnitsScale); - float fSpreadSample = ComputeSpreadWeight(fOffsetLength, fSampleSpreadLength, fPixelToSampleUnitsScale); + float fCenter = ComputeSpreadWeight(fStepOffset, fCenterSpreadLength, fVelocityScale); + float fSample = ComputeSpreadWeight(fStepOffset, fSampleSpreadLength, fVelocityScale); - return vDepthCompare.x * fSpreadCenter + vDepthCompare.y * fSpreadSample; + return vDepthCompare.x * fCenter + vDepthCompare.y * fSample; } float4x4 RotateX(float fAngle) @@ -598,24 +589,26 @@ float4 BlendDiffuse(float4 vDiffuseA, Texture2D DiffuseBlendTexture, float2 vTex float2 CalcVelocityUV(float4 vCurrentProjPos, float4 vPreviousProjPos, float fIntensity = 1.f) { float2 vReturnVelocity = float2(0.5f, 0.5f); - if (vCurrentProjPos.w <= FLT_EPSILON5 || vPreviousProjPos.w <= FLT_EPSILON5) - { + if (vCurrentProjPos.w <= FLT_EPSILON5 || vPreviousProjPos.w <= FLT_EPSILON5) { return vReturnVelocity; } + + { + float2 currentNDC = vCurrentProjPos.xy / vCurrentProjPos.w; + float2 previousNDC = vPreviousProjPos.xy / vPreviousProjPos.w; - float2 currentNDC = vCurrentProjPos.xy / vCurrentProjPos.w; - float2 previousNDC = vPreviousProjPos.xy / vPreviousProjPos.w; + currentNDC.y *= -1.f; + previousNDC.y *= -1.f; - currentNDC.y *= -1.f; - previousNDC.y *= -1.f; + float2 velocityUV = (currentNDC - previousNDC) * 0.5f; + velocityUV *= fIntensity; + velocityUV = clamp(velocityUV, -1.0f, 1.0f); - // UV 델타 - float2 velocityUV = (currentNDC - previousNDC) * 0.5f; - velocityUV *= fIntensity; - velocityUV = clamp(velocityUV, -1.0f, 1.0f); - - return velocityUV * 0.5f + 0.5f; // 0 속도 -> 0.5 + vReturnVelocity = velocityUV * 0.5f + 0.5f; + } + return vReturnVelocity; } + float2 CalcVelocityUV(float4 vCurrentProjPos, float4 vPreviousProjPos) { return CalcVelocityUV(vCurrentProjPos, vPreviousProjPos, 1.0f); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index 4c0aec50d..4e11a54e4 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -269,33 +269,34 @@ PS_OUT_VELOCITYBLUR PS_MOTIONBLUR(PS_IN In) float2 vCenterUV = In.vTexcoord; float2 vFullResolutionTexelSize = 1.f / g_vResolution; - float fCenterDepth = g_DepthTexture.Sample(PointSampler, vCenterUV).y; - float2 vCenterVelo = g_VelocityTexture.Sample(PointSampler, vCenterUV).xy * 2.f - 1.f; // 0~1 -> -1~+1 - float2 vCenterVeloPixel = vCenterVelo * g_vResolution.xy; - bool bBorrowedVelocityFromTile = false; + float fCenterDepth = g_DepthTexture.Sample(PointSampler, vCenterUV).y * g_fFar; + float2 vCenterVelocity = g_VelocityTexture.Sample(PointSampler, vCenterUV).xy * 2.f - 1.f; // 0~1 -> -1~+1 + float2 vCenterVeloPixel = vCenterVelocity * g_vResolution.xy; + bool bBorrowedVelocity = false; - float2 vBlurVelo = vCenterVelo; - float2 vBlurVeloPixel = vCenterVeloPixel; // 프레임당 픽셀 이동량 + float2 vBlurVelocity = vCenterVelocity; + float2 vBlurVelocityPixel = vCenterVelocity * g_vResolution.xy; // 프레임당 픽셀 이동량 float fVelocityEpsilon = 0.5f; - if (length(vBlurVeloPixel) < fVelocityEpsilon) + if (length(vBlurVelocityPixel) < fVelocityEpsilon) { // 사실상 정지해 있던 픽셀이면 텐트벨로시티맵에서 빌려옴 - vBlurVelo = g_TileVelocityTexture.Sample(PointSampler, vCenterUV).xy * 2.f - 1.f; - vBlurVeloPixel = vBlurVelo * g_vResolution.xy; - bBorrowedVelocityFromTile = true; + vBlurVelocity = g_TileVelocityTexture.Sample(PointSampler, vCenterUV).xy * 2.f - 1.f; + vBlurVelocityPixel = vBlurVelocity * g_vResolution.xy; + bBorrowedVelocity = true; } - if (length(vBlurVeloPixel) < fVelocityEpsilon) { + if (length(vBlurVelocityPixel) < fVelocityEpsilon) + { // 텐트벨로시티맵에서 빌려온 픽셀또한 정지해 있었으면 원본 그대로 반환 Out.vColor = g_ColorTexture.Sample(ClampLinearSampler, vCenterUV); Out.vVelocity = float2(0.5f, 0.5f); return Out; } - float fPixelSpeed = length(vBlurVeloPixel); + float fPixelSpeed = length(vBlurVelocityPixel); - float2 vBlurDirPixel = (vBlurVeloPixel / max(fPixelSpeed, FLT_EPSILON5)); + float2 vBlurDirPixel = (vBlurVelocityPixel / max(fPixelSpeed, FLT_EPSILON5)); // 픽셀의 속도로 블러 반경을 가변적으로 돌림 float fBlurRadiusPixel = clamp(fPixelSpeed * 0.4f , 0.f, g_fMBMaxBlurRadius); @@ -308,39 +309,40 @@ PS_OUT_VELOCITYBLUR PS_MOTIONBLUR(PS_IN In) float fSamplePixelSpeed = fBlurRadiusPixel / max((float) iMaxRadius, 1.f); // 샘플유닛의 크기 - float fScalePixelToSampleUnit = (float) iMaxRadius / max(fBlurRadiusPixel, FLT_EPSILON5); - float fScaleDepth = 0.5f / max(g_fMBSampleBias, FLT_EPSILON5); + float fVelocityScale = (float) iMaxRadius / max(fBlurRadiusPixel, FLT_EPSILON5); + float fDepthScale = 0.5f / max(g_fMBSampleBias, FLT_EPSILON5); float4 vAccColorSum = float4(0.f, 0.f, 0.f, 0.f); float2 vAccVeloSum = float2(0.f, 0.f); float fAccWeight = 0.f; // 센터의 스프레드 길이 - float2 vReferenceVelocityPixel = bBorrowedVelocityFromTile ? vBlurVeloPixel : vCenterVeloPixel; // 빌린놈이면 빌린 타일이 속도 레퍼런스, 아니면 센터가 속도 레퍼런스가 됨 - float fCenterSpreadLengthPixel = clamp(abs(dot(vReferenceVelocityPixel, vBlurDirPixel)), 0.f, fBlurRadiusPixel); // fSampleSpreadLengthPixel 랑 비교하게 될 짝꿍 + float2 vReferenceVelocityPixel = bBorrowedVelocity ? vBlurVelocityPixel : vCenterVeloPixel; // 빌린놈이면 빌린 타일이 속도 레퍼런스, 아니면 센터가 속도 레퍼런스가 됨 + float fCurrentVelocityVector = clamp(abs(dot(vReferenceVelocityPixel, vBlurDirPixel)), 0.f, fBlurRadiusPixel); // fSampleSpreadLengthPixel 랑 비교하게 될 짝꿍 [loop] - for (int iInterval = -iMaxRadius; iInterval <= iMaxRadius; ++iInterval) { - float fOffset = (float) abs(iInterval); - float2 vOffsetPixel = vBlurDirPixel * ((float) iInterval * fSamplePixelSpeed); + for (int iStep = -iMaxRadius; iStep <= iMaxRadius; ++iStep) + { + float fOffset = (float) abs(iStep); + float2 vOffsetPixel = vBlurDirPixel * ((float) iStep * fSamplePixelSpeed); float2 vSamplingUV = vCenterUV + vOffsetPixel * vFullResolutionTexelSize; if (false == IsValidUV(vSamplingUV)) { continue; } - float fSampledDepth = g_DepthTexture.Sample(PointSampler, vSamplingUV).y; - float2 vSampledVelo = g_VelocityTexture.Sample(PointSampler, vSamplingUV).xy * 2.f - 1.f; - float2 vSampledVeloPixel = vSampledVelo * g_vResolution.xy; + float fSampleDepth = g_DepthTexture.Sample(PointSampler, vSamplingUV).y * g_fFar; + float2 vSampledVelocity = g_VelocityTexture.Sample(PointSampler, vSamplingUV).xy * 2.f - 1.f; + float2 vSampledVelocityPixel = vSampledVelocity * g_vResolution.xy; // 샘플의 스프레드 길이 - float fBlurSampleAccurate = abs(dot(vSampledVeloPixel, vBlurDirPixel)); - float fSampleSpreadLengthPixel = clamp(fBlurSampleAccurate, 0.f, fBlurRadiusPixel); - if (true == bBorrowedVelocityFromTile) + float fSampleVelocityVector = clamp(abs(dot(vSampledVelocityPixel, vBlurDirPixel)), 0.f, fBlurRadiusPixel); + if (true == bBorrowedVelocity) { - fSampleSpreadLengthPixel = max(fSampleSpreadLengthPixel, fCenterSpreadLengthPixel); + fSampleVelocityVector = max(fSampleVelocityVector, fCurrentVelocityVector); } // 샘플과 센터의 (깊이테스트 + 스프레드테스트) - float fWeightCalculated = SampleWeight(fCenterDepth, fSampledDepth, fOffset, fCenterSpreadLengthPixel, fSampleSpreadLengthPixel, fScalePixelToSampleUnit, fScaleDepth); + float fWeightCalculated = SampleWeight(fCenterDepth, fSampleDepth, fOffset, + fCurrentVelocityVector, fSampleVelocityVector, fVelocityScale, fDepthScale); if (fWeightCalculated <= 0.f) { continue; @@ -348,7 +350,7 @@ PS_OUT_VELOCITYBLUR PS_MOTIONBLUR(PS_IN In) float4 vSampledColor = g_ColorTexture.Sample(ClampLinearSampler, vSamplingUV); vAccColorSum += vSampledColor * fWeightCalculated; - vAccVeloSum += vSampledVelo * fWeightCalculated; + vAccVeloSum += vSampledVelocity * fWeightCalculated; fAccWeight += fWeightCalculated; } float4 vBlurredColor = vAccColorSum / max(fAccWeight, FLT_EPSILON5); @@ -819,6 +821,7 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) // 경계 블렌딩 폭. 경계 섞는 비중 float fShadowCascadeBlendWidthRatio = 0.02f; // 2% 섞음 + float g_fStaticShadowBlendWidthRatio = 0.05f; // 경계 주변 부드럽게 할 비중 float fCascadeBlend_NearToMiddle = smoothstep(g_fCascadeSplitRatioNear - fShadowCascadeBlendWidthRatio, @@ -832,14 +835,16 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) // 1번째 방법 //Dynamic - > Static //부드럽게 전환 + float fStaticShadowBlendEndRatio = min(1.0f, g_fCascadeSplitRatioFar + g_fStaticShadowBlendWidthRatio); + float fStaticShadowBlendWeight = smoothstep( + g_fCascadeSplitRatioFar, + fStaticShadowBlendEndRatio, + fDepthRatio + ); - float fVisibilityCombinedLogical = min(fVisibilityDynamic, fVisibility_Static); - float fStaticShadowBlendStartRatio = g_fCascadeSplitRatioFar; - float fStaticShadowBlendWidthRatio = 0.05f; - float fStaticShadowBlendEndRatio = min(1.0f, fStaticShadowBlendStartRatio + fStaticShadowBlendWidthRatio); - float fStaticShadowBlendWeight = smoothstep(fStaticShadowBlendStartRatio, fStaticShadowBlendEndRatio, fDepthRatio); - float fVisibilityCombined = lerp(fVisibilityDynamic, fVisibilityCombinedLogical, fStaticShadowBlendWeight); - + float fStaticAdjusted = lerp(1.0f, fVisibility_Static, fStaticShadowBlendWeight); + + float fVisibilityCombined = fVisibilityDynamic * fStaticAdjusted; // 2번째 방법 // Dynamic * Static 항상 최소곱 //float fVisibilityCombined = saturate(fVisibilityDynamic * fVisibility_Static); @@ -1324,42 +1329,43 @@ PS_OUT_SSAO_AMBIENT_OCCLUSION PS_SSAO_AMBIENT_OCCLUSION(PS_IN In) vCenterViewPosition /= vCenterViewPosition.w; } float3 vNormal = normalize(g_NormalTexture.Sample(PointSampler, uv).xyz * 2.f - 1.f); - float3 vCenterViewNormal = mul(vNormal, (float3x3)g_ViewMatrix); + float3 vCenterNormal = mul(vNormal, (float3x3) g_ViewMatrix); float2 vNoiseScale = g_vResolution / 4.f; float3 vNoise = g_SSAONoiseTexture.Sample(SSAODataSampler, uv * vNoiseScale).xyz; - float3 vTangent = normalize(vNoise - vCenterViewNormal * dot(vNoise, vCenterViewNormal)); - float3 vBiNormal = cross(vCenterViewNormal, vTangent); - float3x3 toViewTBNMatrix = float3x3(vTangent, vBiNormal, vCenterViewNormal); + float3 vTangent = normalize(vNoise - vCenterNormal * dot(vNoise, vCenterNormal)); + float3 vBiNormal = cross(vCenterNormal, vTangent); + float3x3 TBNMatrix = float3x3(vTangent, vBiNormal, vCenterNormal); float fOcclusion = 0.f; [loop] for (uint i = 0; i < g_iKernelSize; ++i) { - float3 vViewSamplePosVec = mul(g_SamplePos[i].xyz, toViewTBNMatrix); // TANSPACE -> VIEW - float4 vViewSamplePos = vCenterViewPosition + float4(vViewSamplePosVec * g_fSSAORadius, 0.f); - float4 vNDCSampleOffset = mul(vViewSamplePos, g_ProjMatrix); + float3 vSampleVector= mul(g_SamplePos[i].xyz, TBNMatrix); + float4 vSampleViewPosition = vCenterViewPosition + float4(vSampleVector * g_fSSAORadius, 0.f); + float4 vNDCSampleOffset = mul(vSampleViewPosition, g_ProjMatrix); vNDCSampleOffset /= vNDCSampleOffset.w; - float2 sampleUV; - sampleUV.x = vNDCSampleOffset.x * 0.5f + 0.5f; - sampleUV.y = vNDCSampleOffset.y * -0.5f + 0.5f; + float2 vSampleUV; + vSampleUV.x = vNDCSampleOffset.x * 0.5f + 0.5f; + vSampleUV.y = vNDCSampleOffset.y * -0.5f + 0.5f; - if (sampleUV.x < 0 || sampleUV.x > 1 - || sampleUV.y < 0 || sampleUV.y > 1) { + if (vSampleUV.x < 0 || vSampleUV.x > 1 + || vSampleUV.y < 0 || vSampleUV.y > 1) + { continue; } - float fRecordedSampleViewPosDepth = g_DepthTexture.Sample(PointSampler, sampleUV).y * g_fFar; - float fIsOccluded = (fRecordedSampleViewPosDepth < vViewSamplePos.z - g_fSSAO_BIAS) ? 1.0f : 0.0f; + float fRecordedDepth = g_DepthTexture.Sample(PointSampler, vSampleUV).y * g_fFar; + float fIsOccluded = (fRecordedDepth < vSampleViewPosition.z - g_fSSAO_BIAS) ? 1.0f : 0.0f; - float fRangeCheck = smoothstep(0.f, 1.f, g_fSSAORadius / abs(vViewSamplePos.z - fRecordedSampleViewPosDepth)); + float fRangeCheck = smoothstep(0.f, 1.f, g_fSSAORadius / abs(vSampleViewPosition.z - fRecordedDepth)); fIsOccluded *= fRangeCheck; fOcclusion += fIsOccluded; } fOcclusion = saturate(1.f - (fOcclusion * g_fSSAOStrength / g_iKernelSize) * fRatio); - Out.fOcclusion = fOcclusion ; + Out.fOcclusion = fOcclusion; return Out; } diff --git a/Jusin154_Team3D/Editor/Private/CallBack_Playable_HitReport.cpp b/Jusin154_Team3D/Editor/Private/CallBack_Playable_HitReport.cpp index 1c6946b17..b8fc3202d 100644 --- a/Jusin154_Team3D/Editor/Private/CallBack_Playable_HitReport.cpp +++ b/Jusin154_Team3D/Editor/Private/CallBack_Playable_HitReport.cpp @@ -40,12 +40,12 @@ void CCallBack_Playable_HitReport::onShapeHit(const PSX::PxControllerShapeHit& h { case 23: // 무거운데 올라갈 수 있는 벽 if (m_pGameInstance->Key_Pressing(DIK_E)) { - pOwnerActorData->pOwner->Get_Component()->BookMomentum(fLength * XMVectorSet(0.f, 1.5f, 0.f, 0.f)); + pOwnerActorData->pOwner->Get_Component()->BookVelocity(fLength * XMVectorSet(0.f, 1.5f, 0.f, 0.f)); } else if (m_pGameInstance->Key_Pressing(DIK_R)) { - pOwnerActorData->pOwner->Get_Component()->BookMomentum(fLength * XMVectorSet(0.f, -1.f, 0.f, 0.f)); + pOwnerActorData->pOwner->Get_Component()->BookVelocity(fLength * XMVectorSet(0.f, -1.f, 0.f, 0.f)); } - //pOwnerActorData->pOwner->Get_Component()->BookMomentum(XMVectorSet(0.f, 0.5f * GRAVITY, 0.f, 0.f)); + //pOwnerActorData->pOwner->Get_Component()->BookVelocity(XMVectorSet(0.f, 0.5f * GRAVITY, 0.f, 0.f)); break; case 24: // 문짝 { diff --git a/Jusin154_Team3D/Editor/Private/DummyObject.cpp b/Jusin154_Team3D/Editor/Private/DummyObject.cpp index 3515ef7da..2a8a0bee8 100644 --- a/Jusin154_Team3D/Editor/Private/DummyObject.cpp +++ b/Jusin154_Team3D/Editor/Private/DummyObject.cpp @@ -39,7 +39,7 @@ HRESULT CDummyObject::Initialize(void* pArg) void CDummyObject::Priority_Update(_float fTimeDelta) { - m_pTransformCom->RewindMomentum(); + m_pTransformCom->ResetVelocityVector(); } void CDummyObject::Update(_float fTimeDelta) diff --git a/Jusin154_Team3D/Editor/Private/Dummy_PhysXEffectHitBox.cpp b/Jusin154_Team3D/Editor/Private/Dummy_PhysXEffectHitBox.cpp index 99f4c58de..081a4787f 100644 --- a/Jusin154_Team3D/Editor/Private/Dummy_PhysXEffectHitBox.cpp +++ b/Jusin154_Team3D/Editor/Private/Dummy_PhysXEffectHitBox.cpp @@ -34,12 +34,12 @@ HRESULT CDummy_PhysXEffectHitBox::Initialize(void* pArg) void CDummy_PhysXEffectHitBox::Priority_Update(_float fTimeDelta) { - m_pTransformCom->RewindMomentum(); + m_pTransformCom->ResetVelocityVector(); } void CDummy_PhysXEffectHitBox::Update(_float fTimeDelta) { - m_pTransformCom->AccumulateMomentum(XMLoadFloat3(&m_vDeltaPos)); + m_pTransformCom->AccumulatevVelocity(XMLoadFloat3(&m_vDeltaPos)); } void CDummy_PhysXEffectHitBox::Late_Update(_float fTimeDelta) diff --git a/Jusin154_Team3D/Editor/Private/Dummy_PhysXMonster.cpp b/Jusin154_Team3D/Editor/Private/Dummy_PhysXMonster.cpp index 50695a0bb..dfcb97ee6 100644 --- a/Jusin154_Team3D/Editor/Private/Dummy_PhysXMonster.cpp +++ b/Jusin154_Team3D/Editor/Private/Dummy_PhysXMonster.cpp @@ -16,7 +16,7 @@ CDummy_PhysXMonster::CDummy_PhysXMonster(const CDummy_PhysXMonster& rhs) : void CDummy_PhysXMonster::Priority_Update(_float fTimeDelta) { - m_pTransformCom->RewindMomentum(); + m_pTransformCom->ResetVelocityVector(); m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position()); } @@ -26,16 +26,16 @@ void CDummy_PhysXMonster::Update(_float fTimeDelta) GUI::Text("%f %f", m_vStunTimer.x, m_vStunTimer.y); if (true == m_pCharacter_Controller->IsActive()) { if (m_pGameInstance->Key_Pressing(DIK_UPARROW)) { - m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 0.f, 1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); + m_pTransformCom->AccumulatevVelocity(XMVectorSet(0.f, 0.f, 1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); } if (m_pGameInstance->Key_Pressing(DIK_LEFT)) { - m_pTransformCom->AccumulateMomentum(XMVectorSet(-1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); + m_pTransformCom->AccumulatevVelocity(XMVectorSet(-1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); } if (m_pGameInstance->Key_Pressing(DIK_DOWN)) { - m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 0.f, -1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); + m_pTransformCom->AccumulatevVelocity(XMVectorSet(0.f, 0.f, -1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); } if (m_pGameInstance->Key_Pressing(DIK_RIGHT)) { - m_pTransformCom->AccumulateMomentum(XMVectorSet(1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); + m_pTransformCom->AccumulatevVelocity(XMVectorSet(1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); } m_pCharacter_Controller->Move(fTimeDelta); m_vStunTimer.x = 0.f; diff --git a/Jusin154_Team3D/Editor/Private/Dummy_PhysXPlayable.cpp b/Jusin154_Team3D/Editor/Private/Dummy_PhysXPlayable.cpp index 5cb8b5732..4e67c8a17 100644 --- a/Jusin154_Team3D/Editor/Private/Dummy_PhysXPlayable.cpp +++ b/Jusin154_Team3D/Editor/Private/Dummy_PhysXPlayable.cpp @@ -21,30 +21,30 @@ CDummy_PhysXPlayable::CDummy_PhysXPlayable(const CDummy_PhysXPlayable& rhs): void CDummy_PhysXPlayable::Priority_Update(_float fTimeDelta) { - m_pTransformCom->RewindMomentum(); + m_pTransformCom->ResetVelocityVector(); m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position()); } void CDummy_PhysXPlayable::Update(_float fTimeDelta) { if (m_pGameInstance->Key_Pressing(DIK_UPARROW)) { - m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 0.f, 1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); + m_pTransformCom->AccumulatevVelocity(XMVectorSet(0.f, 0.f, 1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); } if (m_pGameInstance->Key_Pressing(DIK_LEFT)) { - m_pTransformCom->AccumulateMomentum(XMVectorSet(-1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); + m_pTransformCom->AccumulatevVelocity(XMVectorSet(-1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); } if (m_pGameInstance->Key_Pressing(DIK_DOWN)) { - m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 0.f, -1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); + m_pTransformCom->AccumulatevVelocity(XMVectorSet(0.f, 0.f, -1.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); } if (m_pGameInstance->Key_Pressing(DIK_RIGHT)) { - m_pTransformCom->AccumulateMomentum(XMVectorSet(1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); + m_pTransformCom->AccumulatevVelocity(XMVectorSet(1.f, 0.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); } if (m_pGameInstance->Key_Pressing(DIK_LCONTROL)) { if (m_pGameInstance->Key_Pressing(DIK_SPACE)) { - m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, 10.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); + m_pTransformCom->AccumulatevVelocity(XMVectorSet(0.f, 10.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); } if (m_pGameInstance->Key_Pressing(DIK_C)) { - m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, -10.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); + m_pTransformCom->AccumulatevVelocity(XMVectorSet(0.f, -10.f, 0.f, 0.f) * m_pTransformCom->Get_Speed() * fTimeDelta); } if (m_pGameInstance->Key_Down(DIK_V)) { m_pGameInstance->Detach_Actor(*m_pCharacter_Controller->Get_Actor(), m_pGameInstance->Get_CurrentLevelID()); @@ -56,7 +56,7 @@ void CDummy_PhysXPlayable::Update(_float fTimeDelta) } } - m_pTransformCom->AccumulateMomentum(XMVectorSet(0.f, -GRAVITY * fTimeDelta, 0.f, 0.f)); + m_pTransformCom->AccumulatevVelocity(XMVectorSet(0.f, -GRAVITY * fTimeDelta, 0.f, 0.f)); m_pCharacter_Controller->Move(fTimeDelta); } diff --git a/Jusin154_Team3D/Editor/Private/EditEffect.cpp b/Jusin154_Team3D/Editor/Private/EditEffect.cpp index 9897b74e9..24107c874 100644 --- a/Jusin154_Team3D/Editor/Private/EditEffect.cpp +++ b/Jusin154_Team3D/Editor/Private/EditEffect.cpp @@ -43,7 +43,7 @@ HRESULT CEditEffect::Initialize(void* pArg) void CEditEffect::Priority_Update(_float fTimeDelta) { if(m_EffectInfo.isMotionBlur == true) - m_pTransformCom->RewindMomentum(); + m_pTransformCom->ResetVelocityVector(); } void CEditEffect::Update(_float fTimeDelta) diff --git a/Jusin154_Team3D/Editor/Private/Goblin.cpp b/Jusin154_Team3D/Editor/Private/Goblin.cpp index af9e9e6c5..1edd24407 100644 --- a/Jusin154_Team3D/Editor/Private/Goblin.cpp +++ b/Jusin154_Team3D/Editor/Private/Goblin.cpp @@ -476,7 +476,7 @@ void CGoblin::Describe_Entity() GUI::Text("AnimRatio %.2f", m_pModelCom->Get_CurrentTrackProgressRatio()); _float4 vMomentum = {}; - XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum()); + XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentVelocity()); GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w); _float3 Pos; diff --git a/Jusin154_Team3D/Editor/Private/Goblin_States.cpp b/Jusin154_Team3D/Editor/Private/Goblin_States.cpp index b784bbf3a..e9ff0020b 100644 --- a/Jusin154_Team3D/Editor/Private/Goblin_States.cpp +++ b/Jusin154_Team3D/Editor/Private/Goblin_States.cpp @@ -210,7 +210,7 @@ HRESULT CGoblin::Behavior_SwingExitCheck(_float fTimeDelta) vDistance = XMVector4Normalize(vDistance); _float step = dist - fDesiredRange; - m_pTransformCom->AccumulateMomentum(vDistance * step * fTimeDelta * 1.5f); + m_pTransformCom->AccumulatevVelocity(vDistance * step * fTimeDelta * 1.5f); } } diff --git a/Jusin154_Team3D/Editor/Private/Level_Logo.cpp b/Jusin154_Team3D/Editor/Private/Level_Logo.cpp index 2b7e782da..b371f3dea 100644 --- a/Jusin154_Team3D/Editor/Private/Level_Logo.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_Logo.cpp @@ -67,7 +67,6 @@ void CLevel_Logo::Update(_float fTimeDelta) if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::EFFECT)))) return; #endif // 진우 - } HRESULT CLevel_Logo::Render() diff --git a/Jusin154_Team3D/Editor/Private/Monster.cpp b/Jusin154_Team3D/Editor/Private/Monster.cpp index ae6e3e463..713effabd 100644 --- a/Jusin154_Team3D/Editor/Private/Monster.cpp +++ b/Jusin154_Team3D/Editor/Private/Monster.cpp @@ -34,7 +34,7 @@ HRESULT CMonster::Initialize(void* pArg) void CMonster::Priority_Update(_float fTimeDelta) { - m_pTransformCom->RewindMomentum(); + m_pTransformCom->ResetVelocityVector(); __super::Priority_Update(fTimeDelta); } diff --git a/Jusin154_Team3D/Editor/Private/Player.cpp b/Jusin154_Team3D/Editor/Private/Player.cpp index c38ae948a..73ad5614e 100644 --- a/Jusin154_Team3D/Editor/Private/Player.cpp +++ b/Jusin154_Team3D/Editor/Private/Player.cpp @@ -117,7 +117,7 @@ void CPlayer::Priority_Update(_float fTimeDelta) ReLockOnTarget(); if (m_pCharacter_Controller->Get_GravityAmount() > 0.f) SetGravity(); - m_pTransformCom->RewindMomentum(); + m_pTransformCom->ResetVelocityVector(); __super::Priority_Update(fTimeDelta); @@ -530,7 +530,7 @@ void CPlayer::Describe_Entity() } _float4 vMomentum = {}; - XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum()); + XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentVelocity()); GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w); _char label[256]; for (auto& iter : m_KeyFrames) diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index c6c5119e0..19fda2e47 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -101,6 +101,7 @@ vector g_vFogColor; float g_fDepthPackExponent; Texture3D g_VolumeTexture; +float g_fCascadeBlendRatio = 0.02f; float g_fWeights_32[32] = { @@ -813,42 +814,20 @@ PS_OUT_BACKBUFFER PS_MAIN_COMBINED(PS_IN In) /* 광원의 NDC에서 샘플링 */ float fVisibility_Dynamic_Near = ShadowVisibility_hwPCF(g_ShadowNearTexture, vNearShadowPos, g_vNearShadowResolution, g_vShadowBias.x, g_vShadowRadiusTexel.x); float fVisibility_Dynamic_Middle = ShadowVisibility_hwPCF(g_ShadowMiddleTexture, vMiddleShadowPos, g_vMiddleShadowResolution, g_vShadowBias.y, g_vShadowRadiusTexel.y); - float fVisibility_Static = ShadowVisibility_hwPCF(g_PreShadowTexture, vPreShadowPosition, g_vPreShadowResolution, g_vShadowBias.w, g_vShadowRadiusTexel.w); + float fVisibilityStatic = ShadowVisibility_hwPCF(g_PreShadowTexture, vPreShadowPosition, g_vPreShadowResolution, g_vShadowBias.w, g_vShadowRadiusTexel.w); -//////////////////////////// - // 케스케이드 float fDepthRatio = saturate(vDepthDesc.y); - // 경계 블렌딩 폭. 경계 섞는 비중 - float fShadowCascadeBlendWidthRatio = 0.02f; // 2% 섞음 + float fCascadeBlend_Front = smoothstep(g_fCascadeSplitRatioNear - g_fCascadeBlendRatio, + g_fCascadeSplitRatioNear + g_fCascadeBlendRatio, fDepthRatio); - // 경계 주변 부드럽게 할 비중 - float fCascadeBlend_NearToMiddle = smoothstep(g_fCascadeSplitRatioNear - fShadowCascadeBlendWidthRatio, - g_fCascadeSplitRatioNear + fShadowCascadeBlendWidthRatio, fDepthRatio); - //float fCascadeBlend_MiddleToFar = smoothstep(g_fCascadeSplitRatioFar - fShadowCascadeBlendWidthRatio, - //g_fCascadeSplitRatioFar + fShadowCascadeBlendWidthRatio, fDepthRatio); + float fVisibilityDynamic = lerp(fVisibility_Dynamic_Near, fVisibility_Dynamic_Middle, fCascadeBlend_Front); + + float fStaticShadowBlendWeight = smoothstep(g_fCascadeSplitRatioFar - g_fCascadeBlendRatio, + g_fCascadeSplitRatioFar + g_fCascadeBlendRatio, fDepthRatio); - // Near -> Middle - float fVisibilityDynamic = lerp(fVisibility_Dynamic_Near, fVisibility_Dynamic_Middle, fCascadeBlend_NearToMiddle); - - // 1번째 방법 - //Dynamic - > Static - //부드럽게 전환 - - float fVisibilityCombinedLogical = min(fVisibilityDynamic, fVisibility_Static); - float fStaticShadowBlendStartRatio = g_fCascadeSplitRatioFar; - float fStaticShadowBlendWidthRatio = 0.05f; - float fStaticShadowBlendEndRatio = min(1.0f, fStaticShadowBlendStartRatio + fStaticShadowBlendWidthRatio); - float fStaticShadowBlendWeight = smoothstep(fStaticShadowBlendStartRatio, fStaticShadowBlendEndRatio, fDepthRatio); - float fVisibilityCombined = lerp(fVisibilityDynamic, fVisibilityCombinedLogical, fStaticShadowBlendWeight); - - // 2번째 방법 - // Dynamic * Static 항상 최소곱 - //float fVisibilityCombined = saturate(fVisibilityDynamic * fVisibility_Static); - - // 3번째 방법 - // Dynamic , Static 최소값만 취함 - //float fVisibilityCombined = min(fVisibilityDynamic, fVisibility_Static); + fVisibilityStatic = lerp(1.0f, fVisibilityStatic, fStaticShadowBlendWeight); + float fVisibilityCombined = fVisibilityDynamic * fVisibilityStatic; // 최소 밝기 float fShadowMultiplier = lerp(g_fMinShadowBrightness, 1.0f, saturate(fVisibilityCombined)); diff --git a/Jusin154_Team3D/Engine/Private/Character_Controller.cpp b/Jusin154_Team3D/Engine/Private/Character_Controller.cpp index bf45b69cb..c547e201e 100644 --- a/Jusin154_Team3D/Engine/Private/Character_Controller.cpp +++ b/Jusin154_Team3D/Engine/Private/Character_Controller.cpp @@ -262,9 +262,9 @@ _bool CCharacter_Controller::UpdateGroundByCast(_float fTimeDelta) _float fDistanceFromGround = XMVectorGetX(XMVector3Dot(vFootToHitPos, vSurfaceNormal)); _float fDotUpNormal = (fabsf(fDotUp) < FLT_EPSILON) ? FLT_EPSILON: fDotUp; _float fCurrentMomentumY = (-fDistanceFromGround / fDotUpNormal) * 0.3f; - _vector vCurrentMomentum = m_pTransform->Get_CurrentMomentum(); + _vector vCurrentMomentum = m_pTransform->Get_CurrentVelocity(); - m_pTransform->Set_CurrentMomentum( XMVectorSetY(vCurrentMomentum, fCurrentMomentumY) ); + m_pTransform->Set_CurrentVelocity( XMVectorSetY(vCurrentMomentum, fCurrentMomentumY) ); Set_OnGroundFlag(true); if (m_fCurrentSlopeDegree < m_fWalkableSlopeDegree * 0.5f) { m_bSlide = false; @@ -292,17 +292,17 @@ void CCharacter_Controller::Move(_float fTimeDelta) const PSX::PxObstacleContext* pPxObstacles = { nullptr }; // 캐릭터가 충돌해야할 추가적인 장애물 객체?, 닿은 장애물은 캐시된다? if (true == m_bGravity) { if (0 >= m_iIsOnGround) { // 공중: 무조건 중력 - m_pTransform->AccumulateMomentum(XMVectorSet(0.f, -GRAVITY * m_fGravity * fTimeDelta, 0.f, 0.f)); + m_pTransform->AccumulateVelocity(XMVectorSet(0.f, -GRAVITY * m_fGravity * fTimeDelta, 0.f, 0.f)); } else if ((iCoyote_Counter) >= m_iIsOnGround) { UpdateGroundByCast(fTimeDelta);// 바닥에 플레이어 붙이게 함 } else if (m_fCurrentSlopeDegree > m_fWalkableSlopeDegree) { // 너무 가파른 경사: 중력 - m_pTransform->AccumulateMomentum(XMVectorSet(0.f, -GRAVITY * fTimeDelta, 0.f, 0.f)); + m_pTransform->AccumulateVelocity(XMVectorSet(0.f, -GRAVITY * fTimeDelta, 0.f, 0.f)); m_bSlide = true; } } - XMStoreFloat3((_float3*)&pxVecMomentum, m_pTransform->Get_CurrentMomentum()); + XMStoreFloat3((_float3*)&pxVecMomentum, m_pTransform->Get_CurrentVelocity()); m_eBeforeCollisionFlags = m_pController->move(pxVecMomentum, fMinimumDistant, fTimeDelta, pxFilter, pPxObstacles); } diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index 4a636da21..82c98ec33 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -61,7 +61,7 @@ HRESULT CGameInstance::Initialize_Engine(const ENGINE_DESC& EngineDesc, ID3D11De #endif // _DEBUG #ifndef _DEBUG - m_pThreadHolder = CThreadHolder::Create(12); + m_pThreadHolder = CThreadHolder::Create(8); #endif // !_DEBUG if (nullptr == m_pThreadHolder) { @@ -149,28 +149,17 @@ void CGameInstance::Update_Engine(_float fTimeDelta) m_pKey_Manager->Update(); m_pMouse_Manager->Update(); m_pSound_Manager->Update(); -#ifdef _DEBUG - m_pResource_Manager->Describe_Entity(); - m_pFog->Update_Fog(); -#endif // _DEBUG m_pPicking->Update(); m_pObject_Manager->Priority_Update(fExcuteTimeDelta); - m_pPipeLine->Update(); - m_pObject_Manager->Update(fExcuteTimeDelta); - m_pPhysX_Manager->Update(fExcuteTimeDelta); - m_pObject_Manager->Late_Update(fExcuteTimeDelta); m_pVolumetric->Dispatch(); - m_pLevel_Manager->Update(fExcuteTimeDelta); m_pObject_Manager->Clear_DeadObj(); - - //m_pObstacle_Manager->Refresh_Region(); } HRESULT CGameInstance::Draw() diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index bbef4ae3f..ec51057db 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -575,7 +575,7 @@ void CModel::Update_RootBone(_float Amount) vDeltaWorld = XMVectorSetW(vDeltaWorld, 1.f); if (m_bRootBone) { - m_pTransform->AccumulateMomentum(vDeltaWorld); + m_pTransform->AccumulateVelocity(vDeltaWorld); } else { XMStoreFloat4(&m_RootBoneMomentum, vDeltaWorld); diff --git a/Jusin154_Team3D/Engine/Private/Mouse_Manager.cpp b/Jusin154_Team3D/Engine/Private/Mouse_Manager.cpp index 49140c5c8..a5e97f051 100644 --- a/Jusin154_Team3D/Engine/Private/Mouse_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/Mouse_Manager.cpp @@ -207,7 +207,7 @@ void CMouse_Manager::Describe_Entity() GUI::Begin("SYSTEM", 0, IMGUI_GLOBAL_BEGIN_FLAG); GUI::PushItemWidth(IMGUI_GLOBAL_ITEM_WIDTH); if (GUI::CollapsingHeader("Mouse_Manager")) { - GUI::Text("AccumulateMomentum %.2f, %.2f", m_vMove.x, m_vMove.y); + GUI::Text("AccumulateVelocity %.2f, %.2f", m_vMove.x, m_vMove.y); GUI::Text("CurPos %d, %d", m_ptCurrentMouseCur.x, m_ptCurrentMouseCur.y); GUI::Text("Lock %d", m_bLockMouseToCenter); POINT pt = Get_MouseViewPortPos(); diff --git a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp index 95ac3b3d9..96ed9c87a 100644 --- a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp @@ -488,7 +488,7 @@ void CPhysX_Manager::Update_Kinematic() continue; } PHYSX_USERDATA* pUserData = (PHYSX_USERDATA*)pBody->userData; - if (false == pUserData->bAutoOwnerTranslation) { + if (false == pUserData->bAutoTranslation) { continue; } const CTransform* pTransform = pUserData->pOwner->Get_Component(); @@ -497,9 +497,9 @@ void CPhysX_Manager::Update_Kinematic() } } } - for (list::iterator ReleasedActor = ReleasedList.begin(); ReleasedActor != ReleasedList.end();) { - Detach_Actor(*(*ReleasedActor), m_pGameInstance->Get_CurrentLevelID()); - ReleasedActor = ReleasedList.erase(ReleasedActor); + for (auto iterActor = ReleasedList.begin(); iterActor != ReleasedList.end();) { + Detach_Actor(*(*iterActor), m_pGameInstance->Get_CurrentLevelID()); + iterActor = ReleasedList.erase(iterActor); } } @@ -520,7 +520,6 @@ void CPhysX_Manager::Update(_float fTimeDelta) } { // Post Update_Dynamic_ActiveActors(); - //Update_Dynamic_AllActors(); } #ifdef _DEBUG m_pGameInstance->Compute_TimeDelta(TEXT("Timer_PhysX")); @@ -540,7 +539,7 @@ void CPhysX_Manager::Update_Dynamic_ActiveActors() ReleasedList.emplace_back(ppActiveActors[i]); continue; } - if (false == pUserData->bAutoOwnerTranslation) { + if (false == pUserData->bAutoTranslation) { continue; } CTransform* pTransform = pUserData->pOwner->Get_Component(); @@ -549,13 +548,14 @@ void CPhysX_Manager::Update_Dynamic_ActiveActors() _float3 vOriginalScale = pTransform->Get_Scale(); _matrix WorldMatrix = {}; - WorldMatrix = XMMatrixAffineTransformation(XMLoadFloat3(&vOriginalScale), XMVectorZero(), XMLoadFloat4((_float4*)&pPxTransform.q), XMLoadFloat3((_float3*)&pPxTransform.p)); + WorldMatrix = XMMatrixAffineTransformation(XMLoadFloat3(&vOriginalScale), XMVectorZero(), + XMLoadFloat4((_float4*)&pPxTransform.q), XMLoadFloat3((_float3*)&pPxTransform.p)); pTransform->Set_WorldMatrix(WorldMatrix); } } - for (list::iterator ReleasedActor = ReleasedList.begin(); ReleasedActor != ReleasedList.end();) { - Detach_Actor(*(*ReleasedActor), m_pGameInstance->Get_CurrentLevelID()); - ReleasedActor = ReleasedList.erase(ReleasedActor); + for (auto iterActor = ReleasedList.begin(); iterActor != ReleasedList.end();) { + Detach_Actor(*(*iterActor), m_pGameInstance->Get_CurrentLevelID()); + iterActor = ReleasedList.erase(iterActor); } } diff --git a/Jusin154_Team3D/Engine/Private/PipeLine.cpp b/Jusin154_Team3D/Engine/Private/PipeLine.cpp index f4bdbe68c..675ed351f 100644 --- a/Jusin154_Team3D/Engine/Private/PipeLine.cpp +++ b/Jusin154_Team3D/Engine/Private/PipeLine.cpp @@ -361,10 +361,10 @@ void CPipeLine::Make_LightBoxes() _matrix ViewInvMatrix = XMMatrixInverse(nullptr, ViewMatrix); // Cascaded Shadow Map (3단계: Near / Middle / Far) - for (_uint iIndex = 0; iIndex < 3; ++iIndex) + for (_uint iCSMIndex = 0; iCSMIndex < 3; ++iCSMIndex) { _float4 vCascadePoints8[8] = {}; - Get_CascadePoints8(m_vShadowViewPoints, iIndex, vCascadePoints8); + Get_CascadePoints8(m_vShadowViewPoints, iCSMIndex, vCascadePoints8); // AABB 초기값 설정 (첫 번째 점 기준) _float fMinX = vCascadePoints8[0].x; @@ -387,12 +387,6 @@ void CPipeLine::Make_LightBoxes() fMaxZ = max(fMaxZ, vCascadePoints8[iPointIndex].z); } - // 각 Cascade 별로 결과를 저장할 Plane 배열 선택 - _float4* targetPlanes = nullptr; - if (iIndex == 0) targetPlanes = m_vNearShadowViewBoxPlane; - if (iIndex == 1) targetPlanes = m_vMiddleShadowViewBoxPlane; - if (iIndex == 2) targetPlanes = m_vFarShadowViewBoxPlane; - // Shadow Box 여유 공간 추가 (Shadow clipping 방지 / 안정성 확보) fMinX += m_vShadowMarginMin.x; fMaxX += m_vShadowMarginMax.x; @@ -404,7 +398,7 @@ void CPipeLine::Make_LightBoxes() // Cascade 별 Shadow Map 해상도 설정 _uint iShadowWidth = { 0 }; _uint iShadowHeight = { 0 }; - switch (iIndex) + switch (iCSMIndex) { case 0: iShadowWidth = g_iNearShadowWidth; @@ -424,25 +418,31 @@ void CPipeLine::Make_LightBoxes() Adjust_ShadowTexcel(fMinX, fMinY, fMaxX, fMaxY, iShadowWidth, iShadowHeight); + // 각 Cascade 별로 결과를 저장할 Plane 배열 선택 + _float4* pTargetPlanes = nullptr; + if (iCSMIndex == 0) pTargetPlanes = m_vNearShadowViewBoxPlane; + if (iCSMIndex == 1) pTargetPlanes = m_vMiddleShadowViewBoxPlane; + if (iCSMIndex == 2) pTargetPlanes = m_vFarShadowViewBoxPlane; + // Light-Space AABB를 Plane 형태로 변환 (Frustum 형태) // 물체는 그대로 World 좌표 사용 // Plane vs Bounding Volume 테스트만 수행 - targetPlanes[0] = _float4(-1.f, 0.f, 0.f, fMinX); // Left - targetPlanes[1] = _float4(1.f, 0.f, 0.f, -fMaxX); // Right - targetPlanes[2] = _float4(0.f, -1.f, 0.f, fMinY); // Bottom - targetPlanes[3] = _float4(0.f, 1.f, 0.f, -fMaxY); // Top - targetPlanes[4] = _float4(0.f, 0.f, -1.f, fMinZ); // Near - targetPlanes[5] = _float4(0.f, 0.f, 1.f, -fMaxZ); // Far + pTargetPlanes[0] = _float4(-1.f, 0.f, 0.f, fMinX); // Left + pTargetPlanes[1] = _float4(1.f, 0.f, 0.f, -fMaxX); // Right + pTargetPlanes[2] = _float4(0.f, -1.f, 0.f, fMinY); // Bottom + pTargetPlanes[3] = _float4(0.f, 1.f, 0.f, -fMaxY); // Top + pTargetPlanes[4] = _float4(0.f, 0.f, -1.f, fMinZ); // Near + pTargetPlanes[5] = _float4(0.f, 0.f, 1.f, -fMaxZ); // Far // Orthographic Projection 생성 Off-Center 방식 사용 _matrix ProjMatrix = XMMatrixOrthographicOffCenterLH(fMinX, fMaxX, fMinY, fMaxY, fMinZ, fMaxZ); // Light View / View Inverse 저장 - XMStoreFloat4x4(&m_ShadowTransformMatrices[iIndex][ENUM_CLASS(D3DTS::VIEW)], ViewMatrix); - XMStoreFloat4x4(&m_ShadowTransformMatrices[iIndex][ENUM_CLASS(D3DTS::VIEW_INV)], ViewInvMatrix); + XMStoreFloat4x4(&m_ShadowTransformMatrices[iCSMIndex][ENUM_CLASS(D3DTS::VIEW)], ViewMatrix); + XMStoreFloat4x4(&m_ShadowTransformMatrices[iCSMIndex][ENUM_CLASS(D3DTS::VIEW_INV)], ViewInvMatrix); // Light Projection / Projection Inverse 저장 - XMStoreFloat4x4(&m_ShadowTransformMatrices[iIndex][ENUM_CLASS(D3DTS::PROJ)], ProjMatrix); - XMStoreFloat4x4(&m_ShadowTransformMatrices[iIndex][ENUM_CLASS(D3DTS::PROJ_INV)], XMMatrixInverse(nullptr, ProjMatrix)); + XMStoreFloat4x4(&m_ShadowTransformMatrices[iCSMIndex][ENUM_CLASS(D3DTS::PROJ)], ProjMatrix); + XMStoreFloat4x4(&m_ShadowTransformMatrices[iCSMIndex][ENUM_CLASS(D3DTS::PROJ_INV)], XMMatrixInverse(nullptr, ProjMatrix)); } } diff --git a/Jusin154_Team3D/Engine/Private/Renderer.cpp b/Jusin154_Team3D/Engine/Private/Renderer.cpp index eced1af29..b7e9e1d52 100644 --- a/Jusin154_Team3D/Engine/Private/Renderer.cpp +++ b/Jusin154_Team3D/Engine/Private/Renderer.cpp @@ -12,7 +12,7 @@ void CRenderer::Render() Render_NonBlend(); Render_Decal(); Render_EffectNonBlend(); - Render_SSAO();\ + Render_SSAO(); Render_SSAO_BLUR(); Render_LightAcc(); Render_Combined(); diff --git a/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic.cpp b/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic.cpp index 19528766f..7db55c210 100644 --- a/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic.cpp +++ b/Jusin154_Team3D/Engine/Private/RigidBody_Dynamic.cpp @@ -394,7 +394,7 @@ HRESULT CRigidBody_Dynamic::Initialize(void* pArg) m_tagData.pOwner = m_pOwner; XMStoreFloat4x4(&m_tagData.BeforeMatrix, m_pTransform->Get_XMWorldMatrix()); m_tagData.pBody = this; - m_tagData.bAutoOwnerTranslation = pDesc->bAutoOwnerTranslation; + m_tagData.bAutoTranslation = pDesc->bAutoTranslation; m_pRigidBody = m_pGameInstance->Add_DynamicActor(*this, m_pGameInstance->Get_NextLevelID()); m_pRigidBody->setCMassLocalPose(m_PxMassCenter); m_pRigidBody->setRigidDynamicLockFlags(m_eLockFlag); diff --git a/Jusin154_Team3D/Engine/Private/Transform.cpp b/Jusin154_Team3D/Engine/Private/Transform.cpp index ac34e5d00..29b759e85 100644 --- a/Jusin154_Team3D/Engine/Private/Transform.cpp +++ b/Jusin154_Team3D/Engine/Private/Transform.cpp @@ -276,32 +276,32 @@ void CTransform::Translation(_fvector vTrans) Set_State(STATE::POSITION, Get_State(STATE::POSITION) + XMVectorSetW(vTrans, 0.f)); } -void CTransform::AccumulateMomentum(_fvector vMomentum) +void CTransform::AccumulateVelocity(_fvector vVelocity) { - XMStoreFloat3(&m_vMomentum, (XMLoadFloat3(&m_vMomentum) + XMVectorSetW(vMomentum, 0.f))); + XMStoreFloat3(&m_vVelocityVector, (XMLoadFloat3(&m_vVelocityVector) + XMVectorSetW(vVelocity, 0.f))); } -_vector CTransform::Get_CurrentMomentum() const +void CTransform::ResetVelocityVector() { - return XMLoadFloat3(&m_vMomentum); -} -void CTransform::Set_CurrentMomentum(_fvector vMomentum) -{ - XMStoreFloat3(&m_vMomentum, vMomentum); -} -_vector CTransform::Get_EstimatedPositionByMomentum() const -{ - return XMVectorSetW(Get_State(STATE::POSITION) + XMLoadFloat3(&m_vMomentum), 1.f); -} -void CTransform::RewindMomentum() -{ - m_vMomentum = m_vBackMomentum; - m_vBackMomentum = { 0.f, 0.f, 0.f }; + m_vVelocityVector = m_vBackVelocityVector; + m_vBackVelocityVector = { 0.f, 0.f, 0.f }; m_PrevMatrix = m_WorldMatrix; } - -void CTransform::BookMomentum(_fvector vMomentum) +_vector CTransform::Get_CurrentVelocity() const { - XMStoreFloat3(&m_vBackMomentum, (XMLoadFloat3(&m_vBackMomentum) + XMVectorSetW(vMomentum, 0.f))); + return XMLoadFloat3(&m_vVelocityVector); +} +void CTransform::Set_CurrentVelocity(_fvector vVelocity) +{ + XMStoreFloat3(&m_vVelocityVector, vVelocity); +} +_vector CTransform::Get_EstimatedPositionByVelocityVector() const +{ + return XMVectorSetW(Get_State(STATE::POSITION) + XMLoadFloat3(&m_vVelocityVector), 1.f); +} + +void CTransform::BookVelocity(_fvector vVelocity) +{ + XMStoreFloat3(&m_vBackVelocityVector, (XMLoadFloat3(&m_vBackVelocityVector) + XMVectorSetW(vVelocity, 0.f))); } void CTransform::Turn(_fvector vAxis, _float fTimeDelta) diff --git a/Jusin154_Team3D/Engine/Private/imgui_demo.cpp b/Jusin154_Team3D/Engine/Private/imgui_demo.cpp index aab303999..d0748b804 100644 --- a/Jusin154_Team3D/Engine/Private/imgui_demo.cpp +++ b/Jusin154_Team3D/Engine/Private/imgui_demo.cpp @@ -1560,7 +1560,7 @@ static void DemoWindowWidgetsDragAndDrop() }; static int mode = 0; if (ImGui::RadioButton("Copy", mode == Mode_Copy)) { mode = Mode_Copy; } ImGui::SameLine(); - if (ImGui::RadioButton("AccumulateMomentum", mode == Mode_Move)) { mode = Mode_Move; } ImGui::SameLine(); + if (ImGui::RadioButton("AccumulateVelocity", mode == Mode_Move)) { mode = Mode_Move; } ImGui::SameLine(); if (ImGui::RadioButton("Swap", mode == Mode_Swap)) { mode = Mode_Swap; } static const char* names[9] = { @@ -1584,7 +1584,7 @@ static void DemoWindowWidgetsDragAndDrop() // Display preview (could be anything, e.g. when dragging an image we could decide to display // the filename and a small preview of the image, etc.) if (mode == Mode_Copy) { ImGui::Text("Copy %s", names[n]); } - if (mode == Mode_Move) { ImGui::Text("AccumulateMomentum %s", names[n]); } + if (mode == Mode_Move) { ImGui::Text("AccumulateVelocity %s", names[n]); } if (mode == Mode_Swap) { ImGui::Text("Swap %s", names[n]); } ImGui::EndDragDropSource(); } diff --git a/Jusin154_Team3D/Engine/Public/Engine_Enum.h b/Jusin154_Team3D/Engine/Public/Engine_Enum.h index eb72611b2..f35955f9c 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Enum.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Enum.h @@ -128,14 +128,6 @@ enum class PHYSX_KIND { OBSTACLEActor, }; -enum class PHYSX_JOINT { - D6, - DISTANCE, - REVOLUTE, - FIXED, - END -}; - enum class PXOBJECT : _uint { #pragma region NOT_DEFINE NOT_DEFINE = 0, @@ -240,6 +232,14 @@ enum class PXOBJECT : _uint { END = 999 }; +enum class PHYSX_JOINT { + D6, + DISTANCE, + REVOLUTE, + FIXED, + END +}; + enum class HIT_TYPE { HIT_NONE = 0, // 히트모션 없음 diff --git a/Jusin154_Team3D/Engine/Public/Engine_Macro.h b/Jusin154_Team3D/Engine/Public/Engine_Macro.h index d399350f7..3962a7aab 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Macro.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Macro.h @@ -23,7 +23,7 @@ #endif // !_DEBUG //#ifdef 기무리 -#define DEBUG_MOTIONBLUR +//#define DEBUG_MOTIONBLUR //#define DEBUG_SSAO //#define DEBUG_SHADOW //#define DEBUG_CAMERAS @@ -48,7 +48,7 @@ #endif // !_DEBUG #ifdef _DEBUG -#ifdef 기무리 +#ifdef golde #undef ASSERT_NURI #define ASSERT_NURI(expression) assert(expression) #define MSG_BOX(_message) MessageBox(NULL, TEXT(_message), L"System Message", MB_OK); assert(false); diff --git a/Jusin154_Team3D/Engine/Public/Engine_Struct.h b/Jusin154_Team3D/Engine/Public/Engine_Struct.h index 0070d0058..f367909dc 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Struct.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Struct.h @@ -376,7 +376,7 @@ typedef struct tagVertexInstance_UIDesc typedef struct tagPHYSX_USERDATA { PHYSX_KIND eKind = PHYSX_KIND::NOT_DEFINED; - _bool bAutoOwnerTranslation = true; + _bool bAutoTranslation = true; class CGameObject* pOwner = { nullptr }; _float4x4 BeforeMatrix = { }; diff --git a/Jusin154_Team3D/Engine/Public/RigidBody_Dynamic.h b/Jusin154_Team3D/Engine/Public/RigidBody_Dynamic.h index 085bf0a1c..2048d9a9b 100644 --- a/Jusin154_Team3D/Engine/Public/RigidBody_Dynamic.h +++ b/Jusin154_Team3D/Engine/Public/RigidBody_Dynamic.h @@ -19,7 +19,7 @@ class ENGINE_DLL CRigidBody_Dynamic : public CRigidBody typedef struct tagRigidBody_DYNAMIC_Desc : public CRigidBody::RIGIDBODY_DESC { - _bool bAutoOwnerTranslation = true; + _bool bAutoTranslation = true; }RIGIDBODY_DYNAMIC_DESC; private: @@ -62,8 +62,8 @@ class ENGINE_DLL CRigidBody_Dynamic : public CRigidBody _vector Get_Position(); void Set_Position(_vector vPos, _bool bTeleport); void Set_Rotation(_vector vRotQ, _bool bTeleport); - void Set_AutoOwnerTranlation(_bool bAutoOwnerTranslation) { m_tagData.bAutoOwnerTranslation = bAutoOwnerTranslation; }; - _bool Get_AutoOwnerTranlation() { return m_tagData.bAutoOwnerTranslation; }; + void Set_AutoOwnerTranlation(_bool bAutoTranslation) { m_tagData.bAutoTranslation = bAutoTranslation; }; + _bool Get_AutoOwnerTranlation() { return m_tagData.bAutoTranslation; }; void Set_Transform(_matrix WorldMatrix, _bool bTeleport); void Set_Transform(_vector vPos, _vector vRotQ, _bool bTeleport); diff --git a/Jusin154_Team3D/Engine/Public/Transform.h b/Jusin154_Team3D/Engine/Public/Transform.h index b0462e465..27f7da39a 100644 --- a/Jusin154_Team3D/Engine/Public/Transform.h +++ b/Jusin154_Team3D/Engine/Public/Transform.h @@ -63,13 +63,13 @@ class ENGINE_DLL CTransform final : void Translation(_float3& vTrans); void Translation(_fvector vTrans); - void AccumulateMomentum(_fvector vMomentum); - _vector Get_CurrentMomentum() const; - void Set_CurrentMomentum(_fvector vMomentum); - void RewindMomentum(); + void AccumulateVelocity(_fvector vVelocity); + _vector Get_CurrentVelocity() const; + void Set_CurrentVelocity(_fvector vVelocity); + void ResetVelocityVector(); - _vector Get_EstimatedPositionByMomentum() const; - void BookMomentum(_fvector vMomentum); + _vector Get_EstimatedPositionByVelocityVector() const; + void BookVelocity(_fvector vVelocity); void Turn(_fvector vAxis, _float fTimeDelta); void TurnAngle(_float4 vAxis, _float fAngle); @@ -103,8 +103,8 @@ class ENGINE_DLL CTransform final : _float4x4 m_PrevMatrix = {}; _float m_fRadius = { 20.f }; - _float3 m_vMomentum = {}; // 현재 프레임에 계산된 이동량 - _float3 m_vBackMomentum = {}; // 다음 프레임에 계산될 이동량 + _float3 m_vVelocityVector = {}; // 현재 프레임에 계산된 이동량 + _float3 m_vBackVelocityVector = {}; // 다음 프레임에 계산될 이동량 #ifdef RELEASE_DEBUGGER _float3 m_vRotation = {0.f, 0.f, 0.f};