Base class for accelerators.
virtual bool build()
Build this accelerator.
Accelerator(std::vector< Shape * > *_shapes, BBox &_globalBox)
leafTreatment::treatment intersectionChoice
Intersection choice.
decimal(* pLeafTreatmentFunction)(std::list< Intersection > &, decimal)
Pointer to the treatment function of leaf.
Accelerator()
Constructors.
Accelerator(const Accelerator &other)
Copy constructor.
BBox globalBox
Global bounding box.
virtual ~Accelerator()
Destructor.
void setIntersectionChoice(leafTreatment::treatment _intersectionChoice=leafTreatment::FIRST)
leafTreatment::treatment getIntersectionChoice()
Get/Set the Intersection choice.
virtual decimal traverse(Ray *r, std::list< Intersection > &result) const
Run this accelerator.
void defineLeafFunction()
To define leaf function.
std::vector< Shape * > * shapes
Vector of pointers to shapes.
Definition of a bounding box which is aligned along the axis (BBox AABB).
: Describes a ray by a pair of unsigned int. The first one gives the source number (in the range 0-40...
decimal keepAll(std::list< Intersection > ¤tIntersections, decimal currentTmin)
Keep all intersections before reaching currentTmin and return the tmin of the first one encountered.
@ ALL_BEFORE_TRIANGLE
ALL_BEFORE_TRIANGLE.
@ ALL_BEFORE_VISIBLE
ALL_BEFORE_VISIBLE.
decimal keepAllBeforeVisible(std::list< Intersection > ¤tIntersections, decimal currentTmin)
Keep all intersections encountered before intersecting a triangle and before reaching currentTmin,...
decimal keepAllBeforeTriangle(std::list< Intersection > ¤tIntersections, decimal currentTmin)
Keep all intersections encountered before intersecting a visible shape and before reaching currentTmi...
decimal keepFirst(std::list< Intersection > ¤tIntersections, decimal currentTmin)
Keep only the first intersection encountered before reaching currentTmin and return its corresponding...