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

Method Attach

SDK/src/NDK/Components/GraphicsComponent.cpp:49–64  ·  view source on GitHub ↗

! * \brief Attaches a renderable to the entity with a specific matrix * * \param renderable Reference to a renderable element * \param localMatrix Local matrix that will be applied to the instanced renderable * \param renderOrder Render order of the element */

Source from the content-addressed store, hash-verified

47 * \param renderOrder Render order of the element
48 */
49 void GraphicsComponent::Attach(Nz::InstancedRenderableRef renderable, const Nz::Matrix4f& localMatrix, int renderOrder)
50 {
51 m_renderables.emplace_back(m_transformMatrix);
52 Renderable& entry = m_renderables.back();
53 entry.data.localMatrix = localMatrix;
54 entry.data.renderOrder = renderOrder;
55 entry.renderable = std::move(renderable);
56
57 ConnectInstancedRenderableSignals(entry);
58
59 std::size_t materialCount = entry.renderable->GetMaterialCount();
60 for (std::size_t i = 0; i < materialCount; ++i)
61 RegisterMaterial(entry.renderable->GetMaterial(i));
62
63 InvalidateBoundingVolume();
64 }
65
66 void GraphicsComponent::ConnectInstancedRenderableSignals(Renderable& entry)
67 {

Callers 15

EnableBackgroundMethod · 0.80
SetupFPSCounterMethod · 0.80
ConsoleMethod · 0.80
ButtonWidgetMethod · 0.80
ProgressBarWidgetMethod · 0.80
CheckboxWidgetMethod · 0.80
TextAreaWidgetMethod · 0.80
LabelWidgetMethod · 0.80
LuaBinding_SDKMethod · 0.80
TextMethod · 0.80
RenderSystem.cppFile · 0.80
OnEntityAddedMethod · 0.80

Calls 1

GetMaterialCountMethod · 0.80

Tested by

no test coverage detected