Bunch of changes + fixes
This commit is contained in:
@@ -16,6 +16,24 @@ Entity Scene::createEntity(const std::string& name) {
|
||||
return entity;
|
||||
}
|
||||
|
||||
Entity Scene::createCamera(const std::string& name) {
|
||||
Entity camera = createEntity(name);
|
||||
camera.addComponent<CameraComponent>();
|
||||
if (this->activeCamera == entt::null) {
|
||||
this->activeCamera = camera;
|
||||
}
|
||||
return camera;
|
||||
}
|
||||
|
||||
Entity Scene::getActiveCamera() {
|
||||
if (this->activeCamera == entt::null) {
|
||||
return {};
|
||||
}
|
||||
return {this->activeCamera, this};
|
||||
}
|
||||
|
||||
void Scene::setActiveCamera(Entity camera) { this->activeCamera = camera; }
|
||||
|
||||
void Scene::destroyEntity(Entity entity) {
|
||||
if (this->activeCamera == entity) {
|
||||
this->activeCamera = entt::null;
|
||||
|
||||
Reference in New Issue
Block a user