]>
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
.get_corners(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 intersecting
;
40 plane::halfspace
plane::intersects(const sphere
<3>& sphere
) const
42 scalar distance
= distance_to_point(sphere
.point
);
44 if (distance
< -sphere
.radius
) return negative
;
45 else if (distance
< sphere
.radius
) return intersecting
;
This page took 0.04016 seconds and 4 git commands to generate.