| 2 | #include <cassert> |
| 3 | |
| 4 | void |
| 5 | sphere3_example () |
| 6 | { |
| 7 | Imath::V3f center (1.0f, 1.0f, 1.0f); |
| 8 | float radius = 2.0f; |
| 9 | Imath::Sphere3f s (center, radius); |
| 10 | |
| 11 | assert (s.center == center); |
| 12 | assert (s.radius == radius); |
| 13 | |
| 14 | Imath::Line3f line ( |
| 15 | Imath::V3f (0.0f, 0.0f, 0.0f), Imath::V3f (1.0f, 1.0f, 1.0f)); |
| 16 | |
| 17 | Imath::V3f v; |
| 18 | assert (s.intersect (line, v)); |
| 19 | |
| 20 | assert ( |
| 21 | v.equalWithAbsError (Imath::V3f (2.1547f, 2.1547f, 2.1547f), 1e-6f)); |
| 22 | } |
no test coverage detected