| 16 | namespace s3d |
| 17 | { |
| 18 | void ModelObject::draw(const Array<Material>& materials) const |
| 19 | { |
| 20 | for (const auto& part : parts) |
| 21 | { |
| 22 | assert((not part.materialID) || (part.materialID < materials.size())); |
| 23 | |
| 24 | const Material material = (part.materialID ? materials[*part.materialID] : Material{}); |
| 25 | |
| 26 | if (material.diffuseTextureName) |
| 27 | { |
| 28 | part.mesh.draw(TextureAsset(material.diffuseTextureName), |
| 29 | PhongMaterial{ material, HasDiffuseTexture::Yes }); |
| 30 | } |
| 31 | else |
| 32 | { |
| 33 | part.mesh.draw(PhongMaterial{ material, HasDiffuseTexture::No }); |
| 34 | } |
| 35 | } |
| 36 | } |
| 37 | } |
nothing calls this directly
no test coverage detected