assimp
[laserbrain_demo] / src / mesh.cc
index ed4fd98..beb5b49 100644 (file)
@@ -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;
 }