14#include <tracy/Tracy.hpp>
32 class RenderingDataManager;
50 std::string
name =
"game object";
61 std::shared_ptr<Entities::SceneNode>
sceneNode,
62 bool isVisible_ =
true,
63 const std::string & name_ =
"game object"
70 std::shared_ptr<Entities::SceneNode>
sceneNode,
71 bool isVisible_ =
true,
72 const std::string & name_ =
"game object"
79 std::shared_ptr<Entities::SceneNode>
sceneNode,
80 bool isVisible_ =
true,
81 const std::string & name_ =
"game object"
91 std::shared_ptr<Entities::SceneNode>
sceneNode,
92 Core::RenderingDataManager * renderingDataManager,
93 bool isVisible_ =
true,
94 const std::string & name_ =
"game object"
101 std::shared_ptr<Entities::SceneNode>
sceneNode,
102 Core::RenderingDataManager * renderingDataManager,
103 bool isVisible_ =
true,
104 const std::string & name_ =
"game object"
109 entt::entity & actor,
111 std::shared_ptr<Entities::SceneNode>
sceneNode,
112 Core::RenderingDataManager * renderingDataManager,
113 bool isVisible_ =
true,
114 const std::string & name_ =
"game object"
175 [[nodiscard]] std::shared_ptr<Entities::SceneNode>
getSceneNode()
const;
179 std::optional<std::shared_ptr<Entities::SceneNode>>
sceneNode;
186 entt::entity & actor,
188 std::optional<Assets::GltfRenderableHandle> renderable,
The mesh asset stores geometry data and.
Base class for collision shape components.
Logic(Entities::Scene *owningScene)
std::vector< Collision * > collisionChildren_
void initializeMeshData(Entities::Scene *owningScene, entt::entity &actor, Asset::MeshPath asset, std::optional< Assets::GltfRenderableHandle > renderable, Assets::GeometryMeshHandle mesh)
Assets::MeshAssetRef getMeshAsset() const
Gets the asset used by this mesh rendering component.
void setMaterialOverride(Assets::MaterialHandle material)
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.
Mesh(Entities::Scene *owningScene, entt::entity &actor, Asset::MeshPath 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.
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.
std::optional< Assets::MaterialHandle > materialOverride_
Mesh(Entities::Scene *owningScene, entt::entity &actor, Assets::GeometryMeshHandle mesh, std::shared_ptr< Entities::SceneNode > sceneNode, bool isVisible_=true, const std::string &name_="game object")
Rendering::PipelineNames getMaterialNames() const
Gets the material name of this mesh component.
Mesh(Entities::Scene *owningScene, entt::entity &actor, Assets::GltfRenderableHandle renderable, std::shared_ptr< Entities::SceneNode > sceneNode, bool isVisible_=true, const std::string &name_="game object")
bool drawImGui() override
Draw the debug UI.
Mesh(Entities::Scene *owningScene, entt::entity &actor, Assets::GltfRenderableHandle renderable, std::shared_ptr< Entities::SceneNode > sceneNode, Core::RenderingDataManager *renderingDataManager, bool isVisible_=true, const std::string &name_="game object")
Ecs::StaticMeshData * getStaticMeshData() const
Mesh(Entities::Scene *owningScene, entt::entity &actor, Asset::MeshPath asset, std::shared_ptr< Entities::SceneNode > sceneNode, bool isVisible_=true, const std::string &name_="game object")
Production constructor - uses EngineManager singleton to get RenderingDataManager.
entt::entity componentEntity
virtual void onMeshAssetResolved(Assets::MeshAssetRef meshAsset)
Ecs::StaticMeshData * staticMeshData
void clearMaterialOverride()
Core::RenderingDataManager * renderingDataManager_
std::optional< Assets::MaterialHandle > getMaterialOverride() const
glm::mat4 getLocalTransform() const
Gets the local model matrix which isn't affected by its parent.
Mesh(Entities::Scene *owningScene, entt::entity &actor, Assets::GeometryMeshHandle mesh, std::shared_ptr< Entities::SceneNode > sceneNode, Core::RenderingDataManager *renderingDataManager, bool isVisible_=true, const std::string &name_="game object")
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.
AssetHandle< GltfRenderableHandleTag > GltfRenderableHandle
Asset::Ref< Asset::MeshPath, Mesh > MeshAssetRef
AssetHandle< GeometryMeshHandleTag > GeometryMeshHandle
AssetHandle< MaterialHandleTag > MaterialHandle
Manages IBL (Image-Based Lighting) resources for specular reflections.
PipelineNames
Named graphics pipelines used by material selection and shader lookup.
Identifies a named mesh-like asset inside an asset file.