Initial claude dump
This commit is contained in:
@@ -1,16 +1,26 @@
|
||||
#include <sophia/components.hpp>
|
||||
#include <sophia/entity.hpp>
|
||||
#include <sophia/scene.hpp>
|
||||
#include <sophia/util/logger.hpp>
|
||||
|
||||
namespace sophia {
|
||||
|
||||
Scene::Scene() {
|
||||
entt::entity entity = this->registry.create();
|
||||
|
||||
auto& a = this->registry.emplace<TransformComponent>(entity);
|
||||
auto& b = this->registry.get<TransformComponent>(entity);
|
||||
}
|
||||
Scene::Scene() {}
|
||||
|
||||
Scene::~Scene() { log::trace("destroying sophia::Scene"); }
|
||||
|
||||
Entity Scene::createEntity(const std::string& name) {
|
||||
Entity entity{this->registry.create(), this};
|
||||
entity.addComponent<TagComponent>(name.empty() ? "Entity" : name);
|
||||
entity.addComponent<TransformComponent>();
|
||||
return entity;
|
||||
}
|
||||
|
||||
void Scene::destroyEntity(Entity entity) {
|
||||
if (this->activeCamera == entity) {
|
||||
this->activeCamera = entt::null;
|
||||
}
|
||||
this->registry.destroy(entity);
|
||||
}
|
||||
|
||||
} // namespace sophia
|
||||
|
||||
Reference in New Issue
Block a user