- Removed ReadEntireFile
- ZipWriter now writes directly to a file when possible
- Added GetIndex to geometry
- Moved Usd and Obj generators to different files
- Removed unused procedures
- Deduplicated obj generators
- Updated tests for ZipWriter
This commit is contained in:
Vladyslav Baranovskyi
2024-11-22 15:45:57 +02:00
parent 35e80a99e6
commit ac843c0fe3
8 changed files with 330 additions and 417 deletions

View File

@@ -153,4 +153,29 @@ namespace OpenVulkano::Scene
vertices = nullptr;
indices = nullptr;
}
uint32_t Geometry::GetIndex(int index) const
{
uint32_t result = 0;
if (index >= indexCount)
throw std::out_of_range("Index is out of range");
if (indexType == OpenVulkano::Scene::VertexIndexType::UINT16)
{
uint16_t* indices = GetIndices16();
result = indices[index];
}
else if (indexType == OpenVulkano::Scene::VertexIndexType::UINT32)
{
uint32_t* indices = GetIndices32();
result = indices[index];
}
else
{
throw std::runtime_error("Invalid geometry index type");
}
return result;
}
}