osgEarth 2.1.1
Public Member Functions

anonymous_namespace{OverlayDecorator.cpp}::MyConvexPolyhedron Class Reference

List of all members.

Public Member Functions

bool intersects (const osg::BoundingSphere &bs) const
bool intersects (const osg::BoundingBox &box) const

Detailed Description

Extends ConvexPolyhedron to add bounds tests.

Definition at line 43 of file OverlayDecorator.cpp.


Member Function Documentation

bool anonymous_namespace{OverlayDecorator.cpp}::MyConvexPolyhedron::intersects ( const osg::BoundingSphere &  bs) const [inline]

Definition at line 46 of file OverlayDecorator.cpp.

        {
            for( Faces::const_iterator i = _faces.begin(); i != _faces.end(); ++i )
            {
                osg::Plane up = i->plane;
                up.makeUnitLength();
                if ( up.distance( bs.center() ) < -bs.radius() )
                    return false;
            }
            return true;
        }
bool anonymous_namespace{OverlayDecorator.cpp}::MyConvexPolyhedron::intersects ( const osg::BoundingBox &  box) const [inline]

Definition at line 58 of file OverlayDecorator.cpp.

        {
            for( Faces::const_iterator i = _faces.begin(); i != _faces.end(); ++i )
            {
                osg::Plane up = i->plane;
                up.makeUnitLength();

                if ( up.intersect(box) < 0 )
                    return false;
            }
            return true;
        }

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines