| 11 | #include <osg/Vec3> |
| 12 | |
| 13 | static osg::Vec3 sphereCoordToCartesian(float theta, float phi, float r) |
| 14 | { |
| 15 | osg::Vec3 returnVec = osg::Vec3(0.0, 0.0, 0.0); |
| 16 | float phiToHorizontal = osg::PI_2f - phi; |
| 17 | returnVec.x() = std::cos(theta); |
| 18 | returnVec.y() = std::sin(theta); |
| 19 | returnVec.z() = std::sin(phiToHorizontal); |
| 20 | |
| 21 | returnVec.x() *= std::cos(phiToHorizontal); |
| 22 | returnVec.y() *= std::cos(phiToHorizontal); |
| 23 | returnVec.x() *= r; |
| 24 | returnVec.z() *= r; |
| 25 | |
| 26 | returnVec.y() *= r; |
| 27 | return returnVec; |
| 28 | } |
| 29 | |
| 30 | static void generateWireCube(osg::Geometry& geom, float dim) |
| 31 | { |
no test coverage detected