| 119 | } |
| 120 | |
| 121 | void 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 | |
| 140 | void Model::Draw(const RenderContext& renderContext, const Mesh::DrawInfo& info) |
| 141 | { |
no test coverage detected