MCPcopy Create free account
hub / github.com/NazaraEngine/NazaraEngine / AddToRenderQueue

Method AddToRenderQueue

src/Nazara/Graphics/Model.cpp:55–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53 */
54
55 void Model::AddToRenderQueue(AbstractRenderQueue* renderQueue, const InstanceData& instanceData) const
56 {
57 unsigned int submeshCount = m_mesh->GetSubMeshCount();
58 for (unsigned int i = 0; i < submeshCount; ++i)
59 {
60 const StaticMesh* mesh = static_cast<const StaticMesh*>(m_mesh->GetSubMesh(i));
61 const MaterialRef& material = GetMaterial(mesh->GetMaterialIndex());
62
63 MeshData meshData;
64 meshData.indexBuffer = mesh->GetIndexBuffer();
65 meshData.primitiveMode = mesh->GetPrimitiveMode();
66 meshData.vertexBuffer = mesh->GetVertexBuffer();
67
68 renderQueue->AddMesh(instanceData.renderOrder, material, meshData, mesh->GetAABB(), instanceData.transformMatrix);
69 }
70 }
71
72 /*!
73 * \brief Gets the material of the named submesh

Callers

nothing calls this directly

Calls 8

GetSubMeshCountMethod · 0.80
GetSubMeshMethod · 0.80
GetMaterialIndexMethod · 0.80
GetPrimitiveModeMethod · 0.80
GetIndexBufferMethod · 0.45
GetVertexBufferMethod · 0.45
AddMeshMethod · 0.45
GetAABBMethod · 0.45

Tested by

no test coverage detected