The way floordata "planes" were previously stored was non-standard. Instead of a Plane object with a normal + distance, they used a Vector3 object with data laid out as follows: x: X tilt grade (0.25f = 1/4 block). y: Z tilt grade (0.25f = 1/4 block). z: Plane's absolute height at the sector's center (i.e. distance in regular plane terms).
| 835 | // y: Z tilt grade (0.25f = 1/4 block). |
| 836 | // z: Plane's absolute height at the sector's center (i.e. distance in regular plane terms). |
| 837 | static Plane ConvertFakePlaneToPlane(const Vector3& fakePlane, bool isFloor) |
| 838 | { |
| 839 | // Calculate normal from tilt grades. |
| 840 | int sign = isFloor ? -1 : 1; |
| 841 | auto normal = Vector3(-fakePlane.x, 1.0f, -fakePlane.y) * sign; |
| 842 | normal.Normalize(); |
| 843 | |
| 844 | // Determine distance. |
| 845 | float dist = fakePlane.z; |
| 846 | |
| 847 | // Return plane. |
| 848 | return Plane(normal, dist); |
| 849 | } |
| 850 | |
| 851 | void LoadDynamicRoomData() |
| 852 | { |
no test coverage detected