From ab2832a6607e8d2421c0d6c1e4489fc423c8d322 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Mon, 23 Feb 2009 20:26:45 +0000 Subject: [PATCH] fixed compile issues with switch to new Shape::IntersectionList git-svn-id: svn://anubis/fart/branches/2009-02-23_Shape_IntersectList_Update@145 7f9b0f55-74a9-4bce-be96-3c2cd072584d --- main/Scene.cc | 8 ++++---- shapes/Intersect.cc | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/main/Scene.cc b/main/Scene.cc index 425f60a..9270054 100644 --- a/main/Scene.cc +++ b/main/Scene.cc @@ -171,17 +171,17 @@ vector Scene::getRayHits(const Ray & ray) it != m_shapes.end(); it++) { - Shape::IntersectionList intersections = (*it)->intersect(ray); + Shape::IntersectionList intersections = (*it)->intersect(*it, ray); for (int i = 0, num_results = intersections.size(); i < num_results; i++) { refptr shape = intersections[i].first; - refptr isect_point = intersections[i].second; - Vector normal = shape->getNormalAt(*isect_point); + const Vector & isect_point = intersections[i].second; + Vector normal = shape->getNormalAt(isect_point); double dot = normal % ray.getDirection(); - double intersect_dist = ((*isect_point) - ray.getOrigin()).mag(); + double intersect_dist = (isect_point - ray.getOrigin()).mag(); if (dot < 0.0) /* cull back faces */ { double transparency = (*it)->getTransparency(); diff --git a/shapes/Intersect.cc b/shapes/Intersect.cc index c1a81a2..667e2cf 100644 --- a/shapes/Intersect.cc +++ b/shapes/Intersect.cc @@ -10,8 +10,8 @@ Intersect::Intersect(refptr shape1, refptr shape2) Shape::IntersectionList Intersect::intersect(refptr _this, const Ray & ray) { IntersectionList res; - IntersectionList res1 = m_shape1->intersect(ray); - IntersectionList res2 = m_shape2->intersect(ray); + IntersectionList res1 = m_shape1->intersect(m_shape1, ray); + IntersectionList res2 = m_shape2->intersect(m_shape2, ray); /* TODO: finish */