diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj b/Jusin154_Team3D/Client/Default/Client.vcxproj index 69616d59c..c63e31d27 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj @@ -175,6 +175,7 @@ call Update_Resources.bat + @@ -228,7 +229,6 @@ call Update_Resources.bat - @@ -470,6 +470,7 @@ call Update_Resources.bat + @@ -525,7 +526,6 @@ call Update_Resources.bat - diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters index 5b7ea45ed..7df46f555 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters @@ -884,8 +884,8 @@ 03.InfoInstance\04.CutSceneInfo - - 04.Mechanic\TimeSocket + + 02.GameObjects\Cameras\Camera_Cinematic 02.GameObjects\UI\Dialogue_Canvas\Dialogue_Panel\Dialogue_Choice @@ -1857,12 +1857,12 @@ {b03591a7-a14e-425a-8a3f-2a6a054c884a} - - {ca386d46-aca6-44a4-94cc-15610e1a878e} - {d07bd195-0cdf-4a47-8c50-e3a88361352f} + + {581e7b08-09ae-4e52-8e84-d6ac8cc94dc9} + {20f56d81-fd4b-4e24-a73e-792a4700c512} @@ -2718,8 +2718,8 @@ 03.InfoInstance\04.CutSceneInfo - - 04.Mechanic\TimeSocket + + 02.GameObjects\Cameras\Camera_Cinematic 02.GameObjects\UI\Dialogue_Canvas diff --git a/Jusin154_Team3D/Client/Private/CamPosition_Shoulder.cpp b/Jusin154_Team3D/Client/Private/CamPosition_Shoulder.cpp index bd50d7874..b1da4dd04 100644 --- a/Jusin154_Team3D/Client/Private/CamPosition_Shoulder.cpp +++ b/Jusin154_Team3D/Client/Private/CamPosition_Shoulder.cpp @@ -165,7 +165,7 @@ void CCamPosition_Shoulder::Update(_float fTimeDelta) } else if(m_bZoomIn) { - m_pBinded_Camera->Set_Fov(XMConvertToRadians(60.f),fTimeDelta, m_bZoomIn); + m_pBinded_Camera->Set_FovSlope(XMConvertToRadians(60.f),fTimeDelta, m_bZoomIn); } } @@ -292,8 +292,20 @@ _vector CCamPosition_Shoulder::Calc_BestPosition(_fvector vCastingPosition, _gve CMyTools::SortHitsByDistance(sweepHits); // 벽면에서 팔로우 타겟을 살짝 띄우는 오프셋 - _float fCameraSurfaceOffset = 0.05f; - _float fCameraMinDistance = 0.20f; + + static _float fCameraSurfaceOffset = 0.20f; // 높이면 카메라가 벽으로부터 좀 더 안정적으로 띄워지지만 벽에 바짝 붙은 플레이어를 감당불가 + static _float fCameraMinDistance = 0.71f; // 높이면 + +#ifdef _DEBUG + GUI::Begin("CAMERA"); + if (GUI::TreeNode("MinSurfaceOffset")) { + GUI::DragFloat("fCameraMinDistance", &fCameraMinDistance, 0.01f, 0.01f, 1.f); + GUI::DragFloat("fCameraSurfaceOffset", &fCameraSurfaceOffset, 0.01f, 0.01f, 1.f); + GUI::TreePop(); + } + GUI::End(); +#endif // _DEBUG + _float fDistance = { }; _float fFinalTargetDistance = fZeroSafeDistance; for (auto& hit : sweepHits) diff --git a/Jusin154_Team3D/Client/Private/Camera_Cinematic.cpp b/Jusin154_Team3D/Client/Private/Camera_Cinematic.cpp new file mode 100644 index 000000000..bda5fccbe --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Camera_Cinematic.cpp @@ -0,0 +1,309 @@ +#include "pch.h" +#include "Camera_Cinematic.h" +#include "InfoInstance.h" +#include "TimeSocket.h" +#include "Layer.h" + + +CCamera_Cinematic::CCamera_Cinematic(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CCamera(pDevice, pContext) +{ +} + +CCamera_Cinematic::CCamera_Cinematic(const CCamera_Cinematic& rhs) + : CCamera(rhs), + m_pInfoInstance(CInfoInstance::GetInstance()) +{ +} + +void CCamera_Cinematic::Priority_Update(_float fTimeDelta) +{ +#ifdef _DEBUG + if (m_pGameInstance->Key_Pressing(DIK_HOME)) { + if (m_pGameInstance->Key_Up(DIK_END)) { + _string strCutSceneName = "RanrokIntro"; + m_pInfoInstance->Active_Event(strCutSceneName); + } + } +#endif // _DEBUG + if (false == m_bActive) { + return; + } + m_bActive = true; + __super::Bind_Matrices(); +} + +void CCamera_Cinematic::Update(_float fTimeDelta) +{ +#ifdef _DEBUG + Describe_Entity(); +#endif // _DEBUG + if (false == m_bActive) { + return; + } + Transition(fTimeDelta); + Update_LerpTimer(fTimeDelta); + +} +void CCamera_Cinematic::Late_Update(_float fTimeDelta) +{ + if (false == m_bActive) { + return; + } +} +HRESULT CCamera_Cinematic::Render() +{ + return S_OK; +} + +void CCamera_Cinematic::Update_LerpTimer(_float fTimeDelta) +{ + if (false == m_bActive) { + return; + } + Lerp_Translation(fTimeDelta); + Lerp_FovY(fTimeDelta); + if (true == m_bEnable_LookLerp) { + m_vLookLerpTime.x += fTimeDelta; + if (m_vLookLerpTime.y <= m_vLookLerpTime.x) { + m_vLookLerpTime.x = 0.f; + XMStoreFloat3(&m_vLookPos_Src, XMLoadFloat3(&m_vLookPos_Dest)); + XMStoreFloat3(&m_vLookPos_Dest, m_pLookTarget->Get_WorldPostion()); + } + } + + if (true == m_bEnable_FollowLerp) { + m_vFollowLerpTime.x += fTimeDelta; + if (m_vFollowLerpTime.y <= m_vFollowLerpTime.x) { + m_vFollowLerpTime.x = 0.f; + XMStoreFloat3(&m_vFollowPos_Src, m_pTransformCom->Get_State(STATE::POSITION)); + XMStoreFloat3(&m_vFollowPos_Dest, m_pFollowTarget->Get_WorldPostion()); + } + } + +} + +void CCamera_Cinematic::Set_Priority(_uint iPriority) +{ + m_iPriority = iPriority; +} + +void CCamera_Cinematic::Set_LookTarget(CGameObject* pTarget) +{ + SAFE_RELEASE(m_pLookTarget); + m_pLookTarget = pTarget; + SAFE_ADDREF(m_pLookTarget); +} + +void CCamera_Cinematic::Set_FollowTarget(CGameObject* pTarget) +{ + SAFE_RELEASE(m_pFollowTarget); + m_pFollowTarget = pTarget; + SAFE_ADDREF(m_pFollowTarget); +} + +void CCamera_Cinematic::Trigger(CTimeSocket& Socket) +{ + SOCKETCONTENTS* pContents = &Socket.m_Contents; + switch (pContents->eTypeFunc) + { + case TIMESOCKET_FUNC::BIND_CAMERA: + m_pGameInstance->Bind_Camera(NEXT_LEVEL, pContents->wstrKeyName, true); + break; + case TIMESOCKET_FUNC::TRANSLATION: + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3((_float3*)&pContents->pxTransform.p), 1.f)); + m_pTransformCom->RotationQ(pContents->pxTransform.q); + Clear_Lerp_Translation(); + break; + case TIMESOCKET_FUNC::TRANSLATION_LERP: + { + Clear_Lerp_Translation(); + Start_Lerp_Translation(pContents->vParam_11.x, pContents->pxTransform); + } break; + case TIMESOCKET_FUNC::LOOK_AT: + { + Set_LookTarget(pContents->pOtherTarget); + }break; + case TIMESOCKET_FUNC::DONT_LOOK_AT: + { + Set_LookTarget(pContents->pOtherTarget); + }break; + case TIMESOCKET_FUNC::ZOOM_IN: + { + Set_Fov(XMConvertToRadians(pContents->vParam_11.x)); + }break; + case TIMESOCKET_FUNC::ZOOM_OUT: + { + Set_Fov(XMConvertToRadians(pContents->vParam_11.x)); + }break; + case TIMESOCKET_FUNC::ZOOM_LERP: + { + Start_Lerp_FovY(pContents->vParam_11.z, { pContents->vParam_11.x, pContents->vParam_11.y }); + Set_Fov(XMConvertToRadians(pContents->vParam_11.x)); + }break; + case TIMESOCKET_FUNC::END_CINEMATIC: + { + m_pGameInstance->Bind_Camera(CURRENT_LEVEL, Socket.m_Contents.wstrKeyName, true); + }break; + default: + break; + } +} + +HRESULT CCamera_Cinematic::Initialize_Prototype() +{ + return S_OK; +} +HRESULT CCamera_Cinematic::Initialize(void* pArg) +{ + + if (FAILED(__super::Initialize(pArg))) { + return E_FAIL; + } + + if (FAILED(Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} +HRESULT CCamera_Cinematic::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} +HRESULT CCamera_Cinematic::Bind_ShaderResources() +{ + return S_OK; +} +void CCamera_Cinematic::Lerp_Translation(_float fTimeDelta) +{ + if (true == m_bLerpTranslation) { + m_vLerpTranslationTimer.x += fTimeDelta; + if (m_vLerpTranslationTimer.y < m_vLerpTranslationTimer.x) { + m_vLerpTranslationTimer.x = m_vLerpTranslationTimer.y; + m_bLerpTranslation = false; + } + _float4x4 ResultMatrix = {}; + CMyTools::MatrixLerp(&m_vLerpTranslationStart, &m_vLerpTranslationEnd, &m_vLerpRotQStart, &m_vLerpRotQEnd, + ResultMatrix, m_vLerpTranslationTimer.x / m_vLerpTranslationTimer.y); + m_pTransformCom->Set_WorldMatrix(ResultMatrix); + } +} +void CCamera_Cinematic::Start_Lerp_Translation(_float fTimeMaximum, PSX::PxTransform pxTransform) +{ + _float3 vTrans = { pxTransform.p.x , pxTransform.p.y, pxTransform.p.z }; + _float4 vRotQ = { pxTransform.q.x, pxTransform.q.y, pxTransform.q.z, pxTransform.q.w }; + Start_Lerp_Translation(fTimeMaximum, vTrans, vRotQ); +} +void CCamera_Cinematic::Start_Lerp_Translation(_float fTimeMaximum, _float3& vTrans, _float4& vRotQ) +{ + m_bLerpTranslation = { fTimeMaximum != 0 }; + m_vLerpTranslationTimer = { 0.f, fTimeMaximum }; + m_pTransformCom->Compress_WorldMatrix(m_vLerpTranslationStart, m_vLerpRotQStart); + m_vLerpTranslationEnd = vTrans; + m_vLerpRotQEnd = vRotQ; +} +void CCamera_Cinematic::Clear_Lerp_Translation() +{ + m_bLerpTranslation = { false }; + m_vLerpTranslationTimer = {}; + m_vLerpTranslationStart = {}; + m_vLerpTranslationEnd = {}; + m_vLerpRotQStart = {}; + m_vLerpRotQEnd = {}; +} +void CCamera_Cinematic::Lerp_FovY(_float fTimeDelta) +{ + if (true == m_bLerpFovY) { + m_vLerpFovYTimer.x += fTimeDelta; + if (m_vLerpFovYTimer.y < m_vLerpFovYTimer.x) { + m_vLerpFovYTimer.x = m_vLerpFovYTimer.y; + m_bLerpFovY = false; + } + Set_Fov(XMConvertToRadians(CMyTools::Lerp_f1D(m_vFovYLerp.x, m_vFovYLerp.y, m_vLerpFovYTimer.x / m_vLerpFovYTimer.y))); + } +} +void CCamera_Cinematic::Start_Lerp_FovY(_float fTimeMaximum, _float2 vRange) +{ + m_bLerpFovY = true; + m_vFovYLerp = { vRange.x, vRange.y }; + m_vLerpFovYTimer = { 0.f, fTimeMaximum }; +} +void CCamera_Cinematic::Clear_Lerp_FovY() +{ + m_bLerpFovY = false; + m_vFovYLerp = { 60.f, 60.f }; + m_vLerpFovYTimer = { 0.f, 0.f }; +} +CCamera_Cinematic* CCamera_Cinematic::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CCamera_Cinematic* pInstance = new CCamera_Cinematic(pDevice, pContext); + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CCamera_Cinematic"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} +CGameObject* CCamera_Cinematic::Clone(void* pArg, CGameObject* pOwner) +{ + CCamera_Cinematic* pInstance = new CCamera_Cinematic(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CCamera_Cinematic"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} +void CCamera_Cinematic::Free() +{ + __super::Free(); +} + +#ifdef _DEBUG + +void CCamera_Cinematic::Describe_Entity() +{ + GUI::Begin("CAMERA", 0, IMGUI_GLOBAL_BEGIN_FLAG); + if (GUI::CollapsingHeader("Camera_Cinematic_Describe")) { + if (GUI::SmallButton("Trigger_RanrokIntro")) { + _string strCutSceneName = "RanrokIntro"; + m_pInfoInstance->Active_Event(strCutSceneName); + } + m_pTransformCom->Describe_Entity(); + GUI::Text("LOOK_SRC %.2f, %.2f, %.2f", m_vLookPos_Src.x, m_vLookPos_Src.y, m_vLookPos_Src.z); + GUI::Text("LOOK_DST %.2f, %.2f, %.2f", m_vLookPos_Dest.x, m_vLookPos_Dest.y, m_vLookPos_Dest.z); + GUI::Text("FOLLOW_SRC %.2f, %.2f, %.2f", m_vFollowPos_Src.x, m_vFollowPos_Src.y, m_vFollowPos_Src.z); + GUI::Text("FOLLOW_DST %.2f, %.2f, %.2f", m_vFollowPos_Dest.x, m_vFollowPos_Dest.y, m_vFollowPos_Dest.z); + + GUI::DragFloat2("VerticalAngle", (_float*)&m_vAccRotDegree_VerticalLocks, 1.f, 0.f, 89.f); + GUI::Checkbox("TransitionLerp", &m_bEnable_TransitionLerp); + if (true == m_bEnable_TransitionLerp) { + GUI::SameLine(); GUI::Text("Translation : %.1f %.1f", m_vTransitionTime.x, m_vTransitionTime.y); + GUI::SliderFloat("TranslationTime", &m_vTransitionTime.y, 0.1f, 3.f, "%.1f"); + } + + GUI::Checkbox("LookLerp", &m_bEnable_LookLerp); + if (true == m_bEnable_LookLerp) { + GUI::SameLine(); GUI::Text("Translation : %.1f %.1f", m_vLookLerpTime.x, m_vLookLerpTime.y); + GUI::SliderFloat("LookTime", &m_vLookLerpTime.y, 0.1f, 3.f, "%.1f"); + } + + GUI::Checkbox("FollowLerp", &m_bEnable_FollowLerp); + if (true == m_bEnable_FollowLerp) { + GUI::SameLine(); GUI::Text("Translation : %.1f %.1f", m_vFollowLerpTime.x, m_vFollowLerpTime.y); + GUI::SliderFloat("FollowTime", &m_vFollowLerpTime.y, 0.1f, 3.f, "%.1f"); + } + + } + GUI::End(); +} + +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Camera_Debug.cpp b/Jusin154_Team3D/Client/Private/Camera_Debug.cpp index 2a7cfea87..78e8930ea 100644 --- a/Jusin154_Team3D/Client/Private/Camera_Debug.cpp +++ b/Jusin154_Team3D/Client/Private/Camera_Debug.cpp @@ -28,9 +28,6 @@ void CCamera_Debug::Priority_Update(_float fTimeDelta) _float3 vCamPos = {}; _float3 vSetPos = {}; XMStoreFloat3(&vCamPos, m_pTransformCom->Get_State(STATE::POSITION)); -#ifdef _DEBUG - GUI::Text("Cam Coord %.2f, %.2f, %.2f", vCamPos.x, vCamPos.y, vCamPos.z); -#endif // _DEBUG if (m_pGameInstance->Key_Up(DIK_GRAVE)) { m_bMovable = !m_bMovable; @@ -198,7 +195,11 @@ void CCamera_Debug::Describe_Entity() GUI::InputFloat3("Pos", (float*)&vPosition); } } - + GUI::End(); + GUI::Begin("CAMERA"); + if (GUI::CollapsingHeader("DebugCamera")){ + m_pTransformCom->Describe_Entity(); + } GUI::End(); } diff --git a/Jusin154_Team3D/Client/Private/Camera_Gaze.cpp b/Jusin154_Team3D/Client/Private/Camera_Gaze.cpp index 5b6d26d31..4dd9f2729 100644 --- a/Jusin154_Team3D/Client/Private/Camera_Gaze.cpp +++ b/Jusin154_Team3D/Client/Private/Camera_Gaze.cpp @@ -128,12 +128,57 @@ void CCamera_Gaze::Toggle_AIPriority() } } +void CCamera_Gaze::Set_LookTarget(CGameObject* pTarget) +{ + SAFE_RELEASE(m_pLookTarget); + m_pLookTarget = pTarget; + SAFE_ADDREF(m_pLookTarget); +} + +void CCamera_Gaze::Set_FollowTarget(CGameObject* pTarget) +{ + SAFE_RELEASE(m_pFollowTarget); + m_pFollowTarget = pTarget; + SAFE_ADDREF(m_pFollowTarget); +} void CCamera_Gaze::Late_Update(_float fTimeDelta) { if (false == m_bActive) { return; } } +void CCamera_Gaze::Trigger(CTimeSocket& Socket) +{ + SOCKETCONTENTS* pContents = &Socket.m_Contents; + switch (pContents->eTypeFunc) + { + case TIMESOCKET_FUNC::TRANSLATION: + + break; + case TIMESOCKET_FUNC::TRANSLATION_LERP: + { + + } break; + case TIMESOCKET_FUNC::SET_PITCHLIMIT: + { + Set_RotDegreeVerticalLock({ pContents->vParam_11.x , pContents->vParam_11.y }); + }break; + case TIMESOCKET_FUNC::ZOOM_IN: + { + Set_Fov(pContents->vParam_11.x); + }break; + case TIMESOCKET_FUNC::ZOOM_OUT: + { + Set_Fov(pContents->vParam_11.x); + }break; + case TIMESOCKET_FUNC::END_CINEMATIC: + { + m_pGameInstance->Bind_Camera(CURRENT_LEVEL, Socket.m_Contents.wstrKeyName, true); + }break; + default: + break; + } +} HRESULT CCamera_Gaze::Render() { return S_OK; diff --git a/Jusin154_Team3D/Client/Private/CutSceneInfo.cpp b/Jusin154_Team3D/Client/Private/CutSceneInfo.cpp index 4ec4f9475..07fc375cc 100644 --- a/Jusin154_Team3D/Client/Private/CutSceneInfo.cpp +++ b/Jusin154_Team3D/Client/Private/CutSceneInfo.cpp @@ -13,21 +13,29 @@ CCutSceneInfo::CCutSceneInfo() void CCutSceneInfo::Update(_float fTimeDelta) { _float fRatio = 0.f; - for (map<_string, TimeLine>::iterator iter = m_funcActiveEvents.begin(); iter != m_funcActiveEvents.end();) { - list* pSockets = &iter->second.m_Sockets; - iter->second.m_vTimer.x += fTimeDelta; - fRatio = CMyTools::Saturate(iter->second.m_vTimer.x / iter->second.m_vTimer.y); - - for (list::iterator socketIter = pSockets->begin(); socketIter == pSockets->end();) { - if (false == (*socketIter)->Trigger(fRatio)) { - socketIter++; - break; + for (map<_string, TimeLine*>::iterator iter = m_funcActiveEvents.begin(); iter != m_funcActiveEvents.end();) { + list* pSockets = &iter->second->m_Sockets; + iter->second->m_vTimer.x += fTimeDelta; + fRatio = CMyTools::Saturate(iter->second->m_vTimer.x / iter->second->m_vTimer.y); + for (list::iterator socketIter = pSockets->begin(); socketIter != pSockets->end();) { + GUI::Begin("CutScene"); + if (GUI::TreeNode((*socketIter)->m_Contents.strEventName.c_str())) { + GUI::Text("fRatio : %.2f", fRatio); + GUI::TreePop(); } - else { + GUI::End(); + if ((*socketIter)->Trigger(fRatio)) + { + SAFE_RELEASE((*socketIter)); socketIter = pSockets->erase(socketIter); } + else + { + break; + } } if (pSockets->empty()) { + Safe_Delete((*iter).second); iter = m_funcActiveEvents.erase(iter); } else { @@ -45,7 +53,7 @@ void CCutSceneInfo::Change_Level() void CCutSceneInfo::Active_Event(_string& strKey) { - map<_string, TimeLine>::iterator iter = m_funcWaitEvents.find(strKey); + map<_string, TimeLine*>::iterator iter = m_funcWaitEvents.find(strKey); if (iter != m_funcWaitEvents.end()) { m_funcActiveEvents.emplace(iter->first, iter->second); m_funcWaitEvents.erase(iter); @@ -54,41 +62,22 @@ void CCutSceneInfo::Active_Event(_string& strKey) HRESULT CCutSceneInfo::DeActive_ActiveEvent(_string& strKey) { - map<_string, TimeLine>::iterator iter = m_funcActiveEvents.find(strKey); + map<_string, TimeLine*>::iterator iter = m_funcActiveEvents.find(strKey); if (iter != m_funcActiveEvents.end()) { - for (list::iterator socketIter = (*iter).second.m_Sockets.begin(); - socketIter == (*iter).second.m_Sockets.end(); ++iter) { + for (list::iterator socketIter = (*iter).second->m_Sockets.begin(); + socketIter != (*iter).second->m_Sockets.end(); ++socketIter) { SAFE_RELEASE((*socketIter)); } + Safe_Delete((*iter).second); m_funcActiveEvents.erase(iter); } return S_OK; } -void CCutSceneInfo::Load_Events(LEVEL eLevel) +void CCutSceneInfo::Load_Events(pair<_string, TimeLine*>& pairTimeLine) { - switch (eLevel) - { - case Client::LEVEL::STATIC: - break; - case Client::LEVEL::LOADING: - break; - case Client::LEVEL::LOGO: - break; - case Client::LEVEL::INTRO: - break; - case Client::LEVEL::GAMEPLAY: - break; - case Client::LEVEL::FIELD: - break; - case Client::LEVEL::RESTART: - break; - case Client::LEVEL::END: - break; - default: - break; - } + m_funcWaitEvents.emplace(pairTimeLine); } HRESULT CCutSceneInfo::Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex) @@ -109,15 +98,16 @@ HRESULT CCutSceneInfo::Clear_ActiveEvents() { return Clear_Events(m_funcActiveEvents); } -HRESULT CCutSceneInfo::Clear_Events(map<_string, TimeLine>& Events) +HRESULT CCutSceneInfo::Clear_Events(map<_string, TimeLine*>& Events) { - map<_string, TimeLine>::iterator iter = Events.begin(); + map<_string, TimeLine*>::iterator iter = Events.begin(); for (; iter != Events.end();) { - for (list::iterator socketIter = (*iter).second.m_Sockets.begin(); - socketIter == (*iter).second.m_Sockets.end(); ++iter) { + for (list::iterator socketIter = (*iter).second->m_Sockets.begin(); + socketIter != (*iter).second->m_Sockets.end(); ++socketIter) { SAFE_RELEASE((*socketIter)); } + Safe_Delete((*iter).second); iter = Events.erase(iter); } return S_OK; diff --git a/Jusin154_Team3D/Client/Private/InfoInstance.cpp b/Jusin154_Team3D/Client/Private/InfoInstance.cpp index 462cfdbde..a4a85b31a 100644 --- a/Jusin154_Team3D/Client/Private/InfoInstance.cpp +++ b/Jusin154_Team3D/Client/Private/InfoInstance.cpp @@ -5,6 +5,7 @@ #include "MonsterInfo.h" #include "PlayerInfo.h" #include "InteractiveInfo.h" +#include "CutSceneInfo.h" #include "EffectInfo.h" #include "Skill_Data.h" #include "Quest_Data.h" @@ -29,6 +30,7 @@ void CInfoInstance::Update(_float fTimeDelta) m_pSkillInfo->Update(fTimeDelta); m_pInteractiveInfo->Update(fTimeDelta); m_pEffectInfo->Update(fTimeDelta); + m_pCutSceneInfo->Update(fTimeDelta); } void CInfoInstance::Change_Level() @@ -39,6 +41,8 @@ void CInfoInstance::Change_Level() m_pSkillInfo->Change_Level(); m_pInteractiveInfo->Change_Level(); m_pEffectInfo->Change_Level(); +// UI_Event.clear(); + m_pCutSceneInfo->Change_Level(); } CStat* CInfoInstance::Get_PlayerStatPtr() @@ -419,6 +423,21 @@ _float CInfoInstance::Get_Broom_Booster_Timer() return m_fBroom_Booster; } +void CInfoInstance::Active_Event(_string& strKey) +{ + m_pCutSceneInfo->Active_Event(strKey); +} + +HRESULT CInfoInstance::DeActive_ActiveEvent(_string& strKey) +{ + return m_pCutSceneInfo->DeActive_ActiveEvent(strKey); +} + +void CInfoInstance::Load_Events(pair<_string, TimeLine*>& pairTimeLine) +{ + m_pCutSceneInfo->Load_Events(pairTimeLine); +} + #pragma endregion LEVEL CInfoInstance::Get_RestartLevel() { @@ -485,6 +504,11 @@ HRESULT CInfoInstance::Initialize_Information(ID3D11Device* pDevice, ID3D11Devic if (nullptr == m_pDialogue_Data) { return E_FAIL; } + + m_pCutSceneInfo = CCutSceneInfo::Create(pDevice, pContext); + if (nullptr == m_pCutSceneInfo) { + return E_FAIL; + } return S_OK; } @@ -567,6 +591,7 @@ void CInfoInstance::Release_Information() SAFE_RELEASE(m_pMonsterInfo); SAFE_RELEASE(m_pSkillInfo); SAFE_RELEASE(m_pQuestInfo); + SAFE_RELEASE(m_pCutSceneInfo); SAFE_RELEASE(m_pInteractiveInfo); SAFE_RELEASE(m_pEffectInfo); SAFE_RELEASE(m_pDevice); diff --git a/Jusin154_Team3D/Client/Private/Level_Field.cpp b/Jusin154_Team3D/Client/Private/Level_Field.cpp index e2a19c5eb..3c61e99f5 100644 --- a/Jusin154_Team3D/Client/Private/Level_Field.cpp +++ b/Jusin154_Team3D/Client/Private/Level_Field.cpp @@ -7,6 +7,8 @@ #include "EffectPool.h" #include "Light_Main.h" #include "Layer.h" +#include "Camera_Cinematic.h" +#include "TimeSocket.h" #include "Camera_Debug.h" #include "Terrain.h" #include "SkyBox.h" @@ -60,6 +62,9 @@ HRESULT CLevel_Field::Initialize(void* pArg) if (FAILED(Ready_Layer_Monster())) { return E_FAIL; } + if (FAILED(Ready_Layer_CutScene())) { + return E_FAIL; + } m_bLevel = true; m_pInfoInstance->Event_CallBack(TEXT("UIManagerFadeIn")); @@ -75,6 +80,11 @@ HRESULT CLevel_Field::Initialize() void CLevel_Field::Update(_float fTimeDelta) { +#ifdef _DEBUG + Describe_Entity(); +#endif // _DEBUG + + if (m_pGameInstance->Key_Up(DIK_F1)) { //m_pGameInstance->Set_LevelToChange(); @@ -222,9 +232,30 @@ HRESULT CLevel_Field::Ready_Camera() if (FAILED(m_pGameInstance->Bind_Camera(NEXT_LEVEL, CAMERA_DEBUG, true))) { return E_FAIL; } - #endif // _DEBUG + { + CCamera_Cinematic::Camera_Cinematic_DESC Camera_Desc{}; + Camera_Desc.fSpeedPerSec = 5.f; + Camera_Desc.fRotationPerSec = XMConvertToRadians(90.0f); + Camera_Desc.fFovy = XMConvertToRadians(60.0f); + Camera_Desc.fNear = 0.1f; + Camera_Desc.fFar = 500.f; + Camera_Desc.pCameraKey = CAMERA_CINEMATIC; + Camera_Desc.iPriority = 65; + Camera_Desc.bEnableTransitionLerp = true; + Camera_Desc.bEnableLookLerp = true; + Camera_Desc.bEnableFollowLerp = true; + Camera_Desc.vTransitionTime.y = 1.f; + Camera_Desc.pFollowTarget = { nullptr }; + Camera_Desc.pLookTarget = { nullptr }; + + CCamera_Cinematic* pCamera = { nullptr }; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &Camera_Desc, nullptr, &pCamera))) { + return E_FAIL; + } + m_pGameInstance->Add_Camera(NEXT_LEVEL, pCamera, CAMERA_CINEMATIC); + } return S_OK; } @@ -309,6 +340,27 @@ HRESULT CLevel_Field::Reday_Layer_EffectPool() return S_OK; } +HRESULT CLevel_Field::Ready_Layer_CutScene() +{ + CMonster* pMonster = { nullptr }; + CCamera* pCamera = { nullptr }; + { + CLayer* pLayer = m_pGameInstance->Get_Layer(NEXT_LEVEL, LAYER_MONSTER); + if (nullptr != pLayer) { + pMonster = pLayer->Get_Object(); + } + } + { + pCamera = m_pGameInstance->Get_Camera(NEXT_LEVEL, CAMERA_CINEMATIC); + } + + if (nullptr == pMonster || nullptr == pCamera) { + return E_FAIL; + } + Load_CutSceneXML("../Bin/Resources/Data/CutScene/RanrokCutScene.xml", pCamera, pMonster); + return S_OK; +} + pair> CLevel_Field::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID, void* pArg) { CLevel_Field* pInstance = new CLevel_Field(pDevice, pContext, eLevelID); @@ -328,3 +380,271 @@ void CLevel_Field::Free() SAFE_RELEASE(m_pInfoInstance); } + +static _bool IsTrueText(const char* text) +{ + if (!text){ return false; } + return (strcmp(text, "true") == 0) || (strcmp(text, "1") == 0); +} + +static _bool TryReadFloatAttr(tinyxml2::XMLElement* element, const _char* attrName, _float& outValue) +{ + if (!element || !attrName) { + return false; + } + + const _char* text = element->Attribute(attrName); + if (!text || text[0] == '\0'){ + return false; + } + + return (element->QueryFloatAttribute(attrName, &outValue) == tinyxml2::XML_SUCCESS); +} + +static _bool TryReadUIntAttr(tinyxml2::XMLElement* element, const _char* attrName, _uint& outValue) +{ + if (!element || !attrName) return false; + + const _char* text = element->Attribute(attrName); + if (!text || text[0] == '\0') { + return false; + } + + return (element->QueryUnsignedAttribute(attrName, &outValue) == tinyxml2::XML_SUCCESS); +} + +static void ReadPxTransform(tinyxml2::XMLElement* transformNode, PSX::PxTransform& outTransform) +{ + outTransform.p = PSX::PxVec3(0.f, 0.f, 0.f); + outTransform.q = PSX::PxQuat(0.f, 0.f, 0.f, 1.f); + + if (!transformNode) { return; } + + tinyxml2::XMLElement* rotQNode = transformNode->FirstChildElement("RotQ"); + tinyxml2::XMLElement* transNode = transformNode->FirstChildElement("Trans"); + if (!rotQNode || !transNode) { + return; + } + + TryReadFloatAttr(rotQNode, "X", outTransform.q.x); + TryReadFloatAttr(rotQNode, "Y", outTransform.q.y); + TryReadFloatAttr(rotQNode, "Z", outTransform.q.z); + TryReadFloatAttr(rotQNode, "W", outTransform.q.w); + + TryReadFloatAttr(transNode, "X", outTransform.p.x); + TryReadFloatAttr(transNode, "Y", outTransform.p.y); + TryReadFloatAttr(transNode, "Z", outTransform.p.z); +} + +static void ReadFlags16(tinyxml2::XMLElement* flagsNode, _boolean& outFlags) +{ + memset(&outFlags, 0, sizeof(_boolean)); + + if (!flagsNode) { + return; + } + + for (tinyxml2::XMLElement* flagNode = flagsNode->FirstChildElement("Flag"); + flagNode; + flagNode = flagNode->NextSiblingElement("Flag")) + { + int flagId = -1; + if (flagNode->QueryIntAttribute("id", &flagId) != tinyxml2::XML_SUCCESS) { + continue; + } + + if (flagId < 0 || flagId >= 16) { + continue; + } + + outFlags.b[flagId] = IsTrueText(flagNode->GetText()); + } +} + +static void ReadUInt4(tinyxml2::XMLElement* param10Node, _uint4& outValue) +{ + outValue = {}; + + if (!param10Node) { + return; + } + tinyxml2::XMLElement* uintNode = param10Node->FirstChildElement("uint"); + if (!uintNode) return; + + _uint temp = 0; + if (TryReadUIntAttr(uintNode, "X", temp)) outValue.x = temp; + if (TryReadUIntAttr(uintNode, "Y", temp)) outValue.y = temp; + if (TryReadUIntAttr(uintNode, "Z", temp)) outValue.z = temp; + if (TryReadUIntAttr(uintNode, "W", temp)) outValue.w = temp; +} + +static void ReadFloat4(tinyxml2::XMLElement* param11Node, _float4& outValue) +{ + outValue = {}; + + if (!param11Node) { + return; + } + tinyxml2::XMLElement* floatNode = param11Node->FirstChildElement("float"); + if (!floatNode) { + return; + } + + TryReadFloatAttr(floatNode, "X", outValue.x); + TryReadFloatAttr(floatNode, "Y", outValue.y); + TryReadFloatAttr(floatNode, "Z", outValue.z); + TryReadFloatAttr(floatNode, "W", outValue.w); +} + +void CLevel_Field::Load_CutSceneXML(const string& path, CCamera* pCamera, CMonster* pMonster) +{ + tinyxml2::XMLDocument doc; + if (doc.LoadFile(path.c_str()) != tinyxml2::XML_SUCCESS){ + return; + } + + TimeLine* pTimeLine = new TimeLine(); + tinyxml2::XMLElement* pContentsNode = doc.FirstChildElement("RanrokIntro"); + if (!pContentsNode){ + return; + } + + pTimeLine->m_vTimer.y = 0.f; + pContentsNode->QueryFloatAttribute("fDuration", &pTimeLine->m_vTimer.y); + + pTimeLine->m_Sockets.clear(); + + for (tinyxml2::XMLElement* pSocketNode = pContentsNode->FirstChildElement("Socket"); + pSocketNode; pSocketNode = pSocketNode->NextSiblingElement("Socket")) + { + SOCKETCONTENTS SocketContents = {}; + + SocketContents .fRatio = 0.f; + _int fStartPosition = 0; + pSocketNode->QueryIntAttribute("fStartPosition", &fStartPosition); + SocketContents.fRatio = CMyTools::Saturate(fStartPosition / pTimeLine->m_vTimer.y); + // Info + tinyxml2::XMLElement* pInfoNode = pSocketNode->FirstChildElement("Info"); + if (pInfoNode != nullptr) + { + const _char* pEventNameText = pInfoNode->Attribute("strEventName"); + SocketContents.strEventName = pEventNameText ? pEventNameText : ""; + + SocketContents.eTypeParam = TIMESOCKET_PARAM::END; + if (const _char* pTypeText = pInfoNode->Attribute("eTypeParam")) + { + CTimeSocket::TryParse_TimeSocketParam(string_view(pTypeText), SocketContents.eTypeParam); + } + + SocketContents.eTypeFunc = TIMESOCKET_FUNC::END; + if (const _char* pFuncText = pInfoNode->Attribute("eTypeFunc")) + { + CTimeSocket::TryParse_TimeSocketFunc(string_view(pFuncText), SocketContents.eTypeFunc); + } + + SocketContents.pEventTarget = nullptr; + SocketContents.funcEvent = nullptr; + + if (const _char* pTargetText = pInfoNode->Attribute("pTarget")) + { + if (strcmp(pTargetText, "CAMERA_CINEMATIC") == 0) + { + CCamera* pEventTarget = pCamera; + SocketContents.pEventTarget = pEventTarget; + SocketContents.funcEvent = [pEventTarget](CTimeSocket& Socket) { pEventTarget->Trigger(Socket); }; + } + else if (strcmp(pTargetText, "CAMERA_SHOULDER") == 0) + { + CCamera* pEventTarget = m_pGameInstance->Get_Camera(NEXT_LEVEL, CAMERA_SHOULDER); + SocketContents.pEventTarget = pEventTarget; + SocketContents.funcEvent = [pEventTarget](CTimeSocket& Socket) { pEventTarget->Trigger(Socket); }; + } + else if (strcmp(pTargetText, "ACTOR_PLAYER") == 0) + { + CPlayer* pEventTarget = m_pGameInstance->Get_Layer(NEXT_LEVEL, LAYER_PLAYER)->Get_Object(); + SocketContents.pEventTarget = pEventTarget; + SocketContents.funcEvent = [pEventTarget](CTimeSocket& Socket) { pEventTarget->Trigger(Socket); }; + } + } + } + + // -------- Param_0 ---------- + tinyxml2::XMLElement* pParam0Node = pSocketNode->FirstChildElement("Param_0"); + if (nullptr != pParam0Node) + { + switch (SocketContents.eTypeParam) + { + case TIMESOCKET_PARAM::TARGET: + { + tinyxml2::XMLElement* pOtherTargetNode = pParam0Node->FirstChildElement("OtherTarget"); + if (!pOtherTargetNode) break; + + const _char* pLayerNameText = pOtherTargetNode->Attribute("Layer"); + const _char* pTypeIdText = pOtherTargetNode->Attribute("TypeID"); + + if (!pLayerNameText || !pTypeIdText) break; + if (pLayerNameText[0] == '\0' || pTypeIdText[0] == '\0') break; + + SocketContents.wstrLayerName = CMyTools::ToWstring(pLayerNameText); + SocketContents.wstrKeyName = CMyTools::ToWstring(pTypeIdText); + + if (string_view(pTypeIdText) == "Ranrok") + { + SocketContents.pOtherTarget = + m_pGameInstance->Get_Layer(NEXT_LEVEL, SocketContents.wstrLayerName)->Get_Object(); + } + else if (string_view(pTypeIdText) == "CAMERA_CINEMATIC") + { + SocketContents.pOtherTarget = pCamera; + } + else if (string_view(pTypeIdText) == "CAMERA_SHOULDER") + { + SocketContents.pOtherTarget = m_pGameInstance->Get_Camera(NEXT_LEVEL, CAMERA_SHOULDER); + } + + break; + } + + case TIMESOCKET_PARAM::TRANSFORM: + { + tinyxml2::XMLElement* pTransformNode = pParam0Node->FirstChildElement("Transform"); + ReadPxTransform(pTransformNode, SocketContents.pxTransform); + break; + } + case TIMESOCKET_PARAM::END: + default: + break; + } + } + + // -------- vFlags / Param_10 / Param_11 ---------- + ReadFlags16(pSocketNode->FirstChildElement("vFlags"), SocketContents.vFlags); + ReadUInt4(pSocketNode->FirstChildElement("Param_10"), SocketContents.vParam_10); + ReadFloat4(pSocketNode->FirstChildElement("Param_11"), SocketContents.vParam_11); + CTimeSocket* pSocket = CTimeSocket::Create(&SocketContents); + if (!pSocket) { + continue; + } + pTimeLine->m_Sockets.push_back(pSocket); + } + pTimeLine->m_Sockets.sort([](CTimeSocket* a, CTimeSocket* b) { + return a->m_Contents.fRatio < b->m_Contents.fRatio; + }); + pair<_string, TimeLine*> pairResult = { _string(pContentsNode->Name()), pTimeLine }; + m_pInfoInstance->Load_Events(pairResult); +} + +#ifdef _DEBUG +void CLevel_Field::Describe_Entity() +{ + GUI::Begin("CutScene"); + if (GUI::Button("ReadyCutScene")) { + Ready_Layer_CutScene(); + } + if (GUI::Button("DeActiveCutScene")) { + _string strDeActiveEvent = "RanrokIntro"; + m_pInfoInstance->DeActive_ActiveEvent(strDeActiveEvent); + } + GUI::End(); +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index 2582c1206..7be62d2ef 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -312,7 +312,7 @@ HRESULT CLevel_GamePlay::Ready_Background() #ifdef 기무리 isReady_Background = true; isReady_Hogsmeade = true; - isReady_Hogwart = false; + isReady_Hogwart = true; #endif // #ifdef 나 isReady_Background = true; @@ -947,7 +947,6 @@ HRESULT CLevel_GamePlay::Ready_Layer_Player(const _wstring& strLayerTag) } } } - CHuman_Duelist::DUELISTDESC DuelistDesc = {}; DuelistDesc.vPos = _float4(1003.f, 5.f, 1005.f, 1.f); DuelistDesc.vRotQ = _float4(0.f, 0.f, 0.f, 1.f); diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index 067cb1cdc..01de241cd 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -10,6 +10,7 @@ #include "Broom.h" #include "Camera_Gaze.h" +#include "Camera_Cinematic.h" #include "CamPosition_Arm.h" #include "CamPosition_Shoulder.h" #include "CamPosition_Socket.h" @@ -424,8 +425,8 @@ HRESULT CLoader::Loading_For_GamePlay() #endif // #ifdef 기무리 isLoad_Background = true; - isLoad_Hogwart = false; - isLoad_UI_SEQUANTIAL = false; + isLoad_Hogwart = true; + isLoad_UI_SEQUANTIAL = true; isLoad_NPC = true; isLoad_Monster = true; #endif // @@ -3658,6 +3659,10 @@ HRESULT CLoader::Loading_For_GamePlay() if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCamera_Gaze::Create(m_pDevice, m_pContext)))) return E_FAIL; + /* For.Prototype_GameObject_Camera_Cinematic */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCamera_Cinematic::Create(m_pDevice, m_pContext)))) + return E_FAIL; + /* For.Prototype_GameObject_CamPosition_Player */ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCamPosition_Socket::Create(m_pDevice, m_pContext)))) return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index 2235bf758..7052c1074 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -14,6 +14,7 @@ #include "Layer.h" #include "MapElement_Interactable.h" #include "Monster.h" +#include "TimeSocket.h" #include "PlayerRobe.h" #include "RaceRing.h" #include "Wand.h" @@ -474,6 +475,33 @@ void CPlayer::OnHit(CGameObject* pOther, CGameObject* pCaller) { } +void CPlayer::Trigger(CTimeSocket& Socket) +{ + SOCKETCONTENTS* pContents = &Socket.m_Contents; + switch (pContents->eTypeFunc) + { + case TIMESOCKET_FUNC::TRANSLATION: + { + _vector vNewPos = XMVectorSetW(XMLoadFloat3((_float3*)&pContents->pxTransform.p), 1.f); + m_pTransformCom->Set_State(STATE::POSITION, vNewPos); + m_pCharacter_Controller->Set_Position(vNewPos); + m_pTransformCom->RotationQ(pContents->pxTransform.q); + m_pTransformCom->RewindMomentum(); + } + break; + case TIMESOCKET_FUNC::TRANSLATION_LERP: + { + + } break; + case TIMESOCKET_FUNC::SET_ANIMSTATE: + { + + } break; + default: + break; + } +} + void CPlayer::Start_CameraShake(_float fTime, _float fIntense) { m_vCameraShakeTimer.x = 0.f; diff --git a/Jusin154_Team3D/Client/Private/Ranrok.cpp b/Jusin154_Team3D/Client/Private/Ranrok.cpp index 3f06fa38a..36f46dcac 100644 --- a/Jusin154_Team3D/Client/Private/Ranrok.cpp +++ b/Jusin154_Team3D/Client/Private/Ranrok.cpp @@ -10,6 +10,8 @@ #include "Layer.h" #include "TrailObject.h" #include "MapElement_Interactable.h" +#include "TimeSocket.h" +#include "Layer.h" #pragma region STATE @@ -315,6 +317,32 @@ HRESULT CRanrok::Render_Shadow(SHADOW eType) return S_OK; } +void CRanrok::Trigger(CTimeSocket& Socket) +{ + SOCKETCONTENTS* pContents = &Socket.m_Contents; + switch (pContents->eTypeFunc) + { + case TIMESOCKET_FUNC::TRANSLATION: + { + + }break; + case TIMESOCKET_FUNC::TRANSLATION_LERP: + { + + }break; + case TIMESOCKET_FUNC::SET_ANIMSTATE: + { + //m_pFSM->Set_State(FSMSTATE::CUTSCENE); + }break; + case TIMESOCKET_FUNC::SET_FSMSTATE: + { + //m_pModelCom->Set_AnimationIndex(); + }break; + default: + break; + } +} + HRESULT CRanrok::Render_MotionTrail(ID3D11ShaderResourceView* pSRV) { for (_uint i = ENUM_CLASS(RANROK_MESH_ORDER::WINGS); i < ENUM_CLASS(RANROK_MESH_ORDER::END); ++i) diff --git a/Jusin154_Team3D/Client/Private/Ride_Panel.cpp b/Jusin154_Team3D/Client/Private/Ride_Panel.cpp index 9c7a6276c..1840a9252 100644 --- a/Jusin154_Team3D/Client/Private/Ride_Panel.cpp +++ b/Jusin154_Team3D/Client/Private/Ride_Panel.cpp @@ -126,7 +126,7 @@ void CRide_Panel::Update(_float fTimeDelta) if (m_bHover == true) { - Start_Lerp(fTimeDelta); + Start_Lerp_Translation(fTimeDelta); } else { diff --git a/Jusin154_Team3D/Client/Private/SpellLearn_ChaserPointer.cpp b/Jusin154_Team3D/Client/Private/SpellLearn_ChaserPointer.cpp index 05a2bcc0a..d8cc07aa5 100644 --- a/Jusin154_Team3D/Client/Private/SpellLearn_ChaserPointer.cpp +++ b/Jusin154_Team3D/Client/Private/SpellLearn_ChaserPointer.cpp @@ -167,7 +167,7 @@ void CSpellLearn_ChaserPointer::Line(_float fTime) { m_vLerp_Position = m_MoveLine[m_iCurrentLine]; - if (Start_Lerp(fTime) == true) + if (Start_Lerp_Translation(fTime) == true) { if (m_iCurrentLine < m_iLineIndex - 1) { diff --git a/Jusin154_Team3D/Client/Private/SpellLearn_Overlay.cpp b/Jusin154_Team3D/Client/Private/SpellLearn_Overlay.cpp index bff6981fc..02cb8fc25 100644 --- a/Jusin154_Team3D/Client/Private/SpellLearn_Overlay.cpp +++ b/Jusin154_Team3D/Client/Private/SpellLearn_Overlay.cpp @@ -127,7 +127,7 @@ void CSpellLearn_Overlay::Update(_float fTimeDelta) if (m_fSizeUp == true) { - if (Start_Lerp(fTimeDelta * m_fTimeMult * m_fMoveSpeed) == true) + if (Start_Lerp_Translation(fTimeDelta * m_fTimeMult * m_fMoveSpeed) == true) { m_fSizeUp = false; } diff --git a/Jusin154_Team3D/Client/Private/SpellLearn_Slot.cpp b/Jusin154_Team3D/Client/Private/SpellLearn_Slot.cpp index 5fcebb92a..db036793d 100644 --- a/Jusin154_Team3D/Client/Private/SpellLearn_Slot.cpp +++ b/Jusin154_Team3D/Client/Private/SpellLearn_Slot.cpp @@ -97,7 +97,7 @@ void CSpellLearn_Slot::Update(_float fTimeDelta) if (m_fSizeUp == true) { - if (Start_Lerp(fTimeDelta * m_fTimeMult * m_fMoveSpeed) == true) + if (Start_Lerp_Translation(fTimeDelta * m_fTimeMult * m_fMoveSpeed) == true) { m_fSizeUp = false; } diff --git a/Jusin154_Team3D/Client/Private/TimeSocket.cpp b/Jusin154_Team3D/Client/Private/TimeSocket.cpp deleted file mode 100644 index adf5699fd..000000000 --- a/Jusin154_Team3D/Client/Private/TimeSocket.cpp +++ /dev/null @@ -1,78 +0,0 @@ -#include "pch.h" -#include "TimeSocket.h" -#include "GameObject.h" - -CTimeSocket::CTimeSocket() -{ -} - -_bool CTimeSocket::Trigger(_float fRatio) -{ - _bool bResult = false; - if (m_fRatio <= fRatio) { - bResult = true; - m_funcEvent(*this); - - Finalize(); - } - - return bResult; -} - -HRESULT CTimeSocket::Initialize(CGameObject* pTarget, _string& strTag) -{ - m_pEventTarget = pTarget; - SAFE_ADDREF(m_pEventTarget); - m_strEventName = strTag; - m_eTypeParam = TIMESOCKET_PARAM::END; - return S_OK; -} - -HRESULT CTimeSocket::Initialize(CGameObject* pTarget, _string& strTag, PSX::PxTransform& pxTransform) -{ - m_pEventTarget = pTarget; - SAFE_ADDREF(m_pEventTarget); - m_strEventName = strTag; - m_pxTransform = pxTransform; - m_eTypeParam = TIMESOCKET_PARAM::TRANSFORM; - return S_OK; -} - -HRESULT CTimeSocket::Initialize(CGameObject* pTarget, _string& strTag, CGameObject* pOther) -{ - m_pEventTarget = pTarget; - SAFE_ADDREF(m_pEventTarget); - m_strEventName = strTag; - m_pOtherTarget = pOther; - SAFE_ADDREF(m_pOtherTarget); - m_eTypeParam = TIMESOCKET_PARAM::TARGET; - return S_OK; -} - -void CTimeSocket::Finalize() -{ - switch (m_eTypeParam) - { - case TIMESOCKET_PARAM::TARGET: - SAFE_RELEASE(m_pOtherTarget); - break; - case TIMESOCKET_PARAM::TRANSFORM: - m_pxTransform = {}; - break; - default: - break; - } - SAFE_RELEASE(m_pEventTarget); -} - -CTimeSocket* CTimeSocket::Create() -{ - return new CTimeSocket(); -} - -void CTimeSocket::Free() -{ - __super::Free(); - - Finalize(); -} diff --git a/Jusin154_Team3D/Client/Public/Camera_Cinematic.h b/Jusin154_Team3D/Client/Public/Camera_Cinematic.h new file mode 100644 index 000000000..15d4153ca --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Camera_Cinematic.h @@ -0,0 +1,76 @@ +#pragma once + +#include "Client_Define.h" +#include "Camera.h" + +NS_BEGIN(Client) + +class CCamera_Cinematic final : public CCamera +{ +public: + typedef struct tagCamera_Cinematic : public CCamera::CAMERA_DESC + { + }Camera_Cinematic_DESC; +private: + CCamera_Cinematic(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CCamera_Cinematic(const CCamera_Cinematic& rhs); + virtual ~CCamera_Cinematic() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + virtual void Trigger(CTimeSocket& Socket)override; + +public: + void Update_LerpTimer(_float fTimeDelta); + void Set_Priority(_uint iPriority); + void Set_LookTarget(CGameObject* pTarget); + void Set_FollowTarget(CGameObject* pTarget); + + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + HRESULT Bind_ShaderResources() override; + + void Lerp_Translation(_float fTimeDelta); + void Start_Lerp_Translation(_float fTimeMaximum, PSX::PxTransform pxTransform); + void Start_Lerp_Translation(_float fTimeMaximum, _float3& vTrans, _float4& vRotQ); + void Clear_Lerp_Translation(); + + + void Lerp_FovY(_float fTimeDelta); + void Start_Lerp_FovY(_float fTimeMaximum, _float2 vRange); + void Clear_Lerp_FovY(); + +private: + CInfoInstance* m_pInfoInstance = { nullptr }; + + _bool m_bLerpTranslation = { false }; + _float2 m_vLerpTranslationTimer = {}; + + _float3 m_vLerpTranslationStart = {}; + _float3 m_vLerpTranslationEnd = {}; + _float4 m_vLerpRotQStart = {}; + _float4 m_vLerpRotQEnd = {}; + + _bool m_bLerpFovY = { false }; + _float2 m_vFovYLerp = { 60.f, 60.f }; + _float2 m_vLerpFovYTimer = { }; + +public: + static CCamera_Cinematic* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, CGameObject* pOwner) override; + virtual void Free() override; + + +#ifdef _DEBUG + void Describe_Entity() override; + +#endif // _DEBUG +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Camera_Gaze.h b/Jusin154_Team3D/Client/Public/Camera_Gaze.h index e1f890778..3c0ea2ae3 100644 --- a/Jusin154_Team3D/Client/Public/Camera_Gaze.h +++ b/Jusin154_Team3D/Client/Public/Camera_Gaze.h @@ -2,6 +2,7 @@ #include "Client_Define.h" #include "Camera.h" +#include "TimeSocket.h" NS_BEGIN(Client) @@ -19,14 +20,17 @@ class CCamera_Gaze final : public CCamera public: virtual void Priority_Update(_float fTimeDelta) override; virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual void Trigger(class CTimeSocket& Socket)override; + virtual HRESULT Render() override; void Update_LerpTimer(_float fTimeDelta); void Enable_FollowLerp(); void Enable_LookLerp(); - void Sync_Follow(_bool bSink); + void Sync_Follow(_bool bSync); void Toggle_Priority(); void Toggle_AIPriority(); - virtual void Late_Update(_float fTimeDelta) override; - virtual HRESULT Render() override; + void Set_LookTarget(CGameObject* pTarget); + void Set_FollowTarget(CGameObject* pTarget); private: virtual HRESULT Initialize_Prototype() override; @@ -36,7 +40,7 @@ class CCamera_Gaze final : public CCamera _bool m_bSyncFollow = { false }; private: CInfoInstance* m_pInfoInstance = { nullptr }; - + public: static CCamera_Gaze* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Client/Public/Client_Macro.h b/Jusin154_Team3D/Client/Public/Client_Macro.h index eff67e7d3..d3fde4fa2 100644 --- a/Jusin154_Team3D/Client/Public/Client_Macro.h +++ b/Jusin154_Team3D/Client/Public/Client_Macro.h @@ -34,6 +34,7 @@ namespace Client { #define CAMERA_SHOULDER TEXT("CAMERA_SHOULDER") #define CAMERA_AI TEXT("CAMERA_AI") #define CAMERA_MODEL TEXT("CAMERA_MODEL") +#define CAMERA_CINEMATIC TEXT("CAMERA_CINEMATIC") #pragma endregion #pragma region COMPONENT diff --git a/Jusin154_Team3D/Client/Public/Client_Struct.h b/Jusin154_Team3D/Client/Public/Client_Struct.h index ce5a47cbf..6aeeeb7ed 100644 --- a/Jusin154_Team3D/Client/Public/Client_Struct.h +++ b/Jusin154_Team3D/Client/Public/Client_Struct.h @@ -1,41 +1,41 @@ #pragma once NS_BEGIN(Engine) -class CModel; -class CRigidBody_Static; -class CUnit; + class CModel; + class CRigidBody_Static; + class CUnit; + class CTimeSocket; NS_END -namespace Client +NS_BEGIN(Client) +typedef struct tagFolderLoad { + _wstring pModelTag; + CModel* pLoadedModel; + filesystem::path pathModel; + + _bool bLoadTags; + vector<_wstring> pRigidBodyTags; + vector LoadedRigidBody; +}FOLDER_LOAD; + +typedef struct tagSpellInfo { - typedef struct tagFolderLoad { - _wstring pModelTag; - CModel* pLoadedModel; - filesystem::path pathModel; - - _bool bLoadTags; - vector<_wstring> pRigidBodyTags; - vector LoadedRigidBody; - }FOLDER_LOAD; - - typedef struct tagSpellInfo - { - _int iSpell_ID{}; - _wstring pSpell_Name; - _wstring pImage_Name; - _int iSpell_Type{}; - _wstring pType_Name; - _int iSkill_Type{}; - _float fSpell_Damage{}; - _float fSpell_CoolTime{}; - _float fDuration{}; - _int iAnimNum{}; - _wstring pSpellInfo; - _bool bSpell_Lock = false; - _bool bEquip_Spell = false; - _bool bUse_Skill = false; - _float fPreview{}; - _float fVidio{}; - }SPELL_INFO; + _int iSpell_ID{}; + _wstring pSpell_Name; + _wstring pImage_Name; + _int iSpell_Type{}; + _wstring pType_Name; + _int iSkill_Type{}; + _float fSpell_Damage{}; + _float fSpell_CoolTime{}; + _float fDuration{}; + _int iAnimNum{}; + _wstring pSpellInfo; + _bool bSpell_Lock = false; + _bool bEquip_Spell = false; + _bool bUse_Skill = false; + _float fPreview{}; + _float fVidio{}; +}SPELL_INFO; typedef struct DialogueChoice { @@ -99,191 +99,191 @@ namespace Client _int iGold{}; }UNITINFO; - typedef struct tagDamageInfo - { - _float4 vTarget_Pos{}; - _float fDamage{}; - DAMAGE_TYPE eType = DAMAGE_TYPE::NOMAL; - }DAMAGE_INFO; +typedef struct tagDamageInfo +{ + _float4 vTarget_Pos{}; + _float fDamage{}; + DAMAGE_TYPE eType = DAMAGE_TYPE::NOMAL; +}DAMAGE_INFO; - typedef struct tagObjectiveInfo - { - _bool bClear{}; - _int iTargetID{}; - _int iRequiredCount{}; - _int iCurrentCount{}; - }OBJECTIVEINFO; +typedef struct tagObjectiveInfo +{ + _bool bClear{}; + _int iTargetID{}; + _int iRequiredCount{}; + _int iCurrentCount{}; +}OBJECTIVEINFO; - typedef struct tagRewardsInfo - { - _int iRewardType{}; - _int iRewardID{}; - }REWARDSINFO; +typedef struct tagRewardsInfo +{ + _int iRewardType{}; + _int iRewardID{}; +}REWARDSINFO; - typedef struct tagQuestInfo - { - _int iQuestID{}; - _int iType{}; - _wstring pQuestName; - _wstring pQuestInfo; - vector ObjectiveInfo; - vector RewardsInfo; - _int iAcceptState; - }QUESTINFO; +typedef struct tagQuestInfo +{ + _int iQuestID{}; + _int iType{}; + _wstring pQuestName; + _wstring pQuestInfo; + vector ObjectiveInfo; + vector RewardsInfo; + _int iAcceptState; +}QUESTINFO; - typedef struct tagSpellLearnInfo - { - _wstring pSpellName{}; - _wstring pImageName{}; - _int iSpellID{}; - _int iSpellType{}; - _float fSpellSize{}; - _float2 fStartPosition{}; - _float2 fEndPosition{}; - vector<_float4> Booster; - vector<_float4> Lines; - }SPELLLEARNINFO; +typedef struct tagSpellLearnInfo +{ + _wstring pSpellName{}; + _wstring pImageName{}; + _int iSpellID{}; + _int iSpellType{}; + _float fSpellSize{}; + _float2 fStartPosition{}; + _float2 fEndPosition{}; + vector<_float4> Booster; + vector<_float4> Lines; +}SPELLLEARNINFO; - typedef struct tagDialougeInfo - { - _wstring pName; - _wstring pText; - _float fTime = 1.f; - }DIALOGUEINFO; +typedef struct tagDialougeInfo +{ + _wstring pName; + _wstring pText; + _float fTime = 1.f; +}DIALOGUEINFO; - typedef struct tagEffectInfo - { - _float4 vColor = { 0.f ,0.f ,0.f ,1.f }; +typedef struct tagEffectInfo +{ + _float4 vColor = { 0.f ,0.f ,0.f ,1.f }; - _float2 vDiffuseUVGainAmount = {}; - _float2 vMaskingUVGainAmount = {}; - _float2 vNoiseUVGainAmount = {}; + _float2 vDiffuseUVGainAmount = {}; + _float2 vMaskingUVGainAmount = {}; + _float2 vNoiseUVGainAmount = {}; - _float2 vDistortionTime = {}; - _float2 vMaskDistortionUVGainAmount = {}; + _float2 vDistortionTime = {}; + _float2 vMaskDistortionUVGainAmount = {}; - _float2 vUVCutting = { 1.f ,1.f }; - _float2 vUVMaskCutting = { 1.f ,1.f }; + _float2 vUVCutting = { 1.f ,1.f }; + _float2 vUVMaskCutting = { 1.f ,1.f }; - _int iMaskMoveLerpOption = { 0 }; - _int iDiffuseMoveLerpOption = { 0 }; - _int iNoiseMoveLerpOption = { 0 }; + _int iMaskMoveLerpOption = { 0 }; + _int iDiffuseMoveLerpOption = { 0 }; + _int iNoiseMoveLerpOption = { 0 }; - _int iMaskDistortionMoveLerpOption = { 0 }; - _int iDiffuseDistortionMoveLerpOption = { 0 }; + _int iMaskDistortionMoveLerpOption = { 0 }; + _int iDiffuseDistortionMoveLerpOption = { 0 }; - _int iBlurWeight = { 0 }; + _int iBlurWeight = { 0 }; - _bool isDiffuse = {}; - _bool isMasking = {}; - _bool isDissolve = {}; - _bool isNoise = {}; - _bool isEmissive = {}; - _bool isDistortion = {}; - _bool isDiffuseUVMove = {}; - _bool isNoiseUVMove = {}; - _bool isMaskUVMove = {}; - _bool isBlur = {}; - _bool isBillboard = {}; + _bool isDiffuse = {}; + _bool isMasking = {}; + _bool isDissolve = {}; + _bool isNoise = {}; + _bool isEmissive = {}; + _bool isDistortion = {}; + _bool isDiffuseUVMove = {}; + _bool isNoiseUVMove = {}; + _bool isMaskUVMove = {}; + _bool isBlur = {}; + _bool isBillboard = {}; - _float4 vEmissive = { 0.f ,0.f ,0.f ,0.f }; - _float fDiffuseAlpha = { 1.f }; - _float fBlurIntensity = {}; - _float fNoiseDistortionIntensity = {}; - _float fEmissiveStrength = { 0.f }; + _float4 vEmissive = { 0.f ,0.f ,0.f ,0.f }; + _float fDiffuseAlpha = { 1.f }; + _float fBlurIntensity = {}; + _float fNoiseDistortionIntensity = {}; + _float fEmissiveStrength = { 0.f }; - LIGHT_DESC LightDesc = {}; - RENDER eRenderOrder = { RENDER::EFFECT }; + LIGHT_DESC LightDesc = {}; + RENDER eRenderOrder = { RENDER::EFFECT }; - _bool isReverseDissolve = {}; + _bool isReverseDissolve = {}; - EFFECT_TYPE eEffectType = { EFFECT_TYPE::EFFECT }; + EFFECT_TYPE eEffectType = { EFFECT_TYPE::EFFECT }; - _bool isEmissiveDissolve = { false }; + _bool isEmissiveDissolve = { false }; - _bool isMaskClampSample = { false }; - _bool isNoiseColor = { false }; - _bool isNoiseAlpha = { false }; - _bool isNomalDissolve = {}; + _bool isMaskClampSample = { false }; + _bool isNoiseColor = { false }; + _bool isNoiseAlpha = { false }; + _bool isNomalDissolve = {}; - _float fSoftenExp = { 1.31429f }; - _float fSoftStrength = {}; - _float fCoreBoost = {}; - _float fRadius = {}; + _float fSoftenExp = { 1.31429f }; + _float fSoftStrength = {}; + _float fCoreBoost = {}; + _float fRadius = {}; - _float fSoftMaskEdge = {}; - _float fSoftMask = {}; + _float fSoftMaskEdge = {}; + _float fSoftMask = {}; - _bool isEmissiveDissolveReverse = { false }; - _bool isOnlyBlur = { false }; + _bool isEmissiveDissolveReverse = { false }; + _bool isOnlyBlur = { false }; - SHADER_PASS_INSTANCE_MODEL eShaderPass = { SHADER_PASS_INSTANCE_MODEL::NON_NOMALMAP }; + SHADER_PASS_INSTANCE_MODEL eShaderPass = { SHADER_PASS_INSTANCE_MODEL::NON_NOMALMAP }; - _bool isBlurNoEmissive = {}; + _bool isBlurNoEmissive = {}; - _bool isMotionBlur = {}; + _bool isMotionBlur = {}; - _bool isNoise_G = {}; - _bool isNoise_B = {}; + _bool isNoise_G = {}; + _bool isNoise_B = {}; - _float fModelBlurIntensity = { 0.f }; + _float fModelBlurIntensity = { 0.f }; - _bool isBloom = {}; - _bool isBloomDissolve = {}; - _bool isBloomReverseDissolve = {}; - _float fBloomStrength = {}; - BLOOM_TYPE eBloomType = {}; + _bool isBloom = {}; + _bool isBloomDissolve = {}; + _bool isBloomReverseDissolve = {}; + _float fBloomStrength = {}; + BLOOM_TYPE eBloomType = {}; - _float fDissolveDelay = {}; - _float fReverseDissolveDelay = {}; - _float2 vDissolveUVGainAmount = {}; - _bool isDissolveMove = {}; + _float fDissolveDelay = {}; + _float fReverseDissolveDelay = {}; + _float2 vDissolveUVGainAmount = {}; + _bool isDissolveMove = {}; - _float3 vDissolveValue = {}; /* Soft Mask , Cut Ratio*/ + _float3 vDissolveValue = {}; /* Soft Mask , Cut Ratio*/ - _float fModelDistortIntensity = {}; - _float fPadding0 = {}; + _float fModelDistortIntensity = {}; + _float fPadding0 = {}; - _float fLightDeley = {}; - _float fLightIntensity = {}; - _float isLightTime = { 0.f }; - _bool isLightDissolve = {}; + _float fLightDeley = {}; + _float fLightIntensity = {}; + _float isLightTime = { 0.f }; + _bool isLightDissolve = {}; - _bool isDissolve_G = {}; + _bool isDissolve_G = {}; - _float4 vBlurColor = {}; - _float2 vUVNoiseCutting = { 1.f ,1.f }; + _float4 vBlurColor = {}; + _float2 vUVNoiseCutting = { 1.f ,1.f }; - _float fEmissiveColorCut = {}; + _float fEmissiveColorCut = {}; - _float fRimLightPower = {}; - _float fRimLightStrength = {}; + _float fRimLightPower = {}; + _float fRimLightStrength = {}; - _float4 vNoiseColor = {}; - _float4 vRimLightColor = {}; + _float4 vNoiseColor = {}; + _float4 vRimLightColor = {}; - _float2 vMaskOffset = {}; + _float2 vMaskOffset = {}; - _bool isDiffuse_R = {}; - _bool isDiffuse_G = {}; - _bool isDiffuse_B = {}; - _bool isBlurColor = {}; + _bool isDiffuse_R = {}; + _bool isDiffuse_G = {}; + _bool isDiffuse_B = {}; + _bool isBlurColor = {}; - _bool isBlurDissolve = {}; - _bool isNomalMap = {}; - _bool isNoDissolveSmoothStep = {}; - _bool isNonSoftEffect = {}; + _bool isBlurDissolve = {}; + _bool isNomalMap = {}; + _bool isNoDissolveSmoothStep = {}; + _bool isNonSoftEffect = {}; - _float2 vDissolveSmoothRange = { 0.1f , 0.1f }; - _float2 vPadding0 = {}; + _float2 vDissolveSmoothRange = { 0.1f , 0.1f }; + _float2 vPadding0 = {}; - _bool isRimLight = {}; - _bool isMask_G = {}; - _bool isMask_B = {}; - _bool isDissolve_B = {}; + _bool isRimLight = {}; + _bool isMask_G = {}; + _bool isMask_B = {}; + _bool isDissolve_B = {}; _float4 vPadding1 = {}; _float4 vPadding2 = {}; @@ -301,73 +301,79 @@ namespace Client _float fDiffuseAlpha = { 1.f }; _float4 vColor = { 0.f ,0.f ,0.f ,1.f }; - /* 마스크 */ - _bool isMask = {}; - _float fSoftMaskEdge = {}; - _float fSoftMask = {}; + /* 마스크 */ + _bool isMask = {}; + _float fSoftMaskEdge = {}; + _float fSoftMask = {}; - /* 노이즈 */ - _bool isNoise = {}; - _bool isNoiseColor = { false }; - _bool isNoiseAlpha = { false }; - _float fNoiseStrength = {}; + /* 노이즈 */ + _bool isNoise = {}; + _bool isNoiseColor = { false }; + _bool isNoiseAlpha = { false }; + _float fNoiseStrength = {}; - /* 디스 토션 */ - _bool isDistortion = {}; - _float2 vDistortionTime = {}; - _float2 vDiffuseDistortioUVAmount = {}; - _float2 vMaskDistortionUVAmount = {}; - _float fDistortionIntensity = {}; + /* 디스 토션 */ + _bool isDistortion = {}; + _float2 vDistortionTime = {}; + _float2 vDiffuseDistortioUVAmount = {}; + _float2 vMaskDistortionUVAmount = {}; + _float fDistortionIntensity = {}; - /* 이미시브 */ - _float4 vEmissive = { 0.f ,0.f ,0.f ,0.f }; + /* 이미시브 */ + _float4 vEmissive = { 0.f ,0.f ,0.f ,0.f }; - _float fEmissiveStrength = { 0.f }; - _float fSoftenExp = { 1.31429f }; - _float fSoftStrength = {}; - _float fCoreBoost = {}; - _float fRadius = {}; + _float fEmissiveStrength = { 0.f }; + _float fSoftenExp = { 1.31429f }; + _float fSoftStrength = {}; + _float fCoreBoost = {}; + _float fRadius = {}; - /* 블러 */ - _bool isBlur = {}; - _bool isOnlyBlur = { false }; - _float fBlurIntensity = {}; - _int iBlurWeight = {}; + /* 블러 */ + _bool isBlur = {}; + _bool isOnlyBlur = { false }; + _float fBlurIntensity = {}; + _int iBlurWeight = {}; - /* 블룸 */ - _bool isBloom = {}; + /* 블룸 */ + _bool isBloom = {}; - _bool isBloomDissolve = {}; - _bool isBloomReverseDissolve = {}; + _bool isBloomDissolve = {}; + _bool isBloomReverseDissolve = {}; - _float fBloomStrength = {}; + _float fBloomStrength = {}; - BLOOM_TYPE eBloomType = {}; - _float2 vBloomTime = {}; + BLOOM_TYPE eBloomType = {}; + _float2 vBloomTime = {}; - _int iNumVertex = { 256 }; + _int iNumVertex = { 256 }; - RENDER eRenderOrder = { RENDER::EFFECT }; - SHADER_PASS_POSTEX eShaderPass = { SHADER_PASS_POSTEX::TRAIL }; + RENDER eRenderOrder = { RENDER::EFFECT }; + SHADER_PASS_POSTEX eShaderPass = { SHADER_PASS_POSTEX::TRAIL }; - _float fDamping = { 0.5f }; - _float fRopeLength = { 0.1f }; - _float fMass = { 0.5f }; + _float fDamping = { 0.5f }; + _float fRopeLength = { 0.1f }; + _float fMass = { 0.5f }; - _float2 vDissolveTime = {}; + _float2 vDissolveTime = {}; - _float fPadding0 = {}; - _float3 vPadding2 = {}; + _float fPadding0 = {}; + _float3 vPadding2 = {}; - _float fPadding1 = {}; - _float fPadding2 = {}; - _float fPadding3 = {}; + _float fPadding1 = {}; + _float fPadding2 = {}; + _float fPadding3 = {}; - _bool isDissolve = {}; - _bool isPadding1 = {}; - _bool isPadding2 = {}; + _bool isDissolve = {}; + _bool isPadding1 = {}; + _bool isPadding2 = {}; - }TRAIL_INFO; +}TRAIL_INFO; + +struct TimeLine { + _float2 m_vTimer = {}; + _uint m_eTypeTimeLine = {}; + list m_Sockets = {}; }; +NS_END diff --git a/Jusin154_Team3D/Client/Public/CutSceneInfo.h b/Jusin154_Team3D/Client/Public/CutSceneInfo.h index ac5cb50e3..2e56d96ac 100644 --- a/Jusin154_Team3D/Client/Public/CutSceneInfo.h +++ b/Jusin154_Team3D/Client/Public/CutSceneInfo.h @@ -10,12 +10,6 @@ NS_END NS_BEGIN(Client) -struct TimeLine { - _float2 m_vTimer = {}; - _uint m_eTypeTimeLine = {}; - list m_Sockets = {}; -}; - class CCutSceneInfo final : public CBase { private: @@ -29,7 +23,7 @@ class CCutSceneInfo final : public CBase public: void Active_Event(_string& strKey); HRESULT DeActive_ActiveEvent(_string& strKey); - void Load_Events(LEVEL eLevel); + void Load_Events(pair<_string, TimeLine*>& pairTimeLine); private: CGameInstance* m_pGameInstance = { nullptr }; @@ -37,13 +31,16 @@ class CCutSceneInfo final : public CBase ID3D11Device* m_pDevice = { nullptr }; ID3D11DeviceContext* m_pContext = { nullptr }; - map<_string, TimeLine> m_funcActiveEvents = {}; - map<_string, TimeLine> m_funcWaitEvents = {}; + map<_string, TimeLine*> m_funcActiveEvents = {}; + map<_string, TimeLine*> m_funcWaitEvents = {}; private: HRESULT Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); - HRESULT Clear_ActiveEvents(); - HRESULT Clear_Events(map<_string, TimeLine>&Events); +#ifdef _DEBUG +public: +#endif // _DEBUG + HRESULT Clear_ActiveEvents(); + HRESULT Clear_Events(map<_string, TimeLine*>&Events); HRESULT Clear_AllEvents(); diff --git a/Jusin154_Team3D/Client/Public/InfoInstance.h b/Jusin154_Team3D/Client/Public/InfoInstance.h index ff3f95986..86f1550dd 100644 --- a/Jusin154_Team3D/Client/Public/InfoInstance.h +++ b/Jusin154_Team3D/Client/Public/InfoInstance.h @@ -103,6 +103,11 @@ DECLARE_SINGLETON(CInfoInstance) void Set_Broom_Booster_Timer(_float fTimer); _float Get_Broom_Booster_Timer(); #pragma endregion +#pragma region CutScene + void Active_Event(_string& strKey); + HRESULT DeActive_ActiveEvent(_string& strKey); + void Load_Events(pair< _string, struct TimeLine*>& pairTimeLine); +#pragma endregion #pragma region Effect HRESULT Regist_ActiveEffect(CEffect_Container* pEffect); @@ -120,6 +125,7 @@ DECLARE_SINGLETON(CInfoInstance) class CMonsterInfo* m_pMonsterInfo = { nullptr }; class CMapInfo* m_pMapInfo = { nullptr }; class CEffectInfo* m_pEffectInfo = { nullptr }; + class CCutSceneInfo* m_pCutSceneInfo = { nullptr }; class CSkill_Data* m_pSkillInfo = { nullptr }; class CQuest_Data* m_pQuestInfo= { nullptr }; class CInteractiveInfo* m_pInteractiveInfo = { nullptr }; diff --git a/Jusin154_Team3D/Client/Public/Level_Field.h b/Jusin154_Team3D/Client/Public/Level_Field.h index df9d3463f..934a665f9 100644 --- a/Jusin154_Team3D/Client/Public/Level_Field.h +++ b/Jusin154_Team3D/Client/Public/Level_Field.h @@ -3,6 +3,10 @@ #include "Client_Define.h" #include "Level.h" +NS_BEGIN(Engine) +class CCamera; +NS_END + NS_BEGIN(Client) class CLevel_Field final : public CLevel @@ -38,10 +42,17 @@ class CLevel_Field final : public CLevel HRESULT Ready_Layer_Effect(const _wstring& strLayerTag); HRESULT Ready_Layer_Monster(); HRESULT Reday_Layer_EffectPool(); + HRESULT Ready_Layer_CutScene(); public: static pair> Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID, void* pArg); virtual void Free() override; + + void Load_CutSceneXML(const string& path, CCamera* pCamera, class CMonster* pMonster); + +#ifdef _DEBUG + virtual void Describe_Entity(); +#endif // _DEBUG }; NS_END diff --git a/Jusin154_Team3D/Client/Public/Player.h b/Jusin154_Team3D/Client/Public/Player.h index 640fe0537..328c73c80 100644 --- a/Jusin154_Team3D/Client/Public/Player.h +++ b/Jusin154_Team3D/Client/Public/Player.h @@ -27,6 +27,7 @@ class CPlayer final : public CUnit virtual HRESULT Render_Shadow(SHADOW eType) override; virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr)override; virtual void OnHit(CGameObject* pOther, CGameObject* pCaller = nullptr)override; + virtual void Trigger(class CTimeSocket& Socket)override; _bool Get_Aim() { return m_bAim; } void Set_SpellHit(_bool bHit) { m_bSpellHit = bHit; } void Set_Shield(_bool bShield) { m_bShield = bShield; } diff --git a/Jusin154_Team3D/Client/Public/Ranrok.h b/Jusin154_Team3D/Client/Public/Ranrok.h index a5fb53746..eb94849c3 100644 --- a/Jusin154_Team3D/Client/Public/Ranrok.h +++ b/Jusin154_Team3D/Client/Public/Ranrok.h @@ -55,6 +55,7 @@ class CRanrok final : public CMonster virtual HRESULT Render() override; virtual HRESULT Render_OutLine() override; virtual HRESULT Render_Shadow(SHADOW eType) override; + virtual void Trigger(CTimeSocket& Socket)override; HRESULT Render_MotionTrail(ID3D11ShaderResourceView* pSRV); virtual _vector Get_LockOnPos() override; virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr)override; diff --git a/Jusin154_Team3D/Client/Public/TimeSocket.h b/Jusin154_Team3D/Client/Public/TimeSocket.h deleted file mode 100644 index 6953d9be8..000000000 --- a/Jusin154_Team3D/Client/Public/TimeSocket.h +++ /dev/null @@ -1,60 +0,0 @@ -#pragma once -#include "Client_Define.h" -#include "GameInstance.h" - - -NS_BEGIN(Engine) -class CGameObject; -NS_END - - -NS_BEGIN(Client) - -typedef enum class typeTimeSocket_Param { - TARGET, - TRANSFORM, - END -}TIMESOCKET_PARAM; - -typedef enum class typeTimeSocket_Func { - TRIGGER, - POSITION, - TAG, - TARGETTING, - END -}TIMESOCKET_FUNC; - -class CTimeSocket final : public CBase -{ -private: - CTimeSocket(); - virtual ~CTimeSocket() = default; -public: - _float m_fRatio = { 0.f }; - _bool m_bTriggerred = { false }; - CGameObject* m_pEventTarget = { nullptr }; - _string m_strEventName = {}; - TIMESOCKET_PARAM m_eTypeParam = {}; - union { - CGameObject* m_pOtherTarget = { nullptr }; - PSX::PxTransform m_pxTransform; - }; - - virtual _bool Trigger(_float fRatio); - -public: - HRESULT Initialize(CGameObject* pTarget, _string& strTag); - HRESULT Initialize(CGameObject* pTarget, _string& strTag, PSX::PxTransform& pxTransform); - HRESULT Initialize(CGameObject* pTarget, _string& strTag, CGameObject* pOther); - -public: - static CTimeSocket* Create(); - virtual void Free() override; - -private: - function m_funcEvent = { nullptr }; -private: - void Finalize(); -}; - -NS_END diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/CutScene/RanrokCutScene.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/CutScene/RanrokCutScene.xml new file mode 100644 index 000000000..15253a742 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/CutScene/RanrokCutScene.xml @@ -0,0 +1,342 @@ + + + + + + + + + + + + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + + + + + + + + + + + + + + + + + + + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + + + + + + + + + + + + + + + + + + + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + + + + + + + + + + + + + + + + + + + + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + + + + + + + + + + + + + + + + + + + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + + + + + + + + + + + + + + + + + + + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + + + + + + + + + + + + + + + + + + + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + + + + + + + + + + + + + + + + + + + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + + + + + + + + + + + + + + + + + + + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + false + + + + + + + + + diff --git a/Jusin154_Team3D/Editor/Private/CamPosition_Shoulder.cpp b/Jusin154_Team3D/Editor/Private/CamPosition_Shoulder.cpp index 9eea44ab3..aacbd8c8d 100644 --- a/Jusin154_Team3D/Editor/Private/CamPosition_Shoulder.cpp +++ b/Jusin154_Team3D/Editor/Private/CamPosition_Shoulder.cpp @@ -111,8 +111,8 @@ void CCamPosition_Shoulder::Update(_float fTimeDelta) if (m_pGameInstance->Key_Up(DIK_P)) { m_vShoulderOtherRatio = m_vShoulderPosRatio = m_vShoulderStartRatio; m_vShoulderStartRatio.x *= -1.f; - m_bLerp = true; - m_vLerpTimer.x = 0.f; + m_bLerpTranslation = true; + m_vLerpTranslationTimer.x = 0.f; } } @@ -121,12 +121,12 @@ void CCamPosition_Shoulder::Late_Update(_float fTimeDelta) if (FAILED(m_pGameInstance->IsBinded_Camera(CAMERA_SHOULDER))) { return; } - if (true == m_bLerp) { - m_vLerpTimer.x += fTimeDelta; - XMStoreFloat3(&m_vShoulderPosRatio, XMVectorLerp(XMLoadFloat3(&m_vShoulderStartRatio), XMLoadFloat3(&m_vShoulderOtherRatio), m_vLerpTimer.x / m_vLerpTimer.y)); - if (m_vLerpTimer.x > m_vLerpTimer.y) { - m_bLerp = false; - m_vLerpTimer.x = 0.f; + if (true == m_bLerpTranslation) { + m_vLerpTranslationTimer.x += fTimeDelta; + XMStoreFloat3(&m_vShoulderPosRatio, XMVectorLerp(XMLoadFloat3(&m_vShoulderStartRatio), XMLoadFloat3(&m_vShoulderOtherRatio), m_vLerpTranslationTimer.x / m_vLerpTranslationTimer.y)); + if (m_vLerpTranslationTimer.x > m_vLerpTranslationTimer.y) { + m_bLerpTranslation = false; + m_vLerpTranslationTimer.x = 0.f; m_vShoulderPosRatio = m_vShoulderOtherRatio; } diff --git a/Jusin154_Team3D/Editor/Private/LoadingWidget.cpp b/Jusin154_Team3D/Editor/Private/LoadingWidget.cpp index 9adb078a0..e203437b0 100644 --- a/Jusin154_Team3D/Editor/Private/LoadingWidget.cpp +++ b/Jusin154_Team3D/Editor/Private/LoadingWidget.cpp @@ -90,7 +90,7 @@ void CLoadingWidget::Update(_float fTimeDelta) } if (m_bLerpOn == true) { - Start_Lerp(m_fMoveSpeed); + Start_Lerp_Translation(m_fMoveSpeed); } if (m_bLerpOff == true) diff --git a/Jusin154_Team3D/Editor/Private/Mission_Icon.cpp b/Jusin154_Team3D/Editor/Private/Mission_Icon.cpp index 4c8f7af6e..baf3037f8 100644 --- a/Jusin154_Team3D/Editor/Private/Mission_Icon.cpp +++ b/Jusin154_Team3D/Editor/Private/Mission_Icon.cpp @@ -101,7 +101,7 @@ void CMission_Icon::Update(_float fTimeDelta) } if (m_bLerpOn == true) { - Start_Lerp(m_fMoveSpeed); + Start_Lerp_Translation(m_fMoveSpeed); } if (m_bLerpOff == true) diff --git a/Jusin154_Team3D/Editor/Private/Ride_Panel.cpp b/Jusin154_Team3D/Editor/Private/Ride_Panel.cpp index 0e4a565ad..193ac237e 100644 --- a/Jusin154_Team3D/Editor/Private/Ride_Panel.cpp +++ b/Jusin154_Team3D/Editor/Private/Ride_Panel.cpp @@ -111,7 +111,7 @@ void CRide_Panel::Update(_float fTimeDelta) if (m_bHover == true) { - Start_Lerp(fTimeDelta); + Start_Lerp_Translation(fTimeDelta); } else { diff --git a/Jusin154_Team3D/Editor/Private/SpellLearn_ChaserPointer.cpp b/Jusin154_Team3D/Editor/Private/SpellLearn_ChaserPointer.cpp index 5c760c82f..157ede96e 100644 --- a/Jusin154_Team3D/Editor/Private/SpellLearn_ChaserPointer.cpp +++ b/Jusin154_Team3D/Editor/Private/SpellLearn_ChaserPointer.cpp @@ -165,7 +165,7 @@ void CSpellLearn_ChaserPointer::Line(_float fTime) { m_vLerp_Position = m_MoveLine[m_iCurrentLine]; - if (Start_Lerp(fTime) == true) + if (Start_Lerp_Translation(fTime) == true) { if (m_iCurrentLine < m_iLineIndex - 1) { diff --git a/Jusin154_Team3D/Editor/Private/SpellLearn_Overlay.cpp b/Jusin154_Team3D/Editor/Private/SpellLearn_Overlay.cpp index 7c04ff286..591a9e3c1 100644 --- a/Jusin154_Team3D/Editor/Private/SpellLearn_Overlay.cpp +++ b/Jusin154_Team3D/Editor/Private/SpellLearn_Overlay.cpp @@ -125,7 +125,7 @@ void CSpellLearn_Overlay::Update(_float fTimeDelta) if (m_fSizeUp == true) { - if (Start_Lerp(fTimeDelta * m_fTimeMult * m_fMoveSpeed) == true) + if (Start_Lerp_Translation(fTimeDelta * m_fTimeMult * m_fMoveSpeed) == true) { m_fSizeUp = false; } diff --git a/Jusin154_Team3D/Editor/Private/SpellLearn_Slot.cpp b/Jusin154_Team3D/Editor/Private/SpellLearn_Slot.cpp index f7d879eaf..5c30daa21 100644 --- a/Jusin154_Team3D/Editor/Private/SpellLearn_Slot.cpp +++ b/Jusin154_Team3D/Editor/Private/SpellLearn_Slot.cpp @@ -95,7 +95,7 @@ void CSpellLearn_Slot::Update(_float fTimeDelta) if (m_fSizeUp == true) { - if (Start_Lerp(fTimeDelta * m_fTimeMult * m_fMoveSpeed) == true) + if (Start_Lerp_Translation(fTimeDelta * m_fTimeMult * m_fMoveSpeed) == true) { m_fSizeUp = false; } diff --git a/Jusin154_Team3D/Editor/Public/CamPosition_Shoulder.h b/Jusin154_Team3D/Editor/Public/CamPosition_Shoulder.h index a5b431472..14cbd0a93 100644 --- a/Jusin154_Team3D/Editor/Public/CamPosition_Shoulder.h +++ b/Jusin154_Team3D/Editor/Public/CamPosition_Shoulder.h @@ -46,8 +46,8 @@ class CCamPosition_Shoulder final : public CCamPosition _float3 m_vShoulderStartRatio = { 1.f, 2.f, -1.f }; _float3 m_vShoulderOtherRatio = { 1.f, 2.f, -1.f }; - _bool m_bLerp = { false }; - _float2 m_vLerpTimer = { 0.f, 1.f }; + _bool m_bLerpTranslation = { false }; + _float2 m_vLerpTranslationTimer = { 0.f, 1.f }; _float2 m_vAccRotDegrees = { 0.f, 0.f }; _float2 m_vAccRealDegrees = { 0.f, 0.f }; diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj b/Jusin154_Team3D/Engine/Default/Engine.vcxproj index 67cc7ddc9..2027d57d7 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj @@ -310,6 +310,7 @@ call Update_Lib.bat + NotUsing NotUsing @@ -551,6 +552,7 @@ call Update_Lib.bat + diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters index df4eb975a..611457454 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters @@ -319,6 +319,9 @@ {7eab7292-025e-40d7-aa71-73e7a3c71ea7} + + {bd29f336-b363-41e9-91cc-d1f295015afc} + @@ -609,6 +612,9 @@ 02.Element\02.Component\06.Model\Motion_Trail + + 00.System\01.Timer\TimeSocket + @@ -1265,6 +1271,9 @@ 02.Element\02.Component\06.Model\Motion_Trail + + 00.System\01.Timer\TimeSocket + diff --git a/Jusin154_Team3D/Engine/Private/Camera.cpp b/Jusin154_Team3D/Engine/Private/Camera.cpp index 96886d17a..664d55f04 100644 --- a/Jusin154_Team3D/Engine/Private/Camera.cpp +++ b/Jusin154_Team3D/Engine/Private/Camera.cpp @@ -139,6 +139,13 @@ void CCamera::EnableTransition(_float fTransitionTime) m_vTransitionTime.y = fTransitionTime; } +void CCamera::DisableTransition() +{ + m_bIsCurrentTransition = false; + m_vTransitionTime.x = 0.f; + m_vTransitionTime.y = 1.f; +} + void CCamera::Set_RotDegreeVerticalLock(_float2 vVerticalLock) { m_vAccRotDegree_VerticalLocks = vVerticalLock; @@ -168,7 +175,7 @@ void CCamera::ZoomIn(_float fTimeDelta) } -void CCamera::Set_Fov(_float fFovy, _float fTimeDelta,_bool& bZoomIn) +void CCamera::Set_FovSlope(_float fFovy, _float fTimeDelta,_bool& bZoomIn) { if (fFovy > m_fFovy) { @@ -192,6 +199,11 @@ void CCamera::Set_Fov(_float fFovy, _float fTimeDelta,_bool& bZoomIn) } } +void CCamera::Set_Fov(_float fFovy) +{ + m_fFovy = fFovy; +} + _float CCamera::Get_Fov() { return m_fFovy; diff --git a/Jusin154_Team3D/Engine/Private/Camera_Manager.cpp b/Jusin154_Team3D/Engine/Private/Camera_Manager.cpp index 77fd7a9e3..fca41334d 100644 --- a/Jusin154_Team3D/Engine/Private/Camera_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/Camera_Manager.cpp @@ -58,6 +58,12 @@ HRESULT CCamera_Manager::Bind_Camera(_uint iLevel, const _wstring& wstrCameraKey return S_OK; } +CCamera* CCamera_Manager::Get_Camera(_uint iLevel, const _wstring& strCameraKey) +{ + CCamera* pOut = Find_Camera(iLevel, strCameraKey); + return pOut; +} + HRESULT CCamera_Manager::IsBinded_Camera(const _wstring& wstrCameraKey) { if (m_wstrCurrentCameraKey == wstrCameraKey) { diff --git a/Jusin154_Team3D/Engine/Private/ElementObject.cpp b/Jusin154_Team3D/Engine/Private/ElementObject.cpp index f06ff23ee..4dfbfdeb8 100644 --- a/Jusin154_Team3D/Engine/Private/ElementObject.cpp +++ b/Jusin154_Team3D/Engine/Private/ElementObject.cpp @@ -137,7 +137,7 @@ _float CElementObject::Get_Nine_Slice_Bottom() return m_vNine_Slice.w; } -_bool CElementObject::Start_Lerp(_float fTimeDelta) +_bool CElementObject::Start_Lerp_Translation(_float fTimeDelta) { _vector Pos = XMLoadFloat4(&m_fCurrent_Position); diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index 8950b472d..eb3b004cb 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -984,6 +984,10 @@ HRESULT CGameInstance::Add_Camera(_uint iLevel, CCamera* pCamera, const _wstring { return m_pCamera_Manager->Add_Camera(iLevel, pCamera, strCameraKey); } +CCamera* CGameInstance::Get_Camera(_uint iLevel, const _wstring& strCameraKey) +{ + return m_pCamera_Manager->Get_Camera(iLevel, strCameraKey); +} HRESULT CGameInstance::Bind_Camera(_uint iLevel, const _wstring& strCameraKey, _bool bIgnorePriority) { return m_pCamera_Manager->Bind_Camera(iLevel, strCameraKey, bIgnorePriority); diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index 4cc196921..7b217543b 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -219,9 +219,9 @@ _bool CModel::Play_Anim(_float fTimeDelta, CTransform* pTransform) 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; + fRatio = (m_fBlendTime / m_fBlendDuration); + if (fRatio > 1.f) { + fRatio = 1.f; } CAnimation* pCurAnim = m_Animations[m_iCurrentAnimIndex]; @@ -229,9 +229,9 @@ _bool CModel::Play_Anim(_float fTimeDelta, CTransform* pTransform) m_bIsFinishedAnim = pCurAnim->Update_TransformationMatrices(m_Bones, m_bIsLoop, fTimeDelta, true, m_iBoneMask, m_OutScale,m_OutRotation, m_OutTranslation,m_iRootBoneIndex); - pCurAnim->InterpAnim(pPreAnim, m_Bones, m_fRatio); + pCurAnim->InterpAnim(pPreAnim, m_Bones, fRatio); - if (m_fRatio >= 1.f) + if (fRatio >= 1.f) { m_iPreAnimIndex = m_iCurrentAnimIndex; m_fBlendTime = 0.f; @@ -263,7 +263,7 @@ _bool CModel::Play_Anim(_float fTimeDelta, CTransform* pTransform) if (m_bRatio) { - Update_RootBone(m_fAmount * m_fRatio); + Update_RootBone(m_fAmount * fRatio); } else { @@ -290,9 +290,9 @@ _bool CModel::Play_Anim(_float fTimeDelta, CTransform* pTransform) if (m_bQueuedAnim) { - if (m_fRatio >= 1.f) + if (fRatio >= 1.f) { - m_fRatio = 1.f; + fRatio = 1.f; m_iPreAnimIndex = m_iCurrentAnimIndex; m_fBlendTime = 0.f; @@ -315,8 +315,8 @@ _bool CModel::Play_Dual_Anim(_float fTimeDelta, CTransform* pTransform) 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; + fRatio = (m_fBlendTime / m_fBlendDuration); + if (fRatio > 1.f) fRatio = 1.f; m_fSecondBlendTime += fTimeDelta; m_fSecondRatio = (m_fSecondBlendTime / m_fSecondBlendDuration); @@ -333,7 +333,7 @@ _bool CModel::Play_Dual_Anim(_float fTimeDelta, CTransform* pTransform) m_Animations[m_iCurrSecondAnimIndex]->InterpSecondAnim(m_Animations[m_iCurrentAnimIndex], m_iBoneMask, m_Bones, m_fSecondRatio* 5.f); - if (m_fRatio >= 1.f) + if (fRatio >= 1.f) { m_iPreAnimIndex = m_iCurrentAnimIndex; m_fBlendTime = 0.f; @@ -387,7 +387,7 @@ _bool CModel::Play_Dual_Anim(_float fTimeDelta, CTransform* pTransform) } if (m_bRatio) { - Update_RootBone(m_fAmount * m_fRatio); + Update_RootBone(m_fAmount * fRatio); } else { @@ -441,7 +441,7 @@ _bool CModel::Play_Dual_Anim(_float fTimeDelta, CTransform* pTransform) _bool CModel::IsBlending() const { return m_iPreAnimIndex != m_iCurrentAnimIndex && - m_fRatio < 1.f; + fRatio < 1.f; } @@ -2082,7 +2082,7 @@ void CModel::ComputeLocal(_uint AnimIndex, _uint MeshIndex) pDesc->CurrentAnimIndex = m_iCurrentAnimIndex; pDesc->PrevAnimIndex = m_iPreAnimIndex; pDesc->PrevTime = m_Animations[m_iPreAnimIndex]->Get_CurrentTrackPosition(); - pDesc->BlendRatio = m_fRatio; + pDesc->BlendRatio = fRatio; pDesc->RootBoneIndex = m_iRootBoneIndex; pDesc->PlayHeadBone = m_bHeadBone; diff --git a/Jusin154_Team3D/Engine/Private/NPCStat.cpp b/Jusin154_Team3D/Engine/Private/NPCStat.cpp index 8eb63279b..38fb97ad4 100644 --- a/Jusin154_Team3D/Engine/Private/NPCStat.cpp +++ b/Jusin154_Team3D/Engine/Private/NPCStat.cpp @@ -19,7 +19,7 @@ HRESULT CNPCStat::Initialize_Prototype(tinyxml2::XMLNode* pChild) pElement->QueryIntAttribute("ID", &m_NpcInfo.iID); m_NpcInfo.pNpc_Name = CMyTools::ToWstring(pElement->Attribute("Name")); m_NpcInfo.pName = CMyTools::ToWstring(pElement->Attribute("NpcName")); - pElement->QueryIntAttribute("TAG", &m_NpcInfo.iNpcType); + pElement->QueryIntAttribute("ZOOM_IN", &m_NpcInfo.iNpcType); pElement->QueryFloatAttribute("SizeX", &m_NpcInfo.fFontPos); return S_OK; } diff --git a/Jusin154_Team3D/Engine/Private/PanelObject.cpp b/Jusin154_Team3D/Engine/Private/PanelObject.cpp index 258e22c95..1cf136457 100644 --- a/Jusin154_Team3D/Engine/Private/PanelObject.cpp +++ b/Jusin154_Team3D/Engine/Private/PanelObject.cpp @@ -162,7 +162,7 @@ void CPanelObject::Function_Callback(wstring Name, void* pArg) } } -_bool CPanelObject::Start_Lerp(_float fTimeDelta) +_bool CPanelObject::Start_Lerp_Translation(_float fTimeDelta) { _vector Pos = XMLoadFloat4(&m_fCurrent_Position); diff --git a/Jusin154_Team3D/Engine/Private/TimeSocket.cpp b/Jusin154_Team3D/Engine/Private/TimeSocket.cpp new file mode 100644 index 000000000..cfd501a0e --- /dev/null +++ b/Jusin154_Team3D/Engine/Private/TimeSocket.cpp @@ -0,0 +1,90 @@ +#include "pch.h" +#include "TimeSocket.h" +#include "GameObject.h" + +CTimeSocket::CTimeSocket() +{ +} + +_bool CTimeSocket::Trigger(_float fRatio) +{ + _bool bResult = false; + if (m_Contents.fRatio <= fRatio) { + bResult = true; + m_Contents.funcEvent(*this); + } + + return bResult; +} +HRESULT CTimeSocket::Initialize(void* pArg) +{ + SOCKETCONTENTS* pDesc = static_cast(pArg); + + m_Contents.fRatio = pDesc->fRatio; + m_Contents.bTriggerred = pDesc->bTriggerred; + m_Contents.pEventTarget = pDesc->pEventTarget; + m_Contents.strEventName = pDesc->strEventName; + m_Contents.wstrLayerName = pDesc->wstrLayerName; + m_Contents.wstrKeyName = pDesc->wstrKeyName; + m_Contents.eTypeParam = pDesc->eTypeParam; + m_Contents.eTypeFunc = pDesc->eTypeFunc; + m_Contents.vFlags = pDesc->vFlags; + m_Contents.vParam_10 = pDesc->vParam_10; + m_Contents.vParam_11 = pDesc->vParam_11; + m_Contents.funcEvent = pDesc->funcEvent; + + switch (m_Contents.eTypeParam) + { + case TIMESOCKET_PARAM::TARGET: + m_Contents.pOtherTarget = pDesc->pOtherTarget; + break; + case TIMESOCKET_PARAM::TRANSFORM: + m_Contents.pxTransform = pDesc->pxTransform; + break; + case TIMESOCKET_PARAM::NOT_USE: + m_Contents.pOtherTarget = nullptr; + break; + default: + m_Contents.pOtherTarget = nullptr; + break; + } + + SAFE_ADDREF(m_Contents.pEventTarget); + if (m_Contents.eTypeParam == TIMESOCKET_PARAM::TARGET){ + SAFE_ADDREF(m_Contents.pOtherTarget); + } + + return S_OK; +} + +void CTimeSocket::Finalize() +{ + switch (m_Contents.eTypeParam) + { + case TIMESOCKET_PARAM::TARGET: + SAFE_RELEASE(m_Contents.pOtherTarget); + break; + default: + break; + } + SAFE_RELEASE(m_Contents.pEventTarget); +} + +CTimeSocket* CTimeSocket::Create(void* pArg) +{ + CTimeSocket* pInstance = new CTimeSocket(); + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Created : CTimeSocket"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CTimeSocket::Free() +{ + __super::Free(); + + Finalize(); +} diff --git a/Jusin154_Team3D/Engine/Private/Transform.cpp b/Jusin154_Team3D/Engine/Private/Transform.cpp index 4c1f10a3a..d95985a45 100644 --- a/Jusin154_Team3D/Engine/Private/Transform.cpp +++ b/Jusin154_Team3D/Engine/Private/Transform.cpp @@ -94,6 +94,15 @@ void CTransform::Set_WorldMatrix(PSX::PxTransform dstMatrix) XMMatrixAffineTransformation(XMLoadFloat3(&vScale), XMVectorZero(), XMLoadFloat4((_float4*)&dstMatrix.q), XMLoadFloat3((_float3*)&dstMatrix.p))); } +void CTransform::Compress_WorldMatrix(_float3& vTrans, _float4& vRotQ) +{ + vTrans.x = m_WorldMatrix.m[3][0]; + vTrans.y = m_WorldMatrix.m[3][1]; + vTrans.z = m_WorldMatrix.m[3][2]; + + XMStoreFloat4(&vRotQ, Get_QuarternionVector()); +} + HRESULT CTransform::Initialize_Prototype() { XMStoreFloat4x4(&m_WorldMatrix, XMMatrixIdentity()); @@ -418,6 +427,42 @@ void CTransform::Rotation(_fvector vRPY) Set_State(STATE::LOOK, vLook); } +void CTransform::RotationQ(_fvector vRotQ) +{ + _float3 vScale = Get_Scale(); + _vector vRight = XMVectorSet(1.f, 0.f, 0.f, 0.f) * vScale.x; + _vector vUp = XMVectorSet(0.f, 1.f, 0.f, 0.f) * vScale.y; + _vector vLook = XMVectorSet(0.f, 0.f, 1.f, 0.f) * vScale.z; + + _matrix RotationMatrix = XMMatrixRotationQuaternion(vRotQ); + + vRight = XMVector3TransformNormal(vRight, RotationMatrix); + vUp = XMVector3TransformNormal(vUp, RotationMatrix); + vLook = XMVector3TransformNormal(vLook, RotationMatrix); + + Set_State(STATE::RIGHT, vRight); + Set_State(STATE::UP, vUp); + Set_State(STATE::LOOK, vLook); +} + +void CTransform::RotationQ(PSX::PxQuat vRotQ) +{ + _float3 vScale = Get_Scale(); + _vector vRight = XMVectorSet(1.f, 0.f, 0.f, 0.f) * vScale.x; + _vector vUp = XMVectorSet(0.f, 1.f, 0.f, 0.f) * vScale.y; + _vector vLook = XMVectorSet(0.f, 0.f, 1.f, 0.f) * vScale.z; + + _matrix RotationMatrix = XMMatrixRotationQuaternion(XMVectorSet(vRotQ.x, vRotQ.y, vRotQ.z, vRotQ.w)); + + vRight = XMVector3TransformNormal(vRight, RotationMatrix); + vUp = XMVector3TransformNormal(vUp, RotationMatrix); + vLook = XMVector3TransformNormal(vLook, RotationMatrix); + + Set_State(STATE::RIGHT, vRight); + Set_State(STATE::UP, vUp); + Set_State(STATE::LOOK, vLook); +} + void CTransform::LookAt(_fvector vAt) { _float3 vScale = Get_Scale(); @@ -555,6 +600,35 @@ void CTransform::Free() void CTransform::Describe_Entity() { +#ifdef 기무리 + if (GUI::TreeNode("NuriDebug")) { + { + _vector vScale, vRotQ, vTrans; + XMMatrixDecompose(&vScale, &vRotQ, &vTrans, XMLoadFloat4x4(&m_WorldMatrix)); + _float4 scale, rotQ, trans; + XMStoreFloat4(&scale, vScale); + XMStoreFloat4(&rotQ, vRotQ); + XMStoreFloat4(&trans, vTrans); + if (GUI::SmallButton("Copy")) { + _char buf[512] = {}; + sprintf_s( + buf, sizeof(buf), + "\n" + "\t\n" + "\t\n" + "", + rotQ.x, rotQ.y, rotQ.z, rotQ.w, + trans.x, trans.y, trans.z + ); + GUI::SetClipboardText(buf); + } + GUI::Text("vScale : %.1f\t%.1f\t%.1f", scale.x, scale.y, scale.z); + GUI::Text("vRotQ : %.2f\t%.2f\t%.2f\t%.2f", rotQ.x, rotQ.y, rotQ.z, rotQ.w); + GUI::Text("vTrans : %.1f\t%.1f\t%.1f", trans.x, trans.y, trans.z); + } + GUI::TreePop(); + } +#endif // 기무리 if (GUI::TreeNode("Transform")) { GUI::Text("----- Gizmo ----"); _float3 vMove = {}; diff --git a/Jusin154_Team3D/Engine/Private/UIObject.cpp b/Jusin154_Team3D/Engine/Private/UIObject.cpp index ebb28b9da..a57ffec1f 100644 --- a/Jusin154_Team3D/Engine/Private/UIObject.cpp +++ b/Jusin154_Team3D/Engine/Private/UIObject.cpp @@ -370,7 +370,7 @@ void CUIObject::Lerp_PosY(_float PosY) m_fLerpY = PosY; } -_bool CUIObject::Start_Lerp(_float fTimeDelta) +_bool CUIObject::Start_Lerp_Translation(_float fTimeDelta) { return false; } diff --git a/Jusin154_Team3D/Engine/Private/tinyxml2.cpp b/Jusin154_Team3D/Engine/Private/tinyxml2.cpp index c237340e2..d05ae3efb 100644 --- a/Jusin154_Team3D/Engine/Private/tinyxml2.cpp +++ b/Jusin154_Team3D/Engine/Private/tinyxml2.cpp @@ -1,4 +1,4 @@ -/* +/* Original code by Lee Thomason (www.grinninglizard.com) This software is provided 'as-is', without any express or implied diff --git a/Jusin154_Team3D/Engine/Public/Camera.h b/Jusin154_Team3D/Engine/Public/Camera.h index c22ee96cf..a6acf7155 100644 --- a/Jusin154_Team3D/Engine/Public/Camera.h +++ b/Jusin154_Team3D/Engine/Public/Camera.h @@ -40,7 +40,10 @@ class ENGINE_DLL CCamera abstract : public CGameObject virtual void Late_Update(_float fTimeDelta) override; virtual HRESULT Render() override; virtual HRESULT Ready_Components(void* pArg)override; + virtual void Trigger(class CTimeSocket& Socket) {}; virtual void EnableTransition(_float fTransitionTime); + virtual void DisableTransition(); + void Set_RotDegreeVerticalLock(_float2 vVerticalLock); _float2 Get_RotDegreeVerticalLock(); @@ -49,9 +52,12 @@ class ENGINE_DLL CCamera abstract : public CGameObject _bool IsImportantThan(CCamera* pOther) const; const _float* Get_CurrentFar(); void ZoomIn(_float fTimeDelta); - void Set_Fov(_float fFovy,_float fTimeDelta, _bool& bZoomIn); + void Set_FovSlope(_float fFovy,_float fTimeDelta, _bool& bZoomIn); + + void Set_Fov(_float fFovy); _float Get_Fov(); + protected: _float m_fFovy = {}; _float m_fAspect = {}; diff --git a/Jusin154_Team3D/Engine/Public/Camera_Manager.h b/Jusin154_Team3D/Engine/Public/Camera_Manager.h index e599912ee..3d2ab50a7 100644 --- a/Jusin154_Team3D/Engine/Public/Camera_Manager.h +++ b/Jusin154_Team3D/Engine/Public/Camera_Manager.h @@ -15,6 +15,7 @@ class CCamera_Manager final : public CBase HRESULT Release_Camera(_uint iLevel, const _wstring& wstrCameraKey); HRESULT Add_Camera(_uint iLevel, CCamera* pCamera, const _wstring& wstrCameraKey); HRESULT Bind_Camera(_uint iLevel, const _wstring& wstrCameraKey, _bool bIgnorePriority); + class CCamera* Get_Camera(_uint iLevel, const _wstring& strCameraKey); HRESULT IsBinded_Camera(const _wstring& wstrCameraKey); _vector Get_CameraLook(); _float Get_CameraFov(); diff --git a/Jusin154_Team3D/Engine/Public/ElementObject.h b/Jusin154_Team3D/Engine/Public/ElementObject.h index 3e4d70450..c88564c54 100644 --- a/Jusin154_Team3D/Engine/Public/ElementObject.h +++ b/Jusin154_Team3D/Engine/Public/ElementObject.h @@ -30,7 +30,7 @@ class ENGINE_DLL CElementObject abstract : public CUIObject virtual _float Get_Nine_Slice_Top() override; virtual _float Get_Nine_Slice_Bottom() override; - virtual _bool Start_Lerp(_float fTimeDelta) override; + virtual _bool Start_Lerp_Translation(_float fTimeDelta) override; virtual _bool Start_Lerp_Speed(_float fTimeDelta, _float2 MousePoint) override; virtual _bool Set_Trgger(); virtual void Reset_Pos(_float fTimeDelta)override; diff --git a/Jusin154_Team3D/Engine/Public/Engine_Struct.h b/Jusin154_Team3D/Engine/Public/Engine_Struct.h index a4c17238a..7933e1aa1 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Struct.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Struct.h @@ -619,4 +619,8 @@ typedef struct tagPrevVPMatrices { _float4x4 PrevProjMatrix; }PREVVPMATRICES; +typedef struct tagBoolean { + _bool b[16] = {}; +}_boolean; + NS_END diff --git a/Jusin154_Team3D/Engine/Public/GameInstance.h b/Jusin154_Team3D/Engine/Public/GameInstance.h index 09abcda1b..21b7bebd4 100644 --- a/Jusin154_Team3D/Engine/Public/GameInstance.h +++ b/Jusin154_Team3D/Engine/Public/GameInstance.h @@ -199,6 +199,7 @@ class ENGINE_DLL CGameInstance final : public CBase HRESULT Release_Camera(_uint iLevel, const _wstring& wstrCameraKey); HRESULT Add_Camera(_uint iLevel, class CCamera* pCamera, const _wstring& strCameraKey); HRESULT Bind_Camera(_uint iLevel, const _wstring& strCameraKey, _bool bIgnorePriority); + class CCamera* Get_Camera(_uint iLevel, const _wstring& strCameraKey); HRESULT IsBinded_Camera(const _wstring& strCameraKey); _vector Get_CameraLook(); _float Get_CameraFov(); diff --git a/Jusin154_Team3D/Engine/Public/Model.h b/Jusin154_Team3D/Engine/Public/Model.h index 4de3c997c..3269564bc 100644 --- a/Jusin154_Team3D/Engine/Public/Model.h +++ b/Jusin154_Team3D/Engine/Public/Model.h @@ -214,7 +214,7 @@ class ENGINE_DLL CModel final : public CComponent _matrix m_DeltaAnimationMatrix = {}; // 루트본의 델타애니메이션 class CTransform* m_pTransform = { nullptr }; // 모델 대상의 트랜스폼 - _float m_fRatio = {}; + _float fRatio = {}; _int m_iCurrSecondAnimIndex = { -1 }; _int m_iBoneIndex[ENUM_CLASS(BLEND_BONE::END)] = { -1,-1,-1,-1,-1,-1,-1,-1 }; vector> m_BoneMask; @@ -247,6 +247,7 @@ class ENGINE_DLL CModel final : public CComponent _bool m_bIsSecondFinishedAnim = { false }; _bool m_bIsSecondLoop = { false }; _bool m_bRatio = { false }; + _float m_fRatio = { 0.f }; _bool m_bRootBone = {}; _float4x4 m_RootMatrix = {}; _bool m_bDisableRootMotionScale = {false}; diff --git a/Jusin154_Team3D/Engine/Public/MyTools.h b/Jusin154_Team3D/Engine/Public/MyTools.h index 89bf81ac7..18173e55c 100644 --- a/Jusin154_Team3D/Engine/Public/MyTools.h +++ b/Jusin154_Team3D/Engine/Public/MyTools.h @@ -155,6 +155,30 @@ class CMyTools { XMStoreFloat4x4(&matOut, (XMMatrixAffineTransformation(vTargetScale, XMVectorZero(), vTargetRotq, vTargetTrans))); } + + inline static void MatrixLerp( + _In_ _float3* pTransOrigin, // Origin -> 0 + _In_ _float3* pTransDest, + _In_ _float4* pRotQOrigin, + _In_ _float4* pRotQDest, + _Out_ _float4x4& matOut, _float fRatio) { + fRatio = Saturate(fRatio); + + _vector vOriginRotQ = XMVectorSet(pRotQOrigin->x, pRotQOrigin->y, pRotQOrigin->z, pRotQOrigin->w); + _vector vOriginTrans = XMVectorSet(pTransOrigin->x, pTransOrigin->y, pTransOrigin->z, 0.f); + + _vector vDestRotQ = XMVectorSet(pRotQDest->x, pRotQDest->y, pRotQDest->z, pRotQDest->w); + _vector vDestTrans = XMVectorSet(pTransDest->x, pTransDest->y, pTransDest->z, 0.f); + + if (XMVectorGetX(XMVector4Dot(vOriginRotQ, vDestRotQ)) < 0.f){ + vDestRotQ = XMVectorNegate(vDestRotQ); + } + + _vector vLerpRotQ = XMQuaternionSlerp(vOriginRotQ, vDestRotQ, fRatio); + _vector vLerpTrans = XMVectorLerp(vOriginTrans, vDestTrans, fRatio); + + XMStoreFloat4x4(&matOut, XMMatrixAffineTransformation(XMVectorSet(1.f, 1.f, 1.f, 0.f), XMVectorZero(), vLerpRotQ, vLerpTrans)); + } // 비슷하면 1 직교하면 0 완전 반대방향일수록 -1 inline static _float DirectionCompare(_vector a, _vector b) @@ -337,6 +361,31 @@ class CMyTools { return (Alphabet - 'A'); } + + template + inline static _bool TryParseEnum( string_view text, const pair(&table)[N], ENUM& outValue) + { + for (size_t i = 0; i < N; ++i) + { + if (table[i].first == text) + { + outValue = table[i].second; + return true; + } + } + return false; + } + + template + inline static string_view EnumToString( ENUM value, const pair(&table)[N], string_view fallback = "UNKNOWN") + { + for (size_t i = 0; i < N; ++i) + { + if (table[i].second == value) + return table[i].first; + } + return fallback; + } #ifdef _DEBUG inline static _bool DescribePxTransform(PSX::PxTransform& pxTransform, size_t iID) diff --git a/Jusin154_Team3D/Engine/Public/PanelObject.h b/Jusin154_Team3D/Engine/Public/PanelObject.h index d1b1aefc1..d49e14c04 100644 --- a/Jusin154_Team3D/Engine/Public/PanelObject.h +++ b/Jusin154_Team3D/Engine/Public/PanelObject.h @@ -34,7 +34,7 @@ class ENGINE_DLL CPanelObject abstract : public CUIObject virtual void Add_Function(wstring Name, function Evnet) override; virtual void Function_Callback(wstring Name, void* pArg = nullptr) override; - virtual _bool Start_Lerp(_float fTimeDelta) override; + virtual _bool Start_Lerp_Translation(_float fTimeDelta) override; virtual void Reset_Pos(_float fTimeDelta)override; protected: diff --git a/Jusin154_Team3D/Engine/Public/PhysX/vehicle2/physxConstraints/PxVehiclePhysXConstraintStates.h b/Jusin154_Team3D/Engine/Public/PhysX/vehicle2/physxConstraints/PxVehiclePhysXConstraintStates.h index 3b825b5df..84a5d06d6 100644 --- a/Jusin154_Team3D/Engine/Public/PhysX/vehicle2/physxConstraints/PxVehiclePhysXConstraintStates.h +++ b/Jusin154_Team3D/Engine/Public/PhysX/vehicle2/physxConstraints/PxVehiclePhysXConstraintStates.h @@ -1,4 +1,4 @@ -// Redistribution and use in source and binary forms, with or without +// Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // * Redistributions of source code must retain the above copyright @@ -127,7 +127,7 @@ struct PxVehiclePhysXConstraintState } }; -//TAG:solverprepshader +//ZOOM_IN:solverprepshader PX_FORCE_INLINE PxU32 vehicleConstraintSolverPrep (Px1DConstraint* constraints, PxVec3p& body0WorldOffset, diff --git a/Jusin154_Team3D/Engine/Public/TimeSocket.h b/Jusin154_Team3D/Engine/Public/TimeSocket.h new file mode 100644 index 000000000..bf66c54ee --- /dev/null +++ b/Jusin154_Team3D/Engine/Public/TimeSocket.h @@ -0,0 +1,137 @@ +#pragma once +#include "GameInstance.h" + +NS_BEGIN(Engine) +class CGameObject; +class CTimeSocket; + +typedef enum class typeTimeSocket_Param { + NOT_USE, + TARGET, + TRANSFORM, + END +}TIMESOCKET_PARAM; + +static constexpr pair g_SocketParamTypeTable[ENUM_CLASS(TIMESOCKET_PARAM::END) + 1] = +{ + {"NOT_USE", TIMESOCKET_PARAM::NOT_USE}, + {"TARGET", TIMESOCKET_PARAM::TARGET}, + {"TRANSFORM", TIMESOCKET_PARAM::TRANSFORM}, + {"END", TIMESOCKET_PARAM::END}, +}; + +typedef enum class typeTimeSocket_Func { + // COMMON + TRANSLATION, + TRANSLATION_LERP, + TOGGLE_FLAGS, + + // CAMERA + BIND_CAMERA, + ZOOM_IN, + ZOOM_OUT, + ZOOM_LERP, + FADE_IN, + FADE_OUT, + END_CINEMATIC, + SET_PITCHLIMIT, + LOOK_AT, + DONT_LOOK_AT, + FOLLOW, + DONT_FOLLOW, + SHAKE, + + // CHARACTER + SET_ANIMSTATE, + SET_FSMSTATE, + + // EFFECT + + // SOUND + + // TRIGGER + END +}TIMESOCKET_FUNC; + +static constexpr pair g_SocketFuncTypeTable[ENUM_CLASS(TIMESOCKET_FUNC::END) + 1] = +{ + {"TRANSLATION", TIMESOCKET_FUNC::TRANSLATION}, + {"TRANSLATION_LERP", TIMESOCKET_FUNC::TRANSLATION_LERP}, + {"TOGGLE_FLAGS", TIMESOCKET_FUNC::TOGGLE_FLAGS}, + + {"BIND_CAMERA", TIMESOCKET_FUNC::BIND_CAMERA}, + {"ZOOM_IN", TIMESOCKET_FUNC::ZOOM_IN}, + {"ZOOM_OUT", TIMESOCKET_FUNC::ZOOM_OUT}, + {"ZOOM_LERP", TIMESOCKET_FUNC::ZOOM_LERP}, + {"FADE_IN", TIMESOCKET_FUNC::FADE_IN}, + {"FADE_OUT", TIMESOCKET_FUNC::FADE_OUT}, + {"END_CINEMATIC", TIMESOCKET_FUNC::END_CINEMATIC}, + {"SET_PITCHLIMIT", TIMESOCKET_FUNC::SET_PITCHLIMIT}, + {"LOOK_AT", TIMESOCKET_FUNC::LOOK_AT}, + {"DONT_LOOK_AT", TIMESOCKET_FUNC::DONT_LOOK_AT}, + {"FOLLOW", TIMESOCKET_FUNC::FOLLOW}, + {"DONT_FOLLOW", TIMESOCKET_FUNC::DONT_FOLLOW}, + + {"SET_ANIMSTATE", TIMESOCKET_FUNC::SET_ANIMSTATE}, + {"SET_FSMSTATE", TIMESOCKET_FUNC::SET_FSMSTATE}, + + {"END", TIMESOCKET_FUNC::END}, +}; + +typedef struct tagSocketContents { + _float fRatio = { 0.f }; + _bool bTriggerred = { false }; + CGameObject* pEventTarget = { nullptr }; + _string strEventName = {}; + _wstring wstrLayerName = {}; + _wstring wstrKeyName = {}; + TIMESOCKET_PARAM eTypeParam = {}; + TIMESOCKET_FUNC eTypeFunc = {}; + union { + CGameObject* pOtherTarget = { nullptr }; + PSX::PxTransform pxTransform; + }; + _boolean vFlags = {}; + _uint4 vParam_10 = {}; + _float4 vParam_11 = {}; + function funcEvent = { nullptr }; +}SOCKETCONTENTS; + +class ENGINE_DLL CTimeSocket final : public CBase +{ +private: + CTimeSocket(); + virtual ~CTimeSocket() = default; +public: + SOCKETCONTENTS m_Contents = {}; + virtual _bool Trigger(_float fRatio); + + inline static _bool TryParse_TimeSocketParam(string_view text, TIMESOCKET_PARAM& outValue) + { + return CMyTools::TryParseEnum(text, g_SocketParamTypeTable, outValue); + } + + inline static string_view ToString_TimeSocketParam(TIMESOCKET_PARAM value) + { + return CMyTools::EnumToString(value, g_SocketParamTypeTable, "UNKNOWN_PARAM"); + } + + inline static _bool TryParse_TimeSocketFunc(string_view text, TIMESOCKET_FUNC& outValue) + { + return CMyTools::TryParseEnum(text, g_SocketFuncTypeTable, outValue); + } + + inline static string_view ToString_TimeSocketFunc(TIMESOCKET_FUNC value) + { + return CMyTools::EnumToString(value, g_SocketFuncTypeTable, "UNKNOWN_FUNC"); + } + +public: + static CTimeSocket* Create(void* pArg); + virtual void Free() override; +private: + HRESULT Initialize(void* pArg); + void Finalize(); +}; + +NS_END diff --git a/Jusin154_Team3D/Engine/Public/Transform.h b/Jusin154_Team3D/Engine/Public/Transform.h index 91cd1f269..bcb69fea0 100644 --- a/Jusin154_Team3D/Engine/Public/Transform.h +++ b/Jusin154_Team3D/Engine/Public/Transform.h @@ -28,6 +28,7 @@ class ENGINE_DLL CTransform final : void Set_WorldMatrix(_float4x4& dstMatrix) { memcpy_s(&m_WorldMatrix, sizeof(_float4x4), &dstMatrix, sizeof(_float4x4)); } void Set_WorldMatrix(_fmatrix& dstMatrix) { XMStoreFloat4x4(&m_WorldMatrix, dstMatrix); } void Set_WorldMatrix(PSX::PxTransform dstMatrix); + void Compress_WorldMatrix(_float3& vTrans, _float4& vRotQ); _float Get_Speed() const { return m_fSpeedPerSec; } _float Get_RotationSpeed() const { return m_fRotationPerSec; } _float Get_Radius() const { return m_fRadius; } @@ -77,6 +78,8 @@ class ENGINE_DLL CTransform final : void Rotation(_float fRadianX, _float fRadianY, _float fRadianZ); void Rotation(_float3& vRadian); void Rotation(_fvector vRPY); + void RotationQ(_fvector vRotQ); + void RotationQ(PSX::PxQuat vRotQ); // Up, Down 벡터를 바라보게 하면 터짐, w에 1 있어야함 void LookAt(_fvector vAt); diff --git a/Jusin154_Team3D/Engine/Public/UIObject.h b/Jusin154_Team3D/Engine/Public/UIObject.h index 56a728363..ab627ee6b 100644 --- a/Jusin154_Team3D/Engine/Public/UIObject.h +++ b/Jusin154_Team3D/Engine/Public/UIObject.h @@ -156,7 +156,7 @@ typedef struct tagSpellLearnInfo virtual void Lerp_PosX(_float PosX); virtual void Lerp_PosY(_float PosY); - virtual _bool Start_Lerp(_float fTimeDelta); + virtual _bool Start_Lerp_Translation(_float fTimeDelta); virtual _bool Start_Lerp_Speed(_float fTimeDelta, _float2 Mouse_Point); virtual void Reset_Pos(_float fTimeDelta); virtual void Start_Size_Lerp(_float fTimeDelta); diff --git a/Jusin154_Team3D/Engine/Public/Unit.h b/Jusin154_Team3D/Engine/Public/Unit.h index cc11e348c..203419e88 100644 --- a/Jusin154_Team3D/Engine/Public/Unit.h +++ b/Jusin154_Team3D/Engine/Public/Unit.h @@ -32,6 +32,7 @@ class ENGINE_DLL CUnit abstract : public CContainerObject virtual void Priority_Update(_float fTimeDelta) override; virtual void Update(_float fTimeDelta) override; virtual void Late_Update(_float fTimeDelta) override; + virtual void Trigger(class CTimeSocket& Socket) {}; _wstring& Get_PrototypeTag() { return m_strModelPrototypeTag; } _bool IsAI() { return m_bAI; }