MQEngine
载入中...
搜索中...
未找到
MatrixCacheSystem.h
浏览该文件的文档.
1//
2// Created by Administrator on 2025/1/21.
3//
4
5#ifndef MATRIXCACHESYSTEM_H
6#define MATRIXCACHESYSTEM_H
8#include "../data/Camera.h"
9
10namespace MQEngine {
12 public:
13 MatrixCacheSystem(FCT::Context* ctx, DataManager* dataManager);
14 void update();
15 void updateUniforms();
16 void bindModelMatrix(entt::registry* registry, entt::entity entity, FCT::Layout* layout);
17
18 private:
19 void processEntity(entt::registry* registry, entt::entity entity);
20 void cleanupCacheComponents(entt::registry* registry);
21 FCT::Mat4 calculateRotationMatrix(const RotationComponent& rotation);
22 FCT::Mat4 calculateModelMatrix(const PositionComponent& position, const RotationComponent& rotation, const ScaleComponent& scale);
23
24 FCT::Context* m_ctx;
26 FCT::Uniform m_defaultModelUniform; // 默认模型矩阵uniform,用于没有矩阵cache的情况
27 };
28}
29
30#endif //MATRIXCACHESYSTEM_H
#define ENGINE_API
定义 EnginePCH.h:14
定义 DataManager.h:58
void cleanupCacheComponents(entt::registry *registry)
定义 MatrixCacheSystem.cpp:140
FCT::Mat4 calculateModelMatrix(const PositionComponent &position, const RotationComponent &rotation, const ScaleComponent &scale)
定义 MatrixCacheSystem.cpp:113
DataManager * m_dataManager
定义 MatrixCacheSystem.h:25
FCT::Mat4 calculateRotationMatrix(const RotationComponent &rotation)
定义 MatrixCacheSystem.cpp:105
void bindModelMatrix(entt::registry *registry, entt::entity entity, FCT::Layout *layout)
定义 MatrixCacheSystem.cpp:127
void processEntity(entt::registry *registry, entt::entity entity)
定义 MatrixCacheSystem.cpp:52
MatrixCacheSystem(FCT::Context *ctx, DataManager *dataManager)
定义 MatrixCacheSystem.cpp:9
void updateUniforms()
定义 MatrixCacheSystem.cpp:87
FCT::Context * m_ctx
定义 MatrixCacheSystem.h:24
FCT::Uniform m_defaultModelUniform
定义 MatrixCacheSystem.h:26
void update()
定义 MatrixCacheSystem.cpp:17
定义 application.h:5
定义 Camera.h:16