]>
Dogcows Code - chaz/yoink/blob - src/Moof/Plane.cc
2 /*] Copyright (c) 2009-2010, Charles McGarvey [**************************
3 **] All rights reserved.
7 * Distributable under the terms and conditions of the 2-clause BSD license;
8 * see the file COPYING for a complete text of the license.
10 **************************************************************************/
20 Plane::Halfspace
Plane::intersects(const Aabb
<3>& aabb
) const
25 aabb
.getCorners(corners
);
27 for (int i
= 0; i
< 8; ++i
)
29 if (intersects(corners
[i
]) == NEGATIVE
)
35 if (nPositive
== 0) return NEGATIVE
;
36 else if (nPositive
== 8) return POSITIVE
;
37 else return INTERSECT
;
40 Plane::Halfspace
Plane::intersects(const Sphere
<3>& sphere
) const
42 Scalar distance
= getDistanceToPoint(sphere
.point
);
44 if (distance
< -sphere
.radius
) return NEGATIVE
;
45 else if (distance
< sphere
.radius
) return INTERSECT
;
This page took 0.033265 seconds and 4 git commands to generate.