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

Method GetMaterial

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

Source from the content-addressed store, hash-verified

121}
122
123MaterialBase* StaticModel::GetMaterial(int32 meshIndex, int32 lodIndex) const
124{
125 auto model = Model.Get();
126 ASSERT(model &&
127 Math::IsInRange(lodIndex, 0, model->GetLODsCount()) &&
128 Math::IsInRange(meshIndex, 0, model->LODs[lodIndex].Meshes.Count()));
129 const auto& mesh = model->LODs[lodIndex].Meshes[meshIndex];
130 const auto materialSlotIndex = mesh.GetMaterialSlotIndex();
131 MaterialBase* material = Entries[materialSlotIndex].Material.Get();
132 return material ? material : model->MaterialSlots[materialSlotIndex].Material.Get();
133}
134
135Color32 StaticModel::GetVertexColor(int32 lodIndex, int32 meshIndex, int32 vertexIndex) const
136{

Callers

nothing calls this directly

Calls 6

IsInRangeFunction · 0.85
WaitForLoadedMethod · 0.80
GetMethod · 0.45
GetLODsCountMethod · 0.45
CountMethod · 0.45
GetDefaultMaterialMethod · 0.45

Tested by

no test coverage detected