|
Vulkan Schnee 0.0.1
High-performance rendering engine
|
A component which can be attached as many times to an actor as one wants. It makes it possible to render a mesh attached to an object. More...
#include <MeshComponent.h>
Public Member Functions | |
| 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. | |
| 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") | |
| 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") | |
| 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. | |
| 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") | |
| 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") | |
| ~Mesh () override=default | |
| void | beginPlay () override |
| Called when the component is added to the scene or the game starts. | |
| void | endPlay () override |
| Called when the component is removed or the game ends. | |
| bool | drawImGui () override |
| Draw the debug UI. | |
| bool | isVisible () const |
| If this mesh component should be considered for rendering. | |
| Assets::MeshAssetRef | getMeshAsset () const |
| Gets the asset used by this mesh rendering component. | |
| glm::mat4 | getWorldTransform () const |
| Getter for the world transform of the mesh component. | |
| glm::mat4 | getLocalTransform () const |
| Gets the local model matrix which isn't affected by its parent. | |
| Rendering::PipelineNames | getMaterialNames () const |
| Gets the material name of this mesh component. | |
| void | setMaterialOverride (Assets::MaterialHandle material) |
| void | clearMaterialOverride () |
| std::optional< Assets::MaterialHandle > | getMaterialOverride () const |
| std::string | getAssetName () const |
| Gets the asset name of this mesh component (e.g. "rat") | |
| void | attachCollisionChild (Collision *collision) |
| void | attachCollisionChildren (const std::vector< Collision * > &collisions) |
| void | detachCollisionChild (const Collision *collision) |
| const std::vector< Collision * > & | getCollisionChildren () const |
| bool | ownsCollisionChild (const Logic *component) const |
| virtual void | onMeshAssetResolved (Assets::MeshAssetRef meshAsset) |
| Public Member Functions inherited from Engine::Components::Logic | |
| Logic (Entities::Scene *owningScene) | |
| Logic (const Entities::SpawnContext &context) | |
| virtual | ~Logic ()=default |
| virtual std::string | getComponentName () const |
| Gets the component type name for debugging/UI. | |
| virtual bool | drawImGuiName () |
| Used to alter the name of the entity in the outliner. | |
| virtual void | tick (double deltaTime) |
| Called every frame if ticking is enabled. | |
| bool | hasBegunPlay () const |
| bool | canTick () const |
| Checks if the component is currently set to tick. | |
| void | setCanTick (bool enable) |
| Enables or disables ticking for this component. | |
| Entities::Entity * | getOwningEntity () const |
| Gets the entity this component belongs to. | |
Static Public Attributes | |
| static constexpr const char * | ComponentName = "Mesh" |
| Static Public Attributes inherited from Engine::Components::Logic | |
| static constexpr bool | IsUnique = false |
| Defines whether multiple instances of this component can exist on the same entity. Defaults to false (multiple allowed). Override in derived classes with static constexpr bool IsUnique =
true; if needed. | |
| static constexpr const char * | ComponentName = "Logic" |
| Fallback component type name. Derived classes may override getComponentName() for custom labels. | |
Protected Member Functions | |
| std::shared_ptr< Entities::SceneNode > | getSceneNode () const |
| Ecs::StaticMeshData * | getStaticMeshData () const |
| Protected Member Functions inherited from Engine::Components::Logic | |
| Entities::Scene * | getScene () const |
| Gets the scene this component belongs to. | |
| Core::SceneManager * | getSceneManager () const |
| Helper to get the SceneManager from the owning scene. | |
Protected Attributes | |
| entt::entity | componentEntity = entt::null |
| std::optional< std::shared_ptr< Entities::SceneNode > > | sceneNode |
| Ecs::StaticMeshData * | staticMeshData = nullptr |
Private Member Functions | |
| void | initializeMeshData (Entities::Scene *owningScene, entt::entity &actor, Asset::MeshPath asset, std::optional< Assets::GltfRenderableHandle > renderable, Assets::GeometryMeshHandle mesh) |
Private Attributes | |
| std::string | name = "game object" |
| bool | visible = true |
| Core::RenderingDataManager * | renderingDataManager_ = nullptr |
| std::vector< Collision * > | collisionChildren_ |
| std::optional< Assets::MaterialHandle > | materialOverride_ |
A component which can be attached as many times to an actor as one wants. It makes it possible to render a mesh attached to an object.
Definition at line 44 of file MeshComponent.h.
| Engine::Components::Mesh::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.
References sceneNode.
| Engine::Components::Mesh::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" ) |
References sceneNode.
| Engine::Components::Mesh::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" ) |
References sceneNode.
| Engine::Components::Mesh::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.
References sceneNode.
| Engine::Components::Mesh::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" ) |
References sceneNode.
| Engine::Components::Mesh::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" ) |
References sceneNode.
|
overridedefault |
| void Engine::Components::Mesh::attachCollisionChild | ( | Collision * | collision | ) |
| void Engine::Components::Mesh::attachCollisionChildren | ( | const std::vector< Collision * > & | collisions | ) |
|
overridevirtual |
Called when the component is added to the scene or the game starts.
Reimplemented from Engine::Components::Logic.
| void Engine::Components::Mesh::clearMaterialOverride | ( | ) |
| void Engine::Components::Mesh::detachCollisionChild | ( | const Collision * | collision | ) |
|
overridevirtual |
Draw the debug UI.
Reimplemented from Engine::Components::Logic.
|
overridevirtual |
Called when the component is removed or the game ends.
Reimplemented from Engine::Components::Logic.
|
nodiscard |
Gets the asset name of this mesh component (e.g. "rat")
|
nodiscard |
|
nodiscard |
Gets the local model matrix which isn't affected by its parent.
|
nodiscard |
Gets the material name of this mesh component.
|
nodiscard |
|
nodiscard |
Gets the asset used by this mesh rendering component.
|
nodiscardprotected |
|
nodiscardprotected |
|
nodiscard |
Getter for the world transform of the mesh component.
|
private |
|
nodiscard |
If this mesh component should be considered for rendering.
|
virtual |
Reimplemented in Engine::Components::CollidableMesh.
|
nodiscard |
| void Engine::Components::Mesh::setMaterialOverride | ( | Assets::MaterialHandle | material | ) |
|
private |
Definition at line 193 of file MeshComponent.h.
|
protected |
Definition at line 178 of file MeshComponent.h.
|
staticconstexpr |
Definition at line 47 of file MeshComponent.h.
|
private |
Definition at line 194 of file MeshComponent.h.
|
private |
Definition at line 50 of file MeshComponent.h.
|
private |
Definition at line 192 of file MeshComponent.h.
|
protected |
Definition at line 179 of file MeshComponent.h.
Referenced by Engine::Components::CollidableMesh::CollidableMesh(), Engine::Components::CollidableMesh::CollidableMesh(), Engine::Components::CollidableMesh::CollidableMesh(), Engine::Components::CollidableMesh::CollidableMesh(), Engine::Components::CollidableMesh::CollidableMesh(), Engine::Components::CollidableMesh::CollidableMesh(), Mesh(), Mesh(), Mesh(), Mesh(), Mesh(), and Mesh().
|
protected |
Definition at line 181 of file MeshComponent.h.
|
private |
Definition at line 51 of file MeshComponent.h.