Начинаю добавлять управление камерой. (Сейчас только её позиция)

This commit is contained in:
2026-05-31 22:37:26 +07:00
parent 6389e6b25f
commit e1db9fd588
10 changed files with 112 additions and 6 deletions
+6 -1
View File
@@ -50,6 +50,7 @@ public:
object->SetActorLocate(loc);
object->SetActorRotate(rot);
static_cast<Actor*>(object)->world_ = this;
static_cast<Actor*>(object)->name_ = name;
actors_map.try_emplace(name, object);
return object;
}
@@ -77,7 +78,11 @@ public:
template<class T>
std::weak_ptr<T> GetActorByID(const std::string& id)
{
return actors_map[id];
auto it = actors_map.find(id);
if (it == actors_map.end() || it->second == nullptr)
return {};
return std::static_pointer_cast<T>(it->second);
}
};