added material rendering

This commit is contained in:
2026-04-27 15:56:33 +03:00
parent 457b455042
commit cbcfdce047
16 changed files with 178 additions and 29 deletions

View File

@@ -45,17 +45,18 @@ void C_BaseModelEntity::UpdateModel()
}
m_hModelHandle = g_pAssetManager->LoadModel(m_szCurrentModel);
m_pModel = g_pAssetManager->GetModelByIndex(m_hModelHandle);
CBaseMaterial *pMat = g_pAssetManager->GetMaterialByIndex(m_pModel->m_hMaterial)->m_pLayout;
if (!m_pModel)
{
V_printf("Failed to load %u %s\n", V_strnlen(m_szCurrentModel,255), m_szCurrentModel);
m_pInstance = NULL;
return;
}
FunnyMesh_t *pMesh = g_pAssetManager->GetMeshByIndex(m_pModel->m_hMesh);
m_pInstance = g_pWorldRenderer->CreateInstance(pMesh->m_pMesh);
m_pInstance->SetPosition({0,0,0});
m_pInstance->SetRotation({0,0,0,1});
m_pInstance->SetMaterial(pMat);
}