mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Revert "Core/Entities: Fixed relative position calculation formula in Position::GetPositionOffsetTo"
This reverts commit 4a7fcfe354.
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user