work on world
This commit is contained in:
@@ -151,29 +151,29 @@ uint32_t CAssetManager::LoadModel( const char *szName )
|
||||
switch (pRoot->GetType())
|
||||
{
|
||||
case JSON_PARAMETER_OBJECT:
|
||||
{
|
||||
pMainObject = pRoot->GetObject();
|
||||
if (!pMainObject)
|
||||
{
|
||||
pMainObject = pRoot->GetObject();
|
||||
if (!pMainObject)
|
||||
{
|
||||
V_printf("Failed to load properties\n");
|
||||
return 0;
|
||||
V_printf("Failed to load properties\n");
|
||||
return 0;
|
||||
|
||||
}
|
||||
IJSONValue *pMesh = pMainObject->GetValue("Mesh");
|
||||
IJSONValue *pMaterial = pMainObject->GetValue("Material");
|
||||
IJSONValue *pPhysics = pMainObject->GetValue("Physics");
|
||||
if (pMesh)
|
||||
pModel->m_hMesh = LoadMesh(pMesh->GetStringValue());
|
||||
if (pMaterial)
|
||||
pModel->m_hMaterial = LoadMaterial(pMaterial->GetStringValue());
|
||||
if (pPhysics)
|
||||
pModel->m_hPhysics = LoadPhysics(pPhysics->GetStringValue());
|
||||
}
|
||||
IJSONValue *pMesh = pMainObject->GetValue("Mesh");
|
||||
IJSONValue *pMaterial = pMainObject->GetValue("Material");
|
||||
IJSONValue *pPhysics = pMainObject->GetValue("Physics");
|
||||
if (pMesh)
|
||||
pModel->m_hMesh = LoadMesh(pMesh->GetStringValue());
|
||||
if (pMaterial)
|
||||
pModel->m_hMaterial = LoadMaterial(pMaterial->GetStringValue());
|
||||
if (pPhysics)
|
||||
pModel->m_hPhysics = LoadPhysics(pPhysics->GetStringValue());
|
||||
|
||||
|
||||
|
||||
return hModel;
|
||||
}
|
||||
break;
|
||||
return hModel;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
@@ -317,6 +317,7 @@ HFunnyPhysics CAssetManager::LoadPhysics( const char *szName )
|
||||
IJSONValue *pRoot = JSONManager()->ReadString(szProperties);
|
||||
if (!pRoot)
|
||||
return 0;
|
||||
V_printf("PHYSICS %s\n", szName);
|
||||
|
||||
IJSONObject *pMainObject;
|
||||
switch (pRoot->GetType())
|
||||
@@ -339,6 +340,7 @@ HFunnyPhysics CAssetManager::LoadPhysics( const char *szName )
|
||||
return 0;
|
||||
}
|
||||
CUtlString szType = pTypeValue->GetStringValue();
|
||||
V_printf("szType\n");
|
||||
if (szType == "Sphere")
|
||||
{
|
||||
pPhysics->m_hShape = g_pPhysics->CreateBall({1.0});
|
||||
|
||||
Reference in New Issue
Block a user