Reworking VertexData

This commit is contained in:
Dynamitos
2023-10-24 15:01:09 +02:00
parent a47f17481b
commit 28e5c9ff01
61 changed files with 1157 additions and 1144 deletions
+3 -13
View File
@@ -50,26 +50,16 @@ public:
{
return registry.get<Component>(entity);
}
template<typename Component, typename Func>
void view(Func func) requires std::is_invocable_v<Func, Component&>
template<typename... Component, typename Func>
void view(Func func) requires std::is_invocable_v<Func, Component&...> || std::is_invocable_v<Func, entt::entity, Component&...>
{
registry.view<Component>().each(func);
registry.view<Component...>().each(func);
}
Array<MeshBatch> getStaticMeshes();
LightEnv getLightBuffer();
Component::Skybox getSkybox();
Gfx::PShaderBuffer getSceneDataBuffer() const { return sceneDataBuffer; }
Gfx::PGraphics getGraphics() const { return graphics; }
entt::registry registry;
private:
struct PrimitiveSceneData
{
Matrix4 localToWorld;
Matrix4 worldToLocal;
Vector4 actorLocation;
};
Array<PrimitiveSceneData> sceneData;
Gfx::PShaderBuffer sceneDataBuffer;
LightEnv lightEnv;
PhysicsSystem physics;
Gfx::PGraphics graphics;