2026-02-13 19:15:05 +01:00
|
|
|
#ifndef CSCENE_HPP
|
|
|
|
|
#define CSCENE_HPP
|
|
|
|
|
|
2026-03-14 20:24:17 +01:00
|
|
|
#include "../Systems/EntityComponentManager.hpp"
|
|
|
|
|
#include "../Utils/CSerializable.hpp"
|
2026-02-13 19:15:05 +01:00
|
|
|
#include <string>
|
2026-03-14 20:24:17 +01:00
|
|
|
#include <vulkan/vulkan_raii.hpp>
|
2026-02-13 19:15:05 +01:00
|
|
|
|
2026-03-14 20:24:17 +01:00
|
|
|
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;
|
2026-03-14 20:24:17 +01:00
|
|
|
EntityComponentManager m_ecManager;
|
|
|
|
|
|
2026-02-13 19:15:05 +01:00
|
|
|
public:
|
|
|
|
|
CScene() = delete;
|
|
|
|
|
CScene(std::string name);
|
2026-03-14 20:24:17 +01:00
|
|
|
virtual ~CScene() = default;
|
2026-02-13 19:15:05 +01:00
|
|
|
|
|
|
|
|
unsigned int getNumEntity() const;
|
|
|
|
|
|
2026-03-14 20:24:17 +01:00
|
|
|
CEntity addEntity(std::string name, std::string description);
|
2026-02-13 19:15:05 +01:00
|
|
|
|
|
|
|
|
std::string getName() const;
|
|
|
|
|
|
2026-03-14 20:24:17 +01:00
|
|
|
EntityComponentManager& getECManager(){return m_ecManager;};
|
|
|
|
|
|
2026-02-13 19:15:05 +01:00
|
|
|
void removeEntity(unsigned int index, bool destroy = true);
|
|
|
|
|
|
|
|
|
|
//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();
|
|
|
|
|
|
2026-03-14 20:24:17 +01:00
|
|
|
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
|