Skip to content

Commit

Permalink
Updated incidence angle definition for triangle primitives
Browse files Browse the repository at this point in the history
  • Loading branch information
albertoesmp committed Jan 9, 2024
1 parent 3190438 commit 78047e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/helios_version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

const char * HELIOS_VERSION = "1.3.0";

const char * HELIOS_GIT_HASH = "253259cf";
const char * HELIOS_GIT_HASH = "31904380";

const char * getHeliosVersion(){
return HELIOS_VERSION;
Expand Down
4 changes: 3 additions & 1 deletion src/scene/primitives/Triangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#define _USE_MATH_DEFINES
#include "math.h"
#include <MathConstants.h>

#include <algorithm>
#include <sstream>
Expand Down Expand Up @@ -67,7 +68,8 @@ double Triangle::getIncidenceAngle_rad(
const glm::dvec3 &rayDir,
const glm::dvec3 &intersectionPoint
){
return M_PI - glm::angle(faceNormal, rayDir);
double const angle = glm::angle(faceNormal, rayDir);
return (angle > PI_HALF) ? M_PI - angle : angle; // Return min. angle
}

// These naive methods are much faster than the built-in in Vector3D
Expand Down

0 comments on commit 78047e3

Please sign in to comment.