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

Method Draw

Source/Engine/Content/Assets/Model.cpp:121–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121void Model::Draw(const RenderContext& renderContext, MaterialBase* material, const Matrix& world, StaticFlags flags, bool receiveDecals, int8 sortOrder) const
122{
123 if (!CanBeRendered())
124 return;
125
126 // Select a proper LOD index (model may be culled)
127 const BoundingBox box = GetBox(world);
128 BoundingSphere sphere;
129 BoundingSphere::FromBox(box, sphere);
130 int32 lodIndex = RenderTools::ComputeModelLOD(this, sphere.Center - renderContext.View.Origin, (float)sphere.Radius, renderContext);
131 if (lodIndex == -1)
132 return;
133 lodIndex += renderContext.View.ModelLODBias;
134 lodIndex = ClampLODIndex(lodIndex);
135
136 // Draw
137 LODs[lodIndex].Draw(renderContext, material, world, flags, receiveDecals, DrawPass::Default, 0, sortOrder);
138}
139
140void Model::Draw(const RenderContext& renderContext, const Mesh::DrawInfo& info)
141{

Callers 2

DrawFunction · 0.45
DrawFunction · 0.45

Calls 5

CanBeRenderedFunction · 0.85
GetBoxFunction · 0.85
ClampLODIndexFunction · 0.85
ModelDrawFunction · 0.85
GetMainContextMethod · 0.45

Tested by

no test coverage detected