载入中...
搜索中...
未找到
WorldAnchorProjection.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
4
5#include "ui/UIHost.h"
6
7// Incomplete glm::mat4 is enough for const-reference parameters.
8#include <glm/fwd.hpp>
9
10#include <cstddef>
11#include <vector>
12
13namespace eve::ui {
14
18 float screenX = 0.f;
19 float screenY = 0.f;
20 float depth = 0.f;
21 float scale = 1.f;
22 bool render = false;
23};
24
27 std::size_t stableIndex = 0;
28 float screenX = 0.f;
29 float screenY = 0.f;
30 float width = 0.f;
31 float height = 0.f;
32 float pivotX = 0.f;
33 float pivotY = 0.f;
34 float depth = 0.f;
35 float safeMargin = 0.f;
36 float padding = 0.f;
37 float maxDisplacement = 0.f;
38 int priority = 0;
39 bool avoidOverlap = false;
40};
41
44 std::size_t stableIndex = 0;
45 float screenX = 0.f;
46 float screenY = 0.f;
47 float displacementX = 0.f;
48 float displacementY = 0.f;
49 bool render = false;
50};
51
65 const glm::mat4 &viewProjection,
66 float cameraX, float cameraY, float cameraZ,
67 float viewportWidth, float viewportHeight);
68
77[[nodiscard]] EVENGINE_API_WORLD std::vector<WorldAnchorLayoutResult> resolveWorldAnchorOverlaps(
78 std::vector<WorldAnchorLayoutItem> items, float viewportWidth, float viewportHeight);
79
80} // namespace eve::ui
#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:113
Optional 3D-world projection for this UI host.
Definition UIHost.h:351
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.