Merge branch 'Model' into Develope
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v145</PlatformToolset>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<EnableASAN>true</EnableASAN>
|
||||
</PropertyGroup>
|
||||
|
||||
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -42,7 +42,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v145</PlatformToolset>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<EnableASAN>true</EnableASAN>
|
||||
</PropertyGroup>
|
||||
@@ -168,6 +168,7 @@
|
||||
<ClInclude Include="..\Public\Editor_Define.h" />
|
||||
<ClInclude Include="..\Public\Editor_Macro.h" />
|
||||
<ClInclude Include="..\Public\Editor_Struct.h" />
|
||||
<ClInclude Include="..\Public\Hair.h" />
|
||||
<ClInclude Include="..\Public\Level_EffectViewer.h" />
|
||||
<ClInclude Include="..\public\LodingWidget1.h" />
|
||||
<ClInclude Include="..\public\MiniMap_TrimBorder.h" />
|
||||
@@ -185,7 +186,11 @@
|
||||
<ClInclude Include="..\public\Mission_Icon.h" />
|
||||
<ClInclude Include="..\public\Mission_Key.h" />
|
||||
<ClInclude Include="..\public\Mission_KeyHold.h" />
|
||||
<ClInclude Include="..\Public\Monster.h" />
|
||||
<ClInclude Include="..\public\Mouse_Cursor.h" />
|
||||
<ClInclude Include="..\Public\RootModelPart.h" />
|
||||
<ClInclude Include="..\Public\TombProtector.h" />
|
||||
<ClInclude Include="..\Public\Troll.h" />
|
||||
<ClInclude Include="Editor.h" />
|
||||
<ClInclude Include="framework.h" />
|
||||
<ClInclude Include="Resource.h" />
|
||||
@@ -207,6 +212,7 @@
|
||||
<ClCompile Include="..\Private\DummyRect.cpp" />
|
||||
<ClCompile Include="..\Private\Dummy_Cube.cpp" />
|
||||
<ClCompile Include="..\Private\Dummy_Goblin.cpp" />
|
||||
<ClCompile Include="..\Private\Hair.cpp" />
|
||||
<ClCompile Include="..\Private\Loader.cpp" />
|
||||
<ClCompile Include="..\Private\Level_EffectViewer.cpp" />
|
||||
<ClCompile Include="..\private\LodingWidget1.cpp" />
|
||||
@@ -225,11 +231,15 @@
|
||||
<ClCompile Include="..\private\Mission_Icon.cpp" />
|
||||
<ClCompile Include="..\private\Mission_Key.cpp" />
|
||||
<ClCompile Include="..\private\Mission_KeyHold.cpp" />
|
||||
<ClCompile Include="..\Private\Monster.cpp" />
|
||||
<ClCompile Include="..\private\Mouse_Cursor.cpp" />
|
||||
<ClCompile Include="..\Private\pch.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\RootModelPart.cpp" />
|
||||
<ClCompile Include="..\Private\TombProtector.cpp" />
|
||||
<ClCompile Include="..\Private\Troll.cpp" />
|
||||
<ClCompile Include="Editor.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -145,6 +145,18 @@
|
||||
<Filter Include="01.Level\60.PhysXLab">
|
||||
<UniqueIdentifier>{943a760b-2861-45b7-87b8-462e1309c172}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\ModelParts\RootModelPart">
|
||||
<UniqueIdentifier>{a9a39942-3c35-4932-b845-e8d1787f3ec3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Monster">
|
||||
<UniqueIdentifier>{a2944f33-1db0-480a-b793-7ec7f81e8116}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Monster\TombProtector">
|
||||
<UniqueIdentifier>{6ccfe379-cf97-47af-98ae-b5155d1a0b39}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Monster\Troll">
|
||||
<UniqueIdentifier>{f405a7a7-3eca-4a05-9098-aedc576bd360}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Editor.h">
|
||||
@@ -210,11 +222,26 @@
|
||||
<ClInclude Include="..\Public\Body.h">
|
||||
<Filter>02.GameObjects\ModelParts\Body</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Head.h">
|
||||
<Filter>02.GameObjects\ModelParts\Head</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Hair.h">
|
||||
<Filter>02.GameObjects\ModelParts\Hair</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\ModelParts.h">
|
||||
<Filter>02.GameObjects\ModelParts</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Head.h">
|
||||
<Filter>02.GameObjects\ModelParts\Head</Filter>
|
||||
<ClInclude Include="..\Public\RootModelPart.h">
|
||||
<Filter>02.GameObjects\ModelParts\RootModelPart</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Monster.h">
|
||||
<Filter>02.GameObjects\Monster</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\TombProtector.h">
|
||||
<Filter>02.GameObjects\Monster\TombProtector</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Troll.h">
|
||||
<Filter>02.GameObjects\Monster\Troll</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Level_EffectViewer.h">
|
||||
<Filter>01.Level\40.EffectViewer</Filter>
|
||||
@@ -325,9 +352,6 @@
|
||||
<ClCompile Include="..\Private\Body.cpp">
|
||||
<Filter>02.GameObjects\ModelParts\Body</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\ModelParts.cpp">
|
||||
<Filter>02.GameObjects\ModelParts</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Head.cpp">
|
||||
<Filter>02.GameObjects\ModelParts\Head</Filter>
|
||||
</ClCompile>
|
||||
@@ -388,6 +412,24 @@
|
||||
<ClCompile Include="..\Private\Level_PhysXLab.cpp">
|
||||
<Filter>01.Level\60.PhysXLab</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Hair.cpp">
|
||||
<Filter>02.GameObjects\ModelParts\Hair</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\ModelParts.cpp">
|
||||
<Filter>02.GameObjects\ModelParts</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\RootModelPart.cpp">
|
||||
<Filter>02.GameObjects\ModelParts\RootModelPart</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Monster.cpp">
|
||||
<Filter>02.GameObjects\Monster</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\TombProtector.cpp">
|
||||
<Filter>02.GameObjects\Monster\TombProtector</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Troll.cpp">
|
||||
<Filter>02.GameObjects\Monster\Troll</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Editor.rc">
|
||||
|
||||
@@ -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<CRootModelPart*>(m_pOwner)->Push_ModelParts(this);
|
||||
|
||||
dynamic_cast<CRootModelPart*>(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<CComponent**>(&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()
|
||||
|
||||
@@ -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<CComponent**>(&m_pModelCom))))
|
||||
|
||||
@@ -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<CComponent**>(&m_pModelCom))))
|
||||
|
||||
@@ -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<CRootModelPart*>(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<CComponent**>(&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()
|
||||
{
|
||||
}
|
||||
@@ -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<CRootModelPart*>(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<CComponent**>(&m_pModelCom))))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
@@ -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<CBody>(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, TEXT("Layer_Body"))))
|
||||
return;
|
||||
CBody* pBody = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_Body"))->Get_Object<CBody>();
|
||||
}
|
||||
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<CBody>();
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CHead>(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<CTombProtector>(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<CTroll>(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<CRootModelPart>(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, TEXT("Layer_Root"), nullptr, nullptr, &m_HumanRoot)))
|
||||
return;
|
||||
|
||||
CGameObject* pTempObject = { nullptr };
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CBody>(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<CHead>(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<CHair>(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<CModel>();
|
||||
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<CModel>();
|
||||
|
||||
_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);
|
||||
|
||||
@@ -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<CRootModelPart>(g_iStaticLevel, CRootModelPart::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_Body */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CBody>(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<CHead>(g_iStaticLevel, CHead::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_Hair */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CHair>(g_iStaticLevel, CHair::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_TombProtector */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CTombProtector>(g_iStaticLevel, CTombProtector::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_Troll */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CTroll>(g_iStaticLevel, CTroll::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_Dummy_Cube */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_Cube>(g_iStaticLevel, CDummy_Cube::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
@@ -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<CComponent**>(&m_pShaderCom))))
|
||||
|
||||
@@ -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<CComponent**>(&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()
|
||||
{
|
||||
}
|
||||
@@ -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<CModel>()->Set_PlayAnim(m_pMainModel->Get_PlayAnim());
|
||||
m_ModelParts[i]->Get_Component<CModel>()->Set_AnimationIndex(m_pMainModel->Get_AnimIndex());
|
||||
m_ModelParts[i]->Get_Component<CModel>()->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<CModel>()->Set_AnimationIndex(0);
|
||||
ModelParts->Get_Component<CModel>()->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()
|
||||
{
|
||||
}
|
||||
@@ -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<CComponent**>(&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()
|
||||
{
|
||||
}
|
||||
@@ -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<CComponent**>(&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()
|
||||
{
|
||||
}
|
||||
@@ -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
|
||||
@@ -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<CGameObject*> m_Objects;
|
||||
CGameObject* m_HumanRoot = { nullptr };
|
||||
_int m_iObjectIndex = { 0 };
|
||||
|
||||
|
||||
public:
|
||||
static CLevel_ObjectViewer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID);
|
||||
|
||||
@@ -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
|
||||
@@ -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<class CModelParts*> 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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -42,7 +42,7 @@
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v145</PlatformToolset>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<EnableASAN>true</EnableASAN>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -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<class CBone*>& 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<CBone*>& 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<CBone*>& 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;
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
@@ -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<SaveNode>& 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);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,12 @@ class ENGINE_DLL CAnimation : public CBase
|
||||
vector<LERPDESC> 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 = {}; // 애님 이름
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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<class CAnimation*> m_Animations; // 애니메이션의 벡터,
|
||||
|
||||
class CLerpAnim* m_pLerpAnim = { nullptr }; // 럴프전용 애니메이션
|
||||
|
||||
Reference in New Issue
Block a user