| 105 | } |
| 106 | |
| 107 | bool FloorInfo::IsSurfaceDiagonalStep(bool isFloor) const |
| 108 | { |
| 109 | // 1) Test if surface is split. |
| 110 | if (!IsSurfaceSplit(isFloor)) |
| 111 | return false; |
| 112 | |
| 113 | const auto& surface = isFloor ? FloorSurface : CeilingSurface; |
| 114 | |
| 115 | // 2) Test if plane distances are equal. |
| 116 | // TODO: This check will fail if distances are equal but planes criss-cross. Update this for improved TE geometry building in future. |
| 117 | float dist0 = surface.Triangles[0].Plane.D(); |
| 118 | float dist1 = surface.Triangles[1].Plane.D(); |
| 119 | if (dist0 == dist1) |
| 120 | return false; |
| 121 | |
| 122 | // 3) Test if split angle is aligned diagonal. NOTE: Non-split surfaces default to 0 degrees. |
| 123 | if (surface.SplitAngle != SectorSurfaceData::SPLIT_ANGLE_0 && |
| 124 | surface.SplitAngle != SectorSurfaceData::SPLIT_ANGLE_1) |
| 125 | { |
| 126 | return false; |
| 127 | } |
| 128 | |
| 129 | return true; |
| 130 | } |
| 131 | |
| 132 | bool FloorInfo::IsSurfaceSplitPortal(bool isFloor) const |
| 133 | { |
no outgoing calls
no test coverage detected