25 #ifndef HERMES_GEOMETRY_SURFACE_INTERFACE_H
26 #define HERMES_GEOMETRY_SURFACE_INTERFACE_H
28 #include <hermes/geometry/bbox.h>
46 virtual bbox2 boundingBox()
const = 0;
47 virtual void closestIntersection(
const Ray2 &r,
49 virtual bool intersects(
const Ray2 &r)
const {
51 closestIntersection(r, &i);
63 virtual double signedDistance(
const point2 &p)
const = 0;
79 virtual bbox3 boundingBox()
const = 0;
80 virtual void closestIntersection(
const Ray3 &r,
82 virtual bool intersects(
const Ray3 &r)
const {
84 closestIntersection(r, &i);
87 virtual double closestDistance(
const point3 &p)
const {
96 virtual double signedDistance(
const point3 &p)
const = 0;
float real_t
default floating point type
Definition: defs.h:75
HERMES_DEVICE_CALLABLE real_t distance(const Point2< T > &a, const Point2< T > &b)
Computes the Euclidean distance between two points.
Definition: point.h:295
point2 point
intersection point
Definition: surface.h:36
double t
parametric coordinate from ray
Definition: surface.h:35
bool exists
true if intersection exists
Definition: surface.h:34
normal2 normal
intersection normal
Definition: surface.h:37
double t
parametric coordinate from ray
Definition: surface.h:68
normal3 normal
intersection normal
Definition: surface.h:70
point3 point
intersection point
Definition: surface.h:69
bool exists
true if intersection exists
Definition: surface.h:67