X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2FMoof%2FPlane.cc;fp=src%2FMoof%2FPlane.cc;h=0000000000000000000000000000000000000000;hb=831f04d4bc19a390415ac0bbac4331c7a65509bc;hp=5c4d9fd94b04d852cd96d449a7bf24c11b2c01b9;hpb=299af4f2047e767e5d79501c26444473bda64c64;p=chaz%2Fyoink diff --git a/src/Moof/Plane.cc b/src/Moof/Plane.cc deleted file mode 100644 index 5c4d9fd..0000000 --- a/src/Moof/Plane.cc +++ /dev/null @@ -1,51 +0,0 @@ - -/*] Copyright (c) 2009-2010, Charles McGarvey [************************** -**] All rights reserved. -* -* vi:ts=4 sw=4 tw=75 -* -* Distributable under the terms and conditions of the 2-clause BSD license; -* see the file COPYING for a complete text of the license. -* -**************************************************************************/ - -#include "Aabb.hh" -#include "Plane.hh" -#include "Sphere.hh" - - -namespace Mf { - - -Plane::Halfspace Plane::intersects(const Aabb<3>& aabb) const -{ - Vector3 corners[8]; - int nPositive = 8; - - aabb.getCorners(corners); - - for (int i = 0; i < 8; ++i) - { - if (intersects(corners[i]) == NEGATIVE) - { - --nPositive; - } - } - - if (nPositive == 0) return NEGATIVE; - else if (nPositive == 8) return POSITIVE; - else return INTERSECT; -} - -Plane::Halfspace Plane::intersects(const Sphere<3>& sphere) const -{ - Scalar distance = getDistanceToPoint(sphere.point); - - if (distance < -sphere.radius) return NEGATIVE; - else if (distance < sphere.radius) return INTERSECT; - else return POSITIVE; -} - - -} // namespace Mf -