[add] Model ReWrite

[add] ReMapping Loading Orders
This commit is contained in:
kimnuri
2025-12-02 04:25:53 +09:00
parent 5962a2d2f2
commit c0a12310e3
24 changed files with 436 additions and 640 deletions
+11 -13
View File
@@ -27,16 +27,18 @@ HRESULT CEffectPool::Initialize_Prototype()
HRESULT CEffectPool::Initialize(void* pArg)
{
if (FAILED(__super::Initialize(pArg)))
if (FAILED(__super::Initialize(pArg))){
return E_FAIL;
}
if (FAILED(Ready_Components()))
if (FAILED(Ready_Components())) {
return E_FAIL;
}
if (FAILED(Ready_Effect()))
if (FAILED(Ready_Effect())) {
return E_FAIL;
}
return S_OK;
}
@@ -46,8 +48,6 @@ void CEffectPool::Priority_Update(_float fTimeDelta)
{
if (false == (*iter)->Get_Visible())
{
//SAFE_RELEASE(*iter);
//iter = m_ActiveEffectList.erase(iter);
++iter;
}
else
@@ -64,8 +64,6 @@ void CEffectPool::Update(_float fTimeDelta)
{
if (false == (*iter)->Get_Visible())
{
//SAFE_RELEASE(*iter);
//iter = m_ActiveEffectList.erase(iter);
++iter;
}
else
@@ -78,7 +76,6 @@ void CEffectPool::Update(_float fTimeDelta)
void CEffectPool::Late_Update(_float fTimeDelta)
{
for (auto iter = m_ActiveEffectList.begin(); iter != m_ActiveEffectList.end(); )
{
if (false == (*iter)->Get_Visible())
@@ -102,7 +99,9 @@ HRESULT CEffectPool::Render()
HRESULT CEffectPool::Ready_Components()
{
__super::Ready_Components(nullptr);
if (FAILED(__super::Ready_Components(nullptr))) {
return E_FAIL;
}
return S_OK;
}
@@ -113,9 +112,7 @@ HRESULT CEffectPool::Bind_ShaderResources()
HRESULT CEffectPool::Ready_Effect()
{
if(FAILED(Create_Effect(SKILL_TYPE::JAP, 10, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* {
CNomalJap* pEffect = nullptr;
pEffect = m_pGameInstance->Clone_Prototype<CNomalJap>(iPrototypeLevel, nullptr);
@@ -170,8 +167,9 @@ HRESULT CEffectPool::Create_Effect(SKILL_TYPE eType, _uint iNumEffect, _uint iPr
{
CEffect_Container* pEffect_Container = AddPrototypeEvent(iPrototypeLevel, iCloneLevel);
if (pEffect_Container == nullptr)
if (pEffect_Container == nullptr) {
return E_FAIL;
}
m_EffectList[ENUM_CLASS(eType)].push_back(pEffect_Container);
@@ -90,7 +90,10 @@ void CGoblin::Update(_float fTimeDelta)
m_pRigidBody->ConvertToCCT(*m_pCharacter_Controller);
}
}
#ifdef _DEBUG
Describe_Entity();
#endif // _DEBUG
}
void CGoblin::Late_Update(_float fTimeDelta)
@@ -43,10 +43,12 @@ HRESULT CLevel_GamePlay::Initialize(void* pArg)
if (FAILED(Ready_Layer_UI(LAYER_UI))) {
return E_FAIL;
}
if (FAILED(Reday_Layer_EffectPool())) { //플레이어보다 먼저 생성해야함!
//플레이어보다 먼저 생성해야함!
if (FAILED(Reday_Layer_EffectPool())) {
return E_FAIL;
}
if (FAILED(Ready_Layer_Item(TEXT("Layer_Item")))) { // 이것도 플레이어보다 먼저 생성해야함!
// 이것도 플레이어보다 먼저 생성해야함!
if (FAILED(Ready_Layer_Item(LAYER_ITEM))) {
return E_FAIL;
}
if (FAILED(Ready_Layer_Player(LAYER_PLAYER))) {
@@ -192,21 +194,19 @@ HRESULT CLevel_GamePlay::Ready_Markers()
HRESULT CLevel_GamePlay::Ready_Layer_Player(const _wstring& strLayerTag)
{
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CPlayer>(g_iStaticLevel, NEXT_LEVEL, strLayerTag, m_pBroom))){
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CPlayer>(g_iStaticLevel, NEXT_LEVEL, strLayerTag))){
return E_FAIL;
}
return S_OK;
}
HRESULT CLevel_GamePlay::Ready_Layer_Item(const _wstring& strLayerTag)
{
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CBroom>(g_iStaticLevel, NEXT_LEVEL, strLayerTag, nullptr, nullptr, &m_pBroom)))
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CBroom>(g_iStaticLevel, NEXT_LEVEL, LAYER_ITEM, nullptr, nullptr))) {
return E_FAIL;
}
return S_OK;
}
@@ -231,15 +231,15 @@ HRESULT CLevel_GamePlay::Ready_Layer_SkyBox(const _wstring& strLayerTag)
HRESULT CLevel_GamePlay::Ready_Layer_Monster()
{
for (_uint i = 0; i < 2; ++i)
{
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CGoblin>(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER,&i))) {
return E_FAIL;
}
}
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CTroll>(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) {
return E_FAIL;
}
//for (_uint i = 0; i < 2; ++i)
//{
// if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CGoblin>(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER,&i))) {
// return E_FAIL;
// }
//}
//if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CTroll>(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) {
// return E_FAIL;
//}
return S_OK;
}
@@ -247,10 +247,10 @@ HRESULT CLevel_GamePlay::Ready_Layer_Monster()
HRESULT CLevel_GamePlay::Reday_Layer_EffectPool()
{
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CEffectPool>(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_EffectPool")))) //플레이어보다 먼저 생성해야함!
//플레이어보다 먼저 생성해야함!
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CEffectPool>(g_iStaticLevel, NEXT_LEVEL, LAYER_EFFECTPOOL))) {
return E_FAIL;
}
return S_OK;
}
+302 -367
View File
@@ -196,6 +196,250 @@ HRESULT CLoader::Loading_For_GamePlay()
{
m_strMessage = TEXT("텍스쳐를(을) 로딩 중 입니다.");
#pragma region MAP_MODELS
vector<future<vector<FOLDER_LOAD*>*>> jobMapModels;
{
{ /* Terrain */
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Collision/Terrain",
".bin", false
));
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Terrain",
".bin", false
));
}
{ /* Ollivanders*/
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Ollivanders/Meshes",
".bin", false
));
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Ollivanders/Collision",
".bin", false
));
}
{ /* Gatehouse*/
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Gatehouse/Meshes",
".bin", false
));
}
{ /* TScrolls */
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TScrolls/Meshes",
".bin", false
));
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TScrolls/Collisions",
".bin", false
));
}
{ /* 3BroomStick*/
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_ThreeBroomsticks/Meshes",
".bin", false
));
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_ThreeBroomsticks/Collision",
".bin", false
));
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_ThreeBroomsticks/Meshes/3Broom_Kit",
".bin", false
));
}
{ /* BLDG_QuidditchShop */
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_QuidditchShop/Meshes",
".bin", false
));
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_QuidditchShop/Collision",
".bin", false
));
}
{ /* BLDG_HogsheadInn */
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_HogsheadInn/Meshes",
".bin", false
));
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_HogsheadInn/Collision",
".bin", false
));
}
{ /* BLDG_Honeydukes */
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Honeydukes/Meshes",
".bin", false
));
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Honeydukes/Collision",
".bin", false
));
}
{ /* BLDG_OwlPost */
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_OwlPost/Meshes",
".bin", false
));
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_OwlPost/Collision",
".bin", false
));
}
{ /* BLDG_TeaShop */
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TeaShop/Meshes",
".bin", false
));
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TeaShop/Collision",
".bin", false
));
}
{ /* BLDG_Zonkos */
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Zonkos/Meshes",
".bin", false
));
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Zonkos/Collision",
".bin", false
));
}
{ /* BLDG_DB_GR */
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_DB_GR/Meshes",
".bin", false
));
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_DB_GR/Collision",
".bin", false
));
}
{ /* BLDG_Potions */
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Potions/Meshes",
".bin", false
));
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Potions/Collisions",
".bin", false
));
}
{ /* BLDG_Salon */
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Salon/Meshes",
".bin", false
));
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Salon/Collision",
".bin", false
));
}
{ /* Hengist_Tree */
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Vegetation/Hengist_Tree",
".bin", false
));
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Collision/Vegetation",
".bin", false
));
}
{ /* GEN A*/
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_A/Meshes",
".bin", false
));
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_A/Collision",
".bin", false
));
}
{ /* GEN B*/
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_B/Meshes",
".bin", false
));
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_B/Collision",
".bin", false
));
}
{ /* GEN C*/
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_C/Meshes",
".bin", false
));
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_C/Collision",
".bin", false
));
}
{ /* GEN E*/
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_E/Meshes",
".bin", false
));
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_E/Collision",
".bin", false
));
}
{ /* GEN F*/
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_F/Meshes",
".bin", false
));
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_F/Collision",
".bin", false
));
}
{ /* GEN G*/
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_G/Meshes",
".bin", false
));
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_G/Collision",
".bin", false
));
}
{ /* GEN H*/
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_H/Meshes",
".bin", false
));
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_H/Collision",
".bin", false
));
}
{ /* GEN J*/
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_J/Meshes",
".bin", false
));
jobMapModels.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_J/Collision",
".bin", false
));
}
}
#pragma endregion
#pragma region UI
Asset_FileLoad("../Bin/Resources/Textures/Keyboard", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath)
@@ -456,6 +700,29 @@ HRESULT CLoader::Loading_For_GamePlay()
m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다.");
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_UIEDITOR,
CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl"),
VTXPOSTEX::Elements, VTXPOSTEX::iNumElements)))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_UIINSTANCE,
CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl"),
VTX_POSTEX_INSTANCE_UI::Elements, VTX_POSTEX_INSTANCE_UI::iNumElements)))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_INSTANCE_MODEL,
CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl"),
VTX_MODEL_INSTANCE_PARTICLE::Elements, VTX_MODEL_INSTANCE_PARTICLE::iNumElements)))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_INSTANCE_PROP_MODEL,
CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxWorldModelInstance.hlsl"),
VTX_MODEL_INSTANCE_MODEL::Elements, VTX_MODEL_INSTANCE_MODEL::iNumElements)))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_VTXPOS,
CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxPos.hlsl"),
VTXPOS::Elements, VTXPOS::iNumElements)))) {
@@ -506,31 +773,6 @@ HRESULT CLoader::Loading_For_GamePlay()
return E_FAIL;
}
m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다.");
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_UIEDITOR,
CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl"),
VTXPOSTEX::Elements, VTXPOSTEX::iNumElements)))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_UIINSTANCE,
CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl"),
VTX_POSTEX_INSTANCE_UI::Elements, VTX_POSTEX_INSTANCE_UI::iNumElements)))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_INSTANCE_MODEL,
CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl"),
VTX_MODEL_INSTANCE_PARTICLE::Elements, VTX_MODEL_INSTANCE_PARTICLE::iNumElements)))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_INSTANCE_PROP_MODEL,
CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxWorldModelInstance.hlsl"),
VTX_MODEL_INSTANCE_MODEL::Elements, VTX_MODEL_INSTANCE_MODEL::iNumElements)))) {
return E_FAIL;
}
// Heavy Wall
CRigidBody_Dynamic::RIGIDBODY_PROTOTYPE_DYNAMIC_DESC Desc{};
@@ -548,8 +790,6 @@ HRESULT CLoader::Loading_For_GamePlay()
Desc.vAutoDamping = { 100.f, 100.f };
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_HEAVY_WALL"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) {
return E_FAIL;
}
@@ -582,9 +822,6 @@ HRESULT CLoader::Loading_For_GamePlay()
#pragma endregion
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Wand_Model"),
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Wand/Wand.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixRotationX(XMConvertToRadians(-90.f)) * XMMatrixIdentity()))))
return E_FAIL;
@@ -644,11 +881,6 @@ HRESULT CLoader::Loading_For_GamePlay()
m_strMessage = TEXT("Model Loading..");
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_SkyboxModel"),
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/SkyBox/SkyBox.bin", XMMatrixIdentity()))))
return E_FAIL;
Asset_FileLoad("../Bin/Resources/Models/Effect/ParticleMesh", L"Prototype_Instance_Model_", [&](_wstring wstrFileName, const _char* pFilePath) {
if (FAILED(m_pGameInstance->Add_Asset_Prototype(NEXT_LEVEL, wstrFileName,
@@ -679,326 +911,6 @@ HRESULT CLoader::Loading_For_GamePlay()
});
#pragma region MAP_MODELS
vector<future<void>> jobFutures;
_uint iLoadCount = 46;
vector<vector<FOLDER_LOAD*>*> Contents(iLoadCount);
{
{ /* Terrain */
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Collision/Terrain",
".bin", false,
&Contents[jobFutures.size()]
));
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Terrain",
".bin", false,
&Contents[jobFutures.size()]
));
}
{ /* Ollivanders*/
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Ollivanders/Meshes",
".bin", false,
&Contents[jobFutures.size()]
));
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Ollivanders/Collision",
".bin", false,
&Contents[jobFutures.size()]
));
}
{ /* Gatehouse*/
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Gatehouse/Meshes",
".bin", false,
&Contents[jobFutures.size()]
));
}
{ /* TScrolls */
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TScrolls/Meshes",
".bin", false,
&Contents[jobFutures.size()]
));
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TScrolls/Collisions",
".bin", false,
&Contents[jobFutures.size()]
));
}
{ /* 3BroomStick*/
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_ThreeBroomsticks/Meshes",
".bin", false,
&Contents[jobFutures.size()]
));
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_ThreeBroomsticks/Collision",
".bin", false,
&Contents[jobFutures.size()]
));
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_ThreeBroomsticks/Meshes/3Broom_Kit",
".bin", false,
&Contents[jobFutures.size()]
));
}
{ /* BLDG_QuidditchShop */
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_QuidditchShop/Meshes",
".bin", false,
&Contents[jobFutures.size()]
));
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_QuidditchShop/Collision",
".bin", false,
&Contents[jobFutures.size()]
));
}
{ /* BLDG_HogsheadInn */
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_HogsheadInn/Meshes",
".bin", false,
&Contents[jobFutures.size()]
));
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_HogsheadInn/Collision",
".bin", false,
&Contents[jobFutures.size()]
));
}
{ /* BLDG_Honeydukes */
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Honeydukes/Meshes",
".bin", false,
&Contents[jobFutures.size()]
));
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Honeydukes/Collision",
".bin", false,
&Contents[jobFutures.size()]
));
}
{ /* BLDG_OwlPost */
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_OwlPost/Meshes",
".bin", false,
&Contents[jobFutures.size()]
));
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_OwlPost/Collision",
".bin", false,
&Contents[jobFutures.size()]
));
}
{ /* BLDG_TeaShop */
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TeaShop/Meshes",
".bin", false,
&Contents[jobFutures.size()]
));
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TeaShop/Collision",
".bin", false,
&Contents[jobFutures.size()]
));
}
{ /* BLDG_Zonkos */
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Zonkos/Meshes",
".bin", false,
&Contents[jobFutures.size()]
));
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Zonkos/Collision",
".bin", false,
&Contents[jobFutures.size()]
));
}
{ /* BLDG_DB_GR */
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_DB_GR/Meshes",
".bin", false,
&Contents[jobFutures.size()]
));
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_DB_GR/Collision",
".bin", false,
&Contents[jobFutures.size()]
));
}
{ /* BLDG_Potions */
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Potions/Meshes",
".bin", false,
&Contents[jobFutures.size()]
));
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Potions/Collisions",
".bin", false,
&Contents[jobFutures.size()]
));
}
{ /* BLDG_Salon */
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Salon/Meshes",
".bin", false,
&Contents[jobFutures.size()]
));
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Salon/Collision",
".bin", false,
&Contents[jobFutures.size()]
));
}
{ /* Hengist_Tree */
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Vegetation/Hengist_Tree",
".bin", false,
&Contents[jobFutures.size()]
));
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Collision/Vegetation",
".bin", false,
&Contents[jobFutures.size()]
));
}
{ /* GEN A*/
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_A/Meshes",
".bin", false,
&Contents[jobFutures.size()]
));
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_A/Collision",
".bin", false,
&Contents[jobFutures.size()]
));
}
{ /* GEN B*/
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_B/Meshes",
".bin", false,
&Contents[jobFutures.size()]
));
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_B/Collision",
".bin", false,
&Contents[jobFutures.size()]
));
}
{ /* GEN C*/
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_C/Meshes",
".bin", false,
&Contents[jobFutures.size()]
));
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_C/Collision",
".bin", false,
&Contents[jobFutures.size()]
));
}
{ /* GEN E*/
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_E/Meshes",
".bin", false,
&Contents[jobFutures.size()]
));
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_E/Collision",
".bin", false,
&Contents[jobFutures.size()]
));
}
{ /* GEN F*/
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_F/Meshes",
".bin", false,
&Contents[jobFutures.size()]
));
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_F/Collision",
".bin", false,
&Contents[jobFutures.size()]
));
}
{ /* GEN G*/
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_G/Meshes",
".bin", false,
&Contents[jobFutures.size()]
));
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_G/Collision",
".bin", false,
&Contents[jobFutures.size()]
));
}
{ /* GEN H*/
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_H/Meshes",
".bin", false,
&Contents[jobFutures.size()]
));
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_H/Collision",
".bin", false,
&Contents[jobFutures.size()]
));
}
{ /* GEN J*/
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_J/Meshes",
".bin", false,
&Contents[jobFutures.size()]
));
jobFutures.emplace_back(Deferred_FolderLoad(
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_J/Collision",
".bin", false,
&Contents[jobFutures.size()]
));
}
}
for (auto& jobFuture : jobFutures)
{
jobFuture.get();
}
for (_uint i = 0; i < Contents.size(); ++i) {
for (_uint j = 0; j < (Contents[i])->size(); ++j) {
FOLDER_LOAD* pContents = (*Contents[i])[j];
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pModelTag, pContents->pLoadedModel))) {
return E_FAIL;
}
for (_uint k = 0; k < pContents->pRigidBodyTags.size(); ++k) {
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pRigidBodyTags[k], pContents->LoadedRigidBody[k]))) {
return E_FAIL;
}
}
}
}
for (_uint i = 0; i < Contents.size(); ++i) {
for (_uint j = 0; j < (Contents[i])->size(); ++j) {
Safe_Delete((*Contents[i])[j]);
}
Safe_Delete(Contents[i]);
}
#pragma endregion
m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다.");
@@ -1186,8 +1098,6 @@ HRESULT CLoader::Loading_For_GamePlay()
if (FAILED(m_pGameInstance->Add_Prototype<CFSM>(g_iStaticLevel, CFSM::Create(m_pDevice, m_pContext))))
return E_FAIL;
/* For.Prototype_GameObject_Camera_Gaze */
if (FAILED(m_pGameInstance->Add_Prototype<CCamera_Gaze>(g_iStaticLevel, CCamera_Gaze::Create(m_pDevice, m_pContext))))
return E_FAIL;
@@ -1233,6 +1143,31 @@ HRESULT CLoader::Loading_For_GamePlay()
return E_FAIL;
}
#pragma region RECEIVE_THREAD
{ // MapModels
_uint iIndex = 0;
for (auto& JobMapModels : jobMapModels)
{
vector<FOLDER_LOAD*>* pOut = JobMapModels.get();
for (_uint i = 0; i < pOut->size(); ++i) {
FOLDER_LOAD* pContents = (*pOut)[i];
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pModelTag, pContents->pLoadedModel))) {
return E_FAIL;
}
for (_uint j = 0; j < pContents->pRigidBodyTags.size(); ++j) {
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pRigidBodyTags[j], pContents->LoadedRigidBody[j]))) {
return E_FAIL;
}
}
Safe_Delete(pContents);
}
iIndex++;
Safe_Delete(pOut);
}
}
#pragma endregion
m_strMessage = TEXT("정보를 불러오는 중입니다.");
m_strMessage = TEXT("로딩이 완료되었습니다..");
@@ -1310,18 +1245,18 @@ HRESULT CLoader::Asset_FileLoad(const _char* pDirectoryPath, const _tchar* pPreN
return S_OK;
}
void APIENTRY Deferred_FolderLoad_Main(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pDirectoryPath, const _char* pFileExt, _bool bUseTag, vector<FOLDER_LOAD*>** OutContents)
vector<FOLDER_LOAD*>* APIENTRY Deferred_FolderLoad_Main(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pDirectoryPath, const _char* pFileExt, _bool bUseTag)
{
if (FAILED(CoInitializeEx(nullptr, 0))) {
return;
return nullptr;
}
if (!filesystem::exists(pDirectoryPath)) {
MSG_BOX(" 경로 이상해 ");
return;
return nullptr;
}
*OutContents = new vector<FOLDER_LOAD*>;
vector<FOLDER_LOAD*>* pOut = new vector<FOLDER_LOAD*>;
for (const auto& file : filesystem::directory_iterator(pDirectoryPath))
{
if (file.is_directory()) { continue; }
@@ -1336,7 +1271,7 @@ void APIENTRY Deferred_FolderLoad_Main(ID3D11Device* pDevice, ID3D11DeviceContex
_wstring wstrFileName = L"Prototype_GameObject_" + file.path().stem().wstring();
CModel* pModel = CModel::Create(pDevice, pContext, MODEL::ENVIROMENT, szFilePath);
_uint iNumMesh = pModel->Get_NumMeshes();
{
@@ -1363,17 +1298,17 @@ void APIENTRY Deferred_FolderLoad_Main(ID3D11Device* pDevice, ID3D11DeviceContex
pContents->LoadedRigidBody.emplace_back(CRigidBody_Static::Create(pDevice, pContext, Desc));
}
}
(*OutContents)->emplace_back(pContents);
(*pOut).emplace_back(pContents);
}
(*OutContents)->shrink_to_fit();
(*pOut).shrink_to_fit();
CoUninitialize();
return;
return pOut;
}
future<void> CLoader::Deferred_FolderLoad(const _char* pDirectoryPath, const _char* pFileExt, _bool bUseTag, vector<FOLDER_LOAD*>** OutContents)
future<vector<FOLDER_LOAD*>*> CLoader::Deferred_FolderLoad(const _char* pDirectoryPath, const _char* pFileExt, _bool bUseTag)
{
return m_pGameInstance->EnqueueJob(&Deferred_FolderLoad_Main, m_pDevice, m_pContext, pDirectoryPath, pFileExt, bUseTag, OutContents);
return m_pGameInstance->EnqueueJob(&Deferred_FolderLoad_Main, m_pDevice, m_pContext, pDirectoryPath, pFileExt, bUseTag);
}
pair<_wstring, CModel*>* APIENTRY Deferred_ModelLoad_Main(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, const _char* pDirectoryPath, const _tchar* pPrototypeTag, _fmatrix PreTransform)
+3 -3
View File
@@ -60,11 +60,11 @@ HRESULT CPlayer::Initialize(void* pArg)
Load_KeyFrame();
#endif // _DEBUG
m_pBroom = static_cast<CBroom*>(pArg);
SAFE_ADDREF(m_pBroom);
m_pBroom = m_pGameInstance->Get_Layer(NEXT_LEVEL, LAYER_ITEM)->Get_Object<CBroom>();
m_pBroomModel = m_pBroom->Get_Component<CModel>();
SAFE_ADDREF(m_pBroomModel);
m_pBroomTransform = m_pBroom->Get_Component<CTransform>();
SAFE_ADDREF(m_pBroom);
SAFE_ADDREF(m_pBroomModel);
SAFE_ADDREF(m_pBroomTransform);
Add_FSM();
+3
View File
@@ -93,7 +93,10 @@ void CTroll::Update(_float fTimeDelta)
}
}
#ifdef _DEBUG
Describe_Entity();
#endif // _DEBUG
}
void CTroll::Late_Update(_float fTimeDelta)
@@ -55,6 +55,8 @@ namespace Client {
#define LAYER_DOT TEXT("Layer_Dot")
#define LAYER_CELL TEXT("Layer_Cell")
#define LAYER_TRIGGER TEXT("Layer_Trigger")
#define LAYER_ITEM TEXT("Layer_Item")
#define LAYER_EFFECTPOOL TEXT("Layer_EffectPool")
#define LAYER_LIGHT TEXT("Layer_Light")
#define LAYER_MAPOBJECTMANAGER TEXT("Layer_MapObjectManager")
+1 -1
View File
@@ -40,7 +40,7 @@ class CLoader final : public CBase
private:
HRESULT Asset_FileLoad(const _char* pDirectoryPath, const _tchar* pPreName, function<HRESULT(_wstring, const _char*)> AddPrototypeEvent);
future<void> Deferred_FolderLoad(const _char* pDirectoryPath, const _char* pFileExt, _bool bUseTag, vector<FOLDER_LOAD*>** OutContents);
future<vector<FOLDER_LOAD*>*> Deferred_FolderLoad(const _char* pDirectoryPath, const _char* pFileExt, _bool bUseTag);
future<pair<_wstring, CModel*>*> Deferred_ModelLoad(MODEL eType, const _char* pDirectoryPath, _fmatrix PreTransform, const _tchar* pPrototypeTag);
public:
static CLoader* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eNextLevelID);
@@ -269,7 +269,6 @@ call Update_Lib.bat
</ClCompile>
<ClCompile Include="..\Private\Key_Manager.cpp" />
<ClCompile Include="..\Private\Layer.cpp" />
<ClCompile Include="..\Private\LerpAnim.cpp" />
<ClCompile Include="..\Private\Level.cpp" />
<ClCompile Include="..\Private\Level_Manager.cpp" />
<ClCompile Include="..\Private\Light.cpp" />
@@ -522,7 +521,6 @@ call Update_Lib.bat
<ClInclude Include="..\Public\IMGUI\imstb_truetype.h" />
<ClInclude Include="..\Public\Key_Manager.h" />
<ClInclude Include="..\Public\Layer.h" />
<ClInclude Include="..\Public\LerpAnim.h" />
<ClInclude Include="..\Public\Level.h" />
<ClInclude Include="..\Public\Level_Manager.h" />
<ClInclude Include="..\Public\Light.h" />
@@ -178,9 +178,6 @@
<Filter Include="02.Element\02.Component\06.Model\Animation\Channel">
<UniqueIdentifier>{3625aad6-89b2-490e-bd9c-3cff284605e4}</UniqueIdentifier>
</Filter>
<Filter Include="02.Element\02.Component\06.Model\LerpAnim">
<UniqueIdentifier>{92ec7ae6-14ee-455c-a3ad-378e46f3b1f0}</UniqueIdentifier>
</Filter>
<Filter Include="02.Element\02.Component\02.VIBuffer\Cube">
<UniqueIdentifier>{be0d499e-e4cf-4dde-92a0-a0904e713045}</UniqueIdentifier>
</Filter>
@@ -462,9 +459,6 @@
<ClCompile Include="..\Private\Channel.cpp">
<Filter>02.Element\02.Component\06.Model\Animation\Channel</Filter>
</ClCompile>
<ClCompile Include="..\Private\LerpAnim.cpp">
<Filter>02.Element\02.Component\06.Model\LerpAnim</Filter>
</ClCompile>
<ClCompile Include="..\Private\VIBuffer_Cube.cpp">
<Filter>02.Element\02.Component\02.VIBuffer\Cube</Filter>
</ClCompile>
@@ -1094,9 +1088,6 @@
<ClInclude Include="..\Public\Channel.h">
<Filter>02.Element\02.Component\06.Model\Animation\Channel</Filter>
</ClInclude>
<ClInclude Include="..\Public\LerpAnim.h">
<Filter>02.Element\02.Component\06.Model\LerpAnim</Filter>
</ClInclude>
<ClInclude Include="..\Public\VIBuffer_Cube.h">
<Filter>02.Element\02.Component\02.VIBuffer\Cube</Filter>
</ClInclude>
+4 -6
View File
@@ -29,9 +29,7 @@ CAnimation::CAnimation(const CAnimation& rhs)
, m_fTempTrack{rhs.m_fTempTrack }
{
memcpy_s(m_TickPerSeconds, sizeof(_float) * 2, rhs.m_TickPerSeconds, sizeof(_float) * 2);
strcpy_s(m_szName, sizeof(m_szName), rhs.m_szName);
for (auto& pChannel : m_Channels) {
SAFE_ADDREF(pChannel);
}
@@ -359,7 +357,6 @@ void CAnimation::CreateGPUData(ID3D11Device* pDevice)
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;
@@ -368,6 +365,7 @@ HRESULT CAnimation::Initialize(const vector<CBone*>& Bones, const aiAnimation* p
pos++;
}
m_strName = m_strName.substr(pos);
m_strName.shrink_to_fit();
m_fDuration = (_float)pAIAnimation->mDuration;
m_TickPerSeconds[0] = (_float)pAIAnimation->mTicksPerSecond;
@@ -406,8 +404,8 @@ CAnimation* CAnimation::Create(const vector<CBone*>& Bones, const aiAnimation* p
HRESULT CAnimation::Initialize(const vector<CBone*>& Bones, const CModel* pModel, SaveAnimation* pSaveAnimation)
{
m_pSaveAnim = pSaveAnimation;
strcpy_s(m_szName, pSaveAnimation->AnimName.c_str());
m_strName = pSaveAnimation->AnimName;
m_strName.shrink_to_fit();
m_fDuration = pSaveAnimation->mDuration;
m_fTickPerSecond = pSaveAnimation->mTicksPerSecond;
+9 -10
View File
@@ -8,7 +8,7 @@ CBone::CBone()
CBone::CBone(const CBone& other):
CBase()
{
memcpy_s(m_szName, sizeof(_char) * MAX_PATH, other.m_szName, sizeof(_char) * MAX_PATH);
m_strName = other.m_strName;
m_TransformationMatrix = other.m_TransformationMatrix;
m_CombinedTransformationMatrix = other.m_CombinedTransformationMatrix;
m_iParentBoneIndex = other.m_iParentBoneIndex;
@@ -55,11 +55,10 @@ _float3 CBone::Get_LocalPosition()
#ifdef EDITOR_PROJECT
HRESULT CBone::SaveAsBinary(HANDLE hFile, DWORD& dwByte)
{
string strName = m_szName;
strName.shrink_to_fit();
DWORD iLength = (DWORD)strName.length();
m_strName.shrink_to_fit();
DWORD iLength = (DWORD)m_strName.length();
WriteFile(hFile, &iLength, sizeof(_uint), &dwByte, nullptr);
WriteFile(hFile, strName.data(), iLength, &dwByte, nullptr);
WriteFile(hFile, m_strName.data(), iLength, &dwByte, nullptr);
WriteFile(hFile, &m_iParentBoneIndex, sizeof(_int), &dwByte, nullptr);
WriteFile(hFile, &m_TransformationMatrix, sizeof(_float4x4), &dwByte, nullptr);
WriteFile(hFile, &m_matInitial, sizeof(_float4x4), &dwByte, nullptr);
@@ -82,8 +81,8 @@ CBone* CBone::Create(const aiNode* pAINode, _int iParentIndex)
HRESULT CBone::Initialize(const aiNode* pAINode, _int iParentIndex)
{
strcpy_s(m_szName, pAINode->mName.data);
m_strName = pAINode->mName.data;
m_strName.shrink_to_fit();
m_iParentBoneIndex = iParentIndex;
memcpy(&m_TransformationMatrix, &pAINode->mTransformation, sizeof(_float4x4));
@@ -114,7 +113,8 @@ HRESULT CBone::Initialize(HANDLE hFile, DWORD& dwByte)
if (!ReadFile(hFile, &iLength, sizeof(_uint), &dwByte, nullptr)) {
return E_FAIL;
}
if (!ReadFile(hFile, m_szName, iLength, &dwByte, nullptr)) {
m_strName.resize(iLength);
if (!ReadFile(hFile, m_strName.data(), iLength, &dwByte, nullptr)) {
return E_FAIL;
}
if (!ReadFile(hFile, &m_iParentBoneIndex, sizeof(_int), &dwByte, nullptr)) {
@@ -134,8 +134,7 @@ HRESULT CBone::Initialize(HANDLE hFile, DWORD& dwByte)
HRESULT CBone::Initialize(const SaveNode& _SaveNode, _int iParentIndex)
{
strcpy_s(m_szName, _SaveNode.NodeName.c_str());
m_strName = _SaveNode.NodeName;
m_iParentBoneIndex = iParentIndex;
memcpy(&m_TransformationMatrix, &_SaveNode.Transformation, sizeof(_float4x4));
+8 -8
View File
@@ -11,9 +11,9 @@ CChannel::CChannel()
#ifdef EDITOR_PROJECT
HRESULT CChannel::Initialize(const vector<CBone*>& Bones, const aiNodeAnim* pAIChannel)
{
strcpy_s(m_szName, pAIChannel->mNodeName.data);
m_iBoneIndex = CModel::Get_BoneIndex(m_szName, Bones);
m_strName = pAIChannel->mNodeName.data;
m_strName.shrink_to_fit();
m_iBoneIndex = CModel::Get_BoneIndex(m_strName.c_str(), Bones);
if (-1 == m_iBoneIndex) {
return E_FAIL;
}
@@ -102,8 +102,8 @@ CHANNEL_DESC CChannel::Fill_GPU_ChannelDesc()
HRESULT CChannel::Initialize(const vector<CBone*>& Bones, _uint iIndex)
{
m_iBoneIndex = iIndex;
memcpy_s(m_szName, sizeof(_char) * MAX_PATH, Bones[iIndex]->Get_Name(), sizeof(_char) * MAX_PATH);
m_strName = Bones[iIndex]->Get_Name();
m_strName.shrink_to_fit();
m_iNumKeyFrames = 2;
m_KeyFrames.resize(m_iNumKeyFrames);
@@ -191,9 +191,9 @@ void CChannel::Set_Frame(_uint iIndex, KEYFRAME& kf)
HRESULT CChannel::Initialize(const CModel* pModel, SaveChannel* pSaveChannel)
{
strcpy_s(m_szName, pSaveChannel->ChannelName.c_str());
m_iBoneIndex = pModel->Get_BoneIndex(m_szName);
m_strName = pSaveChannel->ChannelName;
m_strName.shrink_to_fit();
m_iBoneIndex = pModel->Get_BoneIndex(m_strName.c_str());
m_PreTransformMatrix = pModel->Get_PreTransformMatrix();
m_iNumKeyFrames = max(pSaveChannel->ScalingKeyCount, pSaveChannel->RotationKeyCount);
@@ -324,7 +324,7 @@ HRESULT CCharacter_Controller::Initialize(void* pArg)
Desc.reportCallback = pDesc->pCallback_HitReport;
Desc.behaviorCallback = pDesc->pCallback_Behavior;
Desc.slopeLimit = cosf(XMConvertToRadians(m_fWalkableSlopeDegree));
Desc.nonWalkableMode = PSX::PxControllerNonWalkableMode::ePREVENT_CLIMBING;
Desc.nonWalkableMode = PSX::PxControllerNonWalkableMode::ePREVENT_CLIMBING_AND_FORCE_SLIDING;
Desc.material = m_pGameInstance->Create_Material(&pDesc->fMaterial);
m_pController = m_pGameInstance->Add_BoxController(Desc);
m_pController->setUserData(&m_tagData);
@@ -340,7 +340,7 @@ HRESULT CCharacter_Controller::Initialize(void* pArg)
Desc.reportCallback = pDesc->pCallback_HitReport;
Desc.behaviorCallback = pDesc->pCallback_Behavior;
Desc.slopeLimit = cosf(XMConvertToRadians(m_fWalkableSlopeDegree));
Desc.nonWalkableMode = PSX::PxControllerNonWalkableMode::ePREVENT_CLIMBING;
Desc.nonWalkableMode = PSX::PxControllerNonWalkableMode::ePREVENT_CLIMBING_AND_FORCE_SLIDING;
Desc.material = m_pGameInstance->Create_Material(&pDesc->fMaterial);
m_pController = m_pGameInstance->Add_CapsuleController(Desc);
m_pController->setUserData(&m_tagData);
@@ -49,7 +49,7 @@ HRESULT CGameInstance::Initialize_Engine(const ENGINE_DESC& EngineDesc, ID3D11De
}
}
}
m_pThreadHolder = CThreadHolder::Create(4);
m_pThreadHolder = CThreadHolder::Create( 12 );
if (nullptr == m_pThreadHolder) {
return E_FAIL;
}
@@ -647,15 +647,19 @@ void CGameInstance::Add_ModelToMap(const _char* filePath, CModel* pModel)
void CGameInstance::Add_SaveModel(const _char* filePath, SaveModel sModel)
{
lock_guard<mutex> lock(m_mtxLoadModelLock);
m_sModelMap[filePath] = sModel;
}
SaveModel* CGameInstance::Load_SaveModel(const _char* filePath)
{
m_mtxLoadModelLock.lock();
auto iter = m_sModelMap.find(filePath);
m_mtxLoadModelLock.unlock();
return &iter->second;
lock_guard<mutex> lock(m_mtxLoadModelLock);
map<const _char*, SaveModel>::iterator iter = m_sModelMap.find(filePath);
if (iter == m_sModelMap.end()) {
return nullptr;
}
SaveModel* pOut = &iter->second;
return pOut;
}
#pragma region PhysX_Manager
@@ -1,94 +0,0 @@
#include "pch.h"
#include "LerpAnim.h"
#include "Channel.h"
#include "Bone.h"
CLerpAnim::CLerpAnim()
{
}
_bool CLerpAnim::Update_TransformationMatrices(const vector<CBone*>& Bones, _float fTimeDelta)
{
m_fCurrentTrackPosition += m_fTickPerSecond * fTimeDelta;
if (m_fCurrentTrackPosition >= m_fDuration) {
m_fCurrentTrackPosition = m_fDuration;
m_bLerping = false;
return false;
}
/*_uint iIndex = {};
for (auto& pChannel : m_Channels) {
if (true == m_Movable[iIndex]) {
pChannel->Update_TransformationMatirx(Bones, m_fCurrentTrackPosition, &m_CurrentKeyFrameIndices[iIndex]);
}
iIndex++;
}*/
return true;
}
HRESULT CLerpAnim::Initialize(_uint iNumBone, _float fTickPerSecond, const vector<CBone*>& Bones)
{
m_iNumChannels = iNumBone;
m_fTickPerSecond = fTickPerSecond;
m_CurrentKeyFrameIndices.resize(m_iNumChannels);
m_Movable.resize(m_iNumChannels);
m_InitialFrames.resize(m_iNumChannels);
m_Channels.reserve(m_iNumChannels);
return S_OK;
}
void CLerpAnim::Begin(const vector<class CBone*>& Bones, vector<LERPDESC>& StartFrames, vector<LERPDESC>& EndFrames, _float fDuration, _uint iRootBoneIndex)
{
{ // 초기화
//KEYFRAME kf = { // 항등행렬의 키프레임
// { 1.f, 1.f, 1.f },
// { 0.f, 0.f, 0.f, 1.f },
// { 0.f, 0.f, 0.f},
// m_fDuration };
m_bLerping = true;
m_fDuration = fDuration;
m_fCurrentTrackPosition = 0.f;
for (_uint i = 0; i < m_iNumChannels; ++i) {
m_Channels[i]->Set_Frame(1, m_InitialFrames[i]); // 끝프레임을 초기 값으로 채우기
}
fill(m_CurrentKeyFrameIndices.begin(), m_CurrentKeyFrameIndices.end(), 0);
fill(m_Movable.begin(), m_Movable.end(), false);
}
{ // 실제 값 채우기
for (LERPDESC& Desc : EndFrames) // 끝프레임을 실제 값으로 채우기
{
_int iIndex = Desc.iSlot;
Desc.tagKeyFrame.fTrackPosition = m_fDuration;
m_Channels[iIndex]->Set_Frame(1, Desc.tagKeyFrame);
}
for (_uint i = 0; i < StartFrames.size(); ++i) { // 시작 프레임을 현재 본 상태 키프레임으로 채우기
_int iIndex = StartFrames[i].iSlot;
m_Movable[iIndex] = true;
m_Channels[iIndex]->Set_Frame(0, StartFrames[i].tagKeyFrame);
}
//m_Movable[iRootBoneIndex] = false;
}
}
CLerpAnim* CLerpAnim::Create(_uint iNumBone, _float fTickPerSecond, const vector<CBone*>& Bones)
{
CLerpAnim* pInstance = new CLerpAnim;
if (FAILED(pInstance->Initialize(iNumBone, fTickPerSecond, Bones))) {
SAFE_RELEASE(pInstance);
}
return pInstance;
}
void CLerpAnim::Free()
{
__super::Free();
for (auto& pChannel : m_Channels) {
SAFE_RELEASE(pChannel);
}
m_Channels.clear();
m_CurrentKeyFrameIndices.clear();
}
;
+7 -5
View File
@@ -57,7 +57,8 @@ HRESULT CMesh::Render_Indexed(_uint IndexCount, _uint StartIndexLocation, _uint
#ifdef EDITOR_PROJECT
HRESULT CMesh::Initialize_Prototype(MODEL eType, vector<class CBone*>& Bones, const aiMesh* pAIMesh, _fmatrix& PreTransformMatrix)
{
strcpy_s(m_szName, pAIMesh->mName.data);
m_strName = pAIMesh->mName.data;
m_strName.shrink_to_fit();
m_iMaterialIndex = pAIMesh->mMaterialIndex;
m_iNumVertexBuffers = 1;
@@ -151,7 +152,8 @@ HRESULT CMesh::Render_Instance(_uint iNumInstance)
HRESULT CMesh::Initialize_Prototype(MODEL eType, const CModel* pModel, SaveMesh* _SaveMesh, _fmatrix PreTransformMatrix)
{
strcpy_s(m_szName, _SaveMesh->MeshName.c_str());
m_strName = _SaveMesh->MeshName;
m_strName.shrink_to_fit();
m_iMaterialIndex = _SaveMesh->MaterialIndex;
m_iNumVertexBuffers = 1;
@@ -317,7 +319,7 @@ HRESULT CMesh::Ready_VertexBuffer_For_Anim(const CModel* pModel, SaveMesh* _Save
for (_uint i = 0; i < m_iNumBones; i++)
{
SaveBone _SaveBone = _SaveMesh->Bones[i];
strcpy_s(m_szName, _SaveBone.BoneName.c_str());
m_strName = _SaveBone.BoneName;
memcpy(&OffsetMatrix, &_SaveBone.OffsetMatrix, sizeof(_float4x4));
@@ -361,7 +363,7 @@ HRESULT CMesh::Ready_VertexBuffer_For_Anim(const CModel* pModel, SaveMesh* _Save
{
m_iNumBones = 1;
m_BoneIndices.push_back(pModel->Get_BoneIndex(m_szName));
m_BoneIndices.push_back(pModel->Get_BoneIndex(m_strName.c_str()));
m_offsetMatrices.push_back(OffsetMatrix);
}
@@ -554,7 +556,7 @@ HRESULT CMesh::Ready_VertexBuffer_For_Anim(vector<class CBone*>& Bones, const ai
}
if (0 == m_iNumBones) {
m_iNumBones = 1;
m_BoneIndices.push_back(CModel::Get_BoneIndex(m_szName, Bones));
m_BoneIndices.push_back(CModel::Get_BoneIndex(m_strName.c_str(), Bones));
m_offsetMatrices.push_back(OffSetMatrix);
}
+11 -10
View File
@@ -4,7 +4,6 @@
#include "Mesh.h"
#include "Material.h"
#include "Animation.h"
#include "LerpAnim.h"
#include "GameObject.h"
#include "Transform.h"
#include "ComputeShader.h"
@@ -24,7 +23,6 @@ CModel::CModel(const CModel& rhs)
m_Materials(rhs.m_Materials),
m_iNumMaterials(rhs.m_iNumMaterials),
m_iNumAnimations(rhs.m_iNumAnimations),
m_pLerpAnim(rhs.m_pLerpAnim),
m_fRadius(rhs.m_fRadius),
m_vRadiusOffset(rhs.m_vRadiusOffset)
{
@@ -525,7 +523,7 @@ void CModel::Set_CurrentTrackPosition(_float TrackPosition)
const _char* CModel::Get_AnimList(_uint iIndex)
{
return m_Animations[iIndex]->Get_SZName();
return m_Animations[iIndex]->Get_Name().c_str();
}
_float CModel::Get_CurrentTrackPosition()
@@ -882,7 +880,7 @@ _bool CModel::SaveAssimpModel(const _char* filename)
for (size_t i = 0; i < m_Materials.size(); i++)
{
modelData.Materials.push_back(m_Materials[i]->Get_SaveMaterial());
modelData.Materials.emplace_back(m_Materials[i]->Get_SaveMaterial());
}
std::vector<SaveNode> allNodes;
@@ -1372,6 +1370,9 @@ HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _
}
m_pSaveModel = m_pGameInstance->Load_SaveModel(pModelFilePath);
if (nullptr == m_pSaveModel) {
return S_OK;
}
LoadAdditionalAnimations(pModelFilePath);
@@ -1562,13 +1563,13 @@ _bool CModel::LoadData(const _char* filename)
NewModel.Materials.clear();
for (_uint i = 0; i < NewModel.MaterialCount; i++)
{
SaveMaterial mat;
SaveMaterial pMAt;
for (_uint k = 0; k < AI_TEXTURE_TYPE_MAX; k++)
{
_uint MaterialCount = 0;
fread(&MaterialCount, sizeof(_uint), 1, fp);
mat.Path[k].resize(MaterialCount);
pMAt.Path[k].resize(MaterialCount);
for (_uint j = 0; j < MaterialCount; j++)
{
_uint len = 0;
@@ -1576,11 +1577,11 @@ _bool CModel::LoadData(const _char* filename)
std::string temp;
temp.resize(len);
fread(&temp[0], sizeof(_char), len, fp);
mat.Path[k][j] = temp;
pMAt.Path[k][j] = temp;
}
}
NewModel.Materials.push_back(mat);
NewModel.Materials.push_back(pMAt);
}
if (MODEL::ENVIROMENT == m_eType)
@@ -1838,6 +1839,7 @@ void CModel::Free()
SAFE_RELEASE(m_pConstantBuffer);
SAFE_RELEASE(m_pParentBuffer);
SAFE_RELEASE(m_pLocalPosBuffer);
for (auto& pAnimation : m_Animations) {
SAFE_RELEASE(pAnimation);
}
@@ -1857,7 +1859,6 @@ void CModel::Free()
m_Bones.clear();
SAFE_RELEASE(m_pTransform);
SAFE_RELEASE(m_pLerpAnim);
m_SaveModel.clear();
@@ -1888,7 +1889,7 @@ void CModel::Describe_Entity()
for (_uint i = 0; i < m_iNumAnimations; ++i) {
name.clear();
name.append(m_Animations[i]->Get_SZName());
name.append(m_Animations[i]->Get_Name().c_str());
size_t pos = name.find_last_of('|');
if (0 > pos) { pos = 0; }
+1 -3
View File
@@ -31,7 +31,6 @@ 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 Set_CurrentTrackPosition(_float TrackPosition) { m_fCurrentTrackPosition = TrackPosition; }
_float Get_CurrentTrackPosition() { return m_fCurrentTrackPosition; }
_float Get_CurrentTrackProgressRatio() { return m_fTempTrack / m_fDurationSeconds;}
@@ -68,14 +67,13 @@ class ENGINE_DLL CAnimation : public CBase
private:
SaveAnimation* m_pSaveAnim = { nullptr };
_char m_szName[MAX_PATH] = {};
_float m_fTickPerSecond = {};
_float m_fAnimSpeed = {1.f};
_bool m_bPause = { FALSE }; // 애님퍼즈 인덱스
_string m_strName = {}; // 애님 이름
_float m_fCurrentTrackPosition = {}; // 현재 트랙 위치
_float m_fDuration = {}; // 트랙의 전체 길이
_bool m_bPause = { FALSE }; // 애님퍼즈 인덱스
_float m_TickPerSeconds[2] = { 0.f, 0.f }; // 초당 트랙 이동 거리
_uint m_iNumChannels = {}; // 영향을 받는 본의 수
_float m_fTempTrack = {};
+4 -4
View File
@@ -21,21 +21,21 @@ class ENGINE_DLL CBone final : public CBase
return XMStoreFloat4x4(&m_CombinedTransformationMatrix, newMatrix);
}
_bool Compare_Name(const _char* pBoneName) const {
return !strcmp(pBoneName, m_szName);
return !strcmp(pBoneName, m_strName.c_str());
}
void Get_KeyFrame(KEYFRAME& kf, _bool bIsCurrentFrame); // 현재 본의 로컬매트릭스를 캡쳐해서 키프레임으로 성분 분해하여 올려보낸다.
const _char* Get_Name() const { return m_szName; }
const _char* Get_Name() const { return m_strName.c_str(); }
_float3 Get_LocalPosition();
void Update_CombinedTransformationMatrix(const vector<CBone*>& Bones, _fmatrix PreTransformMatrix);
void Set_TransformationMatrix(_fmatrix TransformationMatrix); // 애니메이션에서 현재 로컬 매트릭스를 변경할 때 사용된다
_float4x4 Get_TransformationMatrix() { return m_TransformationMatrix; }
_int Get_ParentBoneIndex() { return m_iParentBoneIndex; }
private:
_char m_szName[MAX_PATH] = {}; // 본의 이름
_string m_strName = {};
_float4x4 m_TransformationMatrix = {}; // 본의 현재 로컬 매트릭스
_float4x4 m_CombinedTransformationMatrix = {}; // 본의 루트노드로부터 상대적인 복합매트릭스 ( 부모노드는 PreTranformMatrix와 월드좌표로부터 상대적임 )
_int m_iParentBoneIndex = { -1 }; // 부모본의 인덱스 ( 모델에 있는 본벡터의 인덱스 ) ( 부모는 인덱스 -1 고정 )
_float4x4 m_matInitial = {};
_int m_iParentBoneIndex = { -1 }; // 부모본의 인덱스 ( 모델에 있는 본벡터의 인덱스 ) ( 부모는 인덱스 -1 고정 )
private:
HRESULT Initialize(HANDLE hFile, DWORD& dwByte);
// 바이너리
+9 -11
View File
@@ -32,9 +32,9 @@ class ENGINE_DLL CChannel : public CBase
KEYFRAME* Get_Frame(_uint iIndex);
void Set_Frame(_uint iIndex, KEYFRAME& kf);
_bool Compare_Name(const _char* pChannelname) const {
return !strcmp(pChannelname, m_szName);
return !strcmp(pChannelname, m_strName.c_str());
}
_char* Get_Name() { return m_szName; }
const _char* Get_Name() { return m_strName.c_str(); }
private:
// 바이너리
HRESULT Initialize(const class CModel* pModel, SaveChannel* pSaveChannel);
@@ -51,23 +51,21 @@ class ENGINE_DLL CChannel : public CBase
private:
_char m_szName[MAX_PATH] = {}; // 영향을 받을 본의 이름
_string m_strName = {};
_int m_iBoneIndex = { -1 }; // 본 벡터에서 본의 인덱스
_uint m_iNumKeyFrames = {}; // Animation의 m_fDuration동안 이 본이 취해야할 키프레임의 갯수
_float4x4 m_PreTransformMatrix = {};
vector<KEYFRAME> m_KeyFrames; // 키프레임 벡터
_float3 m_vPrevRootPos = { 0.f, 0.f, 0.f };
_float4 m_vPrevRootRot = { 0.f, 0.f, 0.f,0.f };
_matrix m_BoneTransformationMatrix = {};
_bool m_bInitialRootPos = { false };
_bool m_bInitialRootRotSaved = {false};
_float4 m_vInitialRootRot = {};
_bool m_IsUpper = false;
_int m_ilayerIndex = 0;
_float4 m_vPrevRootRot = { 0.f, 0.f, 0.f,0.f };
_float4 m_vInitialRootRot = {};
_matrix m_BoneTransformationMatrix = {};
LOCALPOS_DESC LocalPos = {};
vector<KEYFRAME_DESC> m_KeyFrameDesc;
_bool m_bInitialRootPos = { false };
_bool m_bInitialRootRotSaved = { false };
_bool m_IsUpper = false;
public:
// 바이너리
static CChannel* Create(const class CModel* pModel, SaveChannel* pSaveChannel);
-36
View File
@@ -1,36 +0,0 @@
#pragma once
#include "Base.h"
NS_BEGIN(Engine)
class ENGINE_DLL CLerpAnim : public CBase
{
private:
CLerpAnim();
virtual ~CLerpAnim() = default;
public:
_bool IsLerping() { return m_bLerping; }
_bool Update_TransformationMatrices(const vector<class CBone*>& Bones, _float fTimeDelta);
HRESULT Initialize(_uint iNumBone, _float fTickPerSecond, const vector<class CBone*>& Bones);
void Begin(const vector<class CBone*>& Bones, vector<LERPDESC>& StartFrames, vector<LERPDESC>& EndFrames, _float fDuration, _uint iRootBoneIndex);
private:
_float m_fCurrentTrackPosition = {}; // 현재 트랙 위치
_float m_fTickPerSecond = {}; // 초당 트랙 이동 거리
_uint m_iNumChannels = {}; // 영향을 받는 본의 수
vector<class CChannel*> m_Channels; // 이 애니메이션이 영향을 준 사전 계산된 본의 배열
vector<KEYFRAME> m_InitialFrames; // 초기 프레임
vector<_uint> m_CurrentKeyFrameIndices; // 각 본이 현재 애니메이션에서 취해야할 키프레임 왼쪽 인덱스
vector<_bool> m_Movable; // 각 본이 럴프 도중 업데이트를 받아야할지 말아야할지 스위치
_bool m_bLerping = { false }; // 럴프 확인 부울
_float m_fDuration = { 0.25f }; // 럴프 주기
public:
static CLerpAnim* Create(_uint iNumBone, _float fTickPerSecond, const vector<class CBone*>& Bones);
virtual void Free() override;
};
NS_END
+2 -5
View File
@@ -16,7 +16,7 @@ class ENGINE_DLL CMesh final : public CVIBuffer
return m_iMaterialIndex;
}
const _char* Get_Name() const { return m_szName; }
const _char* Get_Name() const { return m_strName.c_str(); }
HRESULT Bind_BoneMatrices(const vector<class CBone*>& Bones, class CShader* pShader, const _char* pConstantName);
HRESULT Bind_BoneMatrices(_float4x4* pCombinedMatrices, class CShader* pShader, const _char* pConstantName);
HRESULT Render_Indexed(_uint IndexCount, _uint StartIndexLocation, _uint BaseVertexLocation);
@@ -44,11 +44,8 @@ class ENGINE_DLL CMesh final : public CVIBuffer
HRESULT Ready_VertexBuffer_For_NonAnim(SaveMesh* _SaveMesh, _fmatrix PreTransformMatrix);
HRESULT Ready_VertexBuffer_For_Anim(const class CModel* pModel, SaveMesh* _SaveMesh);
//
private:
_char m_szName[MAX_PATH] = {};
_string m_strName = { };
_uint m_iMaterialIndex = {};
_uint m_iNumBones = { };
_uint m_iStartIndex = {};
+25 -26
View File
@@ -102,22 +102,16 @@ class ENGINE_DLL CModel final : public CComponent
#endif // EDITOR_PROJECT
private:
#ifdef EDITOR_PROJECT
const aiScene* m_pAIScene = { nullptr };
Assimp::Importer m_Importer;
#endif
private:
MODEL m_eType = {}; // 모델의 타입
_float4x4 m_PreTransformMatrix = {}; // 사전에 루트본에 곱해줄 매트릭스
_uint m_iNumMeshes = {}; // 메쉬의 갯수
vector<class CMesh*> m_Meshes; // 메쉬의 벡터
_uint m_iNumPhysXMeshes = {}; // 피직스 메쉬의 갯수
vector<PSX::PxTriangleMesh*> m_TriMeshes = {}; // 피직스 메쉬의 갯수
_uint m_iNumPhysXMeshes = {}; // 피직스 메쉬의 갯수
_uint m_iNumMeshes = {}; // 메쉬의 갯수
_uint m_iNumMaterials = {}; // 머테리얼의 갯수
_float m_fAmount = { 1.f };
vector<class CMaterial*> m_Materials; // 머테리얼의 벡터
vector<class CBone*> m_Bones; // 본의 벡터, 정렬순서는 루트본부터 트리의 마지막 노드까지
@@ -128,33 +122,27 @@ class ENGINE_DLL CModel final : public CComponent
_bool m_bIsFinishedAnim = { false }; // 대상 애니메이션이 끝났는지
_bool m_bIsFinishedLerp = { false }; // 럴프 애니메이션이 끝났는지
_bool m_bPlayAnim = { true };
_float m_fAmount = { 1.f };
_int m_iPreAnimIndex = { -1 };
_float m_fBlendTime = { 0.f };
_float m_fBlendDuration = { 0.3f };
_float m_fRadius = { 0.f }; // 컬링용 Radius
_float3 m_vRadiusOffset = {}; // 컬링용 Radius Offset
_float m_fSecondBlendTime = {};
_float m_fSecondBlendDuration = { 0.3f };
_float m_fSecondRatio = {};
vector<class CAnimation*> m_Animations; // 애니메이션의 벡터,
class CLerpAnim* m_pLerpAnim = { nullptr }; // 럴프전용 애니메이션
_int m_iRootBoneIndex = { -1 }; // 루트본의 인덱스
_matrix m_PrevAnimationMatrix = XMMatrixIdentity(); // 루트본의 이전 위치
_matrix m_DeltaAnimationMatrix = {}; // 루트본의 델타애니메이션
class CTransform* m_pTransform = { nullptr }; // 모델 대상의 트랜스폼
_float m_fRatio = {};
_int m_iBoneIndex[ENUM_CLASS(BLEND_BONE::END)] = { -1,-1,-1,-1,-1,-1 };
_int m_iCurrSecondAnimIndex = { -1 };
_bool m_bIsSecondFinishedAnim = { false };
_bool m_bIsSecondLoop = { false };
_int m_iBoneIndex[ENUM_CLASS(BLEND_BONE::END)] = { -1,-1,-1,-1,-1,-1 };
vector<vector<_uint>> m_BoneMask;
_float m_fSecondBlendTime = {};
_float m_fSecondBlendDuration = {0.3f};
_float m_fSecondRatio = {};
// 바이너리
@@ -163,19 +151,29 @@ class ENGINE_DLL CModel final : public CComponent
//
vector<_float4x4> m_BoneMatrix;
_bool m_bRatio = { false };
_float3 m_vPrevRootPos = { 0.f, 0.f, 0.f };
_float4 m_vPrevRootRot = { 0.f, 0.f, 0.f,0.f };
_matrix m_BoneTransformationMatrix = {};
_bool m_bInitialRootPos = { false };
_bool m_bInitialRootRotSaved = { false };
_float4 m_vInitialRootRot = {};
_float m_fRadius = { 0.f }; // 컬링용 Radius
_int m_iRootBoneIndex = { -1 }; // 루트본의 인덱스
_vector m_vector[3];
_bool m_bLoopRestarted = false;
vector<_uint> m_iBoneMask;
_bool m_bInitialRootPos = { false };
_bool m_bInitialRootRotSaved = { false };
_bool m_bLoopRestarted = false;
_bool m_bIsSecondFinishedAnim = { false };
_bool m_bIsSecondLoop = { false };
_bool m_bRatio = { false };
private:
#ifdef EDITOR_PROJECT
const aiScene* m_pAIScene = { nullptr };
Assimp::Importer m_Importer;
#endif
#pragma region Compute
@@ -226,7 +224,8 @@ class ENGINE_DLL CModel final : public CComponent
//
virtual CComponent* Clone(void* pArg, class CGameObject* pOwner = nullptr);
virtual void Free(); public:
virtual void Free();
public:
#ifdef _DEBUG
void Describe_Entity() override;
#endif // _DEBUG