3#include "Engine/Component/MeshComponent.h"
4#include "Engine/Mesh/GltfLoader.h"
38 std::shared_ptr<Entities::SceneNode>
sceneNode,
39 bool isVisible_ =
true,
40 const std::string & name_ =
"game object"
56 std::shared_ptr<Entities::SceneNode>
sceneNode,
57 bool isVisible_ =
true,
58 const std::string & name_ =
"game object"
74 std::shared_ptr<Entities::SceneNode>
sceneNode,
75 bool isVisible_ =
true,
76 const std::string & name_ =
"game object"
93 std::shared_ptr<Entities::SceneNode>
sceneNode,
94 Core::RenderingDataManager * renderingDataManager,
95 bool isVisible_ =
true,
96 const std::string & name_ =
"game object"
111 entt::entity & actor,
113 std::shared_ptr<Entities::SceneNode>
sceneNode,
114 Core::RenderingDataManager * renderingDataManager,
115 bool isVisible_ =
true,
116 const std::string & name_ =
"game object"
131 entt::entity & actor,
133 std::shared_ptr<Entities::SceneNode>
sceneNode,
134 Core::RenderingDataManager * renderingDataManager,
135 bool isVisible_ =
true,
136 const std::string & name_ =
"game object"
bool isCollisionEnabled() const
Returns whether collision generation has been requested.
static constexpr const char * ComponentName
Component registry name.
void ensurePhysicsBody()
Adds a PhysicsBody to the owning actor if needed and applies the static flag.
void removeOwnedCollision()
Removes collision components created and owned by this component.
CollidableMesh(Entities::Scene *owningScene, entt::entity &actor, Assets::GltfRenderableHandle renderable, std::shared_ptr< Entities::SceneNode > sceneNode, bool isVisible_=true, const std::string &name_="game object")
Constructs a collidable mesh from a glTF renderable handle using the engine rendering data manager.
CollidableMesh(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")
Constructs a collidable mesh from a geometry mesh handle with an explicit rendering data manager.
bool createCollisionFromProperties()
Creates collision components from imported glTF collision properties.
CollidableMesh(Entities::Scene *owningScene, entt::entity &actor, Assets::GeometryMeshHandle mesh, std::shared_ptr< Entities::SceneNode > sceneNode, bool isVisible_=true, const std::string &name_="game object")
Constructs a collidable mesh from a geometry mesh handle using the engine rendering data manager.
CollidableMesh(Entities::Scene *owningScene, entt::entity &actor, Asset::MeshPath asset, std::shared_ptr< Entities::SceneNode > sceneNode, bool isVisible_=true, const std::string &name_="game object")
Constructs a collidable mesh using the engine rendering data manager.
void rebuildOwnedCollision()
Rebuilds all collision owned by this component from imported properties or fallback bounds.
void setCollisionProperties(const Assets::Loaders::GltfLoader::VulkanSchneeExtension::CollisionProperties &properties)
Sets imported collision properties used to build collision components.
bool createFallbackBoxCollision()
Creates a BoxCollision from the resolved mesh asset's local vertex bounds.
void loadCollisionPropertiesFromAsset()
Loads authored glTF collision properties for this mesh asset when available.
Assets::Loaders::GltfLoader::VulkanSchneeExtension::CollisionProperties CollisionProperties
CollidableMesh(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")
Constructs a collidable mesh from a glTF renderable handle with an explicit rendering data manager.
void clearCollisionProperties()
Clears imported collision properties and falls back to mesh bounds when collision is enabled.
void endPlay() override
Removes collision owned by this component, then ends mesh playback.
CollidableMesh(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")
Constructs a collidable mesh with an explicit rendering data manager.
void onMeshAssetResolved(Assets::MeshAssetRef meshAsset) override
Handles mesh asset resolution and builds deferred fallback collision when requested.
void enableCollision(bool enabled)
Enables or disables generated collision for this mesh.
bool collisionPropertiesResolved_
void setCollisionStatic(bool isStatic)
Sets whether the generated PhysicsBody should be static.
std::optional< CollisionProperties > collisionProperties_
std::vector< Collision * > ownedCollisionChildren_
void markCollisionPropertiesResolved()
Marks authored collision metadata as already inspected for this mesh.
std::optional< std::shared_ptr< Entities::SceneNode > > sceneNode
Scene node used for transforms.
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.
Owns scene entities, actor lifetime, and the scene graph root.
AssetHandle< GltfRenderableHandleTag > GltfRenderableHandle
Handle to one mesh-bearing node inside a glTF file.
Asset::Ref< Asset::MeshPath, Mesh > MeshAssetRef
Asset reference to mesh geometry loaded from a mesh asset path.
AssetHandle< GeometryMeshHandleTag > GeometryMeshHandle
Handle to non-skinned mesh geometry.
Identifies a named mesh-like asset inside an asset file.
Collision shape properties imported from Blender.