X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fentity.cpp;h=23586010e1183f4238420d73e5ba458414748711;hb=4ef32c5a4a5bdb6da8383f66d8265715eb2ed4f9;hp=b24835030884be373db2d3a9adfcaeea2d8f42b5;hpb=9eb7fb38870c6324580683752d49d62b7a431bce;p=blank.git diff --git a/src/entity.cpp b/src/entity.cpp index b248350..2358601 100644 --- a/src/entity.cpp +++ b/src/entity.cpp @@ -1,6 +1,7 @@ #include "entity.hpp" -#include "chunk.hpp" +#include "geometry.hpp" +#include "shape.hpp" #include #include @@ -25,7 +26,7 @@ Entity::Entity() } -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); @@ -93,7 +94,7 @@ glm::mat4 Entity::Transform(const Chunk::Pos &chunk_offset) const { 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;