X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=src%2Fgeometry%2Fprimitive.hpp;h=52a3617835245382b6e2014091116cc881fc3c87;hb=c2bf905f4b9863fe0f5c876ed00fe298cb95ab6b;hp=76064c1b13f8ce2e26ef26075e3e44b8dce9c750;hpb=dcd54cacda98c2c0f7cf0c7a9131fb858d8ee10a;p=blank.git diff --git a/src/geometry/primitive.hpp b/src/geometry/primitive.hpp index 76064c1..52a3617 100644 --- a/src/geometry/primitive.hpp +++ b/src/geometry/primitive.hpp @@ -102,7 +102,7 @@ struct Plane { Plane(const glm::vec3 &n, float d) : normal(n), dist(d) { } - Plane(const glm::vec4 &abcd) + explicit Plane(const glm::vec4 &abcd) : normal(abcd), dist(abcd.w) { } void Normalize() noexcept { @@ -130,14 +130,14 @@ struct Frustum { const Plane &Far() const noexcept { return plane[5]; } /// create frustum from transposed MVP - Frustum(const glm::mat4 &mat) + explicit Frustum(const glm::mat4 &mat) : plane{ - { mat[3] + mat[0] }, - { mat[3] - mat[0] }, - { mat[3] + mat[1] }, - { mat[3] - mat[1] }, - { mat[3] + mat[2] }, - { mat[3] - mat[2] }, + Plane{ mat[3] + mat[0] }, + Plane{ mat[3] - mat[0] }, + Plane{ mat[3] + mat[1] }, + Plane{ mat[3] - mat[1] }, + Plane{ mat[3] + mat[2] }, + Plane{ mat[3] - mat[2] }, } { } void Normalize() noexcept {