载入中...
搜索中...
未找到
WorldAnchorProjection.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5#include "ui/UIHost.h"
6
7#include <glm/mat4x4.hpp>
8
9#include <cstddef>
10#include <vector>
11
12namespace eve::ui {
13
17 float screenX = 0.f;
18 float screenY = 0.f;
19 float depth = 0.f;
20 float scale = 1.f;
21 bool render = false;
22};
23
26 std::size_t stableIndex = 0;
27 float screenX = 0.f;
28 float screenY = 0.f;
29 float width = 0.f;
30 float height = 0.f;
31 float pivotX = 0.f;
32 float pivotY = 0.f;
33 float depth = 0.f;
34 float safeMargin = 0.f;
35 float padding = 0.f;
36 float maxDisplacement = 0.f;
37 int priority = 0;
38 bool avoidOverlap = false;
39};
40
43 std::size_t stableIndex = 0;
44 float screenX = 0.f;
45 float screenY = 0.f;
46 float displacementX = 0.f;
47 float displacementY = 0.f;
48 bool render = false;
49};
50
64 const glm::mat4 &viewProjection,
65 float cameraX, float cameraY, float cameraZ,
66 float viewportWidth, float viewportHeight);
67
76[[nodiscard]] EVENGINE_API_WORLD std::vector<WorldAnchorLayoutResult> resolveWorldAnchorOverlaps(
77 std::vector<WorldAnchorLayoutItem> items, float viewportWidth, float viewportHeight);
78
79} // namespace eve::ui
Vec3 anchor
Definition CaveMesh.cpp:90
#define EVENGINE_API_WORLD
Definition Export.h:109
std::vector< WorldAnchorLayoutResult > resolveWorldAnchorOverlaps(std::vector< WorldAnchorLayoutItem > items, float viewportWidth, float viewportHeight)
Resolves projected host overlap with bounded deterministic vertical displacement.
WorldAnchorProjection projectWorldAnchor(const UIHost::WorldAnchor &anchor, const glm::mat4 &viewProjection, float cameraX, float cameraY, float cameraZ, float viewportWidth, float viewportHeight)
Projects one world-space UI anchor using a Vulkan RH-ZO view-projection matrix.
WorldAnchorState
Visibility result of projecting a world-space UI anchor.
Definition UIHost.h:91
Optional 3D-world projection for this UI host.
Definition UIHost.h:307
One projected host participating in deterministic screen-space placement.
Owning placement result corresponding to WorldAnchorLayoutItem::stableIndex.
Immutable result of projecting a UI world anchor into a viewport.