Files
CosmicEngine/src/Engine/Core/Scene/CScene.hpp
T

90 lines
2.1 KiB
C++
Raw Normal View History

2026-02-13 19:15:05 +01:00
#ifndef CSCENE_HPP
#define CSCENE_HPP
#include "../Systems/EntityComponentManager.hpp"
#include "../Utils/CSerializable.hpp"
2026-02-13 19:15:05 +01:00
#include <string>
#include <vulkan/vulkan_raii.hpp>
#include "../Physics/CTangibleWorld.hpp"
namespace CosmicCore {
class CEntity;
2026-02-13 19:15:05 +01:00
class CScene : public CSerializable {
private:
// The name of the scene.
std::string m_name;
EntityComponentManager m_ecManager;
CTangibleWorld m_tangibleWorld;
2026-02-13 19:15:05 +01:00
public:
CScene() = delete;
CScene(std::string name);
virtual ~CScene();
2026-02-13 19:15:05 +01:00
unsigned int getNumEntity() const;
CEntity createEntity();
2026-02-13 19:15:05 +01:00
std::string getName() const;
EntityComponentManager& getECManager(){return m_ecManager;};
2026-02-13 19:15:05 +01:00
void removeEntity(unsigned int index, bool destroy = true);
CTangibleWorld& getTangibleWorld() {return m_tangibleWorld;};
2026-02-13 19:15:05 +01:00
//CEntity* getActiveCamera();
//void setActiveCamera(CEntity* newCamera);
/**
* @brief Getter to the light.
* @return The pointer m_mainLight.
*/
//CEntity* getMainLight();
/**
* @brief Setter of the light.
* @param light : The light to set as main light.
*/
//void setMainLight(CEntity* light);
/**
* @brief Setter of the ODE world handling class.
* @param[in, out] world The pointer to the physical world.
*/
//void setTangibleWorld(CTangibleWorld* world);
/**
* @brief Getter to the physical world of the environment.
* @return The pointer m_tangibleWorld.
*/
//std::weak_ptr<CAbstractTangibleWorld> getTangibleWorld();
/**
* @brief Setter of the layer mask.
* @param[in] mask The new mask value.
*/
void setMask(unsigned int mask);
/**
* @brief Getter to the layer mask.
* @return The value of m_maskLayer.
*/
//unsigned int getMask();
void render(vk::raii::CommandBuffer& cmd, uint32_t frameIndex);
2026-02-13 19:15:05 +01:00
//void updateScript();
nlohmann::json to_json();
/*static CScene* from_json(nlohmann::json& j)
{
CScene* s = new CScene(j["Name"]);
for (nlohmann::json& entity : j["Entities"])
{
CEntity* e = CEntity::from_json(s, entity);
s->addEntity(e);
}
return s;
};*/
};
}
#endif