8 double& range,
double &alpha)
const {
16 if( cos(alpha)*cos(direction) + sin(alpha)*sin(direction) > 0 )
28 bool Environment::ray_tracing(
const double p[2],
const double direction,
double& out_distance,
double &out_alpha,
int*stuff_id)
const {
31 double champion_range, champion_alpha;
32 for(
size_t i=0;i<stuff.size();i++) {
33 Stuff * s = stuff.at(i);
37 if(champion==-1 || range<champion_range) {
39 champion_range = range;
40 champion_alpha = alpha;
48 out_distance = champion_range;
49 out_alpha = champion_alpha;
bool ray_tracing(const double p[2], const double direction, double &out_distance, double &out_alpha, int *stuff_id) const
double normalize_0_2PI(double t)
double segment_alpha(const double p0[2], const double p1[2])
bool ray_tracing(const double p[2], const double direction, double &out_distance, double &out_alpha) const
int segment_ray_tracing(const double p0[2], const double p1[2], const double eye[2], double direction, double *range)
virtual bool ray_tracing(const double p[2], const double direction, double &out_distance, double &out_alpha) const =0