diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj b/Jusin154_Team3D/Client/Default/Client.vcxproj index 01584470d..3f3bd6c8f 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj @@ -169,7 +169,9 @@ - + + + @@ -223,6 +225,9 @@ + + + diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters index 1c2c3c505..a94092e3b 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters @@ -67,9 +67,6 @@ 02.GameObjects\Item\Wand - - 02.GameObjects\Cameras\CameraPosition\Player - 02.GameObjects\Cameras\CameraPosition\Arm @@ -151,6 +148,15 @@ 02.GameObjects\PhysX\EffectHitBox + + 02.GameObjects\Cameras\CameraPosition\Socket + + + 02.GameObjects\Cameras\CameraPosition\Player\Target + + + 02.GameObjects\Cameras\CameraPosition\Player\Shoulder + @@ -233,9 +239,6 @@ {8d89a59c-fbd2-4a4a-ab01-a70abb80cc49} - - {708bbc88-47fb-42c5-b060-14cec7d646f2} - {b24c78ef-dccc-41f0-a086-053ae6b7fbf4} @@ -374,6 +377,15 @@ {54169d8d-f771-4638-a71e-3aca3eeff9bb} + + {1f9c16e8-b675-419f-b166-b79662407259} + + + {708bbc88-47fb-42c5-b060-14cec7d646f2} + + + {2e4f0394-e25c-4508-937a-7e73d005ae5f} + @@ -427,9 +439,6 @@ 02.GameObjects\Item\Wand - - 02.GameObjects\Cameras\CameraPosition\Player - 02.GameObjects\Cameras\CameraPosition\Arm @@ -511,6 +520,15 @@ 02.GameObjects\PhysX\EffectHitBox + + 02.GameObjects\Cameras\CameraPosition\Socket + + + 02.GameObjects\Cameras\CameraPosition\Player\Target + + + 02.GameObjects\Cameras\CameraPosition\Player\Shoulder + diff --git a/Jusin154_Team3D/Client/Private/Broom.cpp b/Jusin154_Team3D/Client/Private/Broom.cpp index a0d336b21..705d3dbde 100644 --- a/Jusin154_Team3D/Client/Private/Broom.cpp +++ b/Jusin154_Team3D/Client/Private/Broom.cpp @@ -38,18 +38,6 @@ void CBroom::Priority_Update(_float fTimeDelta) void CBroom::Update(_float fTimeDelta) { - m_pModelCom->ComputeAnimation(); - - static _uint m_iIndex = 0; - - if (m_pGameInstance->Key_Down(DIK_1)) - m_iIndex++; - if (m_pGameInstance->Key_Down(DIK_2)) - m_iIndex--; - - m_pModelCom->Set_AnimationIndex(m_iIndex); - - m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); } diff --git a/Jusin154_Team3D/Client/Private/CamPosition_Arm.cpp b/Jusin154_Team3D/Client/Private/CamPosition_Arm.cpp index 14c06801f..2f00ec9dc 100644 --- a/Jusin154_Team3D/Client/Private/CamPosition_Arm.cpp +++ b/Jusin154_Team3D/Client/Private/CamPosition_Arm.cpp @@ -6,12 +6,10 @@ CCamPosition_Arm::CCamPosition_Arm(ID3D11Device* pDevice, ID3D11DeviceContext* p : CCamPosition(pDevice, pContext) { } - CCamPosition_Arm::CCamPosition_Arm(const CCamPosition_Arm& rhs) : CCamPosition(rhs) { } - HRESULT CCamPosition_Arm::Initialize_Prototype() { return S_OK; @@ -44,6 +42,7 @@ void CCamPosition_Arm::Priority_Update(_float fTimeDelta) void CCamPosition_Arm::Update(_float fTimeDelta) { + } void CCamPosition_Arm::Late_Update(_float fTimeDelta) @@ -96,12 +95,10 @@ CCamPosition_Arm* CCamPosition_Arm::Clone(void* pArg, class CGameObject* pOWner) return pInstance; } - void CCamPosition_Arm::Free() { __super::Free(); } - void CCamPosition_Arm::Describe_Entity() { } diff --git a/Jusin154_Team3D/Client/Private/CamPosition_Shoulder.cpp b/Jusin154_Team3D/Client/Private/CamPosition_Shoulder.cpp new file mode 100644 index 000000000..0c53d1141 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/CamPosition_Shoulder.cpp @@ -0,0 +1,192 @@ +#include "pch.h" +#include "CamPosition_Shoulder.h" +#include "CamPosition_Target.h" +#include "GameInstance.h" +#include "Camera_Gaze.h" + +CCamPosition_Shoulder::CCamPosition_Shoulder(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CCamPosition(pDevice, pContext) +{ +} +CCamPosition_Shoulder::CCamPosition_Shoulder(const CCamPosition_Shoulder& rhs) + : CCamPosition(rhs) +{ +} +HRESULT CCamPosition_Shoulder::Initialize_Prototype() +{ + return S_OK; +} +HRESULT CCamPosition_Shoulder::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) { + return E_FAIL; + } + if (FAILED(Ready_SubParts())) { + return E_FAIL; + } + + CAMERA_SHOULDER_DESC* pDesc = static_cast(pArg); + { + m_fMouseSensor = pDesc->fMouseSensor; + m_vShoulderPosRatio = pDesc->vInitialLook; + m_fShoulderDistance = pDesc->fShoulderDistance; + m_vAccDegreeXY = { 0.f, 0.f }; + m_fCameraFocalLength = pDesc->fCameraFocalLength; + m_fBackFrontRatio = pDesc->fBackFrontRatio; + m_pTransformCom->Set_State(STATE::POSITION, m_pParentTransformCom->Get_State(STATE::POSITION) + XMVector3Normalize(XMLoadFloat3(&m_vShoulderPosRatio)) * m_fShoulderDistance); + + + _vector vShoulderPos = Get_WorldPostion(); + _vector vCameraLook = XMVectorSet(0.f, 0.f, 1.f, 0.f); + _vector vRotCameraq = XMQuaternionRotationRollPitchYaw(XMConvertToRadians(m_vAccDegreeXY.x), XMConvertToRadians(m_vAccDegreeXY.y), 0.f); + vCameraLook = XMVector3Normalize(XMVector3Rotate(vCameraLook, vRotCameraq)); + + CTransform* pLookTransform = m_pTarget_LookPart->Get_Component(); + CTransform* pFollowTransform = m_pTarget_FollowPart->Get_Component(); + + pLookTransform->Set_State(STATE::POSITION, vShoulderPos + vCameraLook * (m_fCameraFocalLength * m_fBackFrontRatio)); + pFollowTransform->Set_State(STATE::POSITION, vShoulderPos - vCameraLook * (m_fCameraFocalLength * (1 - m_fBackFrontRatio))); + } + + return S_OK; +} + +void CCamPosition_Shoulder::Priority_Update(_float fTimeDelta) +{ + if (true == m_bMovable) { + m_vAccDegreeXY.y += m_pGameInstance->Get_MouseMove().x * m_fMouseSensor; + m_vAccDegreeXY.x += m_pGameInstance->Get_MouseMove().y * m_fMouseSensor; + } + + _vector vLook = XMVector3Normalize(XMLoadFloat3(&m_vShoulderPosRatio)); + _vector vRotq = XMQuaternionRotationRollPitchYaw(0.f, XMConvertToRadians(m_vAccDegreeXY.y), 0.f); + vLook = XMVector3Normalize(XMVector3Rotate(vLook, vRotq)); + + m_pTransformCom->Set_State(STATE::POSITION, m_pParentTransformCom->Get_State(STATE::POSITION) + XMVector3Normalize(vLook) * m_fShoulderDistance); + _vector vShoulderPos = Get_WorldPostion(); + _vector vCameraLook = XMVectorSet(0.f, 0.f, 1.f, 0.f); + _vector vRotCameraq = XMQuaternionRotationRollPitchYaw(XMConvertToRadians(m_vAccDegreeXY.x), XMConvertToRadians(m_vAccDegreeXY.y), 0.f); + vCameraLook = XMVector3Normalize(XMVector3Rotate(vCameraLook, vRotCameraq)); + + CTransform* pLookTransform = m_pTarget_LookPart->Get_Component(); + CTransform* pFollowTransform = m_pTarget_FollowPart->Get_Component(); + + pLookTransform->Set_State(STATE::POSITION, vShoulderPos + vCameraLook * (m_fCameraFocalLength * m_fBackFrontRatio)); + pFollowTransform->Set_State(STATE::POSITION, vShoulderPos - vCameraLook * (m_fCameraFocalLength * (1 - m_fBackFrontRatio))); +} + +void CCamPosition_Shoulder::Update(_float fTimeDelta) +{ + Describe_Entity(); + if (m_pGameInstance->Key_Up(DIK_GRAVE)) { + m_bMovable = !m_bMovable; + } + if (m_pGameInstance->Mouse_Down(DIM_RBUTTON)) { + m_pGameInstance->Toggle_MouseCenter(); + } + if (m_pGameInstance->Key_Up(DIK_P)) { + m_vShoulderPosRatio.x *= -1.f; + } +} + +void CCamPosition_Shoulder::Late_Update(_float fTimeDelta) +{ + +} + +HRESULT CCamPosition_Shoulder::Render() +{ + return S_OK; +} + +_vector CCamPosition_Shoulder::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CCamPosition_Shoulder::Ready_Components(void* pArg) +{ + CTransform::TRANSFORM_DESC DescTransfrom = {}; + DescTransfrom.fRadius = 30.f; + DescTransfrom.fRotationPerSec = 0.f; + DescTransfrom.fSpeedPerSec = 0.f; + if (FAILED(__super::Ready_Components(&DescTransfrom))) { + return E_FAIL; + } + return S_OK; +} +HRESULT CCamPosition_Shoulder::Ready_SubParts() +{ + { + CCamPosition_Target::CAMERAPOSITION_TARGET_DESC Desc{}; + Desc.pParentTransform = m_pTransformCom; + m_pTarget_LookPart = m_pGameInstance->Clone_Prototype< CCamPosition_Target>(g_iStaticLevel, &Desc); + m_pTarget_FollowPart = m_pGameInstance->Clone_Prototype< CCamPosition_Target>(g_iStaticLevel, &Desc); + } + + CCamera_Gaze::CAMERA_GAZE_DESC CameraDesc{}; + CameraDesc.fFovy = XMConvertToRadians(60.0f); + CameraDesc.fNear = 0.1f; + CameraDesc.fFar = 300.f; + CameraDesc.fSpeedPerSec = 5.f; + CameraDesc.fRotationPerSec = XMConvertToRadians(90.f); + CameraDesc.pFollowTarget = m_pTarget_FollowPart; + CameraDesc.pLookTarget = m_pTarget_LookPart; + CameraDesc.iPriority = 51; + + CCamera_Gaze* pCamera = { nullptr }; + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &CameraDesc, nullptr, &pCamera))) + { + return E_FAIL; + } + m_pGameInstance->Add_Camera(NEXT_LEVEL, pCamera, TEXT("CAM_SHOULDER")); + + + return S_OK; +} +CCamPosition_Shoulder* CCamPosition_Shoulder::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CCamPosition_Shoulder* pInstance = new CCamPosition_Shoulder(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CCamPosition_Shoulder"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} +CCamPosition_Shoulder* CCamPosition_Shoulder::Clone(void* pArg, class CGameObject* pOWner) +{ + CCamPosition_Shoulder* pInstance = new CCamPosition_Shoulder(*this); + pInstance->m_pOwner = pOWner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CCamPosition_Shoulder"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} +void CCamPosition_Shoulder::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pTarget_LookPart); + SAFE_RELEASE(m_pTarget_FollowPart); +} +void CCamPosition_Shoulder::Describe_Entity() +{ + GUI::Begin("Cam_Shoulder"); + m_pTransformCom->Describe_Entity(); + GUI::Text("fMouseSensor : %.1f", &m_fMouseSensor); + GUI::SliderFloat("ShoulderDistance", &m_fShoulderDistance, 0.f, 10.f, "%.1f"); + GUI::SliderFloat("BackFrontRatio", &m_fBackFrontRatio, 0.01f, 0.99f, "%.2f"); + GUI::Text("Pitch Yaw : %f %f", &m_vAccDegreeXY.x, &m_vAccDegreeXY.y); + GUI::SliderFloat3("ShoulderPosRatio", (_float*)&m_vShoulderPosRatio, -2.f, 2.f, "%.1f"); + GUI::End(); +} diff --git a/Jusin154_Team3D/Client/Private/CamPosition_Player.cpp b/Jusin154_Team3D/Client/Private/CamPosition_Socket.cpp similarity index 54% rename from Jusin154_Team3D/Client/Private/CamPosition_Player.cpp rename to Jusin154_Team3D/Client/Private/CamPosition_Socket.cpp index 074fdc97e..a0e990a1f 100644 --- a/Jusin154_Team3D/Client/Private/CamPosition_Player.cpp +++ b/Jusin154_Team3D/Client/Private/CamPosition_Socket.cpp @@ -1,18 +1,18 @@ #include "pch.h" -#include "CamPosition_Player.h" +#include "CamPosition_Socket.h" -CCamPosition_Player::CCamPosition_Player(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +CCamPosition_Socket::CCamPosition_Socket(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CCamPosition(pDevice, pContext) { } -CCamPosition_Player::CCamPosition_Player(const CCamPosition_Player& rhs) +CCamPosition_Socket::CCamPosition_Socket(const CCamPosition_Socket& rhs) :CCamPosition(rhs) { } -void CCamPosition_Player::Priority_Update(_float fTimeDelta) +void CCamPosition_Socket::Priority_Update(_float fTimeDelta) { /*_matrix socketMatrix = {}; @@ -24,20 +24,20 @@ void CCamPosition_Player::Priority_Update(_float fTimeDelta) m_pTransformCom->Set_WorldMatrix(/*socketMatrix * */XMLoadFloat4x4(m_pParentTransformCom->Get_WorldMatrixPtr())); } -void CCamPosition_Player::Update(_float fTimeDelta) +void CCamPosition_Socket::Update(_float fTimeDelta) { } -void CCamPosition_Player::Late_Update(_float fTimeDelta) +void CCamPosition_Socket::Late_Update(_float fTimeDelta) { } -HRESULT CCamPosition_Player::Initialize_Prototype() +HRESULT CCamPosition_Socket::Initialize_Prototype() { return S_OK; } -HRESULT CCamPosition_Player::Initialize(void* pArg) +HRESULT CCamPosition_Socket::Initialize(void* pArg) { CAMERAPOSITION_PLAYER_DESC* pDesc = static_cast (pArg); //m_pSocketMatrices = pDesc->pSocketMatrices; @@ -54,7 +54,7 @@ HRESULT CCamPosition_Player::Initialize(void* pArg) return S_OK; } -HRESULT CCamPosition_Player::Ready_Components(void* pArg) +HRESULT CCamPosition_Socket::Ready_Components(void* pArg) { if (FAILED(__super::Ready_Components(pArg))) { @@ -64,42 +64,42 @@ HRESULT CCamPosition_Player::Ready_Components(void* pArg) return S_OK; } -HRESULT CCamPosition_Player::Bind_ShaderResources() +HRESULT CCamPosition_Socket::Bind_ShaderResources() { return S_OK; } -CCamPosition_Player* CCamPosition_Player::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +CCamPosition_Socket* CCamPosition_Socket::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { - CCamPosition_Player* pInstance = new CCamPosition_Player(pDevice, pContext); + CCamPosition_Socket* pInstance = new CCamPosition_Socket(pDevice, pContext); if (FAILED(pInstance->Initialize_Prototype())) { - MSG_BOX("Failed to Created : CCamPosition_Player"); + MSG_BOX("Failed to Created : CCamPosition_Socket"); SAFE_RELEASE(pInstance); } return pInstance; } -CCamPosition_Player* CCamPosition_Player::Clone(void* pArg, class CGameObject* pOWner) +CCamPosition_Socket* CCamPosition_Socket::Clone(void* pArg, class CGameObject* pOWner) { - CCamPosition_Player* pInstance = new CCamPosition_Player(*this); + CCamPosition_Socket* pInstance = new CCamPosition_Socket(*this); pInstance->m_pOwner = pOWner; if (FAILED(pInstance->Initialize(pArg))) { - MSG_BOX("Failed to Cloned : CCamPosition_Player"); + MSG_BOX("Failed to Cloned : CCamPosition_Socket"); SAFE_RELEASE(pInstance); } return pInstance; } -void CCamPosition_Player::Free() +void CCamPosition_Socket::Free() { __super::Free(); } -void CCamPosition_Player::Describe_Entity() +void CCamPosition_Socket::Describe_Entity() { } diff --git a/Jusin154_Team3D/Client/Private/CamPosition_Target.cpp b/Jusin154_Team3D/Client/Private/CamPosition_Target.cpp new file mode 100644 index 000000000..c3b561717 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/CamPosition_Target.cpp @@ -0,0 +1,94 @@ +#include "pch.h" + +#include "CamPosition_Target.h" + +CCamPosition_Target::CCamPosition_Target(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CCamPosition(pDevice, pContext) +{ +} +CCamPosition_Target::CCamPosition_Target(const CCamPosition_Target& rhs) + :CCamPosition(rhs) +{ +} + +void CCamPosition_Target::Priority_Update(_float fTimeDelta) +{ +} + +void CCamPosition_Target::Update(_float fTimeDelta) +{ +} + +void CCamPosition_Target::Late_Update(_float fTimeDelta) +{ +} + +_vector CCamPosition_Target::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CCamPosition_Target::Initialize_Prototype() +{ + return S_OK; +} +HRESULT CCamPosition_Target::Initialize(void* pArg) +{ + CAMERAPOSITION_TARGET_DESC* pDesc = static_cast (pArg); + if (FAILED(__super::Initialize(pArg))) { + return E_FAIL; + } + + if (FAILED(Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CCamPosition_Target::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) + { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CCamPosition_Target::Bind_ShaderResources() +{ + return S_OK; +} + +CCamPosition_Target* CCamPosition_Target::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CCamPosition_Target* pInstance = new CCamPosition_Target(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CCamPosition_Target"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} +CCamPosition_Target* CCamPosition_Target::Clone(void* pArg, class CGameObject* pOWner) +{ + CCamPosition_Target* pInstance = new CCamPosition_Target(*this); + pInstance->m_pOwner = pOWner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CCamPosition_Target"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} +void CCamPosition_Target::Free() +{ + __super::Free(); +} +void CCamPosition_Target::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/Level_Field.cpp b/Jusin154_Team3D/Client/Private/Level_Field.cpp index 8101093b3..dc5946532 100644 --- a/Jusin154_Team3D/Client/Private/Level_Field.cpp +++ b/Jusin154_Team3D/Client/Private/Level_Field.cpp @@ -40,7 +40,7 @@ HRESULT CLevel_Field::Initialize() void CLevel_Field::Update(_float fTimeDelta) { - if (m_pGameInstance->Mouse_Up(DIM_RBUTTON)) + if (m_pGameInstance->Key_Up(DIK_0)) { m_pGameInstance->Set_LevelToChange(); } diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index 5ff6078a2..6146c0058 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -58,7 +58,7 @@ HRESULT CLevel_GamePlay::Initialize() void CLevel_GamePlay::Update(_float fTimeDelta) { - if (m_pGameInstance->Mouse_Up(DIM_RBUTTON)) + if (m_pGameInstance->Key_Up(DIK_0)) { m_pGameInstance->Set_LevelToChange(); } diff --git a/Jusin154_Team3D/Client/Private/Level_Logo.cpp b/Jusin154_Team3D/Client/Private/Level_Logo.cpp index 6c6b50201..b63de72ac 100644 --- a/Jusin154_Team3D/Client/Private/Level_Logo.cpp +++ b/Jusin154_Team3D/Client/Private/Level_Logo.cpp @@ -23,7 +23,7 @@ HRESULT CLevel_Logo::Initialize() void CLevel_Logo::Update(_float fTimeDelta) { - if (m_pGameInstance->Mouse_Up(DIM_RBUTTON)) + if (m_pGameInstance->Key_Up(DIK_0)) { m_pGameInstance->Set_LevelToChange(); } diff --git a/Jusin154_Team3D/Client/Private/Level_Restart.cpp b/Jusin154_Team3D/Client/Private/Level_Restart.cpp index 91dc3500d..3e0d35041 100644 --- a/Jusin154_Team3D/Client/Private/Level_Restart.cpp +++ b/Jusin154_Team3D/Client/Private/Level_Restart.cpp @@ -22,7 +22,7 @@ HRESULT CLevel_Restart::Initialize() void CLevel_Restart::Update(_float fTimeDelta) { - if (m_pGameInstance->Mouse_Up(DIM_RBUTTON)) + if (m_pGameInstance->Key_Up(DIK_0)) { m_pGameInstance->Set_LevelToChange(); } diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index b42dc8eb6..6e6ee579a 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -10,7 +10,9 @@ #include "Player.h" #include "Camera_Gaze.h" -#include "CamPosition_Player.h" +#include "CamPosition_Socket.h" +#include "CamPosition_Target.h" +#include "CamPosition_Shoulder.h" #include "CamPosition_Arm.h" #include "Wand.h" #include "SkyBox.h" @@ -365,7 +367,15 @@ HRESULT CLoader::Loading_For_GamePlay() return E_FAIL; /* For.Prototype_GameObject_CamPosition_Player */ - if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCamPosition_Player::Create(m_pDevice, m_pContext)))) + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCamPosition_Socket::Create(m_pDevice, m_pContext)))) + return E_FAIL; + + /* For.Prototype_GameObject_CamPosition_Shoulder */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCamPosition_Shoulder::Create(m_pDevice, m_pContext)))) + return E_FAIL; + + /* For.Prototype_GameObject_CamPosition_Target */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCamPosition_Target::Create(m_pDevice, m_pContext)))) return E_FAIL; /* For.Prototype_GameObject_CamPosition_Arm */ diff --git a/Jusin154_Team3D/Client/Private/MainApp.cpp b/Jusin154_Team3D/Client/Private/MainApp.cpp index 122b4f2f3..c134df4dd 100644 --- a/Jusin154_Team3D/Client/Private/MainApp.cpp +++ b/Jusin154_Team3D/Client/Private/MainApp.cpp @@ -130,16 +130,21 @@ HRESULT CMainApp::Ready_IMGUI() ImGui_ImplWin32_Init(g_hWnd); ImGui_ImplDX11_Init(m_pDevice, m_pContext); - string strFontTag = "../Bin/Resources/Fonts/SHOWG.TTF"; - + //string strFontTag = "C:\\Windows\\Fonts\\malgun.ttf"; + string strFontTag = "../Bin/Resources/Fonts/malgunsl.TTF"; + ImFontConfig cfg; + cfg.OversampleH = 2; // 가독성 향상 + cfg.OversampleV = 2; + cfg.PixelSnapH = true; ifstream ifile; ifile.open(strFontTag); if (ifile) { - font = io.Fonts->AddFontFromFileTTF(strFontTag.c_str(), 10.f, NULL, io.Fonts->GetGlyphRangesKorean()); + font = io.Fonts->AddFontFromFileTTF(strFontTag.c_str(), 16.f, NULL, io.Fonts->GetGlyphRangesKorean()); } IM_ASSERT(font != NULL); + io.FontDefault = font; return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index 6c0d23408..150724cfd 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -2,14 +2,14 @@ #include "Player.h" #include "GameInstance.h" -#include "CamPosition_Player.h" +#include "CamPosition_Socket.h" #include "Camera_Gaze.h" #include "CamPosition_Arm.h" #include "Wand.h" #include "Character_Controller.h" #include "CallBack_Playable_Behavior.h" +#include "CamPosition_Shoulder.h" #include "CallBack_Playable_HitReport.h" -#include "Character_Controller.h" #pragma region STATE @@ -79,17 +79,6 @@ void CPlayer::Priority_Update(_float fTimeDelta) void CPlayer::Update(_float fTimeDelta) { - m_pModelCom->ComputeAnimation(); - - if (m_pGameInstance->Key_Up(DIK_O)) { - { - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::GAMEPLAY), CURRENT_LEVEL, LAYER_HITBOX, nullptr, this))) { - assert(false); - return; - } - } - } - IsSprint(); IsWalk(); @@ -217,45 +206,61 @@ HRESULT CPlayer::Ready_Parts() return E_FAIL; } - //CCamPosition_Player::CAMERAPOSITION_PLAYER_DESC Desc{}; - - //Desc.pParentTransform = m_pTransformCom; - - //if (FAILED(Add_PartObject("Cam_TopDown_Look", g_iStaticLevel, &m_pCamPosition_TopDown_LookPart, &Desc))) //{ - // return E_FAIL; + // CCamPosition_Socket::CAMERAPOSITION_PLAYER_DESC Desc{}; + + // Desc.pParentTransform = m_pTransformCom; + + // if (FAILED(Add_PartObject("Cam_TopDown_Look", g_iStaticLevel, &m_pCamPosition_TopDown_LookPart, &Desc))) + // { + // return E_FAIL; + // } + + // CCamPosition_Arm::CameraArm_DESC CameraArmDesc{}; + // XMStoreFloat3(&CameraArmDesc.fAt, m_pTransformCom->Get_State(STATE::POSITION)); + // CameraArmDesc.pParentTransform = m_pTransformCom; + // CameraArmDesc.fEye = { 0.f, 10.f, 10.f }; + // CameraArmDesc.fMouseSensor = 0.4f; + // CameraArmDesc.fDistance = 4.f; + // CameraArmDesc.pParentTransform = m_pTransformCom; + + // if (FAILED(Add_PartObject("Cam_TopDown_Follow", g_iStaticLevel, &m_pCamPosition_TopDown_FollowPart, &CameraArmDesc))) { + // return E_FAIL; + // } + + // CCamera_Gaze::CAMERA_GAZE_DESC CameraDesc{}; + // CameraDesc.fFovy = XMConvertToRadians(60.0f); + // CameraDesc.fNear = 0.1f; + // CameraDesc.fFar = 300.f; + // CameraDesc.fSpeedPerSec = 5.f; + // CameraDesc.fRotationPerSec = XMConvertToRadians(90.f); + // CameraDesc.pFollowTarget = m_pCamPosition_TopDown_FollowPart; + // CameraDesc.pLookTarget = m_pCamPosition_TopDown_LookPart; + // CameraDesc.iPriority = 51; + + // CCamera_Gaze* pCamera = { nullptr }; + + // if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &CameraDesc, nullptr, &pCamera))) + // { + // return E_FAIL; + // } + + // m_pGameInstance->Add_Camera(NEXT_LEVEL, pCamera, TEXT("CAM_TOPVIEW")); //} - //CCamPosition_Arm::CameraArm_DESC CameraArmDesc{}; - //XMStoreFloat3(&CameraArmDesc.fAt, m_pTransformCom->Get_State(STATE::POSITION)); - //CameraArmDesc.pParentTransform = m_pTransformCom; - //CameraArmDesc.fEye = { 0.f, 10.f, 10.f }; - //CameraArmDesc.fMouseSensor = 0.4f; - //CameraArmDesc.fDistance = 4.f; - //CameraArmDesc.pParentTransform = m_pTransformCom; + { + CCamPosition_Shoulder::CAMERA_SHOULDER_DESC Desc; + Desc.pParentTransform = m_pTransformCom; + Desc.fMouseSensor = 0.5f; + Desc.fShoulderDistance = 2.f; + Desc.fBackFrontRatio = 0.9f; + Desc.fCameraFocalLength = 10.f; + Desc.vInitialLook = { 1.f, 2.f, -1.f }; - //if (FAILED(Add_PartObject("Cam_TopDown_Follow", g_iStaticLevel, &m_pCamPosition_TopDown_FollowPart, &CameraArmDesc))) { - // return E_FAIL; - //} - - //CCamera_Gaze::CAMERA_GAZE_DESC CameraDesc{}; - //CameraDesc.fFovy = XMConvertToRadians(60.0f); - //CameraDesc.fNear = 0.1f; - //CameraDesc.fFar = 300.f; - //CameraDesc.fSpeedPerSec = 5.f; - //CameraDesc.fRotationPerSec = XMConvertToRadians(90.f); - //CameraDesc.pFollowTarget = m_pCamPosition_TopDown_FollowPart; - //CameraDesc.pLookTarget = m_pCamPosition_TopDown_LookPart; - //CameraDesc.iPriority = 51; - - //CCamera_Gaze* pCamera = { nullptr }; - - //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &CameraDesc, nullptr, &pCamera))) - //{ - // return E_FAIL; - //} - - //m_pGameInstance->Add_Camera(NEXT_LEVEL, pCamera, TEXT("CAM_TOPVIEW")); + if (FAILED(Add_PartObject("Cam_Shoulder_Part", g_iStaticLevel, &m_pCamPosition_ShoulderPart, &Desc))) { + return E_FAIL; + } + } return S_OK; } @@ -278,6 +283,8 @@ HRESULT CPlayer::Bind_ShaderResources() return S_OK; } +#pragma region STATE + HRESULT CPlayer::InputSystem() { if (m_pGameInstance->Key_Down(DIK_1) @@ -599,6 +606,7 @@ void CPlayer::Behavior_DodgeExit() m_pFSM->Disable_State(FSMSTATE::DODGE); } + void CPlayer::Add_FSM() { #pragma region Behavior_Movement_NotFocus @@ -690,6 +698,7 @@ void CPlayer::Set_Anim() m_Animation[STATEANIM::SPRINT] = { 599,true }; } +#pragma endregion STATE CPlayer* CPlayer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { @@ -731,6 +740,7 @@ void CPlayer::Free() Safe_Delete(m_pCallBack_HitReport); SAFE_RELEASE(m_pCamPosition_TopDown_FollowPart); SAFE_RELEASE(m_pCamPosition_TopDown_LookPart); + SAFE_RELEASE(m_pCamPosition_ShoulderPart); } void CPlayer::Describe_Entity() diff --git a/Jusin154_Team3D/Client/Private/State_Combat.cpp b/Jusin154_Team3D/Client/Private/State_Combat.cpp index 35b611131..1e8e15653 100644 --- a/Jusin154_Team3D/Client/Private/State_Combat.cpp +++ b/Jusin154_Team3D/Client/Private/State_Combat.cpp @@ -15,9 +15,15 @@ void CState_Combat::Enter() HRESULT CState_Combat::Update(_float fTimeDelta) { + if (nullptr != m_funcPriorityUpdate) { + m_funcPriorityUpdate(fTimeDelta); + } if (E_FAIL == (__super::Update(fTimeDelta))) { return E_FAIL; } + if (nullptr != m_funcLateUpdate) { + m_funcLateUpdate(fTimeDelta); + } return S_OK; } @@ -31,7 +37,8 @@ HRESULT CState_Combat::Initialize(STATE_COMBAT_DESC* pDesc) if (FAILED(__super::Initialize(pDesc))) { return E_FAIL; } - m_pOwner = pDesc->pOwner; + m_funcPriorityUpdate = pDesc->funcPriorityUpdate; + m_funcLateUpdate = pDesc->funcLateUpdate; m_pModel = m_pOwner->Get_Component(); m_pFSM = m_pOwner->Get_Component(); diff --git a/Jusin154_Team3D/Client/Public/CamPosition_Shoulder.h b/Jusin154_Team3D/Client/Public/CamPosition_Shoulder.h new file mode 100644 index 000000000..0ce2d5088 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/CamPosition_Shoulder.h @@ -0,0 +1,56 @@ +#pragma once +#include "Client_Define.h" +#include "CamPosition.h" +#include "CamPosition_Target.h" + +NS_BEGIN(Client) + +class CCamPosition_Shoulder final : public CCamPosition +{ +public: + typedef struct tagCameraShoulder_Desc : public CCamPosition::CAMERAPOSITION_DESC + { + _float fMouseSensor = { 0.5f }; + _float fShoulderDistance = { 2.f }; + _float fBackFrontRatio = { 0.9f }; + _float fCameraFocalLength = { 10.f }; + _float3 vInitialLook = { 1.f, 2.f, -1.f }; + }CAMERA_SHOULDER_DESC; +private: + CCamPosition_Shoulder(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CCamPosition_Shoulder(const CCamPosition_Shoulder& rhs); + virtual ~CCamPosition_Shoulder() = 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 _vector Get_WorldPostion() override; + + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + HRESULT Ready_Components(void* pArg); + HRESULT Ready_SubParts(); + + _bool m_bMovable = { true }; + _float m_fMouseSensor = { 0.5f }; + _float m_fShoulderDistance = { 2.f }; + _float m_fCameraFocalLength = { 10.f }; + _float m_fBackFrontRatio = { 0.9f }; + _float2 m_vAccDegreeXY = {}; + _float3 m_vShoulderPosRatio = { 1.f, 2.f, -1.f }; + + CCamPosition_Target* m_pTarget_LookPart = { nullptr }; + CCamPosition_Target* m_pTarget_FollowPart = { nullptr }; + +public: + static CCamPosition_Shoulder* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CCamPosition_Shoulder* Clone(void* pArg, class CGameObject* pOWner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/CamPosition_Player.h b/Jusin154_Team3D/Client/Public/CamPosition_Socket.h similarity index 70% rename from Jusin154_Team3D/Client/Public/CamPosition_Player.h rename to Jusin154_Team3D/Client/Public/CamPosition_Socket.h index af5d2a68c..aaac3e749 100644 --- a/Jusin154_Team3D/Client/Public/CamPosition_Player.h +++ b/Jusin154_Team3D/Client/Public/CamPosition_Socket.h @@ -4,7 +4,7 @@ NS_BEGIN(Client) -class CCamPosition_Player final : public CCamPosition +class CCamPosition_Socket final : public CCamPosition { public: typedef struct tagCamPosition_Player : public CCamPosition::CAMERAPOSITION_DESC @@ -12,9 +12,9 @@ class CCamPosition_Player final : public CCamPosition const _float4x4* pSocketMatrices = { }; }CAMERAPOSITION_PLAYER_DESC; private: - CCamPosition_Player(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); - CCamPosition_Player(const CCamPosition_Player& rhs); - virtual ~CCamPosition_Player() = default; + CCamPosition_Socket(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CCamPosition_Socket(const CCamPosition_Socket& rhs); + virtual ~CCamPosition_Socket() = default; public: virtual void Priority_Update(_float fTimeDelta) override; @@ -30,8 +30,8 @@ class CCamPosition_Player final : public CCamPosition const _float4x4* m_pSocketMatrices = { }; public: - static CCamPosition_Player* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); - virtual CCamPosition_Player* Clone(void* pArg, class CGameObject* pOWner) override; + static CCamPosition_Socket* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CCamPosition_Socket* Clone(void* pArg, class CGameObject* pOWner) override; virtual void Free() override; void Describe_Entity() override; }; diff --git a/Jusin154_Team3D/Client/Public/CamPosition_Target.h b/Jusin154_Team3D/Client/Public/CamPosition_Target.h new file mode 100644 index 000000000..ff9bd01bf --- /dev/null +++ b/Jusin154_Team3D/Client/Public/CamPosition_Target.h @@ -0,0 +1,37 @@ +#pragma once +#include "Client_Define.h" +#include "CamPosition.h" + +NS_BEGIN(Client) + +class CCamPosition_Target final : public CCamPosition +{ +public: + typedef struct tagCamPosition_Target : public CCamPosition::CAMERAPOSITION_DESC + { + }CAMERAPOSITION_TARGET_DESC; +private: + CCamPosition_Target(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CCamPosition_Target(const CCamPosition_Target& rhs); + virtual ~CCamPosition_Target() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual _vector Get_WorldPostion() override; + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + HRESULT Ready_Components(void* pArg); + HRESULT Bind_ShaderResources() override; + +public: + static CCamPosition_Target* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CCamPosition_Target* Clone(void* pArg, class CGameObject* pOWner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Camera_Gaze.h b/Jusin154_Team3D/Client/Public/Camera_Gaze.h index 0fbc8b059..ee3c3f931 100644 --- a/Jusin154_Team3D/Client/Public/Camera_Gaze.h +++ b/Jusin154_Team3D/Client/Public/Camera_Gaze.h @@ -10,6 +10,9 @@ class CCamera_Gaze final : public CCamera public: typedef struct tagCamera_Gaze : public CCamera::CAMERA_DESC { + _bool bTransitionLerp = { false }; + _bool bLookLerp = { false }; + _bool bFollowLerp = { false }; }CAMERA_GAZE_DESC; private: CCamera_Gaze(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Client/Public/Player.h b/Jusin154_Team3D/Client/Public/Player.h index e2ef42d09..497fe5c7b 100644 --- a/Jusin154_Team3D/Client/Public/Player.h +++ b/Jusin154_Team3D/Client/Public/Player.h @@ -37,8 +37,9 @@ class CPlayer final : public CUnit _bool m_bSprintToggle = { false }; _bool m_bWalkToggle = { false }; - class CCamPosition_Player* m_pCamPosition_TopDown_LookPart = { nullptr }; + class CCamPosition_Socket* m_pCamPosition_TopDown_LookPart = { nullptr }; class CCamPosition_Arm* m_pCamPosition_TopDown_FollowPart = { nullptr }; + class CCamPosition_Shoulder* m_pCamPosition_ShoulderPart = { nullptr }; CCharacter_Controller* m_pCharacter_Controller = { nullptr }; CRigidBody_Dynamic* m_pRigidBody = { nullptr }; diff --git a/Jusin154_Team3D/Client/Public/State_Combat.h b/Jusin154_Team3D/Client/Public/State_Combat.h index df71f9f51..edb8d29fc 100644 --- a/Jusin154_Team3D/Client/Public/State_Combat.h +++ b/Jusin154_Team3D/Client/Public/State_Combat.h @@ -8,7 +8,8 @@ class CState_Combat final : public CState_Root { public: typedef struct tagCombat : public CState_Root::STATE_ROOT_DESC { - + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; }STATE_COMBAT_DESC; private: CState_Combat(); @@ -19,6 +20,10 @@ class CState_Combat final : public CState_Root virtual HRESULT Update(_float fTimeDelta); virtual void Exit(); +private: + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + private: HRESULT Initialize(STATE_COMBAT_DESC* pDesc); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/ContainerTest.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/ContainerTest.xml index 8a7a58cf0..7ef8c42bd 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/ContainerTest.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/ContainerTest.xml @@ -3608,158 +3608,4 @@ - - - - - - Prototype_GameObject_SM_HM_Streets_Hogshead - - - - - - Prototype_GameObject_SM_HM_Streets_A - - - - - - Prototype_GameObject_SM_HM_Streets_B - - - - - - Prototype_GameObject_SM_HM_Streets_SideStreet_A - Prototype_GameObject_SM_HM_Streets_SideStreet_A_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_SideStreet_B - Prototype_GameObject_SM_HM_Streets_SideStreet_B_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_SideStreet_C - Prototype_GameObject_SM_HM_Streets_SideStreet_C_Lod1 - - - - - - Prototype_GameObject_SM_HM_Stairwalls_3Broomsticks - - - - - - Prototype_GameObject_SM_HM_LowerHiStreet_Zonkos - - - - - - Prototype_GameObject_SM_HM_Streets_AA_COL - Prototype_GameObject_SM_HM_Streets_AA_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_BB_COL - Prototype_GameObject_SM_HM_Streets_BB_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_CC_COL - Prototype_GameObject_SM_HM_Streets_CC_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_DD_COL - Prototype_GameObject_SM_HM_Streets_DD_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_EE_COL - Prototype_GameObject_SM_HM_Streets_EE_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_FF_COL - Prototype_GameObject_SM_HM_Streets_FF_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_GG_COL - Prototype_GameObject_SM_HM_Streets_GG_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_HH_COL - Prototype_GameObject_SM_HM_Streets_HH_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_SideStreet_A_COL - Prototype_GameObject_SM_HM_Streets_SideStreet_A_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_SideStreet_B_COL - Prototype_GameObject_SM_HM_Streets_SideStreet_B_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_SideStreet_C_COL - Prototype_GameObject_SM_HM_Streets_SideStreet_C_COL_Lod1 - - - - - - Prototype_GameObject_SM_HM_Streets_SideStreet_D_COL - Prototype_GameObject_SM_HM_Streets_SideStreet_D_COL_Lod1 - - - - - - Prototype_GameObject_SM_HW_Streets_SideStreet_E_COL - Prototype_GameObject_SM_HW_Streets_SideStreet_E_COL_Lod1 - - - - - - Prototype_GameObject_SM_HW_Streets_SideStreet_F_COL - Prototype_GameObject_SM_HW_Streets_SideStreet_F_COL_Lod1 - - - - - diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Hogsmeade_AlphaMap.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Hogsmeade_AlphaMap.bin new file mode 100644 index 000000000..42fda0dc6 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Hogsmeade_AlphaMap.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e113d19eac33fe1a0dc66a5ce1d3c50ea75d9d8ade3ec9ac7b00ad858c992663 +size 67108864 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Map1116.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Map1116.xml index a6cde8f76..8ca7f52a6 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Map1116.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Map1116.xml @@ -2010,21 +2010,6 @@ - - Prototype_GameObject_SM_HM_GEN_A_int_Floor - Prototype_GameObject_SM_HM_GEN_A_int_Floor_Lod1 - - - - - - Prototype_GameObject_SM_HM_GEN_A_int_Walls - Prototype_GameObject_SM_HM_GEN_A_int_Walls_Lod1 - Prototype_GameObject_SM_HM_GEN_A_int_Walls_Lod2 - - - - Prototype_GameObject_SM_HM_GEN_A_EXT_APL_COL Prototype_GameObject_SM_HM_GEN_A_EXT_APL_COL_Lod1 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index a6d0ff757..ba1161adb 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -155,7 +155,7 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) return Out; } - float fDiffuseAOStrength = lerp(1.3f, 2.f, fOcclusion); + float fDiffuseAOStrength = lerp(0.3f, 5.f, fOcclusion); PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxNorTex.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxNorTex.hlsl index 261099f7f..bcdd26cb6 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxNorTex.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxNorTex.hlsl @@ -9,9 +9,9 @@ float g_fUsingSurfaceParams; Texture2D g_DiffuseTexture; Texture2D g_NormalTexture; Texture2D g_SurfaceParamsTexture; -Texture2D g_DiffuseTextures[2]; -Texture2D g_NormalTextures[2]; -Texture2D g_SurfaceParamsTextures[2]; +Texture2D g_DiffuseTextures[4]; +Texture2D g_NormalTextures[4]; +Texture2D g_SurfaceParamsTextures[4]; Texture2D g_MaskTexture; struct VS_IN @@ -69,24 +69,39 @@ PS_OUT PS_MAIN(PS_IN In) { PS_OUT Out; - float2 tileUV = In.vWorldPos.xz / 64.f; + float2 tileUV = In.vWorldPos.xz / 16.f; vector vMask = g_MaskTexture.Sample(DefaultSampler, In.vTexcoord); vector vMtrlDiffuse_0 = g_DiffuseTextures[0].Sample(DefaultSampler, tileUV); vector vMtrlDiffuse_1 = g_DiffuseTextures[1].Sample(DefaultSampler, tileUV); + vector vMtrlDiffuse_2 = g_DiffuseTextures[2].Sample(DefaultSampler, tileUV); + vector vMtrlDiffuse_3 = g_DiffuseTextures[3].Sample(DefaultSampler, tileUV); - vector vMtrlDiffuse = lerp(vMtrlDiffuse_0, vMtrlDiffuse_1, vMask.r); + vector vMtrlDiffuse = float4(float3(vMtrlDiffuse_0.xyz * vMask.r + + vMtrlDiffuse_1.xyz * vMask.g + + vMtrlDiffuse_2.xyz * vMask.b + + vMtrlDiffuse_3.xyz * vMask.a), 1.f); vector vSurface_0 = g_SurfaceParamsTextures[0].Sample(DefaultSampler, tileUV); vector vSurface_1 = g_SurfaceParamsTextures[1].Sample(DefaultSampler, tileUV); + vector vSurface_2 = g_SurfaceParamsTextures[2].Sample(DefaultSampler, tileUV); + vector vSurface_3 = g_SurfaceParamsTextures[3].Sample(DefaultSampler, tileUV); - vector vSurface = lerp(vSurface_0, vSurface_1, vMask.r); + vector vSurface = (vSurface_0 * vMask.r + + vSurface_1 * vMask.g + + vSurface_2 * vMask.b + + vSurface_3 * vMask.a); float3 vNormalDecoded_0 = DecodeNormalFromRG(g_NormalTextures[0], DefaultSampler, tileUV); - float3 vNormalDecoded_1 = DecodeNormalFromRG(g_NormalTextures[0], DefaultSampler, tileUV); + float3 vNormalDecoded_1 = DecodeNormalFromRG(g_NormalTextures[1], DefaultSampler, tileUV); + float3 vNormalDecoded_2 = DecodeNormalFromRG(g_NormalTextures[2], DefaultSampler, tileUV); + float3 vNormalDecoded_3 = DecodeNormalFromRG(g_NormalTextures[3], DefaultSampler, tileUV); - float3 vNormalDecoded = normalize(lerp(vNormalDecoded_0, vNormalDecoded_1, vMask.r)); + float3 vNormalDecoded = normalize(vNormalDecoded_0.xyz * vMask.r + + vNormalDecoded_1.xyz * vMask.g + + vNormalDecoded_1.xyz * vMask.b + + vNormalDecoded_1.xyz * vMask.a); float3 vBinormal = cross(In.vNormal.xyz, float3(1.f, 0.f, 0.f)); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_0.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_0.dds index a38c801b9..c645b3637 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_0.dds and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_0.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_1.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_1.dds index d674bd7a3..88834c5e7 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_1.dds and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_1.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_2.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_2.dds new file mode 100644 index 000000000..2d3f6442e Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_2.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_3.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_3.dds new file mode 100644 index 000000000..36017b3e1 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_D_3.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_1.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_1.dds index b0c66ea01..568c2ac58 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_1.dds and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_1.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_2.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_2.dds new file mode 100644 index 000000000..7eff9329b Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_2.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_3.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_3.dds new file mode 100644 index 000000000..5a76d93a7 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_MRO_3.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_1.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_1.dds index 98fe8de42..43e598aa9 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_1.dds and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_1.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_2.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_2.dds new file mode 100644 index 000000000..6165e524d Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_2.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_3.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_3.dds new file mode 100644 index 000000000..e862b711c Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Terrain/Terrain_N_3.dds differ diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index 7618b75b3..80b4073c2 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -164,6 +164,7 @@ + @@ -290,6 +291,7 @@ + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index a723c5705..afe491829 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -346,6 +346,9 @@ {7e8b7123-11fb-4946-99fe-3265932d0536} + + {54eef1b7-a5ee-444f-9577-44ffc8c3d8bc} + @@ -675,6 +678,12 @@ 80.State + + 02.GameObjects\Wand + + + 02.GameObjects\Env\05.AlphaMap + @@ -1000,6 +1009,9 @@ 02.GameObjects\Layer_Effect\Effect\06.Bombard + + 02.GameObjects\Env\05.AlphaMap + diff --git a/Jusin154_Team3D/Editor/Private/AlphaMap.cpp b/Jusin154_Team3D/Editor/Private/AlphaMap.cpp new file mode 100644 index 000000000..4f0c92ed5 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/AlphaMap.cpp @@ -0,0 +1,194 @@ +#include "pch.h" +#include "AlphaMap.h" +#include "GameInstance.h" + +CAlphaMap::CAlphaMap(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CBase{} + , m_pDevice{ pDevice } + , m_pContext{ pContext } + , m_pGameInstance{ Engine::CGameInstance::GetInstance() } +{ + SAFE_ADDREF(m_pDevice); + SAFE_ADDREF(m_pContext); + SAFE_ADDREF(m_pGameInstance); +} + +void CAlphaMap::Update(_float3& vPosition, _uint iColorIndex, _float fValue, _uint iRange) +{ + D3D11_MAPPED_SUBRESOURCE SubResource{}; + if (FAILED(m_pContext->Map(m_pTexture2D, 0, D3D11_MAP_WRITE_DISCARD, 0, &SubResource))) + return; + + _uint iPixelIndex = {}; + + _uint iStartX = (_uint)(vPosition.x / 0.25f) - (iRange / 2); + _uint iStartZ = (_uint)(vPosition.z / 0.25f) - (iRange / 2); + + for (_uint j = 0; j < iRange; ++j) + { + for (_uint i = 0; i < iRange; ++i) + { + _uint iCurrentX = iStartX + i; + _uint iCurrentZ = iStartZ + j; + + iPixelIndex = (iCurrentZ * m_iNumPixelW) + iCurrentX; + + if (m_iNumPixels <= iPixelIndex) + return; + + if (0 == iColorIndex) + { + m_pPixels[iPixelIndex].x += fValue; + } + else if (1 == iColorIndex) + { + m_pPixels[iPixelIndex].y += fValue; + } + else if (2 == iColorIndex) + { + m_pPixels[iPixelIndex].z += fValue; + } + else if (3 == iColorIndex) + { + m_pPixels[iPixelIndex].w += fValue; + } + else + return; + + _float fWeight = m_pPixels[iPixelIndex].x + m_pPixels[iPixelIndex].y + m_pPixels[iPixelIndex].z + m_pPixels[iPixelIndex].w; + + m_pPixels[iPixelIndex] = _float4(m_pPixels[iPixelIndex].x / fWeight, m_pPixels[iPixelIndex].y / fWeight, m_pPixels[iPixelIndex].z / fWeight, m_pPixels[iPixelIndex].w / fWeight); + } + } + + memcpy(SubResource.pData, m_pPixels, sizeof(_float4) * m_iNumPixels); + + m_pContext->Unmap(m_pTexture2D, 0); + +} + +void CAlphaMap::Save_ToFile(const _char* pFilePath) +{ + string strFilePath = "../Bin/Resources/Data/Map/" + string(pFilePath); + + ofstream out(strFilePath, ios::binary); + + if (false == out.is_open()) + { + MSG_BOX("Failed to Save Binanry File"); + return; + } + for (_uint i = 0; i < m_iNumPixels; ++i) + { + out.write(reinterpret_cast(&m_pPixels[i]), sizeof(_float4)); + } + + out.close(); + + MSG_BOX("Success to Save Binanry File"); +} + +void CAlphaMap::Load_ToFile(const _char* pFilePath) +{ + string strFilePath = "../Bin/Resources/Data/Map/" + string(pFilePath); + + ifstream in(strFilePath, ios::binary); + + if (false == in.is_open()) + { + MSG_BOX("Failed to Load Model Binanry File"); + return; + } + + for (_uint i = 0; i < m_iNumPixels; ++i) + { + in.read(reinterpret_cast<_char*>(&m_pPixels[i]), sizeof(_float4)); + } + + + in.close(); + + D3D11_MAPPED_SUBRESOURCE SubResource{}; + if (FAILED(m_pContext->Map(m_pTexture2D, 0, D3D11_MAP_WRITE_DISCARD, 0, &SubResource))) + return; + + MSG_BOX("Success to Load Binanry File"); + + memcpy(SubResource.pData, m_pPixels, sizeof(_float4) * m_iNumPixels); + + m_pContext->Unmap(m_pTexture2D, 0); +} + +HRESULT CAlphaMap::Initialize(_uint iSizeX, _uint iSizeY) +{ + D3D11_TEXTURE2D_DESC TextureDesc{}; + + TextureDesc.Width = iSizeX; + TextureDesc.Height = iSizeY; + TextureDesc.MipLevels = 1; + TextureDesc.ArraySize = 1; + TextureDesc.Format = DXGI_FORMAT_R32G32B32A32_FLOAT; + + TextureDesc.SampleDesc.Quality = 0; + TextureDesc.SampleDesc.Count = 1; + + + TextureDesc.Usage = D3D11_USAGE_DYNAMIC; + TextureDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE; + TextureDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; + TextureDesc.MiscFlags = 0; + + if (FAILED(m_pDevice->CreateTexture2D(&TextureDesc, nullptr, &m_pTexture2D))) + return E_FAIL; + + if (FAILED(m_pDevice->CreateShaderResourceView(m_pTexture2D, nullptr, &m_pSRV))) + return E_FAIL; + + m_iNumPixels = iSizeX * iSizeY; + m_pPixels = new _float4[m_iNumPixels]; + ZeroMemory(m_pPixels, sizeof(_float4) * m_iNumPixels); + + for (_uint i = 0; i < m_iNumPixels; ++i) + { + m_pPixels[i].x = 1.f; + } + + D3D11_MAPPED_SUBRESOURCE SubResource{}; + if (FAILED(m_pContext->Map(m_pTexture2D, 0, D3D11_MAP_WRITE_DISCARD, 0, &SubResource))) + return E_FAIL; + + memcpy(SubResource.pData, m_pPixels, sizeof(_float4) * m_iNumPixels); + + m_pContext->Unmap(m_pTexture2D, 0); + + m_iNumPixelW = iSizeX; + m_iNumPixelH = iSizeY; + + return S_OK; +} + +CAlphaMap* CAlphaMap::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, _uint iSizeX, _uint iSizeY) +{ + CAlphaMap* pInstance = new CAlphaMap(pDevice, pContext); + + if (FAILED(pInstance->Initialize(iSizeX, iSizeY))) + { + MSG_BOX("Failed to Created : CAlphaMap"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CAlphaMap::Free() +{ + __super::Free(); + + Safe_Delete_Array(m_pPixels); + + SAFE_RELEASE(m_pSRV); + SAFE_RELEASE(m_pTexture2D); + SAFE_RELEASE(m_pContext); + SAFE_RELEASE(m_pDevice); + SAFE_RELEASE(m_pGameInstance); +} diff --git a/Jusin154_Team3D/Editor/Private/CamPosition_Player.cpp b/Jusin154_Team3D/Editor/Private/CamPosition_Player.cpp index 074fdc97e..cf636702f 100644 --- a/Jusin154_Team3D/Editor/Private/CamPosition_Player.cpp +++ b/Jusin154_Team3D/Editor/Private/CamPosition_Player.cpp @@ -75,7 +75,7 @@ CCamPosition_Player* CCamPosition_Player::Create(ID3D11Device* pDevice, ID3D11De if (FAILED(pInstance->Initialize_Prototype())) { - MSG_BOX("Failed to Created : CCamPosition_Player"); + MSG_BOX("Failed to Created : CCamPosition_Socket"); SAFE_RELEASE(pInstance); } @@ -88,7 +88,7 @@ CCamPosition_Player* CCamPosition_Player::Clone(void* pArg, class CGameObject* p pInstance->m_pOwner = pOWner; if (FAILED(pInstance->Initialize(pArg))) { - MSG_BOX("Failed to Cloned : CCamPosition_Player"); + MSG_BOX("Failed to Cloned : CCamPosition_Socket"); SAFE_RELEASE(pInstance); } diff --git a/Jusin154_Team3D/Editor/Private/DummyObject.cpp b/Jusin154_Team3D/Editor/Private/DummyObject.cpp index 72c59ab06..c186b6fef 100644 --- a/Jusin154_Team3D/Editor/Private/DummyObject.cpp +++ b/Jusin154_Team3D/Editor/Private/DummyObject.cpp @@ -44,11 +44,7 @@ void CDummyObject::Priority_Update(_float fTimeDelta) void CDummyObject::Update(_float fTimeDelta) { - m_pModelCom->ComputeAnimation(); - m_pModelCom->Play_Animation(fTimeDelta,m_pTransformCom); - - } void CDummyObject::Late_Update(_float fTimeDelta) diff --git a/Jusin154_Team3D/Editor/Private/Goblin.cpp b/Jusin154_Team3D/Editor/Private/Goblin.cpp index a520dae57..b7b8bb047 100644 --- a/Jusin154_Team3D/Editor/Private/Goblin.cpp +++ b/Jusin154_Team3D/Editor/Private/Goblin.cpp @@ -40,8 +40,6 @@ void CGoblin::Priority_Update(_float fTimeDelta) void CGoblin::Update(_float fTimeDelta) { m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); - - m_pModelCom->ComputeAnimation(); } void CGoblin::Late_Update(_float fTimeDelta) diff --git a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp index 2d1795709..7bf3f026a 100644 --- a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp @@ -30,10 +30,10 @@ HRESULT CLevel_ObjectViewer::Initialize() return E_FAIL; } - if (FAILED(Ready_Layer_Camera(TEXT("Layer_Camera")))) - { - return E_FAIL; - } + //if (FAILED(Ready_Layer_Camera(TEXT("Layer_Camera")))) + //{ + // return E_FAIL; + //} if (FAILED(Ready_Layer_Dummy(TEXT("Layer_Dummy")))) { @@ -58,7 +58,11 @@ void CLevel_ObjectViewer::Update(_float fTimeDelta) Find_Anim(); - //m_Test->Describe_Entity(); + if (m_Test) + { + m_Test->Describe_Entity(); + } + } HRESULT CLevel_ObjectViewer::Render() diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 7b831a205..d568fe29c 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -1472,17 +1472,17 @@ HRESULT CLoader::Loading_For_MapViewer() } /* Terrain_Diffuse */ if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Terrain_Diffuse"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Terrain/Terrain_D_%d.dds"), 2)))) { + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Terrain/Terrain_D_%d.dds"), 4)))) { return E_FAIL; } /* Terrain_Normal */ if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Terrain_Normal"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Terrain/Terrain_N_%d.dds"), 2)))) { + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Terrain/Terrain_N_%d.dds"), 4)))) { return E_FAIL; } /* Terrain_MRO */ if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Terrain_MRO"), - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Terrain/Terrain_MRO_%d.dds"), 2)))) { + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Terrain/Terrain_MRO_%d.dds"), 4)))) { return E_FAIL; } @@ -1507,7 +1507,7 @@ HRESULT CLoader::Loading_For_MapViewer() vector ModelPrototypePath = {}; #pragma region HOGSMEADE - // + ///* Terrain*/ //if (FAILED(MapFolderLoad("C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\Terrain", // ".bin", true, ModelPrototypeTags, ModelPrototypePath))) @@ -1696,317 +1696,317 @@ HRESULT CLoader::Loading_For_MapViewer() #ifdef gimch -//vector> jobFutures; -// -//_uint iLoadCount = 46; -//vector*> Contents(iLoadCount); -// -//{ -// { /* Terrain */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\Terrain", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Terrain", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* TScrolls */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TScrolls\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TScrolls\\Collisions", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* 3BroomStick*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes\\3Broom_Kit", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* Ollivanders*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Ollivanders\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Ollivanders\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* Gatehouse*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Gatehouse\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* BLDG_QuidditchShop */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_QuidditchShop\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_QuidditchShop\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* BLDG_HogsheadInn */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_HogsheadInn\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_HogsheadInn\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* BLDG_Honeydukes */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Honeydukes\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Honeydukes\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* BLDG_OwlPost */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_OwlPost\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_OwlPost\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* BLDG_TeaShop */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TeaShop\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TeaShop\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* BLDG_Zonkos */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Zonkos\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Zonkos\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* BLDG_DB_GR */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_DB_GR\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_DB_GR\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* BLDG_Potions */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Potions\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Potions\\Collisions", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* BLDG_Salon */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Salon\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Salon\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* Hengist_Tree */ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Vegetation\\Hengist_Tree", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\Vegetation", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* GEN A*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_A\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_A\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* GEN B*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_B\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_B\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* GEN C*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_C\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_C\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* GEN E*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_E\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_E\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* GEN F*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_F\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_F\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* GEN G*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_G\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_G\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* GEN H*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_H\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_H\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -// { /* GEN J*/ -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_J\\Meshes", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// jobFutures.emplace_back(Deferred_FolderLoad( -// "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_J\\Collision", -// ".bin", false, -// &Contents[jobFutures.size()] -// )); -// } -//} -// -//for (auto& jobFuture : jobFutures) -//{ -// jobFuture.get(); -//} -// -//for (_uint i = 0; i < Contents.size(); ++i) { -// for (_uint j = 0; j < (Contents[i])->size(); ++j) { -// FOLDER_LOAD* pContents = (*Contents[i])[j]; -// if (true == pContents->bLoadTags) { -// ModelPrototypeTags.push_back(pContents->pModelTag); -// ModelPrototypePath.push_back(pContents->pathModel); -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pModelTag, pContents->pLoadedModel))) { -// return E_FAIL; -// } -// -// for (_uint k = 0; k < pContents->pRigidBodyTags.size(); ++k) { -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pRigidBodyTags[k], pContents->LoadedRigidBody[k]))) { -// return E_FAIL; -// } -// } -// -// } -//} +vector> jobFutures; + +_uint iLoadCount = 46; +vector*> Contents(iLoadCount); + +{ + { /* Terrain */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\Terrain", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Terrain", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* TScrolls */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TScrolls\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TScrolls\\Collisions", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* 3BroomStick*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes\\3Broom_Kit", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* Ollivanders*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Ollivanders\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Ollivanders\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* Gatehouse*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Gatehouse\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_QuidditchShop */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_QuidditchShop\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_QuidditchShop\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_HogsheadInn */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_HogsheadInn\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_HogsheadInn\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_Honeydukes */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Honeydukes\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Honeydukes\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_OwlPost */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_OwlPost\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_OwlPost\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_TeaShop */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TeaShop\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_TeaShop\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_Zonkos */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Zonkos\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Zonkos\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_DB_GR */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_DB_GR\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_DB_GR\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_Potions */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Potions\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Potions\\Collisions", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* BLDG_Salon */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Salon\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_Salon\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* Hengist_Tree */ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Meshes\\Vegetation\\Hengist_Tree", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\Common\\Collision\\Vegetation", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* GEN A*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_A\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_A\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* GEN B*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_B\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_B\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* GEN C*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_C\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_C\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* GEN E*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_E\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_E\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* GEN F*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_F\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_F\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* GEN G*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_G\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_G\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* GEN H*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_H\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_H\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } + { /* GEN J*/ + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_J\\Meshes", + ".bin", false, + &Contents[jobFutures.size()] + )); + jobFutures.emplace_back(Deferred_FolderLoad( + "C:\\MeshTable\\Game\\Environment\\Hogsmeade\\BLDG_GEN_J\\Collision", + ".bin", false, + &Contents[jobFutures.size()] + )); + } +} + + for (auto& jobFuture : jobFutures) + { + jobFuture.get(); + } + + for (_uint i = 0; i < Contents.size(); ++i) { + for (_uint j = 0; j < (Contents[i])->size(); ++j) { + FOLDER_LOAD* pContents = (*Contents[i])[j]; + if (true == pContents->bLoadTags) { + ModelPrototypeTags.push_back(pContents->pModelTag); + ModelPrototypePath.push_back(pContents->pathModel); + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pModelTag, pContents->pLoadedModel))) { + return E_FAIL; + } + + for (_uint k = 0; k < pContents->pRigidBodyTags.size(); ++k) { + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pRigidBodyTags[k], pContents->LoadedRigidBody[k]))) { + return E_FAIL; + } + } + + } + } + -#endif // 기무리 m_strMessage = TEXT("쉐이더를(을) 로딩 중 입니다."); @@ -2069,13 +2069,13 @@ HRESULT CLoader::Loading_For_MapViewer() m_isFinished = true; - //for (_uint i = 0; i < Contents.size(); ++i) { - // for (_uint j = 0; j < (Contents[i])->size(); ++j) { - // Safe_Delete((*Contents[i])[j]); - // } - // Safe_Delete(Contents[i]); - //} - + for (_uint i = 0; i < Contents.size(); ++i) { + for (_uint j = 0; j < (Contents[i])->size(); ++j) { + Safe_Delete((*Contents[i])[j]); + } + Safe_Delete(Contents[i]); + } +#endif return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/MainApp.cpp b/Jusin154_Team3D/Editor/Private/MainApp.cpp index 210675229..32f6f36d0 100644 --- a/Jusin154_Team3D/Editor/Private/MainApp.cpp +++ b/Jusin154_Team3D/Editor/Private/MainApp.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "MainApp.h" #include "GameInstance.h" @@ -111,7 +111,7 @@ HRESULT CMainApp::Ready_IMGUI() //string strFontTag = "C:\\Windows\\Fonts\\malgun.ttf"; string strFontTag = "../Bin/Resources/Fonts/malgunsl.TTF"; ImFontConfig cfg; - cfg.OversampleH = 2; // °¡µ¶¼º Çâ»ó + cfg.OversampleH = 2; // 가독성 향상 cfg.OversampleV = 2; cfg.PixelSnapH = true; ifstream ifile; diff --git a/Jusin154_Team3D/Editor/Private/MainLight.cpp b/Jusin154_Team3D/Editor/Private/MainLight.cpp index feab5b2af..6d2c5fb53 100644 --- a/Jusin154_Team3D/Editor/Private/MainLight.cpp +++ b/Jusin154_Team3D/Editor/Private/MainLight.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "MainLight.h" #include "GameInstance.h" @@ -62,7 +62,7 @@ HRESULT CMainLight::Ready_Components() LightDesc.eType = LIGHT::DIRECTIONAL; LightDesc.vDiffuse = _float4(0.8f, 0.8f, 0.8f, 0.f); - LightDesc.vAmbient = _float4(0.6f, 0.6f, 0.6f, 0.f); + LightDesc.vAmbient = _float4(0.8f, 0.8f, 0.8f, 0.f); LightDesc.vSpecular = _float4(0.f, 0.f, 0.f, 0.f); LightDesc.pDirection = m_pTransformCom->Get_StatePtr(STATE::LOOK); LightDesc.iLevel = NEXT_LEVEL; diff --git a/Jusin154_Team3D/Editor/Private/MapObject_Collision.cpp b/Jusin154_Team3D/Editor/Private/MapObject_Collision.cpp index 66e8e00e8..7a12417b6 100644 --- a/Jusin154_Team3D/Editor/Private/MapObject_Collision.cpp +++ b/Jusin154_Team3D/Editor/Private/MapObject_Collision.cpp @@ -219,6 +219,9 @@ void CMapObject_Collision::Free() for (auto& pModel : m_pModelComs) Safe_Release(pModel); m_pModelComs.clear(); + + m_ModelPrototypeTags.clear(); + m_ModelPathIndices.clear(); } void CMapObject_Collision::Describe_Entity() diff --git a/Jusin154_Team3D/Editor/Private/MapObject_LOD.cpp b/Jusin154_Team3D/Editor/Private/MapObject_LOD.cpp index ecb9744ca..5611c81d2 100644 --- a/Jusin154_Team3D/Editor/Private/MapObject_LOD.cpp +++ b/Jusin154_Team3D/Editor/Private/MapObject_LOD.cpp @@ -60,7 +60,7 @@ HRESULT CMapObject_LOD::Initialize(void* pArg) - m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); + //m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); //m_pColliderCom->Update(ColliderMatrix); @@ -81,9 +81,9 @@ void CMapObject_LOD::Update(_float fTimeDelta) //if (0 == m_iLodIndex) // m_bSelected = true; - m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&m_vPosition), 1.f)); - m_pTransformCom->Set_Scale(m_vScale); - m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z)); + //m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&m_vPosition), 1.f)); + //m_pTransformCom->Set_Scale(m_vScale); + //m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z)); XMStoreFloat4x4(&m_CombinedWorldMatrix, m_pTransformCom->Get_XMWorldMatrix() * m_pParentTransformCom->Get_XMWorldMatrix()); @@ -270,6 +270,9 @@ void CMapObject_LOD::Free() for(auto& pModel : m_pModelComs) SAFE_RELEASE(pModel); m_pModelComs.clear(); + + m_ModelPrototypeTags.clear(); + m_ModelPathIndices.clear(); } void CMapObject_LOD::Describe_Entity() diff --git a/Jusin154_Team3D/Editor/Private/Player.cpp b/Jusin154_Team3D/Editor/Private/Player.cpp index bfd2c7aec..233d42f30 100644 --- a/Jusin154_Team3D/Editor/Private/Player.cpp +++ b/Jusin154_Team3D/Editor/Private/Player.cpp @@ -69,8 +69,6 @@ void CPlayer::Priority_Update(_float fTimeDelta) void CPlayer::Update(_float fTimeDelta) { - m_pModelCom->ComputeAnimation(); - m_pFSM->Update_State(fTimeDelta); m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); @@ -216,21 +214,7 @@ HRESULT CPlayer::Bind_ShaderResources() return S_OK; } -HRESULT CPlayer::InputSystem() -{ - if (m_pGameInstance->Key_Down(DIK_1) - || m_pGameInstance->Key_Down(DIK_2) - || m_pGameInstance->Key_Down(DIK_3) - || m_pGameInstance->Key_Down(DIK_4) - || m_pGameInstance->Key_Down(DIK_5) - || m_pGameInstance->Key_Down(DIK_6)) - { - return S_OK; - } - return E_FAIL; -} - -HRESULT CPlayer::InputSkill() +HRESULT CPlayer::InputAction() { if ( m_pGameInstance->Key_Down(DIK_SPACE) @@ -240,11 +224,9 @@ HRESULT CPlayer::InputSkill() || m_pGameInstance->Key_Down(DIK_Q) || m_pGameInstance->Mouse_Up(DIM_LBUTTON) || m_pGameInstance->Key_Down(DIK_1) - //|| m_pGameInstance->Key_Down(DIK_C) - //|| m_pGameInstance->Key_Down(DIK_V) - //|| m_pGameInstance->Key_Down(DIK_T) - //|| m_pGameInstance->Key_Down(DIK_G) - //|| m_pGameInstance->Key_Down(DIK_B) + || m_pGameInstance->Key_Down(DIK_LSHIFT) + || m_pGameInstance->Key_Down(DIK_C) + || m_pGameInstance->Key_Down(DIK_V) ) { return S_OK; @@ -265,20 +247,24 @@ HRESULT CPlayer::InputMove() } void CPlayer::Behavior_IdleEnter() { + m_pFSM->Enable_State(FSMSTATE::IDLE); pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::IDLE]; if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG|FSMSTATE::WALK)) { - if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG)) { - pairAnimInfo = m_Animation[STATEANIM::JOG_STOP]; - } - else if (m_pFSM->IsEnable_Previous(FSMSTATE::WALK)) { + + if (m_pFSM->IsEnable_Previous(FSMSTATE::WALK)) { pairAnimInfo = m_Animation[STATEANIM::WALK_STOP]; } else if (m_pFSM->IsEnable_Previous(FSMSTATE::SPRINT)) { - // pairAnimInfo = m_Animation[STATEANIM::spr] + pairAnimInfo = m_Animation[STATEANIM::JOG_STOP]; } - } + else if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG)) { + pairAnimInfo = m_Animation[STATEANIM::JOG_STOP]; + } + } + m_bSprintToggle = false; + m_bWalkToggle = false; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } @@ -286,38 +272,37 @@ HRESULT CPlayer::Behavior_IdleExitCheck() { // S_OK -> 현 상태 유지 // E_FAIL -> 현 상태 탈출 - if (SUCCEEDED(InputSystem())) { - //Event - return S_OK; - } - if (SUCCEEDED(InputSkill())) { + if (SUCCEEDED(InputAction())) { if (m_pGameInstance->Key_Down(DIK_SPACE)) { m_pFSM->Change_State(FSMSTATE::JUMP); } else if (m_pGameInstance->Key_Down(DIK_LCONTROL)) { m_pFSM->Change_State(FSMSTATE::DODGE); } - else if (m_pGameInstance->Key_Down(DIK_E)) { - //m_pFSM->Change_State(FSMSTATE::AAA); - } else if (m_pGameInstance->Key_Down(DIK_R)) { - //m_pFSM->Change_State(FSMSTATE::SKILL); + m_pFSM->Change_State(FSMSTATE::COMBAT); } else if (m_pGameInstance->Key_Down(DIK_Q)) { - //m_pFSM->Change_State(FSMSTATE::SKILL2); - } - else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) { - //m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK); + m_pFSM->Change_State(FSMSTATE::COMBAT); } else if (m_pGameInstance->Key_Down(DIK_1)) { - //m_pFSM->Change_State(FSMSTATE::CAST); + m_pFSM->Change_State(FSMSTATE::COMBAT); } + else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) { + m_pFSM->Change_State(FSMSTATE::COMBAT); + } + else if (m_pGameInstance->Key_Down(DIK_V)) { + m_pFSM->Change_State(FSMSTATE::COMBAT); + } + return E_FAIL; } if (SUCCEEDED(InputMove())) { m_pFSM->Change_State(FSMSTATE::MOVE); return E_FAIL; } + pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::IDLE]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); return S_OK; } @@ -328,65 +313,60 @@ void CPlayer::Behavior_IdleExit() void CPlayer::Behavior_MoveEnter() { - pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::SPRINT]; + pair<_uint, _bool> pairAnimInfo = {}; _bool bFoward = m_pGameInstance->Key_Pressing(DIK_W); _bool bLeft = m_pGameInstance->Key_Pressing(DIK_A); _bool bRight = m_pGameInstance->Key_Pressing(DIK_D); _bool bBackward = m_pGameInstance->Key_Pressing(DIK_S); - - if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE | FSMSTATE::DODGE | FSMSTATE::LAND | FSMSTATE::COMBAT)) { - if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE)) { - // Idle -> Move - if (true == m_bSprintToggle) { - m_pFSM->Enable_State(FSMSTATE::SPRINT); - - if (true == bFoward) { - pairAnimInfo = m_Animation[STATEANIM::SPRINT]; - } - else { - // ? - } - } - else if (true == m_bWalkToggle) { - m_pFSM->Enable_State(FSMSTATE::WALK); - - if (true == bFoward) { - pairAnimInfo = m_Animation[STATEANIM::WALK_FWD]; - } - else if (true == bBackward) { - pairAnimInfo = m_Animation[STATEANIM::WALK_BWD]; - } + m_pFSM->Enable_State(FSMSTATE::MOVE); + if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE | FSMSTATE::DODGE)) { + if (true == m_bSprintToggle) { + m_pFSM->Enable_State(FSMSTATE::SPRINT); + m_bWalkToggle = false; + if (true == bFoward) { + pairAnimInfo = m_Animation[STATEANIM::SPRINT]; } } - else if (m_pFSM->IsEnable_Previous(FSMSTATE::DODGE | FSMSTATE::LAND)) { - // OtherMove -> AnotherMove - + else if (true == m_bWalkToggle) { + m_pFSM->Enable_State(FSMSTATE::WALK); + m_bSprintToggle = false; + if (true == bFoward) { + pairAnimInfo = m_Animation[STATEANIM::WALK_FWD]; + } + else if (true == bBackward) { + pairAnimInfo = m_Animation[STATEANIM::WALK_BWD]; + } } - else if (m_pFSM->IsEnable_Previous(FSMSTATE::COMBAT)) { - // Combat -> Move - + else + { + m_pFSM->Enable_State(FSMSTATE::JOG); + m_bSprintToggle = false; + m_bWalkToggle = false; + pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; } } else { // While Moving if (true == m_bSprintToggle) { m_pFSM->Enable_State(FSMSTATE::SPRINT); + m_bWalkToggle = false; pairAnimInfo = m_Animation[STATEANIM::SPRINT]; } else if (true == m_bWalkToggle) { m_pFSM->Enable_State(FSMSTATE::WALK); + m_bSprintToggle = false; if (true == bFoward) { pairAnimInfo = m_Animation[STATEANIM::WALK_FWD]; } else if (true == bBackward){ pairAnimInfo = m_Animation[STATEANIM::WALK_BWD]; } - //else if (true == bLeft){ - // pairAnimInfo = m_Animation[STATEANIM::WALK_STOP]; - //} - //else if (true == bRight){ - // pairAnimInfo = m_Animation[STATEANIM::WALK_BWD]; - //} + } + else { + m_pFSM->Enable_State(FSMSTATE::JOG); + m_bSprintToggle = false; + m_bWalkToggle = false; + pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; } } @@ -395,31 +375,61 @@ void CPlayer::Behavior_MoveEnter() HRESULT CPlayer::Behavior_MoveExitCheck() { - if (SUCCEEDED(InputSystem())) { - //Event - return S_OK; - } - if (SUCCEEDED(InputSkill())) { + pair<_uint, _bool> pairAnimInfo; + if (SUCCEEDED(InputAction())) { if (m_pGameInstance->Key_Down(DIK_SPACE)) { m_pFSM->Change_State(FSMSTATE::JUMP); } else if (m_pGameInstance->Key_Down(DIK_LCONTROL)) { m_pFSM->Change_State(FSMSTATE::DODGE); } - else if (m_pGameInstance->Key_Down(DIK_E)) { - //m_pFSM->Change_State(FSMSTATE::AAA); - } else if (m_pGameInstance->Key_Down(DIK_R)) { - //m_pFSM->Change_State(FSMSTATE::SKILL); + m_pFSM->Change_State(FSMSTATE::COMBAT); } else if (m_pGameInstance->Key_Down(DIK_Q)) { - //m_pFSM->Change_State(FSMSTATE::SKILL2); + m_pFSM->Change_State(FSMSTATE::COMBAT); } else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) { - //m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK); + m_pFSM->Change_State(FSMSTATE::COMBAT); } else if (m_pGameInstance->Key_Down(DIK_1)) { - //m_pFSM->Change_State(FSMSTATE::CAST); + m_pFSM->Change_State(FSMSTATE::COMBAT); + } + else if (m_pGameInstance->Key_Down(DIK_V)) { + m_pFSM->Change_State(FSMSTATE::COMBAT); + } + else if (m_pGameInstance->Key_Down(DIK_LSHIFT)) { + m_bSprintToggle = !m_bSprintToggle; + m_bWalkToggle = false; + if (m_bSprintToggle) + { + m_pFSM->Enable_State(FSMSTATE::SPRINT); + + pairAnimInfo = m_Animation[STATEANIM::SPRINT]; + } + else + { + m_pFSM->Enable_State(FSMSTATE::JOG); + m_pFSM->Disable_State(FSMSTATE::SPRINT); + pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; + } + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + } + else if (m_pGameInstance->Key_Down(DIK_C)) { + m_bWalkToggle = !m_bWalkToggle; + m_bSprintToggle= false; + if (m_bWalkToggle) + { + m_pFSM->Enable_State(FSMSTATE::WALK); + pairAnimInfo = m_Animation[STATEANIM::WALK_FWD]; + } + else + { + m_pFSM->Enable_State(FSMSTATE::JOG); + m_pFSM->Disable_State(FSMSTATE::WALK); + pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; + } + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } return E_FAIL; } @@ -432,23 +442,25 @@ HRESULT CPlayer::Behavior_MoveExitCheck() void CPlayer::Behavior_MoveExit() { - m_pFSM->Disable_State(FSMSTATE::MOVE|FSMSTATE::SPRINT|FSMSTATE::JOG|FSMSTATE::WALK); + m_pFSM->Disable_State(FSMSTATE::MOVE | FSMSTATE::SPRINT | FSMSTATE::JOG | FSMSTATE::WALK); } void CPlayer::Behavior_JumpEnter() { - pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::JUMP_SPRINT]; + pair<_uint, _bool> pairAnimInfo; m_pFSM->Enable_State(FSMSTATE::JUMP); - if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE|FSMSTATE::JOG|FSMSTATE::WALK)) { + if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE|FSMSTATE::WALK|FSMSTATE::JOG|FSMSTATE::SPRINT)) { if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE)) { - // Idle -> Jump - // pairAnimInfo = Get_AnimInfo(STATEANIM::Jump_IDLE); + pairAnimInfo = Get_AnimInfo(STATEANIM::JUMP); } - else if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG)) { - pairAnimInfo = m_Animation[STATEANIM::JUMP_JOG]; + else if (m_pFSM->IsEnable_Previous(FSMSTATE::SPRINT)) { + pairAnimInfo = m_Animation[STATEANIM::JUMP_SPRINT]; } else if (m_pFSM->IsEnable_Previous(FSMSTATE::WALK)) { - + pairAnimInfo = Get_AnimInfo(STATEANIM::JUMP); + } + else if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG)) { + pairAnimInfo = Get_AnimInfo(STATEANIM::JUMP_JOG); } } else { @@ -459,10 +471,6 @@ void CPlayer::Behavior_JumpEnter() HRESULT CPlayer::Behavior_JumpExitCheck() { - if (SUCCEEDED(InputSystem())) { - //Event - return S_OK; - } if (IsCurrentKeyFrame("Jump")) { m_pFSM->Change_State(FSMSTATE::LAND); return E_FAIL; @@ -477,20 +485,22 @@ void CPlayer::Behavior_JumpExit() void CPlayer::Behavior_LandEnter() { + m_pFSM->Enable_State(FSMSTATE::LAND); pair<_uint, _bool> pairAnimInfo = Get_AnimInfo(STATEANIM::LAND); m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } HRESULT CPlayer::Behavior_LandExitCheck() { - if (SUCCEEDED(InputSystem())) { - //Event - //return S_OK; - } if (m_pModelCom->IsFinishedAnim()){ m_pFSM->Change_State(FSMSTATE::IDLE); return E_FAIL; } // 혹시 Land to (Jog, Sprint, Dodge) 같은 애니메이션 있으면 여기에 분기 조건 넣으면 됨 + + if (SUCCEEDED(InputMove())) { + m_pFSM->Change_State(FSMSTATE::MOVE); + return E_FAIL; + } return S_OK; } @@ -502,20 +512,21 @@ void CPlayer::Behavior_LandExit() void CPlayer::Behavior_DodgeEnter() { // 혹시 @@ to Dodge 있으면 여기에 + m_pFSM->Enable_State(FSMSTATE::DODGE); pair<_uint, _bool> pairAnimInfo = Get_AnimInfo(STATEANIM::DODGE); m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } HRESULT CPlayer::Behavior_DodgeExitCheck() { - if (SUCCEEDED(InputSystem())) { - //Event - //return S_OK; - } if (m_pModelCom->IsFinishedAnim()){ m_pFSM->Change_State(FSMSTATE::IDLE); return E_FAIL; } + if (IsCurrentKeyFrame("Dodge")) { + m_pFSM->Change_State(FSMSTATE::MOVE); + return E_FAIL; + } return S_OK; } @@ -524,6 +535,102 @@ void CPlayer::Behavior_DodgeExit() m_pFSM->Disable_State(FSMSTATE::DODGE); } +void CPlayer::Behavior_CombatEnter() +{ + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::COMBAT); + + if (m_pGameInstance->Key_Down(DIK_R)) { + m_pFSM->Enable_State(FSMSTATE::SKILL); + pairAnimInfo = m_Animation[STATEANIM::SKILL]; + } + else if (m_pGameInstance->Key_Down(DIK_Q)) { + m_pFSM->Enable_State(FSMSTATE::SKILL2); + pairAnimInfo = m_Animation[STATEANIM::SKILL2]; + } + else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) { + m_pFSM->Enable_State(FSMSTATE::LIGHT_ATTACK); + pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK]; + } + else if (m_pGameInstance->Key_Down(DIK_1)) { + m_pFSM->Enable_State(FSMSTATE::CAST); + pairAnimInfo = m_Animation[STATEANIM::CAST]; + + } + else if (m_pGameInstance->Key_Down(DIK_V)) { + m_pFSM->Enable_State(FSMSTATE::MAPHELP); + pairAnimInfo = m_Animation[STATEANIM::MAPHELP]; + + } + + + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); +} + +HRESULT CPlayer::Behavior_CombatExitCheck() +{ + pair<_uint, _bool> pairAnimInfo; + if (SUCCEEDED(InputAction())) { + if (m_pGameInstance->Key_Down(DIK_R)) + { + m_pFSM->Enable_State(FSMSTATE::SKILL); + } + else if (m_pGameInstance->Key_Down(DIK_Q)) + { + m_pFSM->Enable_State(FSMSTATE::SKILL2); + } + else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) + { + m_pFSM->Enable_State(FSMSTATE::LIGHT_ATTACK); + _uint iIndex = m_pModelCom->Get_AnimIndex(); + if (m_Animation[STATEANIM::LIGHT_ATTACK].first <= iIndex && m_Animation[STATEANIM::LIGHT_ATTACK].first + 3 > iIndex) { + _float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio(); + if (fRatio >= 0.1f) { + pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK]; + pairAnimInfo.first = iIndex + 1; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + } + } + } + else if (m_pGameInstance->Key_Down(DIK_1)) + { + m_pFSM->Enable_State(FSMSTATE::CAST); + _uint iIndex = m_pModelCom->Get_AnimIndex(); + if (m_Animation[STATEANIM::CAST].first <= iIndex && m_Animation[STATEANIM::CAST].first + 3 > iIndex) { + _float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio(); + if (fRatio >= 0.15f) { + pairAnimInfo = m_Animation[STATEANIM::CAST]; + pairAnimInfo.first = iIndex + 1; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + } + } + } + else if (m_pGameInstance->Key_Down(DIK_V)) + { + m_pFSM->Enable_State(FSMSTATE::MAPHELP); + pairAnimInfo = m_Animation[STATEANIM::MAPHELP]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + } + return E_FAIL; + } + if (SUCCEEDED(InputMove()) && IsCurrentKeyFrame("Combat")) { + m_pFSM->Change_State(FSMSTATE::MOVE); + return E_FAIL; + } + + if (m_pModelCom->IsFinishedAnim()) { + m_pFSM->Change_State(FSMSTATE::IDLE); + return E_FAIL; + } + + return E_FAIL; +} + +void CPlayer::Behavior_CombatExit() +{ + m_pFSM->Disable_State(FSMSTATE::COMBAT | FSMSTATE::LIGHT_ATTACK | FSMSTATE::CAST | FSMSTATE::SKILL | FSMSTATE::SKILL2 | FSMSTATE::MAPHELP); +} + void CPlayer::Add_FSM() { #pragma region Behavior_Movement_NotFocus @@ -543,7 +650,10 @@ void CPlayer::Add_FSM() Desc.funcEnterEvent = [this]() { Behavior_MoveEnter(); }; Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(); }; Desc.funcExitEvent = [this]() { Behavior_MoveExit(); }; - Desc.funcPriorityUpdate = nullptr; + Desc.funcPriorityUpdate = [this](_float fTimeDelta) { + if (m_pGameInstance->Key_Pressing(DIK_A)) {m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta);} + if (m_pGameInstance->Key_Pressing(DIK_D)) { m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta);}; + }; Desc.funcLateUpdate = nullptr; m_States.emplace(FSMSTATE::MOVE, CState_Move::Create(&Desc)); } @@ -571,13 +681,25 @@ void CPlayer::Add_FSM() Desc.funcEnterEvent = [this]() { Behavior_DodgeEnter(); }; Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_DodgeExitCheck(); }; Desc.funcExitEvent = [this]() { Behavior_DodgeExit(); }; - Desc.funcPriorityUpdate = nullptr; + Desc.funcPriorityUpdate = [this](_float fTimeDelta) { + if (m_pGameInstance->Key_Pressing(DIK_A)) { m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); } + if (m_pGameInstance->Key_Pressing(DIK_D)) { m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); }; + }; Desc.funcLateUpdate = nullptr; m_States.emplace(FSMSTATE::DODGE, CState_Dodge::Create(&Desc)); } #pragma endregion #pragma region Behavior_Combat_NotFocus - + { + CState_Combat::STATE_COMBAT_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_CombatEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_CombatExitCheck(); }; + Desc.funcExitEvent = [this]() { Behavior_CombatExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::COMBAT, CState_Combat::Create(&Desc)); + } #pragma endregion #pragma region Behavior_Combat_Focus @@ -595,6 +717,7 @@ void CPlayer::Set_Anim() m_Animation[STATEANIM::LIGHT_ATTACK] = { 413,false }; m_Animation[STATEANIM::LAND] = { 259,false }; m_Animation[STATEANIM::CAST] = { 696,false }; + m_Animation[STATEANIM::MAPHELP] = { 122,false }; m_Animation[STATEANIM::IDLE] = { 266,true }; m_Animation[STATEANIM::IDLE_TURN_L] = { 270,false }; @@ -672,24 +795,9 @@ void CPlayer::Describe_Entity() float Rot3[3] = { RotR, RotU,RotL }; GUI::DragFloat3("Rot", Rot3); + + + string AnimList = m_pModelCom->Get_AnimList(m_pModelCom->Get_AnimIndex()); + GUI::Text(AnimList.c_str()); } - -_bool CPlayer::IsSprint() -{ - if (m_pGameInstance->Key_Down(DIK_LSHIFT)) - { - return m_bSprintToggle = !m_bSprintToggle; - } - return false; -} - -_bool CPlayer::IsWalk() -{ - if (m_pGameInstance->Key_Down(DIK_C)) - { - return m_bWalkToggle = !m_bWalkToggle; - } - return false; -} -//////////////////// diff --git a/Jusin154_Team3D/Editor/Private/State_Combat.cpp b/Jusin154_Team3D/Editor/Private/State_Combat.cpp index 35b611131..1e8e15653 100644 --- a/Jusin154_Team3D/Editor/Private/State_Combat.cpp +++ b/Jusin154_Team3D/Editor/Private/State_Combat.cpp @@ -15,9 +15,15 @@ void CState_Combat::Enter() HRESULT CState_Combat::Update(_float fTimeDelta) { + if (nullptr != m_funcPriorityUpdate) { + m_funcPriorityUpdate(fTimeDelta); + } if (E_FAIL == (__super::Update(fTimeDelta))) { return E_FAIL; } + if (nullptr != m_funcLateUpdate) { + m_funcLateUpdate(fTimeDelta); + } return S_OK; } @@ -31,7 +37,8 @@ HRESULT CState_Combat::Initialize(STATE_COMBAT_DESC* pDesc) if (FAILED(__super::Initialize(pDesc))) { return E_FAIL; } - m_pOwner = pDesc->pOwner; + m_funcPriorityUpdate = pDesc->funcPriorityUpdate; + m_funcLateUpdate = pDesc->funcLateUpdate; m_pModel = m_pOwner->Get_Component(); m_pFSM = m_pOwner->Get_Component(); diff --git a/Jusin154_Team3D/Editor/Private/Terrain.cpp b/Jusin154_Team3D/Editor/Private/Terrain.cpp index 836219ae5..43f688ae1 100644 --- a/Jusin154_Team3D/Editor/Private/Terrain.cpp +++ b/Jusin154_Team3D/Editor/Private/Terrain.cpp @@ -4,6 +4,7 @@ #include "GameInstance.h" #include "DebugCamera.h" #include "VIBuffer_Terrain.h" +#include "AlphaMap.h" CTerrain::CTerrain(ID3D11Device * pDevice, ID3D11DeviceContext * pContext) : CGameObject(pDevice, pContext) @@ -28,28 +29,60 @@ HRESULT CTerrain::Initialize(void* pArg) if (FAILED(Ready_Components())) return E_FAIL; + if (FAILED(Ready_AlphaMap())) + return E_FAIL; + m_fUsingSurfaceParams = 15.f / 27.f; m_vRotation = _float3{ 0.f, 0.f, 0.f }; m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(-194, 18.5f, -153.f, 1.f)); //m_pVIBufferCom->Set_CullingRadius(0.04f); + m_pAlphaMap->Load_ToFile("Hogsmeade_AlphaMap.bin"); + return S_OK; } void CTerrain::Priority_Update(_float fTimeDelta) { - GUI::Begin("Picking Position"); + GUI::Begin("Terrain"); + +#pragma region ALPHA_MAP + //GUI::InputInt("Color", &m_iColorIndex); + //m_iColorIndex = max(0, min(4, m_iColorIndex)); + + //GUI::InputInt("Rnage", (_int*)(&m_iMaskRange)); + //GUI::DragFloat("Value", &m_fMaskValue, 0.01f, -1.0f, 1.f); + //if (GUI::Button("Save", ImVec2(100.f, 30.f))) + //{ + // m_pAlphaMap->Save_ToFile("Hogsmeade_AlphaMap.bin"); + //} + //if (GUI::Button("Load", ImVec2(100.f, 30.f))) + //{ + // m_pAlphaMap->Load_ToFile("Hogsmeade_AlphaMap.bin"); + //} + + + GUI::DragFloat("Up", &m_fUpValue, 0.01f, -1.0f, 1.f); if (m_pGameInstance->Mouse_Pressing(DIM_LBUTTON)) { - if (m_pVIBufferCom->Picking(m_pTransformCom->Get_XMWorldMatrix(), &m_vPickingPosition)) + if (m_pGameInstance->isPicking(&m_vPickingPosition)) { - if(m_pGameInstance->Key_Pressing(DIK_PERIOD)) - m_pVIBufferCom->FitY(m_pTransformCom->Get_XMWorldMatrix(), 0.01f); - if(m_pGameInstance->Key_Pressing(DIK_COMMA)) - m_pVIBufferCom->FitY(m_pTransformCom->Get_XMWorldMatrix(), -0.01f); + if (m_pGameInstance->Key_Pressing(DIK_PERIOD)) + m_pVIBufferCom->FitY(m_pTransformCom->Get_XMWorldMatrix(), m_fUpValue); + if (m_pGameInstance->Key_Pressing(DIK_COMMA)) + m_pVIBufferCom->FitY(m_pTransformCom->Get_XMWorldMatrix(), m_fUpValue * -1.f); + + + //XMStoreFloat3(&m_vPickingPosition, XMVector3TransformCoord(XMLoadFloat3(&m_vPickingPosition), m_pTransformCom->Get_WorldMatrixInv())); + + //m_pAlphaMap->Update(m_vPickingPosition, m_iColorIndex, m_fMaskValue, m_iMaskRange); + } } +#pragma endregion + + /*GUI::InputFloat("Height Ratio", &m_fHeightRatio); max(0.01f, m_fHeightRatio); @@ -73,6 +106,7 @@ void CTerrain::Priority_Update(_float fTimeDelta) void CTerrain::Update(_float fTimeDelta) { //m_pVIBufferCom->Culling(XMMatrixIdentity()); + } @@ -164,7 +198,7 @@ HRESULT CTerrain::Bind_ShaderResources() if (FAILED(m_pMROTextureCom->Bind_ShaderResources(m_pShaderCom, "g_SurfaceParamsTextures", 0, m_pMROTextureCom->Get_Size()))){ return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_SRV("g_MaskTexture", m_pMaskTextureCom->Get_SRV(0)))) { + if (FAILED(m_pShaderCom->Bind_SRV("g_MaskTexture", m_pAlphaMap->Get_SRV()))) { return E_FAIL; } @@ -174,6 +208,16 @@ HRESULT CTerrain::Bind_ShaderResources() return S_OK; } +HRESULT CTerrain::Ready_AlphaMap() +{ + m_pAlphaMap = CAlphaMap::Create(m_pDevice, m_pContext, 2048, 2048); + + if(nullptr == m_pAlphaMap) + return E_FAIL; + + return S_OK; +} + CTerrain* CTerrain::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { CTerrain* pInstance = new CTerrain(pDevice, pContext); @@ -204,6 +248,7 @@ void CTerrain::Free() { __super::Free(); + SAFE_RELEASE(m_pAlphaMap); SAFE_RELEASE(m_pShaderCom); SAFE_RELEASE(m_pVIBufferCom); SAFE_RELEASE(m_pDiffuseTextureCom); diff --git a/Jusin154_Team3D/Editor/Public/AlphaMap.h b/Jusin154_Team3D/Editor/Public/AlphaMap.h new file mode 100644 index 000000000..b172d45c2 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/AlphaMap.h @@ -0,0 +1,43 @@ +#include "Editor_Define.h" +#include "Base.h" + +NS_BEGIN(Engine) +class CGameInstance; +NS_END + +NS_BEGIN(Editor) + +class CAlphaMap final : public CBase +{ +private: + CAlphaMap(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual ~CAlphaMap() = default; + +public: + void Update(_float3& vPosition, _uint iColorIndex, _float fValue, _uint iRange); + ID3D11ShaderResourceView* Get_SRV() { return m_pSRV; } + + void Save_ToFile(const _char* pFilePath); + void Load_ToFile(const _char* pFilePath); +private: + ID3D11Device* m_pDevice = { nullptr }; + ID3D11DeviceContext* m_pContext = { nullptr }; + ID3D11Texture2D* m_pTexture2D = { nullptr }; + ID3D11ShaderResourceView* m_pSRV = { nullptr }; + CGameInstance* m_pGameInstance = { nullptr }; + + _uint m_iNumPixels = {}; + _uint m_iNumPixelW = {}; + _uint m_iNumPixelH = {}; + + _float4* m_pPixels = { nullptr }; + +private: + HRESULT Initialize( _uint iSizeX, _uint iSizeY); + +public: + static CAlphaMap* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, _uint iSizeX, _uint iSizeY); + virtual void Free(); +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Player.h b/Jusin154_Team3D/Editor/Public/Player.h index 078da8ab6..65be8a156 100644 --- a/Jusin154_Team3D/Editor/Public/Player.h +++ b/Jusin154_Team3D/Editor/Public/Player.h @@ -37,6 +37,8 @@ class CPlayer final : public CUnit _bool m_bSprintToggle = { false }; _bool m_bWalkToggle = { false }; + _int m_iCombo = { 0 }; + class CCamPosition_Player* m_pCamPosition_TopDown_LookPart = { nullptr }; class CCamPosition_Arm* m_pCamPosition_TopDown_FollowPart = { nullptr }; private: @@ -53,11 +55,8 @@ class CPlayer final : public CUnit private: virtual void Add_FSM(); virtual void Set_Anim(); - _bool IsSprint(); - _bool IsWalk(); - HRESULT InputSystem(); - HRESULT InputSkill(); + HRESULT InputAction(); HRESULT InputMove(); void Behavior_IdleEnter(); @@ -80,6 +79,10 @@ class CPlayer final : public CUnit HRESULT Behavior_DodgeExitCheck(); void Behavior_DodgeExit(); + void Behavior_CombatEnter(); + HRESULT Behavior_CombatExitCheck(); + void Behavior_CombatExit(); + public: virtual void Reset_Sprint() { m_bSprintToggle = false; } diff --git a/Jusin154_Team3D/Editor/Public/State_Combat.h b/Jusin154_Team3D/Editor/Public/State_Combat.h index 8c7685ea0..858dc260a 100644 --- a/Jusin154_Team3D/Editor/Public/State_Combat.h +++ b/Jusin154_Team3D/Editor/Public/State_Combat.h @@ -8,7 +8,8 @@ class CState_Combat final : public CState_Root { public: typedef struct tagCombat : public CState_Root::STATE_ROOT_DESC { - + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; }STATE_COMBAT_DESC; private: CState_Combat(); @@ -19,6 +20,10 @@ class CState_Combat final : public CState_Root virtual HRESULT Update(_float fTimeDelta); virtual void Exit(); +private: + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + private: HRESULT Initialize(STATE_COMBAT_DESC* pDesc); diff --git a/Jusin154_Team3D/Editor/Public/Terrain.h b/Jusin154_Team3D/Editor/Public/Terrain.h index 95f49559c..63fbeb8e1 100644 --- a/Jusin154_Team3D/Editor/Public/Terrain.h +++ b/Jusin154_Team3D/Editor/Public/Terrain.h @@ -42,9 +42,18 @@ class CTerrain final : public CGameObject _uint m_iTextureIndex = {}; + + class CAlphaMap* m_pAlphaMap = { nullptr }; + _uint m_iMaskRange = {1}; + _int m_iColorIndex = {0}; + _float m_fMaskValue = {0.1f}; + + _float m_fUpValue = { 0.01f }; + private: HRESULT Ready_Components(); HRESULT Bind_ShaderResources(); + HRESULT Ready_AlphaMap(); public: static CTerrain* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl index a6d0ff757..ba1161adb 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Deferred.hlsl @@ -155,7 +155,7 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In) return Out; } - float fDiffuseAOStrength = lerp(1.3f, 2.f, fOcclusion); + float fDiffuseAOStrength = lerp(0.3f, 5.f, fOcclusion); PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0); diff --git a/Jusin154_Team3D/Engine/Private/Animation.cpp b/Jusin154_Team3D/Engine/Private/Animation.cpp index 27c4cac77..4ad2f858b 100644 --- a/Jusin154_Team3D/Engine/Private/Animation.cpp +++ b/Jusin154_Team3D/Engine/Private/Animation.cpp @@ -248,20 +248,6 @@ HRESULT CAnimation::Initialize(const vector& Bones, const aiAnimation* p return S_OK; } -HRESULT CAnimation::SaveAsBinary(HANDLE hFile, DWORD& dwByte) -{ - size_t iNameLength = m_strName.length(); - WriteFile(hFile, &iNameLength, sizeof(size_t), &dwByte, nullptr); - WriteFile(hFile, m_strName.data(), (DWORD)m_strName.length(), &dwByte, nullptr); - WriteFile(hFile, &m_fDuration, sizeof(_float), &dwByte, nullptr); - WriteFile(hFile, &m_TickPerSeconds, sizeof(_float) * 2, &dwByte, nullptr); - WriteFile(hFile, &m_iNumChannels, sizeof(_uint), &dwByte, nullptr); - - for (_uint i = 0; i < m_iNumChannels; ++i) { - m_Channels[i]->SaveAsBinary(hFile, dwByte); - } - return S_OK; -} CAnimation* CAnimation::Create(const vector& Bones, const aiAnimation* pAnimation) { @@ -274,36 +260,6 @@ CAnimation* CAnimation::Create(const vector& Bones, const aiAnimation* p #endif -HRESULT CAnimation::Initialize(HANDLE hFile, DWORD& dwByte) -{ - size_t iNameLength = {}; - if (!ReadFile(hFile, &iNameLength, sizeof(size_t), &dwByte, nullptr)) { - return E_FAIL; - } - m_strName.resize(iNameLength); - if (!ReadFile(hFile, (void*)m_strName.data(), (DWORD)iNameLength, &dwByte, nullptr)) { - return E_FAIL; - } - if (!ReadFile(hFile, &m_fDuration, sizeof(_float), &dwByte, nullptr)) { - return E_FAIL; - } - if (!ReadFile(hFile, &m_TickPerSeconds, sizeof(_float) * 2, &dwByte, nullptr)) { - return E_FAIL; - } - if (!ReadFile(hFile, &m_iNumChannels, sizeof(_uint), &dwByte, nullptr)) { - return E_FAIL; - } - m_CurrentKeyFrameIndices.resize(m_iNumChannels); - m_Channels.reserve(m_iNumChannels); - for (_uint i = 0; i < m_iNumChannels; ++i) { - m_Channels.push_back(CChannel::Create(hFile, dwByte)); - } - if (FAILED(Combined_Initialize())) { - return E_FAIL; - } - return S_OK; -} - HRESULT CAnimation::Initialize(const vector& Bones, const CModel* pModel, SaveAnimation* pSaveAnimation) { m_pSaveAnim = pSaveAnimation; @@ -403,19 +359,6 @@ HRESULT CAnimation::CreateChannelBuffer(ID3D11Device* pDevice, vectorInitialize(hFile, dwByte))) - { - MSG_BOX("Failed to Created : CAnimation"); - SAFE_RELEASE(pInstance); - } - - return pInstance; -} - CAnimation* CAnimation::Create(const vector& Bones, const CModel* pModel, SaveAnimation* pSaveAnimation) { CAnimation* pInstance = new CAnimation(); diff --git a/Jusin154_Team3D/Engine/Private/Channel.cpp b/Jusin154_Team3D/Engine/Private/Channel.cpp index 4b3a29790..c0b1f6b93 100644 --- a/Jusin154_Team3D/Engine/Private/Channel.cpp +++ b/Jusin154_Team3D/Engine/Private/Channel.cpp @@ -87,22 +87,6 @@ CHANNEL_DESC CChannel::Fill_GPU_ChannelDesc() } - -HRESULT CChannel::SaveAsBinary(HANDLE hFile, DWORD& dwByte) -{ - string strName = m_szName; - strName.shrink_to_fit(); - DWORD iLength = (DWORD)strName.length(); - WriteFile(hFile, &iLength, sizeof(_uint), &dwByte, nullptr); - WriteFile(hFile, strName.data(), iLength, &dwByte, nullptr); - WriteFile(hFile, &m_iBoneIndex, sizeof(_int), &dwByte, nullptr); - WriteFile(hFile, &m_iNumKeyFrames, sizeof(_uint), &dwByte, nullptr); - for (auto& keyFrame : m_KeyFrames) { - WriteFile(hFile, &keyFrame, sizeof(KEYFRAME), &dwByte, nullptr); - } - return S_OK; -} - CChannel* CChannel::Create(const vector& Bones, const aiNodeAnim* pAIChannel) { CChannel* pInstance = new CChannel(); @@ -190,14 +174,14 @@ void CChannel::Update_TransformationMatirx(const vector& Bones, const LO XMStoreFloat3(&vCurRootPos, vTranslation); XMMATRIX pre = XMLoadFloat4x4(&m_PreTransformMatrix); - + /* if (!m_bInitialRootPos) { m_bInitialRootPos = true; vTranslation = XMVectorZero(); } else - { + {*/ _vector vDeltaLocal = XMLoadFloat3(&vCurRootPos) - XMLoadFloat3(&m_vPrevRootPos); _vector vDeltaAdjusted = {}; @@ -224,7 +208,7 @@ void CChannel::Update_TransformationMatirx(const vector& Bones, const LO m_vPrevRootPos = vCurRootPos; vTranslation = XMVectorZero(); - } + //} /////////////////////////////////// _float4 curRotF4; @@ -356,32 +340,6 @@ HRESULT CChannel::Initialize(const CModel* pModel, SaveChannel* pSaveChannel) return S_OK; } -CChannel* CChannel::Create(const vector& Bones, _uint iIndex) -{ - CChannel* pInstance = new CChannel(); - - if (FAILED(pInstance->Initialize(Bones, iIndex))) - { - MSG_BOX("Failed to Created : CChannel"); - SAFE_RELEASE(pInstance); - } - - return pInstance; -} - -CChannel* CChannel::Create(HANDLE hFile, DWORD& dwByte) -{ - CChannel* pInstance = new CChannel(); - - if (FAILED(pInstance->Initialize(hFile, dwByte))) - { - MSG_BOX("Failed to Created : CChannel"); - SAFE_RELEASE(pInstance); - } - - return pInstance; -} - CChannel* CChannel::Create(const CModel* pModel, SaveChannel* pSaveChannel) { CChannel* pInstance = new CChannel(); diff --git a/Jusin154_Team3D/Engine/Private/LerpAnim.cpp b/Jusin154_Team3D/Engine/Private/LerpAnim.cpp index ed36a6c1d..1bbfe912f 100644 --- a/Jusin154_Team3D/Engine/Private/LerpAnim.cpp +++ b/Jusin154_Team3D/Engine/Private/LerpAnim.cpp @@ -36,16 +36,6 @@ HRESULT CLerpAnim::Initialize(_uint iNumBone, _float fTickPerSecond, const vecto m_InitialFrames.resize(m_iNumChannels); m_Channels.reserve(m_iNumChannels); - for (_uint i = 0; i < m_iNumChannels; ++i) { - CChannel* pChannel = CChannel::Create(Bones, i); - if (nullptr == pChannel) { - return E_FAIL; - } - m_Channels.push_back(pChannel); - Bones[i]->Get_KeyFrame(m_InitialFrames[i], false); - m_InitialFrames[i].fTrackPosition = m_fDuration; - pChannel->Set_Frame(1, m_InitialFrames[i]); - } return S_OK; } void CLerpAnim::Begin(const vector& Bones, vector& StartFrames, vector& EndFrames, _float fDuration, _uint iRootBoneIndex) diff --git a/Jusin154_Team3D/Engine/Private/Material.cpp b/Jusin154_Team3D/Engine/Private/Material.cpp index 5f1ade52e..a004650a9 100644 --- a/Jusin154_Team3D/Engine/Private/Material.cpp +++ b/Jusin154_Team3D/Engine/Private/Material.cpp @@ -533,6 +533,9 @@ HRESULT CMaterial::Initialize(const _char* pModelFilePath, const SaveMaterial& _ ID3D11ShaderResourceView* pSRV = nullptr; HRESULT hr = S_OK; + if (!m_SRVs[type].empty()) + continue; + const char* ext = strrchr(szFullPath, '.'); if (ext) { @@ -547,7 +550,6 @@ HRESULT CMaterial::Initialize(const _char* pModelFilePath, const SaveMaterial& _ if (FAILED(hr)){ return E_FAIL; } - m_SRVs[type].push_back(pSRV); } } diff --git a/Jusin154_Team3D/Engine/Private/Mesh.cpp b/Jusin154_Team3D/Engine/Private/Mesh.cpp index 4b950894a..1b30573ca 100644 --- a/Jusin154_Team3D/Engine/Private/Mesh.cpp +++ b/Jusin154_Team3D/Engine/Private/Mesh.cpp @@ -149,87 +149,6 @@ HRESULT CMesh::Render_Instance(_uint iNumInstance) return S_OK; } - -HRESULT CMesh::Initialize_Prototype(HANDLE hFile, DWORD& dwByte) -{ - { // 멤버변수 - if (!ReadFile(hFile, &m_iMaterialIndex, sizeof(_uint), &dwByte, nullptr)) { - return E_FAIL; - } - if (!ReadFile(hFile, &m_iNumVertexBuffers, sizeof(_uint), &dwByte, nullptr)) { - return E_FAIL; - } - if (!ReadFile(hFile, &m_iNumVertices, sizeof(_uint), &dwByte, nullptr)) { - return E_FAIL; - } - if (!ReadFile(hFile, &m_iVertexStride, sizeof(_uint), &dwByte, nullptr)) { - return E_FAIL; - } - if (!ReadFile(hFile, &m_iNumIndices, sizeof(_uint), &dwByte, nullptr)) { - return E_FAIL; - } - if (!ReadFile(hFile, &m_iIndexStride, sizeof(_uint), &dwByte, nullptr)) { - return E_FAIL; - } - if (!ReadFile(hFile, &m_iNumBones, sizeof(_uint), &dwByte, nullptr)) { - return E_FAIL; - } - if (!ReadFile(hFile, &m_eIndexFormat, sizeof(DXGI_FORMAT), &dwByte, nullptr)) { - return E_FAIL; - } - if (!ReadFile(hFile, &m_ePrimitive, sizeof(D3D_PRIMITIVE_TOPOLOGY), &dwByte, nullptr)) { - return E_FAIL; - } - DWORD iSize = {}; - if (!ReadFile(hFile, &iSize, sizeof(DWORD), &dwByte, nullptr)) { - return E_FAIL; - } - m_BoneIndices.resize(iSize / sizeof(_int)); - if (!ReadFile(hFile, m_BoneIndices.data(), iSize, &dwByte, nullptr)) { - return E_FAIL; - } - if (!ReadFile(hFile, &iSize, sizeof(DWORD), &dwByte, nullptr)) { - return E_FAIL; - } - m_offsetMatrices.resize(iSize / sizeof(_float4x4)); - if (!ReadFile(hFile, m_offsetMatrices.data(), iSize, &dwByte, nullptr)) { - DWORD err = GetLastError(); - return E_FAIL; - } - - m_pBoneMatrices = new _float4x4[0 == m_iNumBones ? 1 : m_iNumBones]; - ZeroMemory(m_pBoneMatrices, sizeof(_float4x4) * m_iNumBones); - } - { // Vertex Buffer - HRESULT hr = (m_iVertexStride == sizeof(VTXMESH)) ? - Ready_VertexBuffer_For_NonAnim(hFile, dwByte) : - Ready_VertexBuffer_For_Anim(hFile, dwByte); - } - { // Index Buffer - D3D11_BUFFER_DESC IBDesc{}; - if (!ReadFile(hFile, &IBDesc, sizeof(D3D11_BUFFER_DESC), &dwByte, nullptr)) { - return E_FAIL; - } - - _uint* pIndices = new _uint[m_iNumIndices]; - ZeroMemory(pIndices, sizeof(_uint) * m_iNumIndices); - - if (!ReadFile(hFile, pIndices, IBDesc.ByteWidth, &dwByte, nullptr)) { - return E_FAIL; - } - - D3D11_SUBRESOURCE_DATA InitialIBData{}; - InitialIBData.pSysMem = pIndices; - - if (FAILED(m_pDevice->CreateBuffer(&IBDesc, &InitialIBData, &m_pIB))) { - return E_FAIL; - } - - Safe_Delete_Array(pIndices); - } - return S_OK; -} - HRESULT CMesh::Initialize_Prototype(MODEL eType, const CModel* pModel, SaveMesh* _SaveMesh, _fmatrix PreTransformMatrix) { strcpy_s(m_szName, _SaveMesh->MeshName.c_str()); @@ -294,64 +213,6 @@ HRESULT CMesh::Initialize_Prototype(MODEL eType, const CModel* pModel, SaveMesh* return S_OK; } -HRESULT CMesh::Ready_VertexBuffer_For_NonAnim(HANDLE hFile, DWORD& dwByte) -{ - D3D11_BUFFER_DESC VBDesc{}; - if (!ReadFile(hFile, &VBDesc, sizeof(D3D11_BUFFER_DESC), &dwByte, nullptr)) { - return E_FAIL; - } - VTXMESH* pVertices = new VTXMESH[m_iNumVertices]{}; - ZeroMemory(pVertices, sizeof(VTXMESH) * m_iNumVertices); - - m_pVertexPositions = new _float3[m_iNumVertices]; - ZeroMemory(m_pVertexPositions, sizeof(_float3) * m_iNumVertices); - if (!ReadFile(hFile, pVertices, VBDesc.ByteWidth, &dwByte, nullptr)) { - return E_FAIL; - } - for (_uint i = 0; i < m_iNumVertices; ++i) { - m_pVertexPositions[i] = pVertices[i].vPosition; - } - D3D11_SUBRESOURCE_DATA InitialVBData{}; - InitialVBData.pSysMem = pVertices; - - if (FAILED(m_pDevice->CreateBuffer(&VBDesc, &InitialVBData, &m_pVB))) { - return E_FAIL; - } - - Safe_Delete_Array(pVertices); - - return S_OK; -} - -HRESULT CMesh::Ready_VertexBuffer_For_Anim(HANDLE hFile, DWORD& dwByte) -{ - D3D11_BUFFER_DESC VBDesc{}; - if (!ReadFile(hFile, &VBDesc, sizeof(D3D11_BUFFER_DESC), &dwByte, nullptr)) { - return E_FAIL; - } - VTXANIMMESH* pVertices = new VTXANIMMESH[m_iNumVertices]{}; - ZeroMemory(pVertices, sizeof(VTXANIMMESH) * m_iNumVertices); - - m_pVertexPositions = new _float3[m_iNumVertices]; - ZeroMemory(m_pVertexPositions, sizeof(_float3) * m_iNumVertices); - if (!ReadFile(hFile, pVertices, VBDesc.ByteWidth, &dwByte, nullptr)) { - return E_FAIL; - } - for (_uint i = 0; i < m_iNumVertices; ++i) { - m_pVertexPositions[i] = pVertices[i].vPosition; - } - D3D11_SUBRESOURCE_DATA InitialVBData{}; - InitialVBData.pSysMem = pVertices; - - if (FAILED(m_pDevice->CreateBuffer(&VBDesc, &InitialVBData, &m_pVB))) { - return E_FAIL; - } - - Safe_Delete_Array(pVertices); - - return S_OK; -} - HRESULT CMesh::Ready_VertexBuffer_For_NonAnim(SaveMesh* SaveMesh, _fmatrix PreTransformMatrix) { m_iVertexStride = sizeof(VTXMESH); @@ -533,80 +394,6 @@ CMesh* CMesh::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL return pInstance; } -HRESULT CMesh::SaveAsBinary(HANDLE hFile, DWORD& dwByte) -{ - { // 멤버변수 - WriteFile(hFile, &m_iMaterialIndex, sizeof(_uint), &dwByte, nullptr); - WriteFile(hFile, &m_iNumVertexBuffers, sizeof(_uint), &dwByte, nullptr); - WriteFile(hFile, &m_iNumVertices, sizeof(_uint), &dwByte, nullptr); - WriteFile(hFile, &m_iVertexStride, sizeof(_uint), &dwByte, nullptr); - WriteFile(hFile, &m_iNumIndices, sizeof(_uint), &dwByte, nullptr); - WriteFile(hFile, &m_iIndexStride, sizeof(_uint), &dwByte, nullptr); - WriteFile(hFile, &m_iNumBones, sizeof(_uint), &dwByte, nullptr); - WriteFile(hFile, &m_eIndexFormat, sizeof(DXGI_FORMAT), &dwByte, nullptr); - WriteFile(hFile, &m_ePrimitive, sizeof(D3D_PRIMITIVE_TOPOLOGY), &dwByte, nullptr); - - DWORD iSize = (DWORD)(sizeof(_int) * m_BoneIndices.size()); - WriteFile(hFile, &iSize, sizeof(DWORD), &dwByte, nullptr); - WriteFile(hFile, m_BoneIndices.data(), iSize, &dwByte, nullptr); - - iSize = (DWORD)(sizeof(_float4x4) * m_offsetMatrices.size()); - WriteFile(hFile, &iSize, sizeof(DWORD), &dwByte, nullptr); - WriteFile(hFile, m_offsetMatrices.data(), iSize, &dwByte, nullptr); - } - { // Vertex Buffer - D3D11_BUFFER_DESC VBDesc{}; - m_pVB->GetDesc(&VBDesc); // 버퍼 디스크립션 저장 - WriteFile(hFile, &VBDesc, sizeof(D3D11_BUFFER_DESC), &dwByte, nullptr); - - D3D11_BUFFER_DESC StagingDesc{}; - StagingDesc.Usage = D3D11_USAGE_STAGING; - StagingDesc.ByteWidth = VBDesc.ByteWidth; - StagingDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; - StagingDesc.BindFlags = 0; - StagingDesc.MiscFlags = 0; - - ID3D11Buffer* pStaging = nullptr; - if (FAILED(m_pDevice->CreateBuffer(&StagingDesc, nullptr, &pStaging)) || nullptr == pStaging) { - return E_FAIL; - } - m_pContext->CopyResource(pStaging, m_pVB); // 버퍼 복사 - - D3D11_MAPPED_SUBRESOURCE mapped{}; - m_pContext->Map(pStaging, 0, D3D11_MAP_READ, 0, &mapped); - WriteFile(hFile, mapped.pData, VBDesc.ByteWidth, &dwByte, nullptr); - - m_pContext->Unmap(pStaging, 0); - pStaging->Release(); - } - { // Index Buffer - D3D11_BUFFER_DESC IBDesc{}; - m_pIB->GetDesc(&IBDesc); - WriteFile(hFile, &IBDesc, sizeof(D3D11_BUFFER_DESC), &dwByte, nullptr); - - D3D11_BUFFER_DESC StagingDesc{}; - StagingDesc.Usage = D3D11_USAGE_STAGING; - StagingDesc.ByteWidth = IBDesc.ByteWidth; - StagingDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; - StagingDesc.BindFlags = 0; - StagingDesc.MiscFlags = 0; - - ID3D11Buffer* pStaging = nullptr; - if (FAILED(m_pDevice->CreateBuffer(&StagingDesc, nullptr, &pStaging)) || nullptr == pStaging) { - return E_FAIL; - } - m_pContext->CopyResource(pStaging, m_pIB); - - D3D11_MAPPED_SUBRESOURCE mapped{}; - m_pContext->Map(pStaging, 0, D3D11_MAP_READ, 0, &mapped); - WriteFile(hFile, mapped.pData, IBDesc.ByteWidth, &dwByte, nullptr); - - m_pContext->Unmap(pStaging, 0); - pStaging->Release(); - } - return S_OK; -} - PSX::PxTriangleMesh* CMesh::ConvertToPxMesh(const PSX::PxCookingParams* pParam, PSX::PxPhysics* pPhysX, _matrix WorldMatrix) { PSX::PxTriangleMeshDesc tMeshDesc = {}; @@ -779,19 +566,6 @@ HRESULT CMesh::Ready_VertexBuffer_For_Anim(vector& Bones, const ai } #endif -CMesh* CMesh::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, HANDLE hFile, DWORD& dwByte) -{ - CMesh* pInstance = new CMesh(pDevice, pContext); - - if (FAILED(pInstance->Initialize_Prototype(hFile, dwByte))) - { - MSG_BOX("Failed to Created : CMesh"); - SAFE_RELEASE(pInstance); - } - - return pInstance; -} - CMesh* CMesh::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, const CModel* pModel, SaveMesh* _SaveMesh, _fmatrix PreTransformMatrix) { CMesh* pInstance = new CMesh(pDevice, pContext); diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index 5ae671060..6bd49333b 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -83,45 +83,6 @@ _int CModel::Get_BoneIndex(const _char* pBoneName) const return iBoneIndex; } -void CModel::Change_AnimationIndex(_int iAnimationIndex, _bool bIsLoop, _float fLerpDuration, _bool bIgnoreCurrentIndex) -{ - if (false == bIgnoreCurrentIndex && m_iCurrentAnimIndex == iAnimationIndex) { return; } - m_iCurrentAnimIndex = iAnimationIndex; - m_bIsLoop = bIsLoop; - RefreshAnim(); - - m_PrevAnimationMatrix = Get_BoneMatrix(m_iRootBoneIndex); - - - m_Animations[m_iCurrentAnimIndex]->Depart_Animation(); // 애니메이션 종료 이벤트 ( 럴프애님은 자체적으로 불림 ) - vector<_int>* BeforeAnimIndex = m_Animations[m_iCurrentAnimIndex]->Capture_Bones(); // 영향을 받는 본 인덱스 추출 1 - vector<_int>* AfterAnimIndex = m_Animations[iAnimationIndex]->Capture_Bones(); // 영향을 받는 본 인덱스 추출 2 - unordered_set<_int> UnionAnimIndex = {}; - - vector LerpStartFrames; - for (_int i : *BeforeAnimIndex) { - UnionAnimIndex.insert(i); - } - for (_int i : *AfterAnimIndex) { - UnionAnimIndex.insert(i); - } - LerpStartFrames.reserve(UnionAnimIndex.size()); // 영향을 받는 모든 현재 본을 가져옴 - - // 스타팅 키프레임 채우기 pair < 본 인덱스, 키프레임 > - for (auto iter = UnionAnimIndex.begin(); iter != UnionAnimIndex.end(); ++iter) { - LERPDESC desc = {}; - desc.iSlot = *iter; - m_Bones[desc.iSlot]->Get_KeyFrame(desc.tagKeyFrame, true); // 스타팅 키프레임 채우기 - LerpStartFrames.emplace_back(desc); - } - - // 엔딩 키프레임 채우기 pair < 본인덱스, 키프레임 > - vector LerpEndFrames = m_Animations[iAnimationIndex]->Get_StartFrameInformations(); - - // 럴프 애니메이션 시작 - m_pLerpAnim->Begin(m_Bones, LerpStartFrames, LerpEndFrames, fLerpDuration, m_iRootBoneIndex); - -} HRESULT CModel::Bind_Material(_uint iMeshIndex, CShader* pShader) { if (iMeshIndex >= m_iNumMeshes) { @@ -154,6 +115,8 @@ _bool CModel::Play_Animation(_float fTimeDelta,CTransform* pTransform) return false; // 잘못된 초기화 } + ComputeAnimation(); + if (m_iPreAnimIndex != m_iCurrentAnimIndex && m_iPreAnimIndex != 0) { m_fBlendTime += fTimeDelta; @@ -204,55 +167,6 @@ void CModel::Set_AnimationIndex(_uint iIndex, _bool isLoop) m_iCurrentAnimIndex = -1; } -void CModel::Stop_Animation() -{ - if (-1 == m_iCurrentAnimIndex // 정지 혹은 시작을 안시켜준 애님 - || m_iCurrentAnimIndex >= (_int)m_iNumAnimations) // 애님 인덱스 초과됨 - { - return; // 잘못된 초기화 - } - - m_Animations[m_iCurrentAnimIndex]->Depart_Animation(); // 애님이 퇴근할 때 불리는 함수를 부르면서 초기상태로 되돌림 -} - -void CModel::RefreshAnim() -{ - m_bIsFinishedAnim = false; - m_bIsFinishedLerp = false; -} -_float CModel::Get_AnimProgressRatio() -{ - return m_Animations[m_iCurrentAnimIndex]->Get_AnimProgressRatio(); -} -_int CModel::Get_AnimProgressPostion(const _char* pAnimChannelName) -{ - return m_Animations[m_iCurrentAnimIndex]->Get_AnimProgressPostion(pAnimChannelName); -} -_float CModel::Get_AnimEstimatedDuration() -{ - if (MODEL::ANIM == m_eType) { - return m_Animations[m_iCurrentAnimIndex]->Get_AnimEstimatedDuration(); - } - else { - return 0.f; - } - -} -void CModel::Set_AnimProgressPostion(const _char* pChannelName, _uint iPosition) -{ - return m_Animations[m_iCurrentAnimIndex]->Set_AnimProgressPostion(pChannelName, iPosition); -} -void CModel::Set_AnimPauseState(_bool bValue) { - m_Animations[m_iCurrentAnimIndex]->Set_AnimPause(bValue); -} - -void CModel::ReallocateResources(CTransform* pTransform) -{ - SAFE_RELEASE(m_pTransform); - m_pTransform = pTransform; - SAFE_ADDREF(m_pTransform); -} - const _float4x4* CModel::Get_BoneMatrixPtr(const _char* pBoneName) const { vector::const_iterator iter = find_if(m_Bones.begin(), m_Bones.end(), [&](CBone* pBone)->_bool @@ -278,15 +192,6 @@ _matrix CModel::Get_BoneMatrix(_uint iBoneIndex) return m_Bones[iBoneIndex]->Get_CombinedTransformationMatrix(); } -void CModel::Get_BoneMatrices(_float4x4* pOut) -{ - if (0 == m_Bones.size()) { - return; - } - for (_uint i = 0; i < m_Bones.size(); ++i) { - pOut[i] = *m_Bones[i]->Get_CombinedTransformationMatrixPtr(); - } -} void CModel::Set_CurrentTrackPosition(_float TrackPosition) { @@ -303,6 +208,11 @@ _float CModel::Get_CurrentTrackPosition() return m_Animations[m_iCurrentAnimIndex]->Get_CurrentTrackPosition(); } +_float CModel::Get_CurrentTrackProgressRatio() +{ + return m_Animations[m_iCurrentAnimIndex]->Get_CurrentTrackProgressRatio(); +} + _float CModel::Get_AnimSpeed() { return m_Animations[m_iCurrentAnimIndex]->Get_AnimSpeed(); @@ -313,16 +223,6 @@ void CModel::Set_AnimSpeed(_float fSpeed) m_Animations[m_iCurrentAnimIndex]->Set_AnimSpeed(fSpeed); } -void CModel::Set_Anim(CModel* Source) -{ - for (auto& Animations : Source->m_Animations) - { - m_Animations.push_back(Animations); - } - - m_iNumAnimations += (_uint)Source->m_Animations.size(); -} - HRESULT CModel::Render(_uint iMeshIndex) { @@ -1005,16 +905,6 @@ HRESULT CModel::Create_ParentVB() return S_OK; } - -void CModel::Get_BoneMatrix() -{ - m_BoneMatrix.resize(m_Bones.size()); - for (size_t i =0; i < m_Bones.size(); i++) - { - m_BoneMatrix[i] = (*m_Bones[i]->Get_CombinedTransformationMatrixPtr()); - } -} - HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix) { m_eType = eType; diff --git a/Jusin154_Team3D/Engine/Private/Texture.cpp b/Jusin154_Team3D/Engine/Private/Texture.cpp index 70dfb754f..eb24d45a6 100644 --- a/Jusin154_Team3D/Engine/Private/Texture.cpp +++ b/Jusin154_Team3D/Engine/Private/Texture.cpp @@ -120,6 +120,7 @@ HRESULT CTexture::Load_SRV(const _char* szPath, ID3D11ShaderResourceView** ppSRV hr = CreateWICTextureFromFile(m_pDevice, CMyTools::ToWstring(szTextureFilePath).c_str(), nullptr, ppSRV); } } + return hr; } @@ -142,7 +143,6 @@ HRESULT CTexture::ParseTextureIncrementalToSRVs(_uint iNumTextures, const _tchar if (FAILED(hr)) { return E_FAIL; } - m_SRVs.push_back(pSRV); } return S_OK; diff --git a/Jusin154_Team3D/Engine/Public/Animation.h b/Jusin154_Team3D/Engine/Public/Animation.h index 3140d3dd6..d96ba3570 100644 --- a/Jusin154_Team3D/Engine/Public/Animation.h +++ b/Jusin154_Team3D/Engine/Public/Animation.h @@ -26,8 +26,9 @@ class ENGINE_DLL CAnimation : public CBase const _string& Get_Name() const { return m_strName; } const _char* Get_SZName() const { return m_szName; } - void Set_CurrentTrackPosition(_float TrackPosition) { m_fCurrentTrackPosition =TrackPosition; } + void Set_CurrentTrackPosition(_float TrackPosition) { m_fCurrentTrackPosition = TrackPosition; } _float Get_CurrentTrackPosition() { return m_fCurrentTrackPosition; } + _float Get_CurrentTrackProgressRatio() { return m_fCurrentTrackPosition / m_fDuration; } void Set_AnimSpeed(_float fSpeed) { m_fAnimSpeed = fSpeed; } _float Get_AnimSpeed() { return m_fAnimSpeed; } @@ -42,12 +43,10 @@ class ENGINE_DLL CAnimation : public CBase private: HRESULT Initialize(const vector& Bones, const aiAnimation* pAIAnimation); public: - HRESULT SaveAsBinary(HANDLE hFile, DWORD& dwByte); static CAnimation* Create(const vector& Bones, const aiAnimation* pAnimation); #endif // EDITOR_PROJECT private: - HRESULT Initialize(HANDLE hFile, DWORD& dwByte); // 바이너리 HRESULT Initialize(const vector& Bones, const class CModel* pModel,SaveAnimation* pSaveAnimation); // @@ -90,7 +89,6 @@ class ENGINE_DLL CAnimation : public CBase ID3D11ShaderResourceView* m_pKeyFrameSrv = {}; ID3D11ShaderResourceView* m_pChannelSrv = {}; public: - static CAnimation* Create(HANDLE hFile, DWORD& dwByte); // 바이너리 static CAnimation* Create(const vector& Bones, const class CModel* pModel, SaveAnimation* pSaveAnimation); // diff --git a/Jusin154_Team3D/Engine/Public/Channel.h b/Jusin154_Team3D/Engine/Public/Channel.h index 759f3718c..02626af9f 100644 --- a/Jusin154_Team3D/Engine/Public/Channel.h +++ b/Jusin154_Team3D/Engine/Public/Channel.h @@ -15,7 +15,6 @@ class ENGINE_DLL CChannel : public CBase HRESULT Initialize(const vector& Bones, const aiNodeAnim* pAIChannel); public: - HRESULT SaveAsBinary(HANDLE hFile, DWORD& dwByte); static CChannel* Create(const vector& Bones, const aiNodeAnim* pAIChannel); void Fill_GPU_Keyframes(vector& outKeyframes); CHANNEL_DESC Fill_GPU_ChannelDesc(); @@ -29,7 +28,6 @@ class ENGINE_DLL CChannel : public CBase m_vPrevRootPos = { 0.f, 0.f, 0.f }; m_vPrevRootRot = { 0.f,0.f,0.f,0.f }; m_bInitialRootRotSaved = false; - m_bInitialRootPos = false; } _matrix Get_BoneTransformationMatrix() { return m_BoneTransformationMatrix; } @@ -55,15 +53,11 @@ class ENGINE_DLL CChannel : public CBase _float3 m_vPrevRootPos = { 0.f, 0.f, 0.f }; _float4 m_vPrevRootRot = { 0.f, 0.f, 0.f,0.f }; _matrix m_BoneTransformationMatrix = {}; - _float m_fPrevYaw = 0.f; - _bool m_bInitialRootRotSaved = {false}; - _bool m_bInitialRootPos = { false }; - _float4 m_vInitialRootRot = {}; + _bool m_bInitialRootRotSaved = {false}; + _float4 m_vInitialRootRot = {}; - vector m_KeyFrameDesc; + vector m_KeyFrameDesc; public: - static CChannel* Create(const vector& Bones, _uint iIndex); // 럴프전용 - static CChannel* Create(HANDLE hFile, DWORD& dwByte); // 바이너리 static CChannel* Create(const class CModel* pModel, SaveChannel* pSaveChannel); // diff --git a/Jusin154_Team3D/Engine/Public/FSM.h b/Jusin154_Team3D/Engine/Public/FSM.h index f3efbf945..a233d1cbc 100644 --- a/Jusin154_Team3D/Engine/Public/FSM.h +++ b/Jusin154_Team3D/Engine/Public/FSM.h @@ -12,7 +12,12 @@ enum ESTATE : _u64Flag JUMP = 1ULL << 5, LAND = 1ULL << 6, DODGE = 1ULL << 7, - COMBAT, LIGHT_ATTACK, CAST, SKILL,SKILL2, + COMBAT = 1ULL << 8, + LIGHT_ATTACK = 1ULL << 9, + CAST = 1ULL << 10, + SKILL = 1ULL << 11, + SKILL2 = 1ULL << 12, + MAPHELP = 1ULL << 13, END }; NS_END diff --git a/Jusin154_Team3D/Engine/Public/Mesh.h b/Jusin154_Team3D/Engine/Public/Mesh.h index 5fadd3e78..a1c0a5b89 100644 --- a/Jusin154_Team3D/Engine/Public/Mesh.h +++ b/Jusin154_Team3D/Engine/Public/Mesh.h @@ -20,6 +20,7 @@ class ENGINE_DLL CMesh final : public CVIBuffer HRESULT Bind_BoneMatrices(const vector& Bones, class CShader* pShader, const _char* pConstantName); HRESULT Bind_BoneMatrices(_float4x4* pCombinedMatrices, class CShader* pShader, const _char* pConstantName); HRESULT Render_Indexed(_uint IndexCount, _uint StartIndexLocation, _uint BaseVertexLocation); + #ifdef EDITOR_PROJECT private: virtual HRESULT Initialize_Prototype(MODEL eType, vector& Bones, const aiMesh* pAIMesh, _fmatrix& PreTransformMatrix); @@ -27,7 +28,6 @@ class ENGINE_DLL CMesh final : public CVIBuffer HRESULT Ready_VertexBuffer_For_Anim(vector& Bones, const aiMesh* pAIMesh); public: static CMesh* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, vector& Bones, const aiMesh* pAIMesh, _fmatrix& PreTransformMatrix); - HRESULT SaveAsBinary(HANDLE hFile, DWORD& dwByte); PSX::PxTriangleMesh* ConvertToPxMesh(const PSX::PxCookingParams* pParam, PSX::PxPhysics* pPhysX, _matrix WorldMatrix); #endif // EDITOR_PROJECT @@ -38,10 +38,7 @@ class ENGINE_DLL CMesh final : public CVIBuffer _uint Get_Vertex() { return m_iNumVertices; } private: - virtual HRESULT Initialize_Prototype(HANDLE hFile, DWORD& dwByte); virtual HRESULT Initialize(void* pArg) override; - HRESULT Ready_VertexBuffer_For_NonAnim(HANDLE hFile, DWORD& dwByte); - HRESULT Ready_VertexBuffer_For_Anim(HANDLE hFile, DWORD& dwByte); // 바이너리 virtual HRESULT Initialize_Prototype(MODEL eType, const class CModel* pModel, SaveMesh* _SaveMesh, _fmatrix PreTransformMatrix); HRESULT Ready_VertexBuffer_For_NonAnim(SaveMesh* _SaveMesh, _fmatrix PreTransformMatrix); @@ -59,6 +56,7 @@ class ENGINE_DLL CMesh final : public CVIBuffer vector<_int> m_BoneIndices; _float4x4* m_pBoneMatrices = { nullptr }; vector<_float4x4> m_offsetMatrices; + // 바이너리 std::vector<_uint> m_Indices; std::vector<_float3> m_Vertices; @@ -70,7 +68,6 @@ class ENGINE_DLL CMesh final : public CVIBuffer _int m_iRootBoneIndex = { -1 }; public: - static CMesh* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, HANDLE hFile, DWORD& dwByte); // 바이너리 static CMesh* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, const class CModel* pModel, SaveMesh* _SaveMesh, _fmatrix PreTransformMatrix); // diff --git a/Jusin154_Team3D/Engine/Public/Model.h b/Jusin154_Team3D/Engine/Public/Model.h index 4f070c18e..11b773bc0 100644 --- a/Jusin154_Team3D/Engine/Public/Model.h +++ b/Jusin154_Team3D/Engine/Public/Model.h @@ -24,7 +24,6 @@ class ENGINE_DLL CModel final : public CComponent public: #pragma region Model - MODEL Get_Type() const { return m_eType; } _float Get_Radius() const { return m_fRadius; } _float3& Get_RadiusOffset() { return m_vRadiusOffset; } _float4x4* Get_PreTransformMatrixPtr() { return &m_PreTransformMatrix; } @@ -33,24 +32,15 @@ class ENGINE_DLL CModel final : public CComponent virtual HRESULT Render_Indexed(_uint iMeshIndex, _uint IndexCount, _uint StartIndexLocation, _uint BaseVertexLocation); #pragma endregion #pragma region Animation - void Change_AnimationIndex(_int iAnimationIndex, _bool bIsLoop, _float fLerpDuration, _bool bIgnoreCurrentIndex = false); // 애니메이션을 다른 인덱스로 변경함 _bool Play_Animation(_float fTimeDelta, class CTransform* pTransform = nullptr); // 애니메이션에 델타타임을 넣어줌 - void RefreshAnim(); // 애님을 현재 애님의 초기상태로 되돌림 void Set_AnimationIndex(_uint iIndex, _bool isLoop = true); - void Stop_Animation(); // 애니메이션을 정지 (초기상태로) - void Set_Anim(CModel* Source); _bool IsFinishedAnim() const { return m_bIsFinishedAnim; } - _bool IsFinishedLerp() const { return m_bIsFinishedLerp; } - _float Get_AnimProgressRatio(); - _int Get_AnimProgressPostion(const _char* pAnimChannelName); - _float Get_AnimEstimatedDuration(); - void Set_AnimProgressPostion(const _char* pChannelName, _uint iPosition); - void Set_AnimPauseState(_bool bValue);// 애님을 현재상태로 정지 - void ReallocateResources(class CTransform* pTransform = nullptr); // 애님 이동의 대상 트랜스폼(이동시켜야할 트랜스폼)을 재지정함 - void Set_CurrentTrackPosition(_float TrackPosition); + void Set_CurrentTrackPosition(_float TrackPosition); const _char* Get_AnimList(_uint iIndex); - size_t Get_AnimSize() { return m_Animations.size(); } _float Get_CurrentTrackPosition(); + _float Get_CurrentTrackProgressRatio(); + + size_t Get_AnimSize() { return m_Animations.size(); } void Set_PlayAnim(_bool bPlayAnim) { m_bPlayAnim = bPlayAnim; } _bool Get_PlayAnim() const { return m_bPlayAnim; } _int Get_AnimIndex() const { return m_iCurrentAnimIndex; } @@ -63,11 +53,7 @@ class ENGINE_DLL CModel final : public CComponent #pragma endregion #pragma region Bone HRESULT Bind_BoneMatrices(_uint iMeshIndex, class CShader* pShader, const _char* pConstantName); - void Get_BoneMatrices(_float4x4* pOut); - _uint Get_BonesNum() const { return (_uint)m_Bones.size(); } const _float4x4* Get_BoneMatrixPtr(const _char* pBoneName) const; - _int Get_RootBoneIndex() const { return m_iRootBoneIndex; } - void Set_RootBoneIndex(_int iIndex) { m_iRootBoneIndex = iIndex; } static _int Get_BoneIndex(const _char* pBoneName, vector Bones); // 본의 벡터와 이름을 넘겨주면 인덱스를 넘겨줌 ( n 순회 ) _int Get_BoneIndex(const _char* pBoneName) const; _matrix Get_BoneMatrix(_uint iBoneIndex); @@ -78,11 +64,7 @@ static _int Get_BoneIndex(const _char* pBoneName, vector Bones); / #pragma endregion - void Create_Con(); - void UpdateAnimationCS(); - void ComputeAnimation(); - HRESULT Create_ParentVB(); - void Get_BoneMatrix(); + void ComputeAnimation(); public: #ifdef EDITOR_PROJECT @@ -151,26 +133,31 @@ static _int Get_BoneIndex(const _char* pBoneName, vector Bones); / vector<_float4x4> m_BoneMatrix; + +#pragma region Compute + private: - HRESULT Create_CS(); + HRESULT Create_ParentVB(); + HRESULT Create_CS(); + void Create_Temp(); + void Create_LocalPosVB(); + void Create_Con(); + void UpdateAnimationCS(); + _uint m_iNumBuffer = {}; - void Create_Temp(); + vector m_Parent = {}; + vector m_AnimRanges; - void Create_LocalPosVB(); + LOCALPOS_DESC* m_pLocalPos = { nullptr }; - _uint m_iNumBuffer = {}; + class CComputeShader* m_pComputeShader = nullptr; - vector m_Parent = {}; - vector m_AnimRanges; + ID3D11Buffer* m_pConstantBuffer = { nullptr }; - LOCALPOS_DESC* m_pLocalPos = { nullptr }; + ID3D11Buffer* m_pParentBuffer = { nullptr }; + ID3D11Buffer* m_pLocalPosBuffer = { nullptr }; +#pragma endregion - class CComputeShader* m_pComputeShader = nullptr; - - ID3D11Buffer* m_pConstantBuffer = { nullptr }; - - ID3D11Buffer* m_pParentBuffer = { nullptr }; - ID3D11Buffer* m_pLocalPosBuffer = { nullptr }; private: // 바이너리 virtual HRESULT Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix); diff --git a/Jusin154_Team3D/Engine/Public/State.h b/Jusin154_Team3D/Engine/Public/State.h index ebb95553b..246971a8d 100644 --- a/Jusin154_Team3D/Engine/Public/State.h +++ b/Jusin154_Team3D/Engine/Public/State.h @@ -13,6 +13,7 @@ enum ESTATE LAND, DODGE, COMBAT, LIGHT_ATTACK, CAST, SKILL, SKILL2, + MAPHELP, END }; NS_END