38 std::shared_ptr<Entities::SceneNode>
sceneNode,
39 bool isVisible_ =
true,
40 const std::string & name_ =
"game object"
47 std::shared_ptr<Entities::SceneNode>
sceneNode,
48 bool isVisible_ =
true,
49 const std::string & name_ =
"game object"
56 std::shared_ptr<Entities::SceneNode>
sceneNode,
57 bool isVisible_ =
true,
58 const std::string & name_ =
"game object"
75 std::shared_ptr<Entities::SceneNode>
sceneNode,
76 Core::RenderingDataManager * renderingDataManager,
77 bool isVisible_ =
true,
78 const std::string & name_ =
"game object"
85 std::shared_ptr<Entities::SceneNode>
sceneNode,
86 Core::RenderingDataManager * renderingDataManager,
87 bool isVisible_ =
true,
88 const std::string & name_ =
"game object"
95 std::shared_ptr<Entities::SceneNode>
sceneNode,
96 Core::RenderingDataManager * renderingDataManager,
97 bool isVisible_ =
true,
98 const std::string & name_ =
"game object"
bool isCollisionEnabled() const
Returns whether collision generation has been requested.
static constexpr const char * ComponentName
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")
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")
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")
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")
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.
void setCollisionStatic(bool isStatic)
Sets whether the generated PhysicsBody should be static.
std::optional< CollisionProperties > collisionProperties_
std::vector< Collision * > ownedCollisionChildren_
std::optional< std::shared_ptr< Entities::SceneNode > > sceneNode
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.
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
Identifies a named mesh-like asset inside an asset file.
Stores collision shape properties imported from Blender.