|
30 | 30 | #include "FlagEnum.h" |
31 | 31 | #include "Scene/Components/RadientMaterialBindingsStorage.hpp" |
32 | 32 | #include "Scene/Components/RadientMeshComponentStorage.hpp" |
| 33 | +#include "Scene/Components/RadientMorphComponentStorage.hpp" |
33 | 34 | #include "Scene/Components/RadientSkinComponentStorage.hpp" |
34 | 35 |
|
35 | 36 | #include "entt/entity/registry.hpp" |
@@ -70,6 +71,7 @@ class RadientSceneState |
70 | 71 | const RadientMeshRendererComponent& Renderer; |
71 | 72 | const RadientMaterialBindingsComponent* pMaterialBindings = nullptr; |
72 | 73 | const RadientSkinComponent* pSkin = nullptr; |
| 74 | + const RadientMorphComponent* pMorph = nullptr; |
73 | 75 | const RadientMatrix4x4& WorldMatrix; |
74 | 76 | const Bool& EffectiveVisible; |
75 | 77 | }; |
@@ -142,6 +144,7 @@ class RadientSceneState |
142 | 144 | RADIENT_STATUS GetCachedWorldMatrix(RadientEntityID Entity, RadientMatrix4x4& Matrix) const; |
143 | 145 | RADIENT_STATUS GetCamera(RadientEntityID Entity, RadientCameraComponent& Camera) const; |
144 | 146 | RADIENT_STATUS GetSkin(RadientEntityID Entity, RadientSkinComponent& Skin) const; |
| 147 | + RADIENT_STATUS GetMorph(RadientEntityID Entity, RadientMorphComponent& Morph) const; |
145 | 148 | RADIENT_STATUS HasComponent(RadientEntityID Entity, RadientComponentTypeID ComponentType, Bool& HasComponent) const; |
146 | 149 |
|
147 | 150 | const RadientSceneRevisions& GetSceneRevisions() const; |
@@ -177,6 +180,7 @@ class RadientSceneState |
177 | 180 | RADIENT_STATUS SetCamera(RadientEntityID Entity, const RadientCameraComponent& Camera); |
178 | 181 | RADIENT_STATUS SetMesh(RadientEntityID Entity, const RadientMeshComponent& Mesh); |
179 | 182 | RADIENT_STATUS SetSkin(RadientEntityID Entity, const RadientSkinComponent& Skin); |
| 183 | + RADIENT_STATUS SetMorph(RadientEntityID Entity, const RadientMorphComponent& Morph); |
180 | 184 | RADIENT_STATUS SetMeshRenderer(RadientEntityID Entity, const RadientMeshRendererComponent& Renderer); |
181 | 185 | RADIENT_STATUS SetMaterialBindings(RadientEntityID Entity, const RadientMaterialBindingsComponent& Bindings); |
182 | 186 | RADIENT_STATUS SetLight(RadientEntityID Entity, const RadientLightComponent& Light); |
@@ -204,7 +208,7 @@ class RadientSceneState |
204 | 208 | { |
205 | 209 | CHANGE_FLAG_NONE = 0u, |
206 | 210 |
|
207 | | - // Mesh, mesh renderer, material bindings, or skin changed. |
| 211 | + // Mesh, mesh renderer, material bindings, skin, or morph changed. |
208 | 212 | CHANGE_FLAG_DRAWABLES = 1u << 0u, |
209 | 213 |
|
210 | 214 | // Light component data changed. |
@@ -455,13 +459,15 @@ inline RadientSceneState::RenderableMesh RadientSceneState::MakeRenderableMesh(e |
455 | 459 |
|
456 | 460 | const MaterialBindingsStorage* pMaterialBindings = m_Registry.try_get<MaterialBindingsStorage>(Entity); |
457 | 461 | const SkinComponentStorage* pSkin = m_Registry.try_get<SkinComponentStorage>(Entity); |
| 462 | + const MorphComponentStorage* pMorph = m_Registry.try_get<MorphComponentStorage>(Entity); |
458 | 463 |
|
459 | 464 | return RenderableMesh{ |
460 | 465 | EntityData.ID, |
461 | 466 | MeshStorage.Component, |
462 | 467 | Renderer, |
463 | 468 | pMaterialBindings != nullptr ? &pMaterialBindings->Component : nullptr, |
464 | 469 | pSkin != nullptr ? &pSkin->Component : nullptr, |
| 470 | + pMorph != nullptr ? &pMorph->Component : nullptr, |
465 | 471 | WorldTransform.Matrix, |
466 | 472 | EffectiveVisible.Visible}; |
467 | 473 | } |
|
0 commit comments