diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body1/Body.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body1/Body.bin deleted file mode 100644 index 594d7b2a7..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body1/Body.bin and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body1/Body1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body1/Body1.bin deleted file mode 100644 index 69a5f211b..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body1/Body1.bin and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body1/Body1.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body1/Body1.fbx deleted file mode 100644 index a9b67e9ba..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body1/Body1.fbx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7586f3029f295dbcb4d0306a07464420af0efc524cf09568464b07d67340a95c -size 3076716 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DADA/DADA.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DADA/DADA.bin new file mode 100644 index 000000000..aa90fb3e8 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DADA/DADA.bin differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DADA/DADA.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DADA/DADA.fbx new file mode 100644 index 000000000..ae09e939b --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DADA/DADA.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45ee67110f7435227b45aaeb3afbcfb80fa8f9f2579b76781825371e563d0c5f +size 196167180 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body1/T_Vendor_DADA_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DADA/T_Vendor_DADA_D.png similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body1/T_Vendor_DADA_D.png rename to Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DADA/T_Vendor_DADA_D.png diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body1/T_Vendor_DADA_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DADA/T_Vendor_DADA_N.png similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body1/T_Vendor_DADA_N.png rename to Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DADA/T_Vendor_DADA_N.png diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardGrunt/DarkWizardGrunt.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardGrunt/DarkWizardGrunt.bin new file mode 100644 index 000000000..daffcd93c Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardGrunt/DarkWizardGrunt.bin differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardGrunt/DarkWizardGrunt.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardGrunt/DarkWizardGrunt.fbx new file mode 100644 index 000000000..baf5d2ed9 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardGrunt/DarkWizardGrunt.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d94cc1e19b4359316ddfccdcfbb20bc01dbc2f39d2a45f058d44d4144c39249 +size 215318412 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardGrunt/T_HUM_M_CMBH_DarkWizardGrunt_Ashwinder_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardGrunt/T_HUM_M_CMBH_DarkWizardGrunt_Ashwinder_D.png new file mode 100644 index 000000000..438de4cba Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardGrunt/T_HUM_M_CMBH_DarkWizardGrunt_Ashwinder_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardGrunt/T_HUM_M_CMBH_DarkWizardGrunt_Ashwinder_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardGrunt/T_HUM_M_CMBH_DarkWizardGrunt_Ashwinder_N.png new file mode 100644 index 000000000..dccef21ae Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardGrunt/T_HUM_M_CMBH_DarkWizardGrunt_Ashwinder_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardGrunt/T_Old_M_Arms_Ivory02_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardGrunt/T_Old_M_Arms_Ivory02_D.png new file mode 100644 index 000000000..7226b5070 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardGrunt/T_Old_M_Arms_Ivory02_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body2/Body2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardSoldier/Body2.bin similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body2/Body2.bin rename to Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardSoldier/Body2.bin diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardSoldier/DarkWizardSoldier.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardSoldier/DarkWizardSoldier.bin new file mode 100644 index 000000000..7bc591f78 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardSoldier/DarkWizardSoldier.bin differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body2/Body2.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardSoldier/DarkWizardSoldier.fbx similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body2/Body2.fbx rename to Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardSoldier/DarkWizardSoldier.fbx diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body2/T_DarkWizardSoldier_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardSoldier/T_DarkWizardSoldier_D.png similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body2/T_DarkWizardSoldier_D.png rename to Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardSoldier/T_DarkWizardSoldier_D.png diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body2/T_DarkWizardSoldier_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardSoldier/T_DarkWizardSoldier_N.png similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/Body2/T_DarkWizardSoldier_N.png rename to Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardSoldier/T_DarkWizardSoldier_N.png diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardTank/DarkWizardTank.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardTank/DarkWizardTank.bin new file mode 100644 index 000000000..9b05e8d47 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardTank/DarkWizardTank.bin differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardTank/DarkWizardTank.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardTank/DarkWizardTank.fbx new file mode 100644 index 000000000..aa53fb0da --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardTank/DarkWizardTank.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07bd86220c75f6bc5dda73ff5dc446a5a83eca7c88b90d8ace464f77e43e8525 +size 240995100 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardTank/T_DarkWizardTank_AshwinderA_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardTank/T_DarkWizardTank_AshwinderA_D.png new file mode 100644 index 000000000..6f7dc9c4e Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardTank/T_DarkWizardTank_AshwinderA_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardTank/T_DarkWizardTank_AshwinderA_Head_shdr_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardTank/T_DarkWizardTank_AshwinderA_Head_shdr_D.png new file mode 100644 index 000000000..25c0e0e52 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardTank/T_DarkWizardTank_AshwinderA_Head_shdr_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardTank/T_DarkWizardTank_AshwinderA_Head_shdr_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardTank/T_DarkWizardTank_AshwinderA_Head_shdr_N.png new file mode 100644 index 000000000..327b67142 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardTank/T_DarkWizardTank_AshwinderA_Head_shdr_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardTank/T_DarkWizardTank_AshwinderA_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardTank/T_DarkWizardTank_AshwinderA_N.png new file mode 100644 index 000000000..666d09bf3 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardTank/T_DarkWizardTank_AshwinderA_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardTank/T_DarkWizardTank_PoacherA_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardTank/T_DarkWizardTank_PoacherA_D.png new file mode 100644 index 000000000..f66dbfc82 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardTank/T_DarkWizardTank_PoacherA_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardTank/T_DarkWizardTank_PoacherA_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardTank/T_DarkWizardTank_PoacherA_N.png new file mode 100644 index 000000000..7cb041ff2 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Body/DarkWizardTank/T_DarkWizardTank_PoacherA_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Hair/Hair1/Hair.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Hair/Hair1/Hair.bin deleted file mode 100644 index 7305034ef..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Hair/Hair1/Hair.bin and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Hair/Hair1/Hair1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Hair/Hair1/Hair1.bin index 7305034ef..c43033802 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Hair/Hair1/Hair1.bin and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Hair/Hair1/Hair1.bin differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Hair/Hair1/Hair1.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Hair/Hair1/Hair1.fbx index b30f6ac18..5bc1fb30a 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Hair/Hair1/Hair1.fbx +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Hair/Hair1/Hair1.fbx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a6bed60c6be5555ed08388845e833b539eb5ca8095be2e7096aad754450f0320 -size 3383676 +oid sha256:3b007729006283ebeb04abc5a27f7f7be71b22a24c42d3d9a66953cbe7f918fc +size 196498620 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Hair/Hair1/T_GHO_M_Hair_GHOHair01_WigTall_THV_MSK.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Hair/Hair1/T_GHO_M_Hair_GHOHair01_WigTall_THV_MSK.png new file mode 100644 index 000000000..247a7b7b5 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Hair/Hair1/T_GHO_M_Hair_GHOHair01_WigTall_THV_MSK.png 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 deleted file mode 100644 index d0d7958de..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Head.fbx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e8c2af954e432ef10626e687fc032c826b4042f6ba058e485347273087509b76 -size 2730924 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Young_M_Head_Ivory.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Young_M_Head_Ivory.bin new file mode 100644 index 000000000..26ddb04ce Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Young_M_Head_Ivory.bin differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Young_M_Head_Ivory.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Young_M_Head_Ivory.fbx new file mode 100644 index 000000000..70eb923d7 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Head/Young_M_Head_Ivory.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e011347f4995566691487e16eacecf0d506c0c06eacccedaf0eae0f610ca51cc +size 193444396 diff --git a/Jusin154_Team3D/Editor/Private/Body.cpp b/Jusin154_Team3D/Editor/Private/Body.cpp index 5b6a5f972..c37a1b1ca 100644 --- a/Jusin154_Team3D/Editor/Private/Body.cpp +++ b/Jusin154_Team3D/Editor/Private/Body.cpp @@ -24,13 +24,9 @@ HRESULT CBody::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); - - dynamic_cast(m_pOwner)->Push_MainModel(m_pModelCom); return S_OK; } @@ -41,7 +37,7 @@ void CBody::Priority_Update(_float fTimeDelta) void CBody::Update(_float fTimeDelta) { - //m_pModelCom->Play_Animation(fTimeDelta); + __super::Update(fTimeDelta); } void CBody::Late_Update(_float fTimeDelta) @@ -53,45 +49,20 @@ void CBody::Late_Update(_float fTimeDelta) HRESULT CBody::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; - } - } + __super::Render(); return S_OK; } HRESULT CBody::Ready_Components() { - /* Com_Model */ - if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag, - reinterpret_cast(&m_pModelCom)))) - return E_FAIL; - - /*m_pModelCom->Change_AnimationIndex(0, true, 0.4f, true);*/ + if (m_strModelPrototypeTag != L"") + { + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag, + reinterpret_cast(&m_pModelCom)))) + return E_FAIL; + } return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/DummyObject.cpp b/Jusin154_Team3D/Editor/Private/DummyObject.cpp index 3c0ef3c18..8bdccf5e5 100644 --- a/Jusin154_Team3D/Editor/Private/DummyObject.cpp +++ b/Jusin154_Team3D/Editor/Private/DummyObject.cpp @@ -21,7 +21,7 @@ HRESULT CDummyObject::Initialize_Prototype() HRESULT CDummyObject::Initialize(void* pArg) { - OBJECT_DESC* pDesc = static_cast(pArg); + PARTS_OBJECT_DESC* pDesc = static_cast(pArg); m_strModelPrototypeTag = pDesc->pModelPrototypeTag; diff --git a/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp b/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp index 8c00ec440..3052f6689 100644 --- a/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp +++ b/Jusin154_Team3D/Editor/Private/Effect_Editor.cpp @@ -61,7 +61,7 @@ HRESULT CEffect_Editor::Ready_Components(void* pArg) HRESULT CEffect_Editor::Ready_Child() { - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::EFFECT), NEXT_LEVEL, LAYER_EFFECT , nullptr ,this , &m_pEditEffect))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::EFFECT), NEXT_LEVEL, LAYER_EFFECT , nullptr ,this , reinterpret_cast(&m_pEditEffect)))) return E_FAIL; return S_OK; diff --git a/Jusin154_Team3D/Editor/Private/GamePlay_Canvas.cpp b/Jusin154_Team3D/Editor/Private/GamePlay_Canvas.cpp index 8a6584222..2c675e0e6 100644 --- a/Jusin154_Team3D/Editor/Private/GamePlay_Canvas.cpp +++ b/Jusin154_Team3D/Editor/Private/GamePlay_Canvas.cpp @@ -94,12 +94,12 @@ HRESULT CGamePlay_Canvas::Ready_Panel(void* pArg) { CGameObject* asdf = this; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &m_pLoading_Panel))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pLoading_Panel)))) { return E_FAIL; } Add_Panel(TEXT("LoadingPanel"), m_pLoading_Panel); - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &m_pMinimap_Panel))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pMinimap_Panel)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/Hair.cpp b/Jusin154_Team3D/Editor/Private/Hair.cpp index e352e49d5..402d702ce 100644 --- a/Jusin154_Team3D/Editor/Private/Hair.cpp +++ b/Jusin154_Team3D/Editor/Private/Hair.cpp @@ -27,8 +27,6 @@ HRESULT CHair::Initialize(void* pArg) if (FAILED(Ready_Components())) return E_FAIL; - dynamic_cast(m_pOwner)->Push_ModelParts(this); - return S_OK; } @@ -39,7 +37,7 @@ void CHair::Priority_Update(_float fTimeDelta) void CHair::Update(_float fTimeDelta) { - //m_pModelCom->Play_Animation(fTimeDelta); + __super::Update(fTimeDelta); } void CHair::Late_Update(_float fTimeDelta) @@ -51,45 +49,21 @@ void CHair::Late_Update(_float fTimeDelta) 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; - } - } + __super::Render(); return S_OK; } HRESULT CHair::Ready_Components() { - /* Com_Model */ - if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag, - reinterpret_cast(&m_pModelCom)))) - return E_FAIL; + if (m_strModelPrototypeTag != L"") + { + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag, + reinterpret_cast(&m_pModelCom)))) + return E_FAIL; - /*m_pModelCom->Change_AnimationIndex(0, true, 0.4f, true);*/ + } return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Head.cpp b/Jusin154_Team3D/Editor/Private/Head.cpp index 5bfe3879a..5aecdf0c9 100644 --- a/Jusin154_Team3D/Editor/Private/Head.cpp +++ b/Jusin154_Team3D/Editor/Private/Head.cpp @@ -28,8 +28,6 @@ HRESULT CHead::Initialize(void* pArg) if (FAILED(Ready_Components())) return E_FAIL; - dynamic_cast(m_pOwner)->Push_ModelParts(this); - return S_OK; } @@ -40,7 +38,7 @@ void CHead::Priority_Update(_float fTimeDelta) void CHead::Update(_float fTimeDelta) { - //m_pModelCom->Play_Animation(fTimeDelta); + __super::Update(fTimeDelta); } void CHead::Late_Update(_float fTimeDelta) @@ -52,43 +50,20 @@ void CHead::Late_Update(_float fTimeDelta) HRESULT CHead::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; - } - } + __super::Render(); return S_OK; } HRESULT CHead::Ready_Components() { - /* Com_Model */ - if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag, - reinterpret_cast(&m_pModelCom)))) - return E_FAIL; + if (m_strModelPrototypeTag != L"") + { + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag, + reinterpret_cast(&m_pModelCom)))) + return E_FAIL; + } return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp b/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp index 0b6ab1653..c64383a44 100644 --- a/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp +++ b/Jusin154_Team3D/Editor/Private/IMGUIUI.cpp @@ -246,7 +246,7 @@ HRESULT CIMGUIUI::Bind_ShaderResources() HRESULT CIMGUIUI::Ready_Components(void* pArg) { - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &m_pGamePlay_Canvas))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pGamePlay_Canvas)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp index 69f40547a..7819a44f0 100644 --- a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp @@ -74,7 +74,7 @@ void CLevel_ObjectViewer::Add_Human() { if (GUI::BeginTabItem("Body")) { - Category_PartsModelList("Human/Body", "Body"); + Category_PartsModelList("Human/Body","Body"); GUI::EndTabItem(); } @@ -131,7 +131,7 @@ void CLevel_ObjectViewer::Category_ModelList(const _char* Category) { CGameObject* pTempObject = { nullptr }; - CDummyObject::OBJECT_DESC Desc = {}; + CDummyObject::PARTS_OBJECT_DESC Desc = {}; Desc.pModelPrototypeTag = Save_ModelName(szCategory); @@ -143,7 +143,7 @@ void CLevel_ObjectViewer::Category_ModelList(const _char* Category) m_Objects.pop_back(); } - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, m_wszLayer, &Desc, nullptr, &pTempObject))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, m_wszLayer, &Desc, nullptr, reinterpret_cast(&pTempObject)))) return; wcscpy_s(m_wszPreLayer, m_wszLayer); @@ -159,6 +159,11 @@ void CLevel_ObjectViewer::Category_ModelList(const _char* Category) void CLevel_ObjectViewer::Category_PartsModelList(const _char* Category, const _char* Layer) { + if (!m_HumanRoot) + { + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, TEXT("Layer_Root"), nullptr, nullptr, reinterpret_cast(&m_HumanRoot)))) + return; + } for (_uint i = 0; i < m_pGameInstance->BinaryModelFilePathCount(); i++) { const _char* szCategory = m_pGameInstance->Load_BinaryModelFilePath(i); @@ -167,35 +172,16 @@ void CLevel_ObjectViewer::Category_PartsModelList(const _char* Category, const _ { if (GUI::Button(szCategory)) { - if (strcmp("Body", Layer) == 0) - { - if (!m_HumanRoot) - { - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, TEXT("Layer_Root"), nullptr, nullptr, &m_HumanRoot))) - return; - } - } - Save_LayerName(Layer); CGameObject* pTempObject = { nullptr }; - CDummyObject::OBJECT_DESC Desc = {}; + CDummyObject::PARTS_OBJECT_DESC Desc = {}; Desc.pModelPrototypeTag = Save_ModelName(szCategory); - if (m_PartsObjects.size() > 0) - { - m_pGameInstance->Get_Layer(NEXT_LEVEL, m_wszPreLayer)->Clear_Layer(); - m_PartsObjects.pop_back(); - } - - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, m_wszLayer, &Desc, m_HumanRoot, &pTempObject))) - return; - - m_PartsObjects.push_back(pTempObject); - - wcscpy_s(m_wszPreLayer, m_wszLayer); + dynamic_cast(m_HumanRoot)->Set_PrototypeModelName(Desc.pModelPrototypeTag); + dynamic_cast(m_HumanRoot)->Set_ModelName(szCategory); } } } @@ -206,23 +192,20 @@ 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++) { - CModel* pModel = m_Objects[m_iObjectIndex]->Get_Component(); - for (_uint i = 0; i < pModel->Get_AnimSize(); i++) + if (GUI::Button(pModel->Get_AnimList(i))) { - if (GUI::Button(pModel->Get_AnimList(i))) - { - pModel->Set_AnimationIndex(i); - } + pModel->Set_AnimationIndex(i); } } } - if (!m_PartsObjects.empty()) + if (m_HumanRoot) { - if (!m_PartsObjects[m_iObjectIndex]->isDead()) + CModel* pModel = dynamic_cast(m_HumanRoot)->Get_ModelParts(0)->Get_Component(); + if (pModel) { - CModel* pModel = m_PartsObjects[m_iObjectIndex]->Get_Component(); for (_uint i = 0; i < pModel->Get_AnimSize(); i++) { if (GUI::Button(pModel->Get_AnimList(i))) @@ -275,26 +258,28 @@ void CLevel_ObjectViewer::Object_Setting() GUI::End(); GUI::Begin("PartsObject_Info"); - if (!m_PartsObjects.empty()) + if (m_HumanRoot) { - CModel* pModel = m_PartsObjects.front()->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)) + CModel* pModel = dynamic_cast(m_HumanRoot)->Get_ModelParts(0)->Get_Component(); + if (pModel) { - pModel->Set_PlayAnim(bPlayAnim); - } - if (GUI::Button("Delete")) - { - m_pGameInstance->Get_Layer(NEXT_LEVEL, m_wszPreLayer)->Clear_Layer(); - m_PartsObjects.clear(); + _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")) + { + m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_Root"))->Clear_Layer(); + m_HumanRoot = nullptr; + } } } diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index f92eb2b36..dee279c41 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -561,16 +561,24 @@ HRESULT CLoader::Loading_For_ObjectViewer() m_strMessage = TEXT("Model Loading.."); - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Body1_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Body/Body1/Body1.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_DADA_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Body/DADA/DADA.bin", 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_Body2_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Body/Body2/Body2.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_DarkWizardSoldier_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Body/DarkWizardSoldier/DarkWizardSoldier.bin", 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_Head_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Head/Head.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity())))) + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_DarkWizardGrunt_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Body/DarkWizardGrunt/DarkWizardGrunt.bin", 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_DarkWizardTank_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Body/DarkWizardTank/DarkWizardTank.bin", 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_Young_M_Head_Ivory_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Head/Young_M_Head_Ivory.bin", 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_Hair1_Model"), diff --git a/Jusin154_Team3D/Editor/Private/Loading_Panel.cpp b/Jusin154_Team3D/Editor/Private/Loading_Panel.cpp index 1905bb192..829179566 100644 --- a/Jusin154_Team3D/Editor/Private/Loading_Panel.cpp +++ b/Jusin154_Team3D/Editor/Private/Loading_Panel.cpp @@ -131,12 +131,12 @@ HRESULT CLoading_Panel::Ready_Components(void* pArg) HRESULT CLoading_Panel::Ready_Element(void* pArg) { - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &m_pLoadingWidget))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pLoadingWidget)))) { return E_FAIL; } Add_Element(TEXT("LoadingWidget"), m_pLoadingWidget); - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &m_pLoadingWidget_Flame))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pLoadingWidget_Flame)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/Mission_Panel.cpp b/Jusin154_Team3D/Editor/Private/Mission_Panel.cpp index 6dc8ad397..7e1100a3f 100644 --- a/Jusin154_Team3D/Editor/Private/Mission_Panel.cpp +++ b/Jusin154_Team3D/Editor/Private/Mission_Panel.cpp @@ -122,19 +122,19 @@ HRESULT CMission_Panel::Ready_Components(void* pArg) return E_FAIL; } - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &m_pMission_KeyHold))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pMission_KeyHold)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &m_pMission_Key))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pMission_Key)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &m_pActive_Icon))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pActive_Icon)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &m_pMissionBanner_Key))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pMissionBanner_Key)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/ModelParts.cpp b/Jusin154_Team3D/Editor/Private/ModelParts.cpp index 0ea502ab9..33f174a9a 100644 --- a/Jusin154_Team3D/Editor/Private/ModelParts.cpp +++ b/Jusin154_Team3D/Editor/Private/ModelParts.cpp @@ -2,14 +2,15 @@ #include "Body.h" #include "GameInstance.h" +#include "RootModelPart.h" CModelParts::CModelParts(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) - : CGameObject(pDevice, pContext) + : CPartObject(pDevice, pContext) { } CModelParts::CModelParts(const CModelParts& Prototype) - : CGameObject(Prototype) + : CPartObject(Prototype) { } @@ -20,9 +21,13 @@ HRESULT CModelParts::Initialize_Prototype() HRESULT CModelParts::Initialize(void* pArg) { - OBJECT_DESC* pDesc = static_cast(pArg); + PARTS_OBJECT_DESC* pDesc = static_cast(pArg); - m_strModelPrototypeTag = pDesc->pModelPrototypeTag; + m_pParentTransformCom = pDesc->pParentTransform; + if (pDesc->pModelPrototypeTag) + { + m_strModelPrototypeTag = pDesc->pModelPrototypeTag; + } if (FAILED(__super::Initialize(pArg))) return E_FAIL; @@ -40,6 +45,11 @@ void CModelParts::Priority_Update(_float fTimeDelta) void CModelParts::Update(_float fTimeDelta) { + XMStoreFloat4x4(&m_CombinedWorldMatrix, + XMLoadFloat4x4(m_pTransformCom->Get_WorldMatrixPtr()) * XMLoadFloat4x4(m_pParentTransformCom->Get_WorldMatrixPtr())); + + Change_Model(); + } void CModelParts::Late_Update(_float fTimeDelta) @@ -48,9 +58,89 @@ void CModelParts::Late_Update(_float fTimeDelta) HRESULT CModelParts::Render() { + if (!m_pModelCom) + return S_OK; + + 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; } +void CModelParts::Change_Model() +{ + if (dynamic_cast(m_pOwner)->Get_PrototypeModelName()) + { + if (m_strPreModelPrototypeTag != dynamic_cast(m_pOwner)->Get_PrototypeModelName()) + { + Set_Model("Body"); + Set_Model("Hair"); + Set_Model("Head"); + } + } +} + +void CModelParts::Set_Model(const _char* PartType) +{ + const _char* ObjectType = typeid(*this).name(); + const _char* ModelName = dynamic_cast(m_pOwner)->Get_ModelName(); + if (strstr(ObjectType, PartType)) + { + if (strstr(ModelName, PartType)) + { + if (m_pModelCom) + { + m_iAnimIndex = m_pModelCom->Get_AnimIndex(); + m_fTrackPosition = m_pModelCom->Get_CurrentTrackPosition(); + SAFE_RELEASE(m_pModelCom); + Remove_Component(); + } + + m_strModelPrototypeTag = dynamic_cast(m_pOwner)->Get_PrototypeModelName(); + + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag, + reinterpret_cast(&m_pModelCom)))) + return; + + if (strstr(PartType,"Body")) + { + dynamic_cast(m_pOwner)->Set_MainModel(m_pModelCom); + } + + m_pModelCom->Set_AnimationIndex(m_iAnimIndex); + m_pModelCom->Set_CurrentTrackPosition(m_fTrackPosition); + + m_strPreModelPrototypeTag = m_strModelPrototypeTag; + } + } + +} + HRESULT CModelParts::Ready_Components() { __super::Ready_Components(nullptr); @@ -65,9 +155,10 @@ HRESULT CModelParts::Ready_Components() HRESULT CModelParts::Bind_ShaderResources() { - if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { + if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", &m_CombinedWorldMatrix))) { return E_FAIL; } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/Monster.cpp b/Jusin154_Team3D/Editor/Private/Monster.cpp index d8e3d717a..a4f7e1b02 100644 --- a/Jusin154_Team3D/Editor/Private/Monster.cpp +++ b/Jusin154_Team3D/Editor/Private/Monster.cpp @@ -21,7 +21,7 @@ HRESULT CMonster::Initialize_Prototype() HRESULT CMonster::Initialize(void* pArg) { - OBJECT_DESC* pDesc = static_cast(pArg); + PARTS_OBJECT_DESC* pDesc = static_cast(pArg); m_strModelPrototypeTag = pDesc->pModelPrototypeTag; diff --git a/Jusin154_Team3D/Editor/Private/RootModelPart.cpp b/Jusin154_Team3D/Editor/Private/RootModelPart.cpp index af74db4a6..162a74143 100644 --- a/Jusin154_Team3D/Editor/Private/RootModelPart.cpp +++ b/Jusin154_Team3D/Editor/Private/RootModelPart.cpp @@ -4,6 +4,9 @@ #include "GameInstance.h" #include "DebugCamera.h" #include "ModelParts.h" +#include "Body.h" +#include "Head.h" +#include "Hair.h" CRootModelPart::CRootModelPart(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CContainerObject(pDevice, pContext) @@ -25,23 +28,27 @@ HRESULT CRootModelPart::Initialize(void* pArg) if (FAILED(__super::Initialize(pArg))) return E_FAIL; + if (FAILED(Ready_PartObjects())) + return E_FAIL; + return S_OK; } void CRootModelPart::Priority_Update(_float fTimeDelta) { + __super::Priority_Update(fTimeDelta); } void CRootModelPart::Update(_float fTimeDelta) { - if (!m_pMainModel) - return; - Update_Anim(fTimeDelta); + + __super::Update(fTimeDelta); } void CRootModelPart::Late_Update(_float fTimeDelta) { + __super::Late_Update(fTimeDelta); } HRESULT CRootModelPart::Render() @@ -51,36 +58,52 @@ HRESULT CRootModelPart::Render() 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(); + CModel* pModel = ModelParts->Get_Component(); + if (pModel) + { + pModel->Set_PlayAnim(m_pMainModel->Get_PlayAnim()); + pModel->Set_AnimationIndex(m_pMainModel->Get_AnimIndex()); + pModel->Set_CurrentTrackPosition(m_pMainModel->Get_CurrentTrackPosition()); + pModel->Play_Animation(fTimeDelta); + } } } -void CRootModelPart::Push_MainModel(CModel* MainModel) -{ - m_pMainModel = MainModel; - SAFE_ADDREF(MainModel); -} HRESULT CRootModelPart::Ready_Components() { return S_OK; } +HRESULT CRootModelPart::Ready_PartObjects() +{ + CModelParts::PARTS_OBJECT_DESC PartsDesc{}; + + PartsDesc.pParentTransform = m_pTransformCom; + PartsDesc.pModelPrototypeTag = m_PrototypeModelName; + + CModelParts* pModelPartsObject = { nullptr }; + + if (FAILED(Add_PartObject("Human_Body", ENUM_CLASS(LEVEL::STATIC), reinterpret_cast(&pModelPartsObject), &PartsDesc))) + return E_FAIL; + + m_ModelParts.push_back(pModelPartsObject); + + if (FAILED(Add_PartObject("Human_Head", ENUM_CLASS(LEVEL::STATIC), reinterpret_cast(&pModelPartsObject), &PartsDesc))) + return E_FAIL; + + m_ModelParts.push_back(pModelPartsObject); + + if (FAILED(Add_PartObject("Human_Hair", ENUM_CLASS(LEVEL::STATIC), reinterpret_cast(&pModelPartsObject), &PartsDesc))) + return E_FAIL; + + m_ModelParts.push_back(pModelPartsObject); + + return S_OK; +} + HRESULT CRootModelPart::Bind_ShaderResources() { return S_OK; @@ -126,5 +149,5 @@ void CRootModelPart::Free() void CRootModelPart::Describe_Entity() { - GUI::Text("HI"); + } diff --git a/Jusin154_Team3D/Editor/Public/DummyObject.h b/Jusin154_Team3D/Editor/Public/DummyObject.h index 8d61c609d..54de78e53 100644 --- a/Jusin154_Team3D/Editor/Public/DummyObject.h +++ b/Jusin154_Team3D/Editor/Public/DummyObject.h @@ -16,7 +16,7 @@ class CDummyObject final : public CGameObject typedef struct tagObjectDesc { const _tchar* pModelPrototypeTag; - }OBJECT_DESC; + }PARTS_OBJECT_DESC; private: CDummyObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CDummyObject(const CDummyObject& Prototype); diff --git a/Jusin154_Team3D/Editor/Public/Hair.h b/Jusin154_Team3D/Editor/Public/Hair.h index 49f564be5..8f35f5521 100644 --- a/Jusin154_Team3D/Editor/Public/Hair.h +++ b/Jusin154_Team3D/Editor/Public/Hair.h @@ -2,6 +2,9 @@ #include "Editor_Define.h" #include "ModelParts.h" +NS_BEGIN(Engine) +class CTexture; +NS_END NS_BEGIN(Editor) @@ -23,6 +26,9 @@ class CHair final : public CModelParts private: HRESULT Ready_Components(); +private: + CTexture* m_pTextureCom = { nullptr }; + public: static CHair* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override; diff --git a/Jusin154_Team3D/Editor/Public/ModelParts.h b/Jusin154_Team3D/Editor/Public/ModelParts.h index 4911d6a64..f0b45833f 100644 --- a/Jusin154_Team3D/Editor/Public/ModelParts.h +++ b/Jusin154_Team3D/Editor/Public/ModelParts.h @@ -1,7 +1,7 @@ #pragma once #include "Editor_Define.h" -#include "GameObject.h" +#include "PartObject.h" NS_BEGIN(Engine) class CShader; @@ -10,13 +10,13 @@ NS_END NS_BEGIN(Editor) -class CModelParts abstract : public CGameObject +class CModelParts abstract : public CPartObject { public: - typedef struct tagObjectDesc + typedef struct tagPartsObjectDesc : public CPartObject::PARTOBJECT_DESC { const _tchar* pModelPrototypeTag; - }OBJECT_DESC; + }PARTS_OBJECT_DESC; protected: CModelParts(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); @@ -30,6 +30,8 @@ class CModelParts abstract : public CGameObject virtual void Update(_float fTimeDelta) override; virtual void Late_Update(_float fTimeDelta) override; virtual HRESULT Render() override; + void Change_Model(); + void Set_Model(const _char*PartType); _wstring& Get_PrototypeTag() { return m_strModelPrototypeTag; } protected: @@ -39,9 +41,11 @@ class CModelParts abstract : public CGameObject _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 }; + _float m_fTrackPosition = {}; + _uint m_iAnimIndex = {}; _wstring m_strModelPrototypeTag; - + _wstring m_strPreModelPrototypeTag; protected: HRESULT Ready_Components(); HRESULT Bind_ShaderResources(); diff --git a/Jusin154_Team3D/Editor/Public/Monster.h b/Jusin154_Team3D/Editor/Public/Monster.h index e48946f37..d00b04260 100644 --- a/Jusin154_Team3D/Editor/Public/Monster.h +++ b/Jusin154_Team3D/Editor/Public/Monster.h @@ -16,7 +16,7 @@ class CMonster final : public CGameObject typedef struct tagObjectDesc { const _tchar* pModelPrototypeTag; - }OBJECT_DESC; + }PARTS_OBJECT_DESC; private: CMonster(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CMonster(const CMonster& Prototype); diff --git a/Jusin154_Team3D/Editor/Public/RootModelPart.h b/Jusin154_Team3D/Editor/Public/RootModelPart.h index fa5dd0b3a..2be0fd1fd 100644 --- a/Jusin154_Team3D/Editor/Public/RootModelPart.h +++ b/Jusin154_Team3D/Editor/Public/RootModelPart.h @@ -23,17 +23,22 @@ class CRootModelPart final : public CContainerObject 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; } - + void Set_PrototypeModelName(const _wchar* PrototypeModelName) { m_PrototypeModelName = PrototypeModelName; } + void Set_ModelName(const _char* Name) { m_ModelName = Name; } + const _wchar* Get_PrototypeModelName() { return m_PrototypeModelName; } + const _char* Get_ModelName() { return m_ModelName; } + class CModelParts* Get_ModelParts(_uint iIndex) { return m_ModelParts[iIndex]; } + void Set_MainModel(class CModel* Model) { m_pMainModel = Model; } private: - CModel* m_pMainModel = { nullptr }; + class CModel* m_pMainModel = { nullptr }; vector m_ModelParts = {}; _uint m_iAnimIndex = { 0 }; - + const _wchar* m_PrototypeModelName = { 0 }; + const _char* m_ModelName = { 0 }; private: HRESULT Ready_Components(); + HRESULT Ready_PartObjects(); HRESULT Bind_ShaderResources(); public: diff --git a/Jusin154_Team3D/Engine/Private/ContainerObject.cpp b/Jusin154_Team3D/Engine/Private/ContainerObject.cpp index 1ce5f515a..d5af513a5 100644 --- a/Jusin154_Team3D/Engine/Private/ContainerObject.cpp +++ b/Jusin154_Team3D/Engine/Private/ContainerObject.cpp @@ -22,6 +22,11 @@ HRESULT CContainerObject::Initialize(void* pArg) if (FAILED(__super::Initialize(pArg))) { return E_FAIL; } + + if (FAILED(Ready_Components(pArg))) { + return E_FAIL; + } + return S_OK; } diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index 51a9a79a4..960eb329f 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -278,9 +278,9 @@ void CModel::Get_BoneMatrices(_float4x4* pOut) } } -void CModel::Reset_CurrentTrackPosition() +void CModel::Set_CurrentTrackPosition(_float TrackPosition) { - m_Animations[m_iCurrentAnimIndex]->Reset_CurrentTrackPosition(); + m_Animations[m_iCurrentAnimIndex]->Set_CurrentTrackPosition(TrackPosition); } const _char* CModel::Get_AnimList(_uint iIndex) diff --git a/Jusin154_Team3D/Engine/Public/Animation.h b/Jusin154_Team3D/Engine/Public/Animation.h index 82122802b..a5a26c873 100644 --- a/Jusin154_Team3D/Engine/Public/Animation.h +++ b/Jusin154_Team3D/Engine/Public/Animation.h @@ -23,7 +23,7 @@ class ENGINE_DLL CAnimation : public CBase const _string& Get_Name() const { return m_strName; } const _char* Get_SZName() const { return m_szName; } - void Reset_CurrentTrackPosition() { m_fCurrentTrackPosition = 0.f; } + void Set_CurrentTrackPosition(_float TrackPosition) { m_fCurrentTrackPosition =TrackPosition; } _float Get_CurrentTrackPosition() { return m_fCurrentTrackPosition; } void Set_AnimSpeed(_float fSpeed) { m_fAnimSpeed = fSpeed; } _float Get_AnimSpeed() { return m_fAnimSpeed; } diff --git a/Jusin154_Team3D/Engine/Public/GameInstance.h b/Jusin154_Team3D/Engine/Public/GameInstance.h index e156ec191..eb7866641 100644 --- a/Jusin154_Team3D/Engine/Public/GameInstance.h +++ b/Jusin154_Team3D/Engine/Public/GameInstance.h @@ -74,7 +74,7 @@ class ENGINE_DLL CGameInstance final : public CBase #pragma region OBJECT_MANAGER template - HRESULT Add_GameObject_ToLayer(_uint iPrototypeLevelIndex, _uint iLayerLevelIndex, const _wstring& strLayerTag, void* pArg = nullptr, class CGameObject* pOwner = nullptr, class CGameObject** ppOut = nullptr) { + HRESULT Add_GameObject_ToLayer(_uint iPrototypeLevelIndex, _uint iLayerLevelIndex, const _wstring& strLayerTag, void* pArg = nullptr, class CGameObject* pOwner = nullptr, T** ppOut = nullptr) { T* pGameObject = Clone_Prototype(iPrototypeLevelIndex, pArg, pOwner); if (nullptr == pGameObject) { diff --git a/Jusin154_Team3D/Engine/Public/GameObject.h b/Jusin154_Team3D/Engine/Public/GameObject.h index 2748a01d0..d4d1daa8c 100644 --- a/Jusin154_Team3D/Engine/Public/GameObject.h +++ b/Jusin154_Team3D/Engine/Public/GameObject.h @@ -68,6 +68,22 @@ class ENGINE_DLL CGameObject abstract return nullptr; } + + template + void Remove_Component() + { + for (auto it = m_Components.begin(); it != m_Components.end(); ) + { + if (dynamic_cast(*it)) + { + SAFE_RELEASE(*it); + it = m_Components.erase(it); + } + else + ++it; + } + } + protected: virtual HRESULT Initialize_Prototype(); virtual HRESULT Initialize(void* pArg); diff --git a/Jusin154_Team3D/Engine/Public/Model.h b/Jusin154_Team3D/Engine/Public/Model.h index 5e4ac2b94..89158d892 100644 --- a/Jusin154_Team3D/Engine/Public/Model.h +++ b/Jusin154_Team3D/Engine/Public/Model.h @@ -39,7 +39,7 @@ class ENGINE_DLL CModel final : public CComponent void Get_BoneMatrices(_float4x4* pOut); _uint Get_BonesNum() const { return (_uint)m_Bones.size(); } - void Reset_CurrentTrackPosition(); + void Set_CurrentTrackPosition(_float TrackPosition); const _char* Get_AnimList(_uint iIndex); size_t Get_AnimSize() { return m_Animations.size(); } _float Get_CurrentTrackPosition();