| 43 | } |
| 44 | |
| 45 | void VoxelMap::setSlice(int z, sp<VoxelSlice> slice) |
| 46 | { |
| 47 | this->centreChanged = true; |
| 48 | if (z < 0 || static_cast<unsigned>(z) >= this->slices.size()) |
| 49 | { |
| 50 | return; |
| 51 | } |
| 52 | // Slices greater than map size are fine, we will just ignore extra pixels |
| 53 | if (slice->getSize().x < this->size.x || slice->getSize().y < this->size.y) |
| 54 | { |
| 55 | return; |
| 56 | } |
| 57 | this->slices[z] = slice; |
| 58 | } |
| 59 | |
| 60 | void VoxelMap::calculateCentre() |
| 61 | { |