|
Vulkan Schnee 0.0.1
High-performance rendering engine
|
#include <CollidableMeshComponent.h>
Public Member Functions | |
| CollidableMesh (Entities::Scene *owningScene, entt::entity &actor, Asset::Path asset, std::shared_ptr< Entities::SceneNode > sceneNode, bool isVisible_=true, const std::string &name_="game object") | |
| CollidableMesh (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") | |
| void | endPlay () override |
| Called when the component is removed or the game ends. | |
| void | enableCollision (bool enabled) |
| bool | isCollisionEnabled () const |
| void | setCollisionProperties (const Assets::Loaders::GltfLoader::VulkanSchneeExtension::CollisionProperties &properties) |
| void | clearCollisionProperties () |
| void | setCollisionStatic (bool isStatic) |
| void | onMeshAssetResolved (Assets::MeshAssetRef meshAsset) override |
| Public Member Functions inherited from Engine::Components::Mesh | |
| 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. | |
| ~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 | 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. | |
| 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 |
| Public Member Functions inherited from Engine::Components::Logic | |
| Logic (Entities::Scene *owningScene) | |
| virtual | ~Logic ()=default |
| virtual std::string | getComponentName () const |
| Gets the component type name for debugging/UI. | |
| 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 = "CollidableMesh" |
| Static Public Attributes inherited from Engine::Components::Mesh | |
| 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. | |
Private Types | |
| using | CollisionProperties = Assets::Loaders::GltfLoader::VulkanSchneeExtension::CollisionProperties |
Private Member Functions | |
| void | rebuildOwnedCollision () |
| bool | createCollisionFromProperties () |
| bool | createFallbackBoxCollision () |
| void | ensurePhysicsBody () |
| void | removeOwnedCollision () |
Private Attributes | |
| std::optional< CollisionProperties > | collisionProperties_ |
| std::vector< Collision * > | ownedCollisionChildren_ |
| bool | collisionRequested_ = false |
| bool | collisionStatic_ = false |
Additional Inherited Members | |
| Protected Member Functions inherited from Engine::Components::Mesh | |
| 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 inherited from Engine::Components::Mesh | |
| entt::entity | componentEntity = entt::null |
| std::optional< std::shared_ptr< Entities::SceneNode > > | sceneNode |
| Ecs::StaticMeshData * | staticMeshData = nullptr |
Definition at line 10 of file CollidableMeshComponent.h.
|
private |
Definition at line 48 of file CollidableMeshComponent.h.
| Engine::Components::CollidableMesh::CollidableMesh | ( | Entities::Scene * | owningScene, |
| entt::entity & | actor, | ||
| Asset::Path | asset, | ||
| std::shared_ptr< Entities::SceneNode > | sceneNode, | ||
| bool | isVisible_ = true, | ||
| const std::string & | name_ = "game object" ) |
References Engine::Components::Mesh::sceneNode.
| Engine::Components::CollidableMesh::CollidableMesh | ( | 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" ) |
References Engine::Components::Mesh::sceneNode.
| void Engine::Components::CollidableMesh::clearCollisionProperties | ( | ) |
|
private |
|
private |
| void Engine::Components::CollidableMesh::enableCollision | ( | bool | enabled | ) |
|
overridevirtual |
Called when the component is removed or the game ends.
Reimplemented from Engine::Components::Logic.
|
private |
|
nodiscard |
|
overridevirtual |
Reimplemented from Engine::Components::Mesh.
|
private |
|
private |
| void Engine::Components::CollidableMesh::setCollisionProperties | ( | const Assets::Loaders::GltfLoader::VulkanSchneeExtension::CollisionProperties & | properties | ) |
| void Engine::Components::CollidableMesh::setCollisionStatic | ( | bool | isStatic | ) |
|
private |
Definition at line 56 of file CollidableMeshComponent.h.
|
private |
Definition at line 58 of file CollidableMeshComponent.h.
|
private |
Definition at line 59 of file CollidableMeshComponent.h.
|
staticconstexpr |
Definition at line 13 of file CollidableMeshComponent.h.
|
private |
Definition at line 57 of file CollidableMeshComponent.h.