| 192 | } |
| 193 | |
| 194 | StaticList<Vec2I, 2> WorldGeometry::splitXRegion(Vec2I const& xRegion) const { |
| 195 | if (m_size[0] == 0) |
| 196 | return {xRegion}; |
| 197 | |
| 198 | starAssert(xRegion[1] >= xRegion[0]); |
| 199 | |
| 200 | // This does not work for ranges greater than m_size[0] wide! |
| 201 | starAssert(xRegion[1] - xRegion[0] <= (int)m_size[0]); |
| 202 | |
| 203 | int x1 = xwrap(xRegion[0]); |
| 204 | int x2 = x1 + xRegion[1] - xRegion[0]; |
| 205 | |
| 206 | if (x2 > (int)m_size[0]) { |
| 207 | return {Vec2I(x1, m_size[0]), Vec2I(0.0f, x2 - m_size[0])}; |
| 208 | } else { |
| 209 | return {{x1, x2}}; |
| 210 | } |
| 211 | } |
| 212 | |
| 213 | StaticList<Vec2F, 2> WorldGeometry::splitXRegion(Vec2F const& xRegion) const { |
| 214 | if (m_size[0] == 0) |
no outgoing calls
no test coverage detected