24 std::vector<Actor*> actors;
26 if (
auto actor =
dynamic_cast<Actor*
>(entity)) {
27 actors.push_back(actor);
47 if (gameObject ==
nullptr) {
48 PLOGW <<
"Attempted to unregister a null GameObject pointer.";
55 PLOGW <<
"GameObject pointer not found in gameObjects vector during unregistration.";
132 PLOGE <<
"Failed to load scene content as the scene was nullptr";
158 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT,
159 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT
constexpr uint32_t MAX_MESHLETS_PER_BIN
#define TRACY_ZONE_SCOPED_NAMED(name)
An Actor is similar to an EngineCore::Entity. An actor is an Entity with a transform.
The application context is the core class which stores the basic openxr and vulkan objects.
A component which can be attached as many times to an actor as one wants. It makes it possible to ren...
void addMeshToMap(const MeshComponent *gameObject)
void unloadScene()
Unloads the current scene.
ApplicationContext * context
std::vector< Entity * > getAllEntities()
Gets a list of pointers to all entities in the current scene.
void addMeshesToMap(const std::vector< MeshComponent * > &gameObjects)
std::optional< VulkanBuffer > meshletToObjectMapBuffer
void setAssetManager(AssetManager *manager)
Sets the asset manager that will be injected into scenes.
AssetManager * assetManager_
void executePendingSceneLoading()
Executes the pending scene load. Should be called between frames.
const MeshComponent * getGameObject(const scene_object_id id) const
void unregisterGameObject(const MeshComponent *gameObject)
unregisters a game object from the active scene
const std::vector< MeshComponent * > & getGameObjects() const
std::vector< MeshComponent * > gameObjects
void loadSceneContent() const
void clear()
Clears all game objects and resets the manager state for a new scene.
std::vector< uint32_t > gameObjectToMeshletMap
std::function< void()> pendingSceneLoad
std::vector< Actor * > getAllActors()
Gets a list of pointers to all actors in the scene.
MeshComponent * registerGameObject(MeshComponent *gameObject)
registers a game object to the active scene
const VulkanBuffer & getMeshletToObjectBuffer() const
void destroyMeshletToObjectMapBuffer()
SceneManager(ApplicationContext *context)
void uploadGameObjectToMeshletMap()
Uploads the changed data to the buffer on the gpu. Is only one buffer.
void createMeshletToObjectMapBuffer(ApplicationContext *context)
bool isSceneChangePending() const
Checks if a scene change has been requested.
void setActiveScene(Scene *scene)
A scene is the overarching structure which can spawn actors.
RAII wrapper for Vulkan buffer and device memory.
Log category system implementation.