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

Binds a world-space widget texture to a mesh through a runtime material. More...

#include <WorldUiSurfaceComponent.h>

Inheritance diagram for Engine::Components::WorldUiSurfaceComponent:
Collaboration diagram for Engine::Components::WorldUiSurfaceComponent:

Public Member Functions

 WorldUiSurfaceComponent (Entities::Scene *scene, Mesh *mesh, WidgetComponent *widget, Asset::MeshPath materialPath, WorldUiMaterialSettings settings={})
void beginPlay () override
 Called when the component is added to the scene or the game starts.
void tick (double deltaTime) override
 Called every frame if ticking is enabled.
bool isMaterialInstalled () const
Assets::MaterialHandle getMaterialHandle () const
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 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.

Private Member Functions

void tryInstallMaterial ()

Private Attributes

Mesh * mesh_ = nullptr
WidgetComponent * widget_ = nullptr
Asset::MeshPath materialPath_
WorldUiMaterialSettings settings_
Assets::RuntimeMaterialLease materialLease_
bool loggedWaitingForDescriptor_ = false

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

Binds a world-space widget texture to a mesh through a runtime material.

Definition at line 30 of file WorldUiSurfaceComponent.h.

Constructor & Destructor Documentation

◆ WorldUiSurfaceComponent()

Engine::Components::WorldUiSurfaceComponent::WorldUiSurfaceComponent ( Entities::Scene * scene,
Mesh * mesh,
WidgetComponent * widget,
Asset::MeshPath materialPath,
WorldUiMaterialSettings settings = {} )

Member Function Documentation

◆ beginPlay()

void Engine::Components::WorldUiSurfaceComponent::beginPlay ( )
overridevirtual

Called when the component is added to the scene or the game starts.

Reimplemented from Engine::Components::Logic.

◆ getMaterialHandle()

Assets::MaterialHandle Engine::Components::WorldUiSurfaceComponent::getMaterialHandle ( ) const
inlinenodiscard

Definition at line 45 of file WorldUiSurfaceComponent.h.

References materialLease_.

◆ isMaterialInstalled()

bool Engine::Components::WorldUiSurfaceComponent::isMaterialInstalled ( ) const
inlinenodiscard

Definition at line 44 of file WorldUiSurfaceComponent.h.

References materialLease_.

◆ tick()

void Engine::Components::WorldUiSurfaceComponent::tick ( double deltaTime)
overridevirtual

Called every frame if ticking is enabled.

Parameters
deltaTimeTime elapsed since last frame.

Reimplemented from Engine::Components::Logic.

◆ tryInstallMaterial()

void Engine::Components::WorldUiSurfaceComponent::tryInstallMaterial ( )
private

Member Data Documentation

◆ loggedWaitingForDescriptor_

bool Engine::Components::WorldUiSurfaceComponent::loggedWaitingForDescriptor_ = false
private

Definition at line 55 of file WorldUiSurfaceComponent.h.

◆ materialLease_

Assets::RuntimeMaterialLease Engine::Components::WorldUiSurfaceComponent::materialLease_
private

Definition at line 54 of file WorldUiSurfaceComponent.h.

Referenced by getMaterialHandle(), and isMaterialInstalled().

◆ materialPath_

Asset::MeshPath Engine::Components::WorldUiSurfaceComponent::materialPath_
private

Definition at line 52 of file WorldUiSurfaceComponent.h.

◆ mesh_

Mesh* Engine::Components::WorldUiSurfaceComponent::mesh_ = nullptr
private

Definition at line 50 of file WorldUiSurfaceComponent.h.

◆ settings_

WorldUiMaterialSettings Engine::Components::WorldUiSurfaceComponent::settings_
private

Definition at line 53 of file WorldUiSurfaceComponent.h.

◆ widget_

WidgetComponent* Engine::Components::WorldUiSurfaceComponent::widget_ = nullptr
private

Definition at line 51 of file WorldUiSurfaceComponent.h.


The documentation for this class was generated from the following file: