Surfaces module

Geometric surfaces in the scene which can be intersected by rays.

Classes

struct Mesh
A triangle mesh.
class Sphere
A sphere centered at the origin with radius m_radius.
struct HitInfo
Contains information about a ray intersection hit point.
class Surface
This is the abstract superclass for all surfaces.
class XformedSurface
A convenience subclass of Surface for surfaces with a Transform.
class XformedSurfaceWithMaterial
Adds a Material to XformedSurface.
class SurfaceGroup
A collection of Surfaces grouped together.
class Triangle
An instance of a triangle for a given face in a mesh.
struct BBH
An axis-aligned bounding box hierarchy acceleration structure.
struct BBHNode
A node of an axis-aligned bounding box hierarchy.
class Quad
A quad spanning from -m_size / 2 to m_size / 2 in the (x,y)-plane at z=0.

Functions

auto single_triangle_intersect(const Ray3f& ray, const Vec3f& v0, const Vec3f& v1, const Vec3f& v2, const Vec3f* n0, const Vec3f* n1, const Vec3f* n2, const Vec2f* t0, const Vec2f* t1, const Vec2f* t2, HitInfo& hit, const Material* material = nullptr) -> bool
Intersect a ray with a single triangle.

Function documentation

bool single_triangle_intersect(const Ray3f& ray, const Vec3f& v0, const Vec3f& v1, const Vec3f& v2, const Vec3f* n0, const Vec3f* n1, const Vec3f* n2, const Vec2f* t0, const Vec2f* t1, const Vec2f* t2, HitInfo& hit, const Material* material = nullptr)

Intersect a ray with a single triangle.