HitPoint nearest_hit;
nearest_hit.dist = FLT_MAX;
- nearest_hit.obj = 0;
+ nearest_hit.data = 0;
if(Mesh::intersect_mode & ISECT_VERTICES) {
// we asked for "intersections" with the vertices of the mesh
if(nearest_vidx != -1) {
hitvert = varr[nearest_vidx];
- nearest_hit.obj = &hitvert;
+ nearest_hit.data = &hitvert;
}
} else {
}
}
- if(nearest_hit.obj) {
+ if(nearest_hit.data) {
if(hit) {
*hit = nearest_hit;
// if we are interested in the mesh and not the faces set obj to this
if(Mesh::intersect_mode & ISECT_FACE) {
- hit->obj = &hitface;
+ hit->data = &hitface;
} else if(Mesh::intersect_mode & ISECT_VERTICES) {
- hit->obj = &hitvert;
+ hit->data = &hitvert;
} else {
- hit->obj = this;
+ hit->data = (void*)this;
}
}
return true;
hit->dist = t;
hit->pos = ray.origin + ray.dir * t;
hit->normal = normal;
- hit->obj = this;
+ hit->data = (void*)this;
}
return true;
}