X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fmesh.cc;h=beb5b4940a7bd6ecafb58cc3081ab92b38cada79;hp=ed4fd9828ecc6ca059e89322b9beaf668d147c20;hb=b7c92831285013b2a0783bccaf3d900545ebb5ba;hpb=a58455a92c7ecab980cbe1b7e282aeb6bfe7e889 diff --git a/src/mesh.cc b/src/mesh.cc index ed4fd98..beb5b49 100644 --- a/src/mesh.cc +++ b/src/mesh.cc @@ -903,7 +903,7 @@ bool Mesh::intersect(const Ray &ray, HitPoint *hit) const 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 @@ -934,7 +934,7 @@ bool Mesh::intersect(const Ray &ray, HitPoint *hit) const if(nearest_vidx != -1) { hitvert = varr[nearest_vidx]; - nearest_hit.obj = &hitvert; + nearest_hit.data = &hitvert; } } else { @@ -961,17 +961,17 @@ bool Mesh::intersect(const Ray &ray, HitPoint *hit) const } } - 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; @@ -1432,7 +1432,7 @@ bool Triangle::intersect(const Ray &ray, HitPoint *hit) const hit->dist = t; hit->pos = ray.origin + ray.dir * t; hit->normal = normal; - hit->obj = this; + hit->data = (void*)this; } return true; }