| 6 | VoxelSlice::VoxelSlice(Vec2<int> size) : size(size), bits(size.x * size.y) {} |
| 7 | |
| 8 | bool VoxelSlice::getBit(Vec2<int> pos) const |
| 9 | { |
| 10 | if (pos.x < 0 || pos.x >= this->size.x || pos.y < 0 || pos.y >= this->size.y) |
| 11 | { |
| 12 | return false; |
| 13 | } |
| 14 | |
| 15 | return this->bits[pos.y * this->size.x + pos.x]; |
| 16 | } |
| 17 | |
| 18 | void VoxelSlice::setBit(Vec2<int> pos, bool b) |
| 19 | { |