| 37 | int BridgeCacheSlotID = 0; |
| 38 | |
| 39 | int FloorInfo::GetSurfaceTriangleID(int x, int z, bool isFloor) const |
| 40 | { |
| 41 | constexpr auto TRI_ID_0 = 0; |
| 42 | constexpr auto TRI_ID_1 = 1; |
| 43 | |
| 44 | static const auto ROT_MATRIX_0 = Matrix::CreateRotationZ(TO_RAD(SectorSurfaceData::SPLIT_ANGLE_0)); |
| 45 | static const auto ROT_MATRIX_1 = Matrix::CreateRotationZ(TO_RAD(SectorSurfaceData::SPLIT_ANGLE_1)); |
| 46 | |
| 47 | // Get matrix. |
| 48 | const auto& rotMatrix = isFloor ? |
| 49 | ((FloorSurface.SplitAngle == SectorSurfaceData::SPLIT_ANGLE_0) ? ROT_MATRIX_0 : ROT_MATRIX_1) : |
| 50 | ((CeilingSurface.SplitAngle == SectorSurfaceData::SPLIT_ANGLE_0) ? ROT_MATRIX_0 : ROT_MATRIX_1); |
| 51 | |
| 52 | // Calculate bias. |
| 53 | auto sectorPoint = GetSectorPoint(x, z).ToVector2(); |
| 54 | float bias = Vector2::Transform(sectorPoint, rotMatrix).x; |
| 55 | |
| 56 | // Return triangle ID according to bias. |
| 57 | return ((bias < 0.0f) ? TRI_ID_0 : TRI_ID_1); |
| 58 | } |
| 59 | |
| 60 | const SectorSurfaceTriangleData& FloorInfo::GetSurfaceTriangle(int x, int z, bool isFloor) const |
| 61 | { |
no test coverage detected