Summary:
- 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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user