added material rendering
This commit is contained in:
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user