Offset values may be used to account for the quirk of room traversal only being able to occur at portals.
| 754 | |
| 755 | // Offset values may be used to account for the quirk of room traversal only being able to occur at portals. |
| 756 | bool UpdateLaraRoom(ItemInfo* item, int height, int xOffset, int zOffset) |
| 757 | { |
| 758 | auto point = Geometry::TranslatePoint(item->Pose.Position, item->Pose.Orientation.y, zOffset, height, xOffset); |
| 759 | |
| 760 | // Hacky L-shaped Location traversal. |
| 761 | item->Location = GetRoomVector(item->Location, point); |
| 762 | item->Location = GetRoomVector(item->Location, Vector3i(item->Pose.Position.x, point.y, item->Pose.Position.z)); |
| 763 | item->Floor = GetSurfaceHeight(item->Location, item->Pose.Position.x, item->Pose.Position.z, true).value_or(NO_HEIGHT); |
| 764 | |
| 765 | if (item->RoomNumber != item->Location.RoomNumber) |
| 766 | { |
| 767 | ItemNewRoom(item->Index, item->Location.RoomNumber); |
| 768 | return true; |
| 769 | } |
| 770 | |
| 771 | return false; |
| 772 | } |