MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / GetMeshData

Method GetMeshData

Source/Engine/Level/Actors/StaticModel.cpp:660–671  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

658}
659
660bool StaticModel::GetMeshData(const MeshReference& ref, MeshBufferType type, BytesContainer& result, int32& count, GPUVertexLayout** layout) const
661{
662 count = 0;
663 if (ref.LODIndex < 0 || ref.MeshIndex < 0)
664 return true;
665 const auto model = Model.Get();
666 if (!model || model->WaitForLoaded())
667 return true;
668 auto& lod = model->LODs[Math::Min(ref.LODIndex, model->LODs.Count() - 1)];
669 auto& mesh = lod.Meshes[Math::Min(ref.MeshIndex, lod.Meshes.Count() - 1)];
670 return mesh.DownloadDataCPU(type, result, count, layout);
671}
672
673MeshBase* StaticModel::GetMesh(const MeshReference& ref) const
674{

Callers

nothing calls this directly

Calls 5

WaitForLoadedMethod · 0.80
DownloadDataCPUMethod · 0.80
MinFunction · 0.50
GetMethod · 0.45
CountMethod · 0.45

Tested by

no test coverage detected