- Block &BlockAt(int index) { return blocks[index]; }
- const Block &BlockAt(int index) const { return blocks[index]; }
- Block &BlockAt(const glm::vec3 &pos) { return BlockAt(ToIndex(pos)); }
- const Block &BlockAt(const glm::vec3 &pos) const { return BlockAt(ToIndex(pos)); }
+ void SetBlock(int index, const Block &) noexcept;
+ void SetBlock(const Block::Pos &pos, const Block &block) noexcept { SetBlock(ToIndex(pos), block); }
+ void SetBlock(const Pos &pos, const Block &block) noexcept { SetBlock(ToIndex(pos), block); }
+
+ const Block &BlockAt(int index) const noexcept { return blocks[index]; }
+ const Block &BlockAt(const Block::Pos &pos) const noexcept { return BlockAt(ToIndex(pos)); }
+ const Block &BlockAt(const Pos &pos) const noexcept { return BlockAt(ToIndex(pos)); }
+
+ const BlockType &Type(const Block &b) const noexcept { return types->Get(b.type); }
+ const BlockType &Type(int index) const noexcept { return Type(BlockAt(index)); }
+
+ void SetLight(int index, int level) noexcept;
+ void SetLight(const Pos &pos, int level) noexcept { SetLight(ToIndex(pos), level); }
+ void SetLight(const Block::Pos &pos, int level) noexcept { SetLight(ToIndex(pos), level); }
+
+ int GetLight(int index) const noexcept;
+ int GetLight(const Pos &pos) const noexcept { return GetLight(ToIndex(pos)); }
+ int GetLight(const Block::Pos &pos) const noexcept { return GetLight(ToIndex(pos)); }
+
+ float GetVertexLight(const Pos &, const BlockModel::Position &, const Model::Normal &) const noexcept;
+
+ bool Intersection(
+ const Ray &ray,
+ const glm::mat4 &M,
+ float &dist
+ ) const noexcept {
+ return blank::Intersection(ray, Bounds(), M, &dist);
+ }