15 const std::string & name_
28 const std::string & name_
37 if (assetManager ==
nullptr)
throw std::runtime_error(
"AssetManager not available on Scene");
43 if ( meshAsset ==
nullptr )
66 entt::entity nodeEntity =
sceneNode.value()->getEntity();
74 if ( engine !=
nullptr && engine->
getRenderer() !=
nullptr )
92 entt::entity nodeEntity =
sceneNode.value()->getEntity();
114 if (
staticMeshData ==
nullptr)
throw std::runtime_error(
"MeshAsset does not exist");
120 return sceneNode->get()->getWorldMatrix();
125 return sceneNode->get()->getLocalTransform().matrix;
static entt::registry & get()
Gets the registry for all components.
MeshAsset * getMeshAsset(const Asset::Path &asset)
Get a mesh from the asset manager. If it does not exist it requests the asset from the asset loader.
EngineCore::Engine * getEngineModule()
gets the pointer to the engine object
static EngineManager & getInstance()
gets a reference to the engine manager
Renderer * getRenderer() const
Getter for the renderer.
virtual void endPlay()
Called when the component is removed or the game ends.
virtual void beginPlay()
Called when the component is added to the scene or the game starts.
LogicComponent(Scene *owningScene)
The mesh asset stores geometry data and.
RenderingDataManager * renderingDataManager_
MeshAsset * getMeshAsset() const
Gets the asset used by this mesh rendering component.
PipelineNames getMaterialNames() const
Gets the material name of this mesh component.
Ecs::StaticMeshData * staticMeshData
std::optional< std::shared_ptr< SceneNode > > sceneNode
void beginPlay() override
Called when the component is added to the scene or the game starts.
bool isVisible() const
If this mesh component should be considered for rendering.
entt::entity componentEntity
MeshComponent(Scene *owningScene, entt::entity &actor, Asset::Path asset, std::shared_ptr< SceneNode > sceneNode, bool isVisible_=true, const std::string &name_="game object")
Production constructor - uses EngineManager singleton to get RenderingDataManager.
glm::mat4 getLocalTransform() const
Gets the local model matrix which isn't affected by its parent.
glm::mat4 getWorldTransform() const
Getter for the world transform of the mesh component.
void endPlay() override
Called when the component is removed or the game ends.
const std::unique_ptr< RenderingDataManager > & getRenderingDataManager() const
Getter for the rendering data manager.
The rendering data manager is supposed to hold all methods to update the contents of the buffers whic...
A scene is the overarching structure which can spawn actors.
AssetManager * getAssetManager() const
Gets the asset manager for this scene.
Log category system implementation.
Is a tag for asset loading. When an asset has been rquested for loading but isnt yet created this tag...
Reference to a MeshComponent for ECS-based iteration. Allows efficient querying of all mesh component...
Stores parent relationships.