32 template<
typename T,
typename... Args>
34 static_assert(std::is_base_of_v<Actor, T>,
"T must derive from Actor");
39 throw std::runtime_error(
"Failed to spawn Actor with world node");
41 std::shared_ptr<SceneNode> node =
sceneGraph->createNode(spawnTransform,
sceneGraph->getRoot(),
false);
43 T* rawPtr =
new T(node,
this, std::forward<Args>(args)...);
46 rawPtr->sceneNode = node;
50 }
catch (
const std::exception &e) {
51 throw std::runtime_error(
"Failed to spawn actor: " + std::string(e.what()));
60 [[nodiscard]] std::vector<Entity*>
getEntities()
const;
#define TRACY_ZONE_SCOPED_NAMED(name)
An Actor is similar to an EngineCore::Entity. An actor is an Entity with a transform.
This is the interface which is used to call a tick function on an object. Everything which should be ...
Represents the entire scene as a graph (specifically, a tree) of SceneNode objects....
Manages game objects within a scene, handling registration, ID allocation, and GPU buffer synchroniza...
Engine * getEngine() const
Gets the engine instance for this scene.
T * spawnActor(const Ecs::LocalTransform &spawnTransform, Args &&... args)
Spawns an actor from a specific class in somewhere into the scene.
void setAssetManager(AssetManager *manager)
Sets the asset manager for this scene (used for dependency injection in tests)
SceneManager * getSceneManager() const
void destroyActor(Actor *actor)
virtual void unloadContent()
AssetManager * getAssetManager() const
Gets the asset manager for this scene.
AssetManager * assetManager
virtual void loadContent()
std::vector< Entity * > getEntities() const
std::unique_ptr< SceneGraph > sceneGraph
std::vector< Entity * > entities
Log category system implementation.