Revert "Core/Entities: Fixed relative position calculation formula in Position::GetPositionOffsetTo"

This reverts commit 4a7fcfe354.
This commit is contained in:
Shauren
2025-10-14 22:09:40 +02:00
parent 30131e820c
commit 133f8693f4

View File

@@ -51,8 +51,8 @@ void Position::GetPositionOffsetTo(Position const& endPos, Position& retOffset)
float dx = endPos.GetPositionX() - GetPositionX();
float dy = endPos.GetPositionY() - GetPositionY();
retOffset.m_positionX = (dx + dy * std::tan(GetOrientation())) / (std::cos(GetOrientation()) + std::sin(GetOrientation()) * std::tan(GetOrientation()));
retOffset.m_positionY = (dy - dx * std::tan(GetOrientation())) / (std::cos(GetOrientation()) + std::sin(GetOrientation()) * std::tan(GetOrientation()));
retOffset.m_positionX = dx * std::cos(GetOrientation()) + dy * std::sin(GetOrientation());
retOffset.m_positionY = dy * std::cos(GetOrientation()) - dx * std::sin(GetOrientation());
retOffset.m_positionZ = endPos.GetPositionZ() - GetPositionZ();
retOffset.SetOrientation(endPos.GetOrientation() - GetOrientation());
}