From fd7caf7240f13d618697dbbc403142c1dd6057a6 Mon Sep 17 00:00:00 2001 From: Roland Hieber Date: Wed, 3 Feb 2010 03:16:41 +0100 Subject: [PATCH] InVoxel() for all Primitives, including fix for Triangle::CalcBounds() --- InfinitePlane.cxx | 2 +- Sphere.cxx | 2 +- Triangle.cxx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/InfinitePlane.cxx b/InfinitePlane.cxx index 13d6e53..93e165f 100644 --- a/InfinitePlane.cxx +++ b/InfinitePlane.cxx @@ -55,5 +55,5 @@ InfinitePlane::CalcBounds() bool InfinitePlane::InVoxel(const Box& box) { - return false; + return CalcBounds().Overlaps(box); } diff --git a/Sphere.cxx b/Sphere.cxx index 6060361..137ce8f 100644 --- a/Sphere.cxx +++ b/Sphere.cxx @@ -62,5 +62,5 @@ Sphere::CalcBounds() bool Sphere::InVoxel(const Box& box) { - return false; + return CalcBounds().Overlaps(box); } diff --git a/Triangle.cxx b/Triangle.cxx index b718555..873f440 100644 --- a/Triangle.cxx +++ b/Triangle.cxx @@ -68,11 +68,11 @@ Triangle::CalcBounds() bounds.Extend(m_a); bounds.Extend(m_b); bounds.Extend(m_c); - return Box(); + return bounds; } bool Triangle::InVoxel(const Box& box) { - return false; + return CalcBounds().Overlaps(box); } -- 2.20.1