[Fix]
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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<CRootModelPart*>(m_pOwner)->Push_ModelParts(this);
|
||||
|
||||
dynamic_cast<CRootModelPart*>(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<CComponent**>(&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<CComponent**>(&m_pModelCom))))
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ HRESULT CDummyObject::Initialize_Prototype()
|
||||
|
||||
HRESULT CDummyObject::Initialize(void* pArg)
|
||||
{
|
||||
OBJECT_DESC* pDesc = static_cast<OBJECT_DESC*>(pArg);
|
||||
PARTS_OBJECT_DESC* pDesc = static_cast<PARTS_OBJECT_DESC*>(pArg);
|
||||
|
||||
m_strModelPrototypeTag = pDesc->pModelPrototypeTag;
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ HRESULT CEffect_Editor::Ready_Components(void* pArg)
|
||||
|
||||
HRESULT CEffect_Editor::Ready_Child()
|
||||
{
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CEditEffect>(ENUM_CLASS(LEVEL::EFFECT), NEXT_LEVEL, LAYER_EFFECT , nullptr ,this , &m_pEditEffect)))
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CEditEffect>(ENUM_CLASS(LEVEL::EFFECT), NEXT_LEVEL, LAYER_EFFECT , nullptr ,this , reinterpret_cast<CEditEffect**>(&m_pEditEffect))))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
|
||||
@@ -94,12 +94,12 @@ HRESULT CGamePlay_Canvas::Ready_Panel(void* pArg)
|
||||
{
|
||||
CGameObject* asdf = this;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CLoading_Panel>(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &m_pLoading_Panel)))
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CLoading_Panel>(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast<CLoading_Panel**>(&m_pLoading_Panel))))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
Add_Panel(TEXT("LoadingPanel"), m_pLoading_Panel);
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CMiniMap_Panel>(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &m_pMinimap_Panel)))
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CMiniMap_Panel>(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast<CMiniMap_Panel**>(&m_pMinimap_Panel))))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -27,8 +27,6 @@ HRESULT CHair::Initialize(void* pArg)
|
||||
if (FAILED(Ready_Components()))
|
||||
return E_FAIL;
|
||||
|
||||
dynamic_cast<CRootModelPart*>(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<CComponent**>(&m_pModelCom))))
|
||||
return E_FAIL;
|
||||
if (m_strModelPrototypeTag != L"")
|
||||
{
|
||||
/* Com_Model */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag,
|
||||
reinterpret_cast<CComponent**>(&m_pModelCom))))
|
||||
return E_FAIL;
|
||||
|
||||
/*m_pModelCom->Change_AnimationIndex(0, true, 0.4f, true);*/
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -28,8 +28,6 @@ HRESULT CHead::Initialize(void* pArg)
|
||||
if (FAILED(Ready_Components()))
|
||||
return E_FAIL;
|
||||
|
||||
dynamic_cast<CRootModelPart*>(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<CComponent**>(&m_pModelCom))))
|
||||
return E_FAIL;
|
||||
if (m_strModelPrototypeTag != L"")
|
||||
{
|
||||
/* Com_Model */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag,
|
||||
reinterpret_cast<CComponent**>(&m_pModelCom))))
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ HRESULT CIMGUIUI::Bind_ShaderResources()
|
||||
|
||||
HRESULT CIMGUIUI::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CGamePlay_Canvas>(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &m_pGamePlay_Canvas)))
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CGamePlay_Canvas>(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast<CGamePlay_Canvas**>(&m_pGamePlay_Canvas))))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -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<CDummyObject>(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, m_wszLayer, &Desc, nullptr, &pTempObject)))
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummyObject>(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, m_wszLayer, &Desc, nullptr, reinterpret_cast<CDummyObject**>(&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<CRootModelPart>(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, TEXT("Layer_Root"), nullptr, nullptr, reinterpret_cast<CRootModelPart**>(&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<CRootModelPart>(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<CBody>(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<CRootModelPart*>(m_HumanRoot)->Set_PrototypeModelName(Desc.pModelPrototypeTag);
|
||||
dynamic_cast<CRootModelPart*>(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<CModel>();
|
||||
for (_uint i = 0; i < pModel->Get_AnimSize(); i++)
|
||||
{
|
||||
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)))
|
||||
{
|
||||
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<CRootModelPart*>(m_HumanRoot)->Get_ModelParts(0)->Get_Component<CModel>();
|
||||
if (pModel)
|
||||
{
|
||||
CModel* pModel = m_PartsObjects[m_iObjectIndex]->Get_Component<CModel>();
|
||||
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<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))
|
||||
CModel* pModel = dynamic_cast<CRootModelPart*>(m_HumanRoot)->Get_ModelParts(0)->Get_Component<CModel>();
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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"),
|
||||
|
||||
@@ -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<CLoadingWidget>(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &m_pLoadingWidget)))
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CLoadingWidget>(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast<CLoadingWidget**>(&m_pLoadingWidget))))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
Add_Element(TEXT("LoadingWidget"), m_pLoadingWidget);
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CLoadingWidget_Flame>(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &m_pLoadingWidget_Flame)))
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CLoadingWidget_Flame>(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast<CLoadingWidget_Flame**>(&m_pLoadingWidget_Flame))))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -122,19 +122,19 @@ HRESULT CMission_Panel::Ready_Components(void* pArg)
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CMission_KeyHold>(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &m_pMission_KeyHold)))
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CMission_KeyHold>(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast<CMission_KeyHold**>(&m_pMission_KeyHold))))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CMission_Key>(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &m_pMission_Key)))
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CMission_Key>(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast<CMission_Key**>(&m_pMission_Key))))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CActive_Icon>(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &m_pActive_Icon)))
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CActive_Icon>(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast<CActive_Icon**>(&m_pActive_Icon))))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CMissionBanner_Key>(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, &m_pMissionBanner_Key)))
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CMissionBanner_Key>(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast<CMissionBanner_Key**>(&m_pMissionBanner_Key))))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -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<OBJECT_DESC*>(pArg);
|
||||
PARTS_OBJECT_DESC* pDesc = static_cast<PARTS_OBJECT_DESC*>(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<CRootModelPart*>(m_pOwner)->Get_PrototypeModelName())
|
||||
{
|
||||
if (m_strPreModelPrototypeTag != dynamic_cast<CRootModelPart*>(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<CRootModelPart*>(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<CModel>();
|
||||
}
|
||||
|
||||
m_strModelPrototypeTag = dynamic_cast<CRootModelPart*>(m_pOwner)->Get_PrototypeModelName();
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag,
|
||||
reinterpret_cast<CComponent**>(&m_pModelCom))))
|
||||
return;
|
||||
|
||||
if (strstr(PartType,"Body"))
|
||||
{
|
||||
dynamic_cast<CRootModelPart*>(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;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ HRESULT CMonster::Initialize_Prototype()
|
||||
|
||||
HRESULT CMonster::Initialize(void* pArg)
|
||||
{
|
||||
OBJECT_DESC* pDesc = static_cast<OBJECT_DESC*>(pArg);
|
||||
PARTS_OBJECT_DESC* pDesc = static_cast<PARTS_OBJECT_DESC*>(pArg);
|
||||
|
||||
m_strModelPrototypeTag = pDesc->pModelPrototypeTag;
|
||||
|
||||
|
||||
@@ -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<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();
|
||||
CModel* pModel = ModelParts->Get_Component<CModel>();
|
||||
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<CBody>("Human_Body", ENUM_CLASS(LEVEL::STATIC), reinterpret_cast<CBody**>(&pModelPartsObject), &PartsDesc)))
|
||||
return E_FAIL;
|
||||
|
||||
m_ModelParts.push_back(pModelPartsObject);
|
||||
|
||||
if (FAILED(Add_PartObject<CHead>("Human_Head", ENUM_CLASS(LEVEL::STATIC), reinterpret_cast<CHead**>(&pModelPartsObject), &PartsDesc)))
|
||||
return E_FAIL;
|
||||
|
||||
m_ModelParts.push_back(pModelPartsObject);
|
||||
|
||||
if (FAILED(Add_PartObject<CHair>("Human_Hair", ENUM_CLASS(LEVEL::STATIC), reinterpret_cast<CHair**>(&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");
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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<class CModelParts*> 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:
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -74,7 +74,7 @@ class ENGINE_DLL CGameInstance final : public CBase
|
||||
|
||||
#pragma region OBJECT_MANAGER
|
||||
template<typename T>
|
||||
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<T>(iPrototypeLevelIndex, pArg, pOwner);
|
||||
if (nullptr == pGameObject) {
|
||||
|
||||
@@ -68,6 +68,22 @@ class ENGINE_DLL CGameObject abstract
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
template<typename T>
|
||||
void Remove_Component()
|
||||
{
|
||||
for (auto it = m_Components.begin(); it != m_Components.end(); )
|
||||
{
|
||||
if (dynamic_cast<T*>(*it))
|
||||
{
|
||||
SAFE_RELEASE(*it);
|
||||
it = m_Components.erase(it);
|
||||
}
|
||||
else
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual HRESULT Initialize_Prototype();
|
||||
virtual HRESULT Initialize(void* pArg);
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user