An interface for the acceleration structure. More...

#include <accel.h>

Inheritance diagram for Accel:
Configurable Component SIMDAlignedType Accel_BVH Accel_BVHSAH Accel_BVHSAHBin Accel_BVHSAHXYZ Accel_Naive Accel_NanoRT Accel_QBVH

Public Member Functions

 LM_INTERFACE_CLASS (Accel, Configurable, 2)
 
 LM_DISABLE_COPY_AND_MOVE (Accel)
 
 LM_INTERFACE_F (0, Build, bool(const Scene *scene))
 Build the acceleration structure. More...
 
 LM_INTERFACE_F (1, Intersect, bool(const Scene *scene, const Ray &ray, Intersection &isect, Float minT, Float maxT))
 Intersection query with triangles. More...
 
- Public Member Functions inherited from Configurable
 LM_INTERFACE_CLASS (Configurable, Component, 1)
 
 LM_DISABLE_COPY_AND_MOVE (Configurable)
 
 LM_INTERFACE_F (0, Initialize, bool(const PropertyNode *prop))
 Initialize the configurable component. More...
 
- Public Member Functions inherited from SIMDAlignedType
void * operator new (std::size_t size) throw (std::bad_alloc)
 
void operator delete (void *p)
 

Detailed Description

An interface for the acceleration structure.

Member Function Documentation

Accel::LM_INTERFACE_F ( ,
Build  ,
bool(const Scene *scene)   
)

Build the acceleration structure.

Some scene may have an acceleration structure for the optimization. The function is automatically called by the Asset::Load function.

Parameters
sceneLoaded scene.
Return values
trueSucceeded to build.
falseFailed to build.
Accel::LM_INTERFACE_F ( ,
Intersect  ,
bool(const Scene *scene, const Ray &ray, Intersection &isect, Float minT, Float maxT)   
)

Intersection query with triangles.

The function checks if ray hits with the scene. This function is supposed to be accelerated by spatial acceleration structure. When intersected, information on the hit point is stored in the intersection data. The intersection is valid only with the range of the distance between minT and maxT.

Parameters
sceneScene.
rayRay.
isectIntersection data.
minTMinimum range of the distance.
minTMaximum range of the distance.
Return values
trueIntersected with the scene.
falseNot intersected with the scene.