Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
Engine::Components::Scene Class Reference

A scene component has a transform. More...

#include <SceneComponent.h>

Inheritance diagram for Engine::Components::Scene:
Collaboration diagram for Engine::Components::Scene:

Public Member Functions

 Scene (Entities::Scene *scene)
 Constructs a scene component without creating a transform entity.
 Scene (Entities::Scene *scene, const entt::entity &parent, const glm::mat4 &transform)
 Constructs a scene component with an explicit local transform matrix.
 Scene (Entities::Scene *scene, const entt::entity &parent, const glm::vec3 &position)
 Constructs a scene component at a local position.
 Scene (Entities::Scene *scene, const entt::entity &parent, const glm::vec3 &position, const glm::quat &rotation)
 Constructs a scene component at a local position and quaternion rotation.
 Scene (Entities::Scene *scene, const entt::entity &parent, const glm::vec3 &position, const glm::vec3 &rotation)
 Constructs a scene component at a local position and Euler rotation.
 Scene (Entities::Scene *scene, const entt::entity &parent, const glm::vec3 &position, const glm::quat &rotation, const glm::vec3 &scale)
 Constructs a scene component with local position, rotation, and scale.
Public Member Functions inherited from Engine::Components::Logic
 Logic (Entities::Scene *owningScene)
 Constructs a logic component owned by a scene.
 Logic (const Entities::SpawnContext &context)
 Constructs a logic component from spawn context data.
virtual ~Logic ()=default
 Destroys the logic component.
virtual std::string getComponentName () const
 Gets the component type name for debugging/UI.
virtual bool drawImGui ()
 Draws component-specific ImGui inspector controls.
virtual bool drawImGuiName ()
 Used to alter the name of the entity in the outliner.
virtual void beginPlay ()
 Called when the component is added to the scene or the game starts.
virtual void tick (double deltaTime)
 Called every frame if ticking is enabled.
virtual void endPlay ()
 Called when the component is removed or the game ends.
bool hasBegunPlay () const
 Checks whether beginPlay() has been called without a matching endPlay().
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.

Protected Attributes

entt::entity component = entt::null
 Stores the data.
Ecs::Transform * transformComponent = nullptr
 Transform data stored on the created ECS component entity.
Ecs::Parent * parentComponent = nullptr
 Parent relationship stored on the transform hierarchy entity.

Private Member Functions

void setParent (const entt::entity &parent)

Additional Inherited Members

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 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.

Detailed Description

A scene component has a transform.

Definition at line 25 of file SceneComponent.h.

Constructor & Destructor Documentation

◆ Scene() [1/6]

Engine::Components::Scene::Scene ( Entities::Scene * scene)
explicit

Constructs a scene component without creating a transform entity.

Parameters
sceneOwning scene for this component.

◆ Scene() [2/6]

Engine::Components::Scene::Scene ( Entities::Scene * scene,
const entt::entity & parent,
const glm::mat4 & transform )
explicit

Constructs a scene component with an explicit local transform matrix.

Parameters
sceneOwning scene for this component.
parentParent ECS entity for the transform hierarchy.
transformLocal transform matrix to store on the created entity.

◆ Scene() [3/6]

Engine::Components::Scene::Scene ( Entities::Scene * scene,
const entt::entity & parent,
const glm::vec3 & position )
explicit

Constructs a scene component at a local position.

Parameters
sceneOwning scene for this component.
parentParent ECS entity for the transform hierarchy.
positionLocal position for the created transform.

◆ Scene() [4/6]

Engine::Components::Scene::Scene ( Entities::Scene * scene,
const entt::entity & parent,
const glm::vec3 & position,
const glm::quat & rotation )
explicit

Constructs a scene component at a local position and quaternion rotation.

Parameters
sceneOwning scene for this component.
parentParent ECS entity for the transform hierarchy.
positionLocal position for the created transform.
rotationLocal rotation for the created transform.

◆ Scene() [5/6]

Engine::Components::Scene::Scene ( Entities::Scene * scene,
const entt::entity & parent,
const glm::vec3 & position,
const glm::vec3 & rotation )
explicit

Constructs a scene component at a local position and Euler rotation.

Parameters
sceneOwning scene for this component.
parentParent ECS entity for the transform hierarchy.
positionLocal position for the created transform.
rotationLocal Euler rotation for the created transform.

◆ Scene() [6/6]

Engine::Components::Scene::Scene ( Entities::Scene * scene,
const entt::entity & parent,
const glm::vec3 & position,
const glm::quat & rotation,
const glm::vec3 & scale )
explicit

Constructs a scene component with local position, rotation, and scale.

Parameters
sceneOwning scene for this component.
parentParent ECS entity for the transform hierarchy.
positionLocal position for the created transform.
rotationLocal rotation for the created transform.
scaleLocal scale for the created transform.

Member Function Documentation

◆ setParent()

void Engine::Components::Scene::setParent ( const entt::entity & parent)
private

Member Data Documentation

◆ component

entt::entity Engine::Components::Scene::component = entt::null
protected

Stores the data.

Definition at line 90 of file SceneComponent.h.

◆ parentComponent

Ecs::Parent* Engine::Components::Scene::parentComponent = nullptr
protected

Parent relationship stored on the transform hierarchy entity.

Definition at line 93 of file SceneComponent.h.

◆ transformComponent

Ecs::Transform* Engine::Components::Scene::transformComponent = nullptr
protected

Transform data stored on the created ECS component entity.

Definition at line 92 of file SceneComponent.h.


The documentation for this class was generated from the following file:
  • /workspace/magerbeton/gl3-vulkan/code/Engine/include/Engine/Component/SceneComponent.h