Rework API graphique Vulkan - EnTT pour ECS + Chargement modèle 3D assimp + SDL3 pour events input et fenetre + mesh texture camera transform ok + attention tous les assets nouveaus ne sont pas commités et il y a du code test en dur dans scene addentity + restructuration globale

This commit is contained in:
Tom Ray
2026-03-14 20:24:17 +01:00
parent 7c352bc280
commit 6695d46bcd
672 changed files with 238656 additions and 1821 deletions
+16 -10
View File
@@ -4,24 +4,22 @@
#include <forward_list>
#include <memory>
#include "../Utils/CSerializable.hpp"
#include <entt/entt.hpp>
#include "../Systems/EntityComponentManager.hpp"
namespace CosmicCore
{
class CScene;
class CEntity : public CSerializable {
using ECManager = entt::registry;
using EntityId = entt::entity;
private:
/**
* @brief A pointer to the scene containing the entity.
*/
std::weak_ptr<CScene> m_scene;
CScene* m_scene;
ECManager& m_registryReference;
EntityComponentManager& m_registryReference;
EntityId m_handle;
@@ -32,7 +30,7 @@ namespace CosmicCore
*/
CEntity() = delete;
CEntity(ECManager& registry, EntityId handle);
CEntity(EntityComponentManager& registry, EntityId handle, CScene* scene);
CEntity(const CEntity& cop);
/**
@@ -49,26 +47,34 @@ namespace CosmicCore
template<typename compType, typename... Args>
void addComponent(std::forward_list<Args...> args)
{
m_registryReference.emplace<compType>(m_handle, *this, args);
m_registryReference().emplace<compType>(m_handle, *this, args);
}
template<typename compType>
void addComponent()
{
m_registryReference.emplace<compType>(m_handle, *this);
m_registryReference().emplace<compType>(m_handle, *this);
}
EntityComponentManager& getRegistry(){return m_registryReference;};
/**
* @brief Getter to the entity's scene.
* @return The pointer m_scene.
*/
std::weak_ptr<CScene> getScene();
CScene* getScene();
/**
* @brief Setter of the scene.
* @param[in, out] e The scene in which the entity will be set.
*/
void setScene(std::weak_ptr<CScene> s);
void setScene(CScene* s);
EntityId operator*(){
return m_handle;
}
//TODO GET COMPONENT VECTOR OF SPECIFIC TYPE ? si utile
nlohmann::json to_json();
};