Skip to content

Commit

Permalink
stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
JulioJPinto committed May 26, 2024
1 parent 4eca55e commit b345a6e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
3 changes: 1 addition & 2 deletions engine/include/frustsum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@ struct Plane {

glm::vec3 point = { 0.f, 0.f, 0.f };
glm::vec3 normal = { 0.f, 1.f, 0.f };
glm::vec4 abcd = { 0.f, 0.f, 0.f, 0.f };

Plane() = default;
Plane(const Plane& other) = default;
Plane(const glm::vec3& normal, glm::vec3 point);

// rethink distance to point
float distanceToPoint(const glm::vec3& point) const {
return abcd.x * point.x + abcd.y * point.y + abcd.z * point.z + abcd.w;
return glm::dot(normal, point - this->point);
}


Expand Down
3 changes: 0 additions & 3 deletions engine/src/frustsum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
Plane::Plane(const glm::vec3& normal, glm::vec3 point) {
this->normal = glm::normalize(normal);
this->point = point;
float d = -normal.x * point.x - normal.y * point.y - normal.z * point.z;

this->abcd = glm::vec4(this->normal, d);
}


Expand Down

0 comments on commit b345a6e

Please sign in to comment.