diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj b/Jusin154_Team3D/Client/Default/Client.vcxproj index 2db7a4a38..4f6f90c61 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj @@ -42,7 +42,7 @@ Application true - v145 + v143 Unicode true diff --git a/Jusin154_Team3D/Editor/Bin/Resources/SaveFile/Box b/Jusin154_Team3D/Editor/Bin/Resources/Models/Box/Box similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/SaveFile/Box rename to Jusin154_Team3D/Editor/Bin/Resources/Models/Box/Box diff --git a/Jusin154_Team3D/Editor/Bin/Resources/SaveFile/GoblinBody b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/GoblinBody similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/SaveFile/GoblinBody rename to Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/GoblinBody diff --git a/Jusin154_Team3D/Editor/Bin/Resources/SaveFile/GoblinHead b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/GoblinHead similarity index 63% rename from Jusin154_Team3D/Editor/Bin/Resources/SaveFile/GoblinHead rename to Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/GoblinHead index 53267f9a0..70cdd40d1 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/SaveFile/GoblinHead and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/GoblinHead differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/GoblinHead.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/GoblinHead.fbx index 68c14b84f..f3701907d 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/GoblinHead.fbx +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/GoblinHead.fbx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b28b1bd940c28a2f562c18e52de5ef01914d588ab221194374105513fa90f62c -size 1054604 +oid sha256:f07bf5432d1e2481ee5219779cfce430c9537c37d1e8efa3a54ab32fdb461e92 +size 2300860 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOB_Mage_Head_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOB_Mage_Head_D.png new file mode 100644 index 000000000..72d3d63fc Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Goblin/T_GOB_Mage_Head_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body new file mode 100644 index 000000000..594d7b2a7 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body.fbx new file mode 100644 index 000000000..a9b67e9ba --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7586f3029f295dbcb4d0306a07464420af0efc524cf09568464b07d67340a95c +size 3076716 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/T_Vendor_DADA_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/T_Vendor_DADA_D.png new file mode 100644 index 000000000..bd1d863a5 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/T_Vendor_DADA_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/T_Vendor_DADA_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/T_Vendor_DADA_N.png new file mode 100644 index 000000000..88d3686f0 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/T_Vendor_DADA_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Hair/Hair b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Hair/Hair new file mode 100644 index 000000000..7305034ef Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Hair/Hair differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Hair/Hair.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Hair/Hair.fbx new file mode 100644 index 000000000..b30f6ac18 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Hair/Hair.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a6bed60c6be5555ed08388845e833b539eb5ca8095be2e7096aad754450f0320 +size 3383676 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Head b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Head new file mode 100644 index 000000000..92616bccf Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Head differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Head.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Head.fbx new file mode 100644 index 000000000..d0d7958de --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Head.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e8c2af954e432ef10626e687fc032c826b4042f6ba058e485347273087509b76 +size 2730924 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/T_NPC_Young_M_Head_Ivory_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/T_NPC_Young_M_Head_Ivory_D.png new file mode 100644 index 000000000..c4b770cdd Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/T_NPC_Young_M_Head_Ivory_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/SaveFile/Steve b/Jusin154_Team3D/Editor/Bin/Resources/Models/Steve/Steve similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/SaveFile/Steve rename to Jusin154_Team3D/Editor/Bin/Resources/Models/Steve/Steve diff --git a/Jusin154_Team3D/Editor/Bin/Resources/SaveFile/TombProtector b/Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/TombProtector similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/SaveFile/TombProtector rename to Jusin154_Team3D/Editor/Bin/Resources/Models/TombProtector/TombProtector diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Body_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Body_D.png new file mode 100644 index 000000000..b63e5e4a5 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Body_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Leather_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Leather_D.png new file mode 100644 index 000000000..9d495b121 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Leather_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Leather_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Leather_N.png new file mode 100644 index 000000000..3533f9808 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Leather_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Metal_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Metal_D.png new file mode 100644 index 000000000..bbbb5572a Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Metal_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Metal_E.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Metal_E.png new file mode 100644 index 000000000..b23efd89f Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Metal_E.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Metal_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Metal_N.png new file mode 100644 index 000000000..3c8bca8ba Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_ArmoredTroll_Metal_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_Mountain01_Eye_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_Mountain01_Eye_D.png new file mode 100644 index 000000000..df0e9262f Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_Mountain01_Eye_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_Mountain01_Head_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_Mountain01_Head_D.png new file mode 100644 index 000000000..0276f34ab Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_Mountain01_Head_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_Mountain01_Head_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_Mountain01_Head_N.png new file mode 100644 index 000000000..f4280c6f9 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_Mountain01_Head_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_Mountain01_Skirt_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_Mountain01_Skirt_D.png new file mode 100644 index 000000000..04895a31f Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_Mountain01_Skirt_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_Mountain01_Skirt_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_Mountain01_Skirt_N.png new file mode 100644 index 000000000..e3d44cbb1 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_Mountain01_Skirt_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_Teeth_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_Teeth_D.png new file mode 100644 index 000000000..5db401caf Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_Teeth_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_Teeth_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_Teeth_N.png new file mode 100644 index 000000000..7c0338fd8 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/T_Troll_Teeth_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/Troll b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/Troll new file mode 100644 index 000000000..181da1740 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/Troll differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/Troll.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/Troll.fbx new file mode 100644 index 000000000..94e082474 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Troll/Troll.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b44b64d49d58489c7ac80620cbd2bf5c5827343301d5303bdaa6314b4040634 +size 136314364 diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index 7baf0829a..b923d21e3 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -42,7 +42,7 @@ Application true - v145 + v143 Unicode true @@ -168,6 +168,7 @@ + @@ -185,7 +186,11 @@ + + + + @@ -207,6 +212,7 @@ + @@ -225,11 +231,15 @@ + Create Create + + + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index c4980c372..dd9fc527c 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -145,6 +145,18 @@ {943a760b-2861-45b7-87b8-462e1309c172} + + {a9a39942-3c35-4932-b845-e8d1787f3ec3} + + + {a2944f33-1db0-480a-b793-7ec7f81e8116} + + + {6ccfe379-cf97-47af-98ae-b5155d1a0b39} + + + {f405a7a7-3eca-4a05-9098-aedc576bd360} + @@ -210,11 +222,26 @@ 02.GameObjects\ModelParts\Body + + 02.GameObjects\ModelParts\Head + + + 02.GameObjects\ModelParts\Hair + 02.GameObjects\ModelParts - - 02.GameObjects\ModelParts\Head + + 02.GameObjects\ModelParts\RootModelPart + + + 02.GameObjects\Monster + + + 02.GameObjects\Monster\TombProtector + + + 02.GameObjects\Monster\Troll 01.Level\40.EffectViewer @@ -325,9 +352,6 @@ 02.GameObjects\ModelParts\Body - - 02.GameObjects\ModelParts - 02.GameObjects\ModelParts\Head @@ -388,6 +412,24 @@ 01.Level\60.PhysXLab + + 02.GameObjects\ModelParts\Hair + + + 02.GameObjects\ModelParts + + + 02.GameObjects\ModelParts\RootModelPart + + + 02.GameObjects\Monster + + + 02.GameObjects\Monster\TombProtector + + + 02.GameObjects\Monster\Troll + diff --git a/Jusin154_Team3D/Editor/Private/Body.cpp b/Jusin154_Team3D/Editor/Private/Body.cpp index eec5892e6..22ca9e94e 100644 --- a/Jusin154_Team3D/Editor/Private/Body.cpp +++ b/Jusin154_Team3D/Editor/Private/Body.cpp @@ -2,6 +2,7 @@ #include "Body.h" #include "GameInstance.h" +#include "RootModelPart.h" CBody::CBody(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CModelParts(pDevice, pContext) @@ -27,8 +28,9 @@ HRESULT CBody::Initialize(void* pArg) if (FAILED(Ready_Components())) return E_FAIL; - m_pModelCom->Set_AnimationIndex(0); + dynamic_cast(m_pOwner)->Push_ModelParts(this); + dynamic_cast(m_pOwner)->Push_MainModel(m_pModelCom); return S_OK; } @@ -39,7 +41,7 @@ void CBody::Priority_Update(_float fTimeDelta) void CBody::Update(_float fTimeDelta) { - m_pModelCom->Play_Animation(fTimeDelta); + //m_pModelCom->Play_Animation(fTimeDelta); } void CBody::Late_Update(_float fTimeDelta) @@ -85,7 +87,7 @@ HRESULT CBody::Render() HRESULT CBody::Ready_Components() { /* Com_Model */ - if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Steve_Model"), + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_HumanBody_Model"), reinterpret_cast(&m_pModelCom)))) return E_FAIL; @@ -110,7 +112,7 @@ CBody* CBody::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) CGameObject* CBody::Clone(void* pArg, CGameObject* pOwner) { CBody* pInstance = new CBody(*this); - + pInstance->m_pOwner = pOwner; if (FAILED(pInstance->Initialize(pArg))) { MSG_BOX("Failed to Cloned : CBody"); @@ -124,6 +126,7 @@ void CBody::Free() { __super::Free(); + } void CBody::Describe_Entity() diff --git a/Jusin154_Team3D/Editor/Private/Dummy_Goblin.cpp b/Jusin154_Team3D/Editor/Private/Dummy_Goblin.cpp index 6e362e40d..4ddcb8891 100644 --- a/Jusin154_Team3D/Editor/Private/Dummy_Goblin.cpp +++ b/Jusin154_Team3D/Editor/Private/Dummy_Goblin.cpp @@ -84,8 +84,6 @@ HRESULT CDummy_Goblin::Render() HRESULT CDummy_Goblin::Ready_Components() { - __super::Ready_Components(nullptr); - /* Com_Model */ if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_GoblinBody_Model"), reinterpret_cast(&m_pModelCom)))) diff --git a/Jusin154_Team3D/Editor/Private/Dummy_Goblin_Head.cpp b/Jusin154_Team3D/Editor/Private/Dummy_Goblin_Head.cpp index dc4ce5fcc..298f60e1a 100644 --- a/Jusin154_Team3D/Editor/Private/Dummy_Goblin_Head.cpp +++ b/Jusin154_Team3D/Editor/Private/Dummy_Goblin_Head.cpp @@ -83,8 +83,6 @@ HRESULT CDummy_Goblin_Head::Render() HRESULT CDummy_Goblin_Head::Ready_Components() { - __super::Ready_Components(nullptr); - /* Com_Model */ if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_GoblinHead_Model"), reinterpret_cast(&m_pModelCom)))) diff --git a/Jusin154_Team3D/Editor/Private/Hair.cpp b/Jusin154_Team3D/Editor/Private/Hair.cpp new file mode 100644 index 000000000..c3a413db1 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Hair.cpp @@ -0,0 +1,131 @@ +#include "pch.h" +#include "Hair.h" + +#include "GameInstance.h" +#include "RootModelPart.h" + +CHair::CHair(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CModelParts(pDevice, pContext) +{ +} + +CHair::CHair(const CHair& Prototype) + : CModelParts(Prototype) +{ +} + +HRESULT CHair::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CHair::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components())) + return E_FAIL; + + dynamic_cast(m_pOwner)->Push_ModelParts(this); + + return S_OK; +} + +void CHair::Priority_Update(_float fTimeDelta) +{ + +} + +void CHair::Update(_float fTimeDelta) +{ + //m_pModelCom->Play_Animation(fTimeDelta); +} + +void CHair::Late_Update(_float fTimeDelta) +{ + _float4 vPos; + XMStoreFloat4(&vPos, Get_WorldPostion()); + m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this, vPos, 20.f); +} + +HRESULT CHair::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + + _uint iNumMeshes = m_pModelCom->Get_NumMeshes(); + + for (_uint i = 0; i < iNumMeshes; i++) + { + if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) { + return E_FAIL; + } + if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_NormalTexture", aiTextureType_NORMALS, 0))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Render(i))) { + return E_FAIL; + } + } + + return S_OK; +} + +HRESULT CHair::Ready_Components() +{ + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_HumanHair_Model"), + reinterpret_cast(&m_pModelCom)))) + return E_FAIL; + + /*m_pModelCom->Change_AnimationIndex(0, true, 0.4f, true);*/ + + return S_OK; +} + +CHair* CHair::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CHair* pInstance = new CHair(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CHair"); + Safe_Release(pInstance); + } + + return pInstance; +} + +CGameObject* CHair::Clone(void* pArg, CGameObject* pOwner) +{ + CHair* pInstance = new CHair(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CHair"); + Safe_Release(pInstance); + } + + return pInstance; +} + +void CHair::Free() +{ + __super::Free(); + +} + +void CHair::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Head.cpp b/Jusin154_Team3D/Editor/Private/Head.cpp index ac6ff763e..1f0a0fc5c 100644 --- a/Jusin154_Team3D/Editor/Private/Head.cpp +++ b/Jusin154_Team3D/Editor/Private/Head.cpp @@ -2,6 +2,7 @@ #include "Head.h" #include "GameInstance.h" +#include "RootModelPart.h" CHead::CHead(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CModelParts(pDevice, pContext) @@ -27,7 +28,7 @@ HRESULT CHead::Initialize(void* pArg) if (FAILED(Ready_Components())) return E_FAIL; - m_pModelCom->Set_AnimationIndex(0); + dynamic_cast(m_pOwner)->Push_ModelParts(this); return S_OK; } @@ -39,7 +40,7 @@ void CHead::Priority_Update(_float fTimeDelta) void CHead::Update(_float fTimeDelta) { - m_pModelCom->Play_Animation(fTimeDelta); + //m_pModelCom->Play_Animation(fTimeDelta); } void CHead::Late_Update(_float fTimeDelta) @@ -85,7 +86,7 @@ HRESULT CHead::Render() HRESULT CHead::Ready_Components() { /* Com_Model */ - if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_GoblinBody_Model"), + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_HumanHead_Model"), reinterpret_cast(&m_pModelCom)))) return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp index f42720072..01b8d1c6f 100644 --- a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp @@ -2,11 +2,16 @@ #include "Level_ObjectViewer.h" #include "GameInstance.h" #include "Level_Loading.h" +#include "RootModelPart.h" #include "Body.h" #include "Head.h" +#include "Hair.h" #include "Dummy_Cube.h" #include "DebugCamera.h" +#include "TombProtector.h" +#include "Troll.h" #include "Layer.h" +#include "GameObject.h" CLevel_ObjectViewer::CLevel_ObjectViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } @@ -39,6 +44,10 @@ void CLevel_ObjectViewer::Update(_float fTimeDelta) Add_Object(); Show_ModelFilePath(); + + Show_AnimList(); + + Object_Setting(); } HRESULT CLevel_ObjectViewer::Render() @@ -54,60 +63,171 @@ void CLevel_ObjectViewer::Add_Object() if (GUI::BeginTabBar("ObjectTabs")) { - if (ImGui::BeginTabItem("Creatures")) - { - GUI::EndTabItem(); - } - if (ImGui::BeginTabItem("Human")) - { - if (GUI::CollapsingHeader("Body")) - { - if (GUI::Button("Add")) - { - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, TEXT("Layer_Body")))) - return; - CBody* pBody = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_Body"))->Get_Object(); - } - if (GUI::Button("Delete")) - { - m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_Body"))->Clear_Layer(); - } - } - if (GUI::CollapsingHeader("Head")) - { - if (GUI::Button("Add")) - { - CGameObject* pOwner = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_Body"))->Get_Object(); - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, TEXT("Layer_Head"), nullptr, pOwner))) - return; - } - } - if (GUI::CollapsingHeader("Hair")) - { - } - GUI::EndTabItem(); - } + Add_Creature(); - GUI::EndTabBar(); + Add_Human(); + + } + GUI::EndTabBar(); + GUI::End(); + +} - GUI::End(); +void CLevel_ObjectViewer::Add_Creature() +{ + if (ImGui::BeginTabItem("Creatures")) + { + if (GUI::Button("Add TombProtector")) + { + CGameObject* pTempObject = { nullptr }; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, TEXT("Layer_Monster"), nullptr, nullptr, &pTempObject))) + return; + m_Objects.push_back(pTempObject); + } + + if (GUI::Button("Add Troll")) + { + CGameObject* pTempObject = { nullptr }; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, TEXT("Layer_Monster"), nullptr, nullptr, &pTempObject))) + return; + m_Objects.push_back(pTempObject); + } + + GUI::EndTabItem(); + } +} + +void CLevel_ObjectViewer::Add_Human() +{ + if (ImGui::BeginTabItem("Human")) + { + if (GUI::CollapsingHeader("Body")) + { + if (GUI::Button("Add Body")) + { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, TEXT("Layer_Root"), nullptr, nullptr, &m_HumanRoot))) + return; + + CGameObject* pTempObject = { nullptr }; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, TEXT("Layer_Body"), nullptr, m_HumanRoot, &pTempObject))) + return; + m_Objects.push_back(pTempObject); + } + } + _bool bDisabled = (m_HumanRoot == nullptr); + if (bDisabled) ImGui::BeginDisabled(); + if (GUI::CollapsingHeader("Head")) + { + if (GUI::Button("Add Head")) + { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, TEXT("Layer_Head"), nullptr, m_HumanRoot))) + return; + } + } + if (GUI::CollapsingHeader("Hair")) + { + if (GUI::Button("Add Hair")) + { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, TEXT("Layer_Hair"), nullptr, m_HumanRoot))) + return; + } + } + if (bDisabled) ImGui::EndDisabled(); + GUI::EndTabItem(); } } void CLevel_ObjectViewer::Show_ModelFilePath() { - GUI::Begin("Model_List"); - for (_uint i = 0; i < m_pGameInstance->ModelFilePathCount(); i++) + /*GUI::Begin("Model_List"); + if(GUI::BeginTabBar("Model_List")) { - /*GUI::Text(m_pGameInstance->Load_BinaryModelFilePath(i));*/ - GUI::SameLine(); - - std::string label = "Binary##" + std::to_string(i); - if (GUI::Button(label.c_str())) + if (GUI::BeginTabItem("Assimp_Model")) { - m_pGameInstance->SaveAssimpModel(m_pGameInstance->Load_ModelFilePath(i)); + for (_uint i = 0; i < m_pGameInstance->ModelFilePathCount(); i++) + { + GUI::Text(m_pGameInstance->Load_ModelFilePath(i)); + GUI::SameLine(); + + std::string label = "Binary##" + std::to_string(i); + if (GUI::Button(label.c_str())) + { + m_pGameInstance->SaveAssimpModel(m_pGameInstance->Load_ModelFilePath(i)); + } + } + GUI::EndTabItem(); + } + + if (GUI::BeginTabItem("Binary_Model")) + { + for (_uint i = 0; i < m_pGameInstance->BinaryModelFilePathCount(); i++) + { + GUI::Text(m_pGameInstance->Load_BinaryModelFilePath(i)); + } + GUI::EndTabItem(); } } + GUI::EndTabBar(); + GUI::End();*/ +} + +void CLevel_ObjectViewer::Show_AnimList() +{ + GUI::Begin("Anim_List"); + if (!m_Objects.empty()) + { + if (!m_Objects[m_iObjectIndex]->isDead()) + { + CModel* pModel = m_Objects[m_iObjectIndex]->Get_Component(); + for (_uint i = 0; i < pModel->Get_AnimSize(); i++) + { + if (GUI::Button(pModel->Get_AnimList(i))) + { + pModel->Set_AnimationIndex(i); + } + } + } + } + GUI::End(); +} + +void CLevel_ObjectViewer::Show_ObjectList() +{ + for (size_t i = 0; i < m_Objects.size(); i++) + { + if (GUI::Selectable(typeid(*m_Objects[i]).name())) + { + m_iObjectIndex = (_int)i; + } + } +} + +void CLevel_ObjectViewer::Object_Setting() +{ + GUI::Begin("Object_Info"); + if (!m_Objects.empty()) + { + Show_ObjectList(); + CModel* pModel = m_Objects[m_iObjectIndex]->Get_Component(); + + _float AnimTrack = pModel->Get_CurrentTrackPosition(); + GUI::DragFloat("AnimTrack", &AnimTrack); + + _float AnimSpeed = pModel->Get_AnimSpeed(); + GUI::DragFloat("AnimSpeed", &AnimSpeed, 0.1f); + pModel->Set_AnimSpeed(AnimSpeed); + + _bool bPlayAnim = pModel->Get_PlayAnim(); + if (GUI::Checkbox("Play Anim", &bPlayAnim)) + { + pModel->Set_PlayAnim(bPlayAnim); + } + if (GUI::Button("Delete")) + { + + } + } + GUI::End(); } @@ -117,7 +237,7 @@ HRESULT CLevel_ObjectViewer::Ready_Layer_Camera(const _wstring& strLayerTag) CameraDesc.fFovy = XMConvertToRadians(60.0f); CameraDesc.fNear = 0.1f; CameraDesc.fFar = 500.f; - CameraDesc.vEye = _float3(0.f, 10.f, -10.f); + CameraDesc.vEye = _float3(0.f, 50.f, -10.f); CameraDesc.vAt = _float3(0.f, 0.f, 0.f); CameraDesc.fSpeedPerSec = 5.f; CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f); diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 131fe1a4d..1399a9346 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -18,13 +18,17 @@ #include "Mission_Key.h" #include "Mission_KeyHold.h" #include "Mouse_Cursor.h" +#include "RootModelPart.h" #include "Head.h" #include "Body.h" +#include "Hair.h" #include "Dummy_Goblin.h" #include "Dummy_Cube.h" #include "LodingWidget1.h" #include "MiniMap_TrimBorder.h" #include "Active_Icon.h" +#include "TombProtector.h" +#include "Troll.h" #pragma endregion @@ -461,44 +465,49 @@ HRESULT CLoader::Loading_For_ObjectViewer() m_strMessage = TEXT("Model Loading.."); - /*if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_GoblinBody_Model"), + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_GoblinBody_Model"), CModel::Create(m_pDevice, m_pContext, "../Bin/Resources/Models/Goblin/GoblinBody.fbx", MODEL::ANIM, XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity(), 0)))) + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_HumanBody_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Body/Body", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) + return E_FAIL; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_HumanHead_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Head/Head", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) + return E_FAIL; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_HumanHair_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/Hair", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) return E_FAIL; if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_GoblinHead_Model"), - CModel::Create(m_pDevice, m_pContext, "../Bin/Resources/Models/Goblin/GoblinHead.fbx", MODEL::ANIM, XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity(), 0)))) + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Goblin/GoblinHead", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) return E_FAIL; - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Desc_Box"), - CModel::Create(m_pDevice, m_pContext, "../Bin/Resources/Models/Box/Box.fbx", MODEL::NONANIM, XMMatrixIdentity(), 0)))) - return E_FAIL; - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Steve_Model"), - CModel::Create(m_pDevice, m_pContext, "../Bin/Resources/Models/Steve/Steve.fbx", MODEL::ANIM, XMMatrixIdentity(), 0)))) - return E_FAIL; - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_TombProtector_Model"), - CModel::Create(m_pDevice, m_pContext, "../Bin/Resources/Models/TombProtector/TombProtector.fbx", MODEL::ANIM,XMMatrixIdentity(), 0)))) - return E_FAIL;*/ - m_strMessage = TEXT("Shader Loading.."); if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_GoblinBody_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/SaveFile/GoblinBody", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Goblin/GoblinBody", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) return E_FAIL; - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Steve_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/SaveFile/Steve",XMMatrixScaling(0.01f,0.01f,0.01f)* XMMatrixIdentity())))) + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Steve/Steve",XMMatrixScaling(0.01f,0.01f,0.01f)* XMMatrixIdentity())))) return E_FAIL; - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_TombProtector_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/SaveFile/TombProtector", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/TombProtector/TombProtector", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) + return E_FAIL; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Troll_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Troll/Troll", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) return E_FAIL; m_strMessage = TEXT("Prototype Loading.."); + /* For.Prototype_GameObject_RootModelPart */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CRootModelPart::Create(m_pDevice, m_pContext)))) + return E_FAIL; + /* For.Prototype_GameObject_Body */ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CBody::Create(m_pDevice, m_pContext)))) return E_FAIL; @@ -507,6 +516,18 @@ HRESULT CLoader::Loading_For_ObjectViewer() if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CHead::Create(m_pDevice, m_pContext)))) return E_FAIL; + /* For.Prototype_GameObject_Hair */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CHair::Create(m_pDevice, m_pContext)))) + return E_FAIL; + + /* For.Prototype_GameObject_TombProtector */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CTombProtector::Create(m_pDevice, m_pContext)))) + return E_FAIL; + + /* For.Prototype_GameObject_Troll */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CTroll::Create(m_pDevice, m_pContext)))) + return E_FAIL; + /* For.Prototype_GameObject_Dummy_Cube */ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CDummy_Cube::Create(m_pDevice, m_pContext)))) return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Private/ModelParts.cpp b/Jusin154_Team3D/Editor/Private/ModelParts.cpp index cc08eb155..205ee8135 100644 --- a/Jusin154_Team3D/Editor/Private/ModelParts.cpp +++ b/Jusin154_Team3D/Editor/Private/ModelParts.cpp @@ -50,7 +50,6 @@ HRESULT CModelParts::Render() HRESULT CModelParts::Ready_Components() { __super::Ready_Components(nullptr); - /* Com_Shader */ if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_ANIMMESH, reinterpret_cast(&m_pShaderCom)))) diff --git a/Jusin154_Team3D/Editor/Private/Monster.cpp b/Jusin154_Team3D/Editor/Private/Monster.cpp new file mode 100644 index 000000000..5aadd39bf --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Monster.cpp @@ -0,0 +1,121 @@ +#include "pch.h" +#include "Monster.h" + +#include "GameInstance.h" +#include "DebugCamera.h" + +CMonster::CMonster(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CGameObject(pDevice, pContext) +{ +} + +CMonster::CMonster(const CMonster& Prototype) + : CGameObject(Prototype) +{ +} + +HRESULT CMonster::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CMonster::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + + if (FAILED(Ready_Components())) + return E_FAIL; + + return S_OK; +} + +void CMonster::Priority_Update(_float fTimeDelta) +{ + +} + +void CMonster::Update(_float fTimeDelta) +{ +} + +void CMonster::Late_Update(_float fTimeDelta) +{ +} + +HRESULT CMonster::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + + _uint iNumMeshes = m_pModelCom->Get_NumMeshes(); + + for (_uint i = 0; i < iNumMeshes; i++) + { + if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) { + return E_FAIL; + } + if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_NormalTexture", aiTextureType_NORMALS, 0))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Render(i))) { + return E_FAIL; + } + } + + return S_OK; +} + +HRESULT CMonster::Ready_Components() +{ + __super::Ready_Components(nullptr); + + /* Com_Shader */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_ANIMMESH, + reinterpret_cast(&m_pShaderCom)))) + return E_FAIL; + + return S_OK; +} + +HRESULT CMonster::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { + return E_FAIL; + } + return S_OK; +} + + +void CMonster::Free() +{ + __super::Free(); + + Safe_Release(m_pShaderCom); + Safe_Release(m_pModelCom); +} + +void CMonster::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/RootModelPart.cpp b/Jusin154_Team3D/Editor/Private/RootModelPart.cpp new file mode 100644 index 000000000..8c94ea2ea --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/RootModelPart.cpp @@ -0,0 +1,129 @@ +#include "pch.h" +#include "RootModelPart.h" + +#include "GameInstance.h" +#include "DebugCamera.h" +#include "ModelParts.h" + +CRootModelPart::CRootModelPart(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CGameObject(pDevice, pContext) +{ +} + +CRootModelPart::CRootModelPart(const CRootModelPart& Prototype) + : CGameObject(Prototype) +{ +} + +HRESULT CRootModelPart::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CRootModelPart::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + return S_OK; +} + +void CRootModelPart::Priority_Update(_float fTimeDelta) +{ +} + +void CRootModelPart::Update(_float fTimeDelta) +{ + if (!m_pMainModel) + return; + + Update_Anim(fTimeDelta); +} + +void CRootModelPart::Late_Update(_float fTimeDelta) +{ +} + +HRESULT CRootModelPart::Render() +{ + return S_OK; +} + +void CRootModelPart::Update_Anim(_float fTimeDelta) +{ + for (size_t i = 0; i < m_ModelParts.size(); i++) + { + m_ModelParts[i]->Get_Component()->Set_PlayAnim(m_pMainModel->Get_PlayAnim()); + m_ModelParts[i]->Get_Component()->Set_AnimationIndex(m_pMainModel->Get_AnimIndex()); + m_ModelParts[i]->Get_Component()->Play_Animation(fTimeDelta); + } +} + +void CRootModelPart::Push_ModelParts(CModelParts* ModelParts) +{ + m_ModelParts.push_back(ModelParts); + SAFE_ADDREF(ModelParts); + for (auto& ModelParts : m_ModelParts) + { + ModelParts->Get_Component()->Set_AnimationIndex(0); + ModelParts->Get_Component()->Reset_CurrentTrackPosition(); + } +} + +void CRootModelPart::Push_MainModel(CModel* MainModel) +{ + m_pMainModel = MainModel; + SAFE_ADDREF(MainModel); +} + +HRESULT CRootModelPart::Ready_Components() +{ + return S_OK; +} + +HRESULT CRootModelPart::Bind_ShaderResources() +{ + return S_OK; +} + +CRootModelPart* CRootModelPart::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CRootModelPart* pInstance = new CRootModelPart(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CRootModelPart"); + Safe_Release(pInstance); + } + + return pInstance; +} + +CGameObject* CRootModelPart::Clone(void* pArg, CGameObject* pOwner) +{ + CRootModelPart* pInstance = new CRootModelPart(*this); + + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CRootModelPart"); + Safe_Release(pInstance); + } + + return pInstance; +} + +void CRootModelPart::Free() +{ + __super::Free(); + + for (auto& ModelParts : m_ModelParts) + { + SAFE_RELEASE(ModelParts); + } + m_ModelParts.clear(); + SAFE_RELEASE(m_pMainModel); +} + +void CRootModelPart::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/TombProtector.cpp b/Jusin154_Team3D/Editor/Private/TombProtector.cpp new file mode 100644 index 000000000..5d6a12edb --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/TombProtector.cpp @@ -0,0 +1,124 @@ +#include "pch.h" +#include "TombProtector.h" + +#include "GameInstance.h" +#include "DebugCamera.h" + +CTombProtector::CTombProtector(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CMonster(pDevice, pContext) +{ +} + +CTombProtector::CTombProtector(const CTombProtector& Prototype) + : CMonster(Prototype) +{ +} + +HRESULT CTombProtector::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CTombProtector::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + + if (FAILED(Ready_Components())) + return E_FAIL; + + + m_pModelCom->Set_AnimationIndex(0); + + return S_OK; +} + +void CTombProtector::Priority_Update(_float fTimeDelta) +{ + +} + +void CTombProtector::Update(_float fTimeDelta) +{ + m_pModelCom->Play_Animation(fTimeDelta); +} + +void CTombProtector::Late_Update(_float fTimeDelta) +{ + _float4 vPos; + XMStoreFloat4(&vPos, Get_WorldPostion()); + m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this, vPos, 20.f); +} + +HRESULT CTombProtector::Render() +{ + __super::Render(); + + return S_OK; +} + +HRESULT CTombProtector::Ready_Components() +{ + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_TombProtector_Model"), + reinterpret_cast(&m_pModelCom)))) + return E_FAIL; + + return S_OK; +} + +HRESULT CTombProtector::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { + return E_FAIL; + } + return S_OK; +} + +CTombProtector* CTombProtector::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CTombProtector* pInstance = new CTombProtector(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CTombProtector"); + Safe_Release(pInstance); + } + + return pInstance; +} + +CGameObject* CTombProtector::Clone(void* pArg, CGameObject* pOwner) +{ + CTombProtector* pInstance = new CTombProtector(*this); + + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CTombProtector"); + Safe_Release(pInstance); + } + + return pInstance; +} + + + +void CTombProtector::Free() +{ + __super::Free(); +} + +void CTombProtector::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Troll.cpp b/Jusin154_Team3D/Editor/Private/Troll.cpp new file mode 100644 index 000000000..5aea2627a --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Troll.cpp @@ -0,0 +1,124 @@ +#include "pch.h" +#include "Troll.h" + +#include "GameInstance.h" +#include "DebugCamera.h" + +CTroll::CTroll(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CMonster(pDevice, pContext) +{ +} + +CTroll::CTroll(const CTroll& Prototype) + : CMonster(Prototype) +{ +} + +HRESULT CTroll::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CTroll::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + + if (FAILED(Ready_Components())) + return E_FAIL; + + + m_pModelCom->Set_AnimationIndex(0); + + return S_OK; +} + +void CTroll::Priority_Update(_float fTimeDelta) +{ + +} + +void CTroll::Update(_float fTimeDelta) +{ + m_pModelCom->Play_Animation(fTimeDelta); +} + +void CTroll::Late_Update(_float fTimeDelta) +{ + _float4 vPos; + XMStoreFloat4(&vPos, Get_WorldPostion()); + m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this, vPos, 20.f); +} + +HRESULT CTroll::Render() +{ + __super::Render(); + + return S_OK; +} + +HRESULT CTroll::Ready_Components() +{ + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Troll_Model"), + reinterpret_cast(&m_pModelCom)))) + return E_FAIL; + + return S_OK; +} + +HRESULT CTroll::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { + return E_FAIL; + } + return S_OK; +} + +CTroll* CTroll::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CTroll* pInstance = new CTroll(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CTroll"); + Safe_Release(pInstance); + } + + return pInstance; +} + +CGameObject* CTroll::Clone(void* pArg, CGameObject* pOwner) +{ + CTroll* pInstance = new CTroll(*this); + + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CTroll"); + Safe_Release(pInstance); + } + + return pInstance; +} + + + +void CTroll::Free() +{ + __super::Free(); +} + +void CTroll::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Public/Hair.h b/Jusin154_Team3D/Editor/Public/Hair.h new file mode 100644 index 000000000..49f564be5 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Hair.h @@ -0,0 +1,33 @@ +#pragma once + +#include "Editor_Define.h" +#include "ModelParts.h" + +NS_BEGIN(Editor) + +class CHair final : public CModelParts +{ +private: + CHair(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CHair(const CHair& Prototype); + virtual ~CHair() = default; + +public: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + +private: + HRESULT Ready_Components(); + +public: + static CHair* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override; + virtual void Free() override; + virtual void Describe_Entity() override; +}; + +NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Editor/Public/Level_ObjectViewer.h b/Jusin154_Team3D/Editor/Public/Level_ObjectViewer.h index 4ace089a8..7e66eef3a 100644 --- a/Jusin154_Team3D/Editor/Public/Level_ObjectViewer.h +++ b/Jusin154_Team3D/Editor/Public/Level_ObjectViewer.h @@ -3,6 +3,10 @@ #include "Editor_Define.h" #include "Level.h" +NS_BEGIN(Engine) +class CGameObject; +NS_END + NS_BEGIN(Editor) class CLevel_ObjectViewer final : public CLevel @@ -14,9 +18,6 @@ class CLevel_ObjectViewer final : public CLevel public: virtual void Update(_float fTimeDelta) override; virtual HRESULT Render() override; - void Add_Object(); - void Show_ModelFilePath(); - private: /* 이 레벨에서 쓰기위한 객체들을 생성한다. */ virtual HRESULT Initialize() override; @@ -25,6 +26,18 @@ class CLevel_ObjectViewer final : public CLevel HRESULT Ready_Layer_UI(const _wstring& strLayerTag); HRESULT Ready_Layer_Dummy(const _wstring& strLayerTag); + void Add_Object(); + void Add_Creature(); + void Add_Human(); + void Show_ModelFilePath(); + void Show_AnimList(); + void Show_ObjectList(); + void Object_Setting(); +private: + vector m_Objects; + CGameObject* m_HumanRoot = { nullptr }; + _int m_iObjectIndex = { 0 }; + public: static CLevel_ObjectViewer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID); diff --git a/Jusin154_Team3D/Editor/Public/Monster.h b/Jusin154_Team3D/Editor/Public/Monster.h new file mode 100644 index 000000000..b64363bba --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Monster.h @@ -0,0 +1,46 @@ +#pragma once + +#include "Editor_Define.h" +#include "GameObject.h" + +NS_BEGIN(Engine) +class CShader; +class CModel; +NS_END + +NS_BEGIN(Editor) + +class CMonster abstract : public CGameObject +{ +protected: + CMonster(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CMonster(const CMonster& Prototype); + virtual ~CMonster() = default; + +public: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + +protected: + CShader* m_pShaderCom = { nullptr }; + CModel* m_pModelCom = { nullptr }; + _bool m_bRimLight = { true }; + _float m_fRimLightPower = { 3.2f }; + _float m_fRimLightStrength = { 3.04f }; + _float3 m_vRimLightColor = { 69.f / 255.f, 5.f / 255.f, 10.f / 255.f }; + +private: + HRESULT Ready_Components(); + HRESULT Bind_ShaderResources(); + +public: + virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr)PURE; + virtual void Free() override; + virtual void Describe_Entity() override; +}; + +NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Editor/Public/RootModelPart.h b/Jusin154_Team3D/Editor/Public/RootModelPart.h new file mode 100644 index 000000000..889b75454 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/RootModelPart.h @@ -0,0 +1,46 @@ +#pragma once + +#include "Editor_Define.h" +#include "GameObject.h" +NS_BEGIN(Engine) +class CModel; +NS_END + +NS_BEGIN(Editor) + +class CRootModelPart final : public CGameObject +{ +private: + CRootModelPart(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CRootModelPart(const CRootModelPart& Prototype); + virtual ~CRootModelPart() = default; + +public: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + void Update_Anim(_float fTimeDelta); + void Push_ModelParts(class CModelParts* ModelParts); + void Push_MainModel(CModel* MainModel); + void Set_AnimIndex(_uint iIndex) { m_iAnimIndex = iIndex; } + +private: + CModel* m_pMainModel = { nullptr }; + vector m_ModelParts = {}; + _uint m_iAnimIndex = {0}; + +private: + HRESULT Ready_Components(); + HRESULT Bind_ShaderResources(); + +public: + static CRootModelPart* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override; + virtual void Free() override; + virtual void Describe_Entity() override; +}; + +NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Editor/Public/TombProtector.h b/Jusin154_Team3D/Editor/Public/TombProtector.h new file mode 100644 index 000000000..bf5402c29 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/TombProtector.h @@ -0,0 +1,34 @@ +#pragma once + +#include "Editor_Define.h" +#include "Monster.h" + +NS_BEGIN(Editor) + +class CTombProtector final : public CMonster +{ +private: + CTombProtector(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CTombProtector(const CTombProtector& Prototype); + virtual ~CTombProtector() = default; + +public: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + +private: + HRESULT Ready_Components(); + HRESULT Bind_ShaderResources(); + +public: + static CTombProtector* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override; + virtual void Free() override; + virtual void Describe_Entity() override; +}; + +NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Editor/Public/Troll.h b/Jusin154_Team3D/Editor/Public/Troll.h new file mode 100644 index 000000000..370a1ac52 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Troll.h @@ -0,0 +1,34 @@ +#pragma once + +#include "Editor_Define.h" +#include "Monster.h" + +NS_BEGIN(Editor) + +class CTroll final : public CMonster +{ +private: + CTroll(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CTroll(const CTroll& Prototype); + virtual ~CTroll() = default; + +public: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + +private: + HRESULT Ready_Components(); + HRESULT Bind_ShaderResources(); + +public: + static CTroll* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override; + virtual void Free() override; + virtual void Describe_Entity() override; +}; + +NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj b/Jusin154_Team3D/Engine/Default/Engine.vcxproj index 7414e74c5..004fde388 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj @@ -42,7 +42,7 @@ DynamicLibrary true - v145 + v143 Unicode true diff --git a/Jusin154_Team3D/Engine/Private/Animation.cpp b/Jusin154_Team3D/Engine/Private/Animation.cpp index ab202e239..92a8d482e 100644 --- a/Jusin154_Team3D/Engine/Private/Animation.cpp +++ b/Jusin154_Team3D/Engine/Private/Animation.cpp @@ -19,6 +19,7 @@ CAnimation::CAnimation(const CAnimation& rhs) , m_strName{ rhs.m_strName } , m_fTickPerSecond{ rhs.m_fTickPerSecond } , m_pSaveAnim{ rhs.m_pSaveAnim } + , m_fAnimSpeed{rhs.m_fAnimSpeed } { memcpy_s(m_TickPerSeconds, sizeof(_float) * 2, rhs.m_TickPerSeconds, sizeof(_float) * 2); @@ -31,7 +32,7 @@ CAnimation::CAnimation(const CAnimation& rhs) _bool CAnimation::Update_TransformationMatrices(const vector& Bones, _bool bIsLoop, _float fTimeDelta) { //m_fCurrentTrackPosition += m_TickPerSeconds[m_bPause] * fTimeDelta; - m_fCurrentTrackPosition += m_fTickPerSecond * fTimeDelta; + m_fCurrentTrackPosition += m_fTickPerSecond * fTimeDelta * m_fAnimSpeed; if (m_fCurrentTrackPosition >= m_fDuration) { m_fCurrentTrackPosition = 0.f; // 루프 if (false == bIsLoop) { @@ -100,6 +101,7 @@ vector<_int>* CAnimation::Capture_Bones() HRESULT CAnimation::Initialize(const vector& Bones, const aiAnimation* pAIAnimation) { m_strName = pAIAnimation->mName.data; + strcpy_s(m_szName, pAIAnimation->mName.data); size_t pos = m_strName.find_last_of('|'); if (0 > pos) { pos = 0; @@ -108,6 +110,7 @@ HRESULT CAnimation::Initialize(const vector& Bones, const aiAnimation* p pos++; } m_strName = m_strName.substr(pos); + m_fDuration = (_float)pAIAnimation->mDuration; m_TickPerSeconds[0] = (_float)pAIAnimation->mTicksPerSecond; m_iNumChannels = pAIAnimation->mNumChannels; diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index 36463ab4a..ad9b1f821 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -175,6 +175,11 @@ const _char* CGameInstance::Load_BinaryModelFilePath(_uint iIndex) return iter->first; } +size_t CGameInstance::BinaryModelFilePathCount() +{ + return m_sModelMap.size(); +} + size_t CGameInstance::ModelFilePathCount() { diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index 25e2097ae..6ca5896fa 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -142,6 +142,8 @@ HRESULT CModel::Bind_BoneMatrices(_uint iMeshIndex, CShader* pShader, const _cha _bool CModel::Play_Animation(_float fTimeDelta) { + if (!m_bPlayAnim) + return false; if (-1 == m_iCurrentAnimIndex // 정지 혹은 시작을 안시켜준 애님 || m_iCurrentAnimIndex >= (_int)m_iNumAnimations) // 애님 인덱스 초과됨 { @@ -276,6 +278,31 @@ void CModel::Get_BoneMatrices(_float4x4* pOut) } } +void CModel::Reset_CurrentTrackPosition() +{ + m_Animations[m_iCurrentAnimIndex]->Reset_CurrentTrackPosition(); +} + +const _char* CModel::Get_AnimList(_uint iIndex) +{ + return m_Animations[iIndex]->Get_SZName(); +} + +_float CModel::Get_CurrentTrackPosition() +{ + return m_Animations[m_iCurrentAnimIndex]->Get_CurrentTrackPosition(); +} + +_float CModel::Get_AnimSpeed() +{ + return m_Animations[m_iCurrentAnimIndex]->Get_AnimSpeed(); +} + +void CModel::Set_AnimSpeed(_float fSpeed) +{ + m_Animations[m_iCurrentAnimIndex]->Set_AnimSpeed(fSpeed); +} + HRESULT CModel::Render(_uint iMeshIndex) { m_Meshes[iMeshIndex]->Bind_Resources(); @@ -439,11 +466,11 @@ bool CModel::SaveAssimpModel(const _char* filename) if (!m_pAIScene) return false; _char szModel[MAX_PATH] = {}; - _char szName[MAX_PATH] = {}; - _splitpath_s(filename, nullptr, 0, nullptr, 0, szName, MAX_PATH, nullptr, 0); - strcat_s(szModel, sizeof(_char) * MAX_PATH, szName); + _char szExt[MAX_PATH] = {}; + _splitpath_s(filename, nullptr, 0, nullptr, 0, nullptr, 0, szExt, MAX_PATH); + strcat_s(szModel, sizeof(_char) * MAX_PATH, szExt); - _string savePath = string("../Bin/Resources/SaveFile/") + szModel; + _string savePath = filename; SaveModel modelData; modelData.MeshCount = m_pAIScene->mNumMeshes; @@ -690,8 +717,6 @@ bool CModel::SaveAssimpModel(const _char* filename) fclose(fp); - MSG_BOX("Save Succeed"); - return true; } _int CModel::SaveNodeRecursive(const aiNode* pAINode, std::vector& outNodes, _int parentIndex) @@ -802,7 +827,15 @@ HRESULT CModel::Initialize_Prototype() HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _fmatrix PreTransformMatrix) { - LoadData(pModelFilePath); + if (!LoadData(pModelFilePath)) + { + _char Temp[256]; + strcpy_s(Temp, pModelFilePath); + strcat_s(Temp,".fbx"); + Assimp_Model_Load(Temp, eType, PreTransformMatrix, 0); + SaveAssimpModel(pModelFilePath); + return S_OK; + } m_pSaveModel = m_pGameInstance->Load_SaveModel(pModelFilePath); m_eType = eType; @@ -932,46 +965,6 @@ bool CModel::LoadData(const _char* filename) } } - - /*_uint diffuseCount = 0; - fread(&diffuseCount, sizeof(_uint), 1, fp); - mat.DiffusePath.resize(diffuseCount); - for (_uint j = 0; j < diffuseCount; j++) - { - _uint len = 0; - fread(&len, sizeof(_uint), 1, fp); - std::string temp; - temp.resize(len); - fread(&temp[0], sizeof(char), len, fp); - mat.DiffusePath[j] = temp; - } - - _uint normalCount = 0; - fread(&normalCount, sizeof(_uint), 1, fp); - mat.NormalPath.resize(normalCount); - for (_uint j = 0; j < normalCount; j++) - { - _uint len = 0; - fread(&len, sizeof(_uint), 1, fp); - std::string temp; - temp.resize(len); - fread(&temp[0], sizeof(char), len, fp); - mat.NormalPath[j] = temp; - } - - _uint specularCount = 0; - fread(&specularCount, sizeof(_uint), 1, fp); - mat.SpecularPath.resize(specularCount); - for (_uint j = 0; j < specularCount; j++) - { - _uint len = 0; - fread(&len, sizeof(_uint), 1, fp); - std::string temp; - temp.resize(len); - fread(&temp[0], sizeof(char), len, fp); - mat.SpecularPath[j] = temp; - }*/ - NewModel.Materials.push_back(mat); } diff --git a/Jusin154_Team3D/Engine/Public/Animation.h b/Jusin154_Team3D/Engine/Public/Animation.h index 9b9fc2ca9..82122802b 100644 --- a/Jusin154_Team3D/Engine/Public/Animation.h +++ b/Jusin154_Team3D/Engine/Public/Animation.h @@ -22,6 +22,12 @@ class ENGINE_DLL CAnimation : public CBase vector Get_StartFrameInformations() { return m_StartKeyFrames; } const _string& Get_Name() const { return m_strName; } + const _char* Get_SZName() const { return m_szName; } + void Reset_CurrentTrackPosition() { m_fCurrentTrackPosition = 0.f; } + _float Get_CurrentTrackPosition() { return m_fCurrentTrackPosition; } + void Set_AnimSpeed(_float fSpeed) { m_fAnimSpeed = fSpeed; } + _float Get_AnimSpeed() { return m_fAnimSpeed; } + #ifdef EDITOR_PROJECT private: @@ -43,6 +49,7 @@ class ENGINE_DLL CAnimation : public CBase SaveAnimation* m_pSaveAnim = { nullptr }; _char m_szName[MAX_PATH] = {}; _float m_fTickPerSecond = {}; + _float m_fAnimSpeed = {1.f}; _bool m_bPause = { FALSE }; // 애님퍼즈 인덱스 _string m_strName = {}; // 애님 이름 diff --git a/Jusin154_Team3D/Engine/Public/GameInstance.h b/Jusin154_Team3D/Engine/Public/GameInstance.h index 7c4303e89..d5a70c422 100644 --- a/Jusin154_Team3D/Engine/Public/GameInstance.h +++ b/Jusin154_Team3D/Engine/Public/GameInstance.h @@ -203,6 +203,7 @@ class ENGINE_DLL CGameInstance final : public CBase void Save_ModelFilePath(const _char* FilePath); const _char* Load_ModelFilePath(_uint iIndex); const _char* Load_BinaryModelFilePath(_uint iIndex); + size_t BinaryModelFilePathCount(); size_t ModelFilePathCount(); private: diff --git a/Jusin154_Team3D/Engine/Public/Model.h b/Jusin154_Team3D/Engine/Public/Model.h index 01bd0f640..e45203a20 100644 --- a/Jusin154_Team3D/Engine/Public/Model.h +++ b/Jusin154_Team3D/Engine/Public/Model.h @@ -39,6 +39,16 @@ class ENGINE_DLL CModel final : public CComponent void Get_BoneMatrices(_float4x4* pOut); _uint Get_BonesNum() const { return (_uint)m_Bones.size(); } + void Reset_CurrentTrackPosition(); + const _char* Get_AnimList(_uint iIndex); + size_t Get_AnimSize() { return m_Animations.size(); } + _float Get_CurrentTrackPosition(); + void Set_PlayAnim(_bool bPlayAnim) { m_bPlayAnim = bPlayAnim; } + _bool Get_PlayAnim() { return m_bPlayAnim; } + _int Get_AnimIndex() { return m_iCurrentAnimIndex; } + _float Get_AnimSpeed(); + void Set_AnimSpeed(_float fSpeed); + public: HRESULT Bind_Material(_uint iMeshIndex, class CShader* pShader, const _char* pConstantName, _uint iType, _uint iTextureIndex); HRESULT Bind_BoneMatrices(_uint iMeshIndex, class CShader* pShader, const _char* pConstantName); @@ -84,6 +94,7 @@ class ENGINE_DLL CModel final : public CComponent _bool m_bIsLoop = { false }; // 루프애니메이션인지 _bool m_bIsFinishedAnim = { false }; // 대상 애니메이션이 끝났는지 _bool m_bIsFinishedLerp = { false }; // 럴프 애니메이션이 끝났는지 + _bool m_bPlayAnim = { true }; vector m_Animations; // 애니메이션의 벡터, class CLerpAnim* m_pLerpAnim = { nullptr }; // 럴프전용 애니메이션