45 name =
"unknown event";
183 virtual bool generateTest(std::vector<vec3>& succededTest, std::vector<vec3>& failTest,
184 unsigned int nbResponses)
244 #ifdef _ALLOW_TARGETING_
245 std::vector<vec3> targets;
Base class of Event, Material, PostFilter, Ray, Repere, Scene, Shape, Simulation, Source.
std::string name
Each instantiated object may be named.
Class describing an event (reflection, diffraction, ...)
int nbResponseLeft
Number of remaining rays to launch.
Shape * shape
The impact primitive.
virtual bool getResponse(vec3 &r, bool force=false)
Return a direction vector for the impact. Ray direction vector in response of the event.
vec3 from
Direction vector of the incoming ray.
vec3 pos
Location point of the event.
Shape * getShape()
Return the primitive of the impact.
void setIncomingDirection(const vec3 &_from)
Set a new incoming vector.
int initialNbResponse
Number of rays to launch after event.
virtual int getType() const
Return the event type.
virtual void setNbResponseLeft(int _nbResponseLeft)
Set the number of remaining rays to launch.
typeevent type
Event type.
virtual bool generateResponse(std::vector< vec3 > &responses, unsigned int nbResponses)
const decimal distance(const Event &other) const
Return distance from another event.
virtual int getInitialNbResponseLeft() const
Return the number of rays to launch after event.
virtual bool generateTest(std::vector< vec3 > &succededTest, std::vector< vec3 > &failTest, unsigned int nbResponses)
const Shape * getShape() const
Sampler * sampler
Pointer to a Sampler.
const vec3 & getPosition() const
Return a reference to the event location point.
bool isReponseLeft()
Return true if it remains rays to launch.
void setShape(Shape *_shape)
Set the impacted primitive of the event.
virtual bool appendTarget(vec3 target, bool force=false)
vec3 getIncomingDirection()
Return the direction of the incoming vector.
Event(const Event &other)
Copy constructor.
virtual double getAngle() const
Get incident angle.
virtual ~Event()
Destructor.
void setPosition(const vec3 &_pos)
Set a new point to the event.
virtual bool isAcceptableResponse(vec3 &test)
Return true if the ray direction vector in response of the event is acceptable.
int getNbResponseLeft()
Return the number of remaining rays to launch.
Event(const vec3 &position=vec3(0.0, 0.0, 0.0), const vec3 &incomingDirection=vec3(0.0, 0.0, 0.0), Shape *_shape=NULL)
Default constructor.
virtual void setType(const typeevent &_type)
Added by DTh to make possible simple test of rays.
Sampler class and its sub-classes describe ray generators used in AcousticRayTracer....
base class for shapes (Cylindre, Mesh, Sphere, Triangle,...)
base_vec3< decimal > vec3