rendering,ui: sync selection circle to renderer instance position

The selection circle was positioned using the entity's game-logic
interpolator (entity->getX/Y/Z), while the actual M2 model is
positioned by CharacterRenderer's independent interpolator (moveInstanceTo).
These two systems can drift apart during movement, causing the circle
to appear under the wrong position relative to the visible model.

Fix: add CharacterRenderer::getInstancePosition / Application::getRenderPositionForGuid
and use the renderer's inst.position for XY (with footZ override for Z)
so the circle always tracks the rendered model exactly. Falls back to
the entity game-logic position when no CharacterRenderer instance exists.
This commit is contained in:
Kelsi 2026-03-10 06:33:44 -07:00
parent 463e3f5ed1
commit ea9c7e68e7
5 changed files with 48 additions and 5 deletions

View file

@ -3175,6 +3175,13 @@ bool CharacterRenderer::getInstanceFootZ(uint32_t instanceId, float& outFootZ) c
return true;
}
bool CharacterRenderer::getInstancePosition(uint32_t instanceId, glm::vec3& outPos) const {
auto it = instances.find(instanceId);
if (it == instances.end()) return false;
outPos = it->second.position;
return true;
}
void CharacterRenderer::detachWeapon(uint32_t charInstanceId, uint32_t attachmentId) {
auto charIt = instances.find(charInstanceId);
if (charIt == instances.end()) return;