13#include <tracy/Tracy.hpp>
31 class RenderingDataManager;
49 std::string
name =
"game object";
60 std::shared_ptr<Entities::SceneNode>
sceneNode,
61 bool isVisible_ =
true,
62 const std::string & name_ =
"game object"
72 std::shared_ptr<Entities::SceneNode>
sceneNode,
73 Core::RenderingDataManager * renderingDataManager,
74 bool isVisible_ =
true,
75 const std::string & name_ =
"game object"
127 [[nodiscard]] std::shared_ptr<Entities::SceneNode>
getSceneNode()
const;
131 std::optional<std::shared_ptr<Entities::SceneNode>>
sceneNode;
The mesh asset stores geometry data and.
Base class for collision shape components.
Logic(Entities::Scene *owningScene)
std::vector< Collision * > collisionChildren_
Assets::MeshAssetRef getMeshAsset() const
Gets the asset used by this mesh rendering component.
bool ownsCollisionChild(const Logic *component) const
void beginPlay() override
Called when the component is added to the scene or the game starts.
void attachCollisionChild(Collision *collision)
std::optional< std::shared_ptr< Entities::SceneNode > > sceneNode
static constexpr const char * ComponentName
void attachCollisionChildren(const std::vector< Collision * > &collisions)
glm::mat4 getWorldTransform() const
Getter for the world transform of the mesh component.
std::string getAssetName() const
Gets the asset name of this mesh component (e.g. "rat")
const std::vector< Collision * > & getCollisionChildren() const
bool isVisible() const
If this mesh component should be considered for rendering.
Rendering::PipelineNames getMaterialNames() const
Gets the material name of this mesh component.
Ecs::StaticMeshData * getStaticMeshData() const
entt::entity componentEntity
virtual void onMeshAssetResolved(Assets::MeshAssetRef meshAsset)
Ecs::StaticMeshData * staticMeshData
Core::RenderingDataManager * renderingDataManager_
glm::mat4 getLocalTransform() const
Gets the local model matrix which isn't affected by its parent.
Mesh(Entities::Scene *owningScene, entt::entity &actor, Asset::Path asset, std::shared_ptr< Entities::SceneNode > sceneNode, bool isVisible_=true, const std::string &name_="game object")
Production constructor - uses EngineManager singleton to get RenderingDataManager.
Mesh(Entities::Scene *owningScene, entt::entity &actor, Asset::Path asset, std::shared_ptr< Entities::SceneNode > sceneNode, Core::RenderingDataManager *renderingDataManager, bool isVisible_=true, const std::string &name_="game object")
Testable constructor - allows injecting RenderingDataManager for testing.
void detachCollisionChild(const Collision *collision)
void endPlay() override
Called when the component is removed or the game ends.
std::shared_ptr< Entities::SceneNode > getSceneNode() const
Represents a node in the scene graph, containing information about its position, rotation,...
A scene is the overarching structure which can spawn, contain and destroy actors or entities.
Asset::Ref< Asset::Path, Mesh > MeshAssetRef
Core audio subsystem owning the miniaudio engine and managing playback.