mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
fix: correct chat bubble Y-coordinate projection
The camera bakes the Vulkan Y-flip into the projection matrix, so no extra Y-inversion is needed when converting NDC to screen pixels. This matches the convention used by the nameplate and minimap marker code. The old formula double-flipped Y, causing chat bubbles to appear at mirrored positions (e.g. below characters instead of above their heads).
This commit is contained in:
parent
17022b9b40
commit
8858edde05
1 changed files with 3 additions and 1 deletions
|
|
@ -13748,7 +13748,9 @@ void GameScreen::renderChatBubbles(game::GameHandler& gameHandler) {
|
||||||
|
|
||||||
glm::vec2 ndc(clipPos.x / clipPos.w, clipPos.y / clipPos.w);
|
glm::vec2 ndc(clipPos.x / clipPos.w, clipPos.y / clipPos.w);
|
||||||
float screenX = (ndc.x * 0.5f + 0.5f) * screenW;
|
float screenX = (ndc.x * 0.5f + 0.5f) * screenW;
|
||||||
float screenY = (1.0f - (ndc.y * 0.5f + 0.5f)) * screenH; // Flip Y
|
// Camera bakes the Vulkan Y-flip into the projection matrix:
|
||||||
|
// NDC y=-1 is top, y=1 is bottom — same convention as nameplate/minimap projection.
|
||||||
|
float screenY = (ndc.y * 0.5f + 0.5f) * screenH;
|
||||||
|
|
||||||
// Skip if off-screen
|
// Skip if off-screen
|
||||||
if (screenX < -200.0f || screenX > screenW + 200.0f ||
|
if (screenX < -200.0f || screenX > screenW + 200.0f ||
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue