diff --git a/Makefile b/Makefile index 06ce9ff..7ff76fc 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ export CPPFLAGS += -I"$(shell cd)" else export CPPFLAGS += -I"$(shell pwd)" endif -export CXXFLAGS := -Wall -O3 +export CXXFLAGS := -Wall -O1 all: $(TARGET) diff --git a/main/Scene.cc b/main/Scene.cc index 6001c2a..55327af 100644 --- a/main/Scene.cc +++ b/main/Scene.cc @@ -196,8 +196,7 @@ vector Scene::getRayHits(const Ray & ray) { minSolidDist = intersect_dist; } - if (minSolidDist == 0.0 - || minSolidDist >= intersect_dist) + if (minSolidDist == 0.0 || minSolidDist >= intersect_dist) { hits.push_back(ShapeDistance(*it, intersect_dist)); } diff --git a/shapes/Sphere.cc b/shapes/Sphere.cc index 045a681..e3aaea6 100644 --- a/shapes/Sphere.cc +++ b/shapes/Sphere.cc @@ -38,9 +38,8 @@ Shape::IntersectList Sphere::intersect(const Ray & ray) Vector Sphere::getNormalAt(const Vector & pt) { - Vector pt_inv = m_inverse.transform_point(pt); + Vector normal = m_inverse.transform_point(pt); - Vector normal = pt_inv; normal.normalize(); return m_transform.transform_normal(normal);