]>
Dogcows Code - chaz/yoink/blob - src/moof/plane.cc
2 /*] Copyright (c) 2009-2011, Charles McGarvey [*****************************
3 **] All rights reserved.
5 * Distributable under the terms and conditions of the 2-clause BSD license;
6 * see the file COPYING for a complete text of the license.
8 *****************************************************************************/
18 plane::halfspace
plane::intersects(const aabb3
& aabb
) const
22 aabb
.get_corners(corners
);
24 for (int i
= 0; i
< 8; ++i
)
26 if (intersects(corners
[i
]) == negative
) --nPositive
;
29 if (nPositive
== 0) return negative
;
30 else if (nPositive
== 8) return positive
;
34 plane::halfspace
plane::intersects(const sphere3
& sphere
) const
36 scalar distance
= distance_to_point(sphere
.point
);
38 if (distance
< -sphere
.radius
) return negative
;
39 else if (distance
< sphere
.radius
) return intersecting
;
This page took 0.032923 seconds and 4 git commands to generate.