Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
WorldUiSurfaceComponent.h
1#pragma once
2
3#include "Engine/Asset/AssetHandles.h"
4#include "Engine/Component/LogicComponent.h"
5#include "Engine/Files/Path.h"
6#include "Engine/Material/RuntimeMaterialLease.h"
7
8#include <glm/vec3.hpp>
9#include <glm/vec4.hpp>
10
11namespace Engine::Components
12{
13 class Mesh;
14 class WidgetComponent;
15
17 {
18 glm::vec4 baseColorFactor{ 1.0f };
19 glm::vec3 emissiveFactor{ 3.0f };
20 float alphaCutoff = 0.01f;
21 float roughness = 0.8f;
22 float metallic = 0.0f;
23 float shScale = 0.0f;
24 float ambientTerm = 1.0f;
25 };
26
30 class WorldUiSurfaceComponent final : public Logic
31 {
32 public:
34 Entities::Scene * scene,
35 Mesh * mesh,
36 WidgetComponent * widget,
37 Asset::MeshPath materialPath,
38 WorldUiMaterialSettings settings = {}
39 );
40
41 void beginPlay() override;
42 void tick( double deltaTime ) override;
43
44 [[nodiscard]] bool isMaterialInstalled() const { return materialLease_.isValid(); }
45 [[nodiscard]] Assets::MaterialHandle getMaterialHandle() const { return materialLease_.handle(); }
46
47 private:
49
50 Mesh * mesh_ = nullptr;
56 };
57} // namespace Engine::Components
Move-only ownership of a material created at runtime.
Logic(Entities::Scene *owningScene)
Constructs a logic component owned by a scene.
A component which can be attached as many times to an actor as one wants. It makes it possible to ren...
Runtime ImGui widget that can be rendered into a world-space UI texture.
WorldUiSurfaceComponent(Entities::Scene *scene, Mesh *mesh, WidgetComponent *widget, Asset::MeshPath materialPath, WorldUiMaterialSettings settings={})
void tick(double deltaTime) override
Called every frame if ticking is enabled.
void beginPlay() override
Called when the component is added to the scene or the game starts.
Owns scene entities, actor lifetime, and the scene graph root.
Definition Scene.h:84
AssetHandle< MaterialHandleTag > MaterialHandle
Handle to a material payload.
Identifies a named mesh-like asset inside an asset file.
Definition AssetPath.h:89