| 147 | } |
| 148 | |
| 149 | cuboid cuboid::clamp(const cuboid &other) |
| 150 | { |
| 151 | if (isValid() && other.isValid()) { |
| 152 | x_min = max(x_min, other.x_min); |
| 153 | y_min = max(y_min, other.y_min); |
| 154 | z_min = max(z_min, other.z_min); |
| 155 | x_max = min(x_max, other.x_max); |
| 156 | y_max = min(y_max, other.y_max); |
| 157 | z_max = min(z_max, other.z_max); |
| 158 | } |
| 159 | else |
| 160 | clear(); |
| 161 | |
| 162 | return *this; |
| 163 | } |
| 164 | |
| 165 | cuboid cuboid::clampMap(bool block) |
| 166 | { |