Fix Cloth with models that use compressed vertex buffer

#4017
This commit is contained in:
Wojtek Figat
2026-03-24 22:59:21 +01:00
parent a63e05d444
commit 29abfbcdc9
9 changed files with 186 additions and 116 deletions

View File

@@ -665,6 +665,16 @@ bool StaticModel::GetMeshData(const MeshReference& ref, MeshBufferType type, Byt
return mesh.DownloadDataCPU(type, result, count, layout);
}
MeshBase* StaticModel::GetMesh(const MeshReference& ref) const
{
const auto model = Model.Get();
if (!model || model->WaitForLoaded())
return nullptr;
auto& lod = model->LODs[Math::Min(ref.LODIndex, model->LODs.Count() - 1)];
auto& mesh = lod.Meshes[Math::Min(ref.MeshIndex, lod.Meshes.Count() - 1)];
return &mesh;
}
MeshDeformation* StaticModel::GetMeshDeformation() const
{
if (!_deformation)