cgv
Loading...
Searching...
No Matches
cgv::data::ray_intersectable Class Referenceabstract

An interface to define objects that are intersectable with a ray. More...

#include <bvh.h>

Public Member Functions

virtual cgv::box3 get_bounds () const =0
 Return the axis-aligned bounding box of the primitive.
 
virtual bool intersect (const cgv::ray3 &ray, ray_intersection_info &info) const =0
 Test if the object is intersected by the given ray.
 

Detailed Description

An interface to define objects that are intersectable with a ray.

Definition at line 27 of file bvh.h.

Constructor & Destructor Documentation

◆ ray_intersectable()

cgv::data::ray_intersectable::ray_intersectable ( )
inline

Definition at line 29 of file bvh.h.

◆ ~ray_intersectable()

virtual cgv::data::ray_intersectable::~ray_intersectable ( )
inlinevirtual

Definition at line 30 of file bvh.h.

Member Function Documentation

◆ intersect()

virtual bool cgv::data::ray_intersectable::intersect ( const cgv::ray3 ray,
ray_intersection_info info 
) const
pure virtual

Test if the object is intersected by the given ray.

The info struct collects additional information about the intersection. The ray parameter t must be set to ensure correct behaviour in any potential outside traversal procedures. The remaining data is optional and may be set as available by the primitive and needed by the caller site.

Parameters
rayThe ray to intersect with.
infoThe ray_intersection_info to collect additional intersection data.
Returns
True if the object is intersected by the ray; false otherwise.

Referenced by cgv::data::bvh::closest_intersection().


The documentation for this class was generated from the following file: