diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ray.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -43,6 +43,18 @@ public: } bool + intersectPlane(const PositionType orig, const Direction3D norm, RelativeDistance & distance) const + { + if constexpr (std::is_floating_point_v<typename PositionType::value_type>) { + return glm::intersectRayPlane(start, direction, orig, norm, distance) && distance >= 0.F; + } + else { + const RelativePosition3D origr = orig - start; + return glm::intersectRayPlane({}, direction, origr, norm, distance) && distance >= 0.F; + } + } + + bool intersectTriangle(const PositionType t0, const PositionType t1, const PositionType t2, BaryPosition & bary, RelativeDistance & distance) const { |