Chunk::Chunk()
: blocks(Size())
, model()
-, transform(1.0f)
, dirty(false) {
}
Chunk::Chunk(Chunk &&other)
: blocks(std::move(other.blocks))
, model(std::move(other.model))
-, transform(other.transform)
, dirty(other.dirty) {
}
Chunk &Chunk::operator =(Chunk &&other) {
blocks = std::move(other.blocks);
model = std::move(other.model);
- transform = other.transform;
dirty = other.dirty;
return *this;
}
void Chunk::Position(const glm::vec3 &pos) {
position = pos;
- transform = glm::translate(pos * Extent());
+}
+
+glm::mat4 Chunk::Transform(const glm::vec3 &offset) const {
+ return glm::translate((position - offset) * Extent());
}