16 #ifndef FERMAT_SELECTOR
17 #define FERMAT_SELECTOR
41 vec3 finalPos(r->getFinalPosition());
46 decimal trueLength = r->computeTrueLength(receptorPos, finalPos, closestPoint);
49 decimal epaisseur = r->getThickness(trueLength,
false);
53 static_cast<Recepteur*
>(r->getRecepteur())->getPosition().distance(closestPoint);
57 if (closestDistance >= (epaisseur / 2.))
65 virtual void insert(T* r,
unsigned long long& replace)
73 vec3 finalPos(r->getFinalPosition());
78 decimal trueLength = r->computeTrueLength(receptorPos, finalPos, closestPoint);
81 decimal epaisseur = r->getThickness(trueLength,
false);
85 static_cast<Recepteur*
>(r->getRecepteur())->getPosition().distance(closestPoint);
89 if (closestDistance >= (epaisseur / 2.))
102 return typeid(
this).
name();
: Rays can be seen as long cones that get thicker as their length increases based on their associated...
virtual const char * getSelectorName()
Return the class type of the selector.
virtual bool insertWithTest(T *r)
Select the ray if it respects the criteria of this Selector.
virtual void insert(T *r, unsigned long long &replace)
Keep the ray.
FermatSelector()
Constructor.
virtual SELECTOR_RESPOND canBeInserted(T *r, unsigned long long &replace)
Check if the ray respects the criteria of this Selector and return a SELECTOR_RESPOND.
virtual Selector< T > * Copy()
Copy Selector.
Receptor inherits from a Sphere Shape.
vec3 getPosition()
Get the center of the bounding box.
Base class for Selector (used to keep or disable rays according different criterias)
void setIsDeletable(bool _isDeletable)
Set deletable flag.
bool deletable
Flag to know if the selector may be deleted or not.
base_vec3< decimal > vec3