MCPcopy Create free account
hub / github.com/Siv3D/OpenSiv3D / draw

Method draw

Siv3D/src/Siv3D/ModelObject/SivModelObject.cpp:18–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16namespace 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}

Callers

nothing calls this directly

Calls 2

TextureAssetClass · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected