osgEarth 2.1.1
|
Functions | |
float | getApparentRotation (const Geometry *geom) |
float anonymous_namespace{ExtrudeGeometryFilter.cpp}::getApparentRotation | ( | const Geometry * | geom | ) |
Definition at line 47 of file ExtrudeGeometryFilter.cpp.
{ Segment n; double maxLen2 = 0.0; ConstSegmentIterator i( geom, true ); while( i.hasMore() ) { Segment s = i.next(); double len2 = (s.second - s.first).length2(); if ( len2 > maxLen2 ) { maxLen2 = len2; n = s; } } const osg::Vec3d& p1 = n.first.x() < n.second.x() ? n.first : n.second; const osg::Vec3d& p2 = n.first.x() < n.second.x() ? n.second : n.first; return atan2( p2.x()-p1.x(), p2.y()-p1.y() ); }