#include "entity.hpp"
-#include "chunk.hpp"
+#include "geometry.hpp"
+#include "shape.hpp"
#include <cmath>
#include <glm/gtx/transform.hpp>
}
-void Entity::SetShape(Shape *s, const glm::vec3 &color) {
+void Entity::SetShape(const Shape *s, const glm::vec3 &color) {
shape = s;
model_buffer.Clear();
shape->Vertices(model_buffer.vertices, model_buffer.normals, model_buffer.indices);
Ray Entity::Aim(const Chunk::Pos &chunk_offset) const {
glm::mat4 transform = Transform(chunk_offset);
- glm::vec4 from = transform * glm::vec4(0.0f, 0.0f, 1.0f, 1.0f);
+ glm::vec4 from = transform * glm::vec4(0.0f, 0.0f, 0.0f, 1.0f);
from /= from.w;
glm::vec4 to = transform * glm::vec4(0.0f, 0.0f, -1.0f, 1.0f);
to /= to.w;