mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Fix game object sign orientation and restrict nameplates to target only
Game object M2 models share the same default facing (+renderX) as character models, so apply the same π/2 offset instead of π when computing renderYawM2go from canonical yaw. This corrects street signs and hanging shop signs that were 90° off after the server-yaw formula fix. Nameplates (health bar + name label) are now only rendered for the currently targeted entity, matching WoW's default UI behaviour and reducing visual noise.
This commit is contained in:
parent
6a681bcf67
commit
18e6c2e767
2 changed files with 6 additions and 1 deletions
|
|
@ -6698,7 +6698,9 @@ void Application::spawnOnlineGameObject(uint64_t guid, uint32_t entry, uint32_t
|
||||||
|
|
||||||
glm::vec3 renderPos = core::coords::canonicalToRender(glm::vec3(x, y, z));
|
glm::vec3 renderPos = core::coords::canonicalToRender(glm::vec3(x, y, z));
|
||||||
const float renderYawWmo = orientation;
|
const float renderYawWmo = orientation;
|
||||||
const float renderYawM2go = orientation + glm::radians(180.0f);
|
// M2 game objects: model default faces +renderX. renderYaw = canonical + 90° = server_yaw
|
||||||
|
// (same offset as creature/character renderer so all M2 models face consistently)
|
||||||
|
const float renderYawM2go = orientation + glm::radians(90.0f);
|
||||||
|
|
||||||
bool loadedAsWmo = false;
|
bool loadedAsWmo = false;
|
||||||
if (isWmo) {
|
if (isWmo) {
|
||||||
|
|
|
||||||
|
|
@ -4718,6 +4718,9 @@ void GameScreen::renderNameplates(game::GameHandler& gameHandler) {
|
||||||
auto* unit = dynamic_cast<game::Unit*>(entityPtr.get());
|
auto* unit = dynamic_cast<game::Unit*>(entityPtr.get());
|
||||||
if (!unit || unit->getMaxHealth() == 0) continue;
|
if (!unit || unit->getMaxHealth() == 0) continue;
|
||||||
|
|
||||||
|
// Only show nameplate for the currently targeted unit
|
||||||
|
if (guid != targetGuid) continue;
|
||||||
|
|
||||||
// Convert canonical WoW position → render space, raise to head height
|
// Convert canonical WoW position → render space, raise to head height
|
||||||
glm::vec3 renderPos = core::coords::canonicalToRender(
|
glm::vec3 renderPos = core::coords::canonicalToRender(
|
||||||
glm::vec3(unit->getX(), unit->getY(), unit->getZ()));
|
glm::vec3(unit->getX(), unit->getY(), unit->getZ()));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue