Vulkan Schnee 0.0.1
High-performance rendering engine
Loading...
Searching...
No Matches
MeshComponent.h
Go to the documentation of this file.
1#pragma once
2
5#include <string>
6
7#ifdef ENABLE_TRACY
8#include <tracy/Tracy.hpp>
9#endif
10
11namespace EngineCore
12{
13 class Engine;
14 class SceneNode;
15 class Mesh;
17} // namespace EngineCore
18
19namespace EngineCore
20{
21 class MaterialShader;
22
28 {
29 std::string name = "game object";
30 bool visible = true;
31
32 public:
37 Scene* owningScene,
38 entt::entity & actor,
39 Asset::Path asset,
40 std::shared_ptr<SceneNode> sceneNode,
41 bool isVisible_ = true,
42 const std::string & name_ = "game object"
43 );
44
49 Scene* owningScene,
50 entt::entity & actor,
51 Asset::Path asset,
52 std::shared_ptr<SceneNode> sceneNode,
53 RenderingDataManager* renderingDataManager,
54 bool isVisible_ = true,
55 const std::string & name_ = "game object"
56 );
57
58 ~MeshComponent() override = default;
59
60 void beginPlay() override;
61 void endPlay() override;
62
67 [[nodiscard]] bool isVisible() const;
68
73 [[nodiscard]] MeshAsset* getMeshAsset() const;
74
79 [[nodiscard]] glm::mat4 getWorldTransform() const;
84 [[nodiscard]] glm::mat4 getLocalTransform() const;
85
90 [[nodiscard]] PipelineNames getMaterialNames() const;
91
92 private:
93 entt::entity componentEntity = entt::null;
94 std::optional<std::shared_ptr<SceneNode>> sceneNode;
95
98 };
99} // namespace EngineCore
LogicComponent(Scene *owningScene)
The mesh asset stores geometry data and.
Definition MeshAsset.h:15
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.
~MeshComponent() override=default
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.
The rendering data manager is supposed to hold all methods to update the contents of the buffers whic...
Represents a node in the scene graph, containing information about its position, rotation,...
Definition SceneGraph.h:24
A scene is the overarching structure which can spawn actors.
Definition Scene.h:17
Log category system implementation.