#
SurfaceGroup class
#include <darts/surface_group.h>

A collection of Surfaces grouped together.

Provides an interface for treating a collection of Surfaces as a single Surface. This base class implements a naive linear-time intersection routine which simply intersects each ray with every child Surface.

This class also serves as the superclass for acceleration structures (such as BVHs, KD-Trees) which are responsible for performing ray-surface intersection tests against a collection of Surfaces.

We derive SurfaceGroup from XformedSurface so that nested SurfaceGroups can be individually positioned/oriented with respect to their parent.

## Base classes

- class XformedSurface
- A convenience subclass of Surface for surfaces with a Transform.

## Derived classes

- struct BBH
- An axis-aligned bounding box hierarchy acceleration structure.

## Constructors, destructors, conversion operators

- SurfaceGroup(const json& j = json::object())
- Create a new naive accelerator, add children if they are specified in
`j`

.

## Public functions

## Protected variables

- vector<shared_ptr<Surface>> m_surfaces
- All children.

## Function documentation

###
bool SurfaceGroup:: intersect(const Ray3f& ray,
HitInfo& hit) const override

Intersect a ray against all surfaces registered with the Accelerator.

Parameters | |
---|---|

ray in | A 3-dimensional ray data structure with minimum/maximum extent information |

hit out | A detailed intersection record, which will be filled by the intersection query |

Returns | True if an intersection was found |

Intersect a ray against this surface and return detailed intersection information.