osgEarth 2.1.1
Public Member Functions | Public Attributes

anonymous_namespace{NodeUtils.cpp}::ComputeMaxNormalLength Struct Reference

List of all members.

Public Member Functions

void set (const osg::Vec3 &normalECEF, const osg::Matrixd &local2world, float *maxNormalLen)
void operator() (const osg::Vec3 &v1, bool)
void operator() (const osg::Vec3 &v1, const osg::Vec3 &v2, bool)
void operator() (const osg::Vec3 &v1, const osg::Vec3 &v2, const osg::Vec3 &v3, bool)
void operator() (const osg::Vec3 &v1, const osg::Vec3 &v2, const osg::Vec3 &v3, const osg::Vec3 &v4, bool)
void compute (const osg::Vec3 &v)

Public Attributes

osg::Vec3 _normal
osg::Matrixd _local2world
float * _maxNormalLen

Detailed Description

Definition at line 32 of file NodeUtils.cpp.


Member Function Documentation

void anonymous_namespace{NodeUtils.cpp}::ComputeMaxNormalLength::compute ( const osg::Vec3 &  v) [inline]

Definition at line 67 of file NodeUtils.cpp.

        {
            osg::Vec3d vworld = v * _local2world;
            double vlen = vworld.length();
            vworld.normalize();

            // the dot product of the 2 vecs is the cos of the angle between them;
            // mult that be the vector length to get the new normal length.
            float normalLen = fabs(_normal * vworld) * vlen;

            if ( normalLen < *_maxNormalLen )
                *_maxNormalLen = normalLen;
        }
void anonymous_namespace{NodeUtils.cpp}::ComputeMaxNormalLength::operator() ( const osg::Vec3 &  v1,
const osg::Vec3 &  v2,
bool   
) [inline]

Definition at line 46 of file NodeUtils.cpp.

        {         
            compute( v1 );
            compute( v2 );
        }
void anonymous_namespace{NodeUtils.cpp}::ComputeMaxNormalLength::operator() ( const osg::Vec3 &  v1,
const osg::Vec3 &  v2,
const osg::Vec3 &  v3,
const osg::Vec3 &  v4,
bool   
) [inline]

Definition at line 59 of file NodeUtils.cpp.

        {         
            compute( v1 );
            compute( v2 );
            compute( v3 );
            compute( v4 );
        }
void anonymous_namespace{NodeUtils.cpp}::ComputeMaxNormalLength::operator() ( const osg::Vec3 &  v1,
const osg::Vec3 &  v2,
const osg::Vec3 &  v3,
bool   
) [inline]

Definition at line 52 of file NodeUtils.cpp.

        {         
            compute( v1 );
            compute( v2 );
            compute( v3 );
        }
void anonymous_namespace{NodeUtils.cpp}::ComputeMaxNormalLength::operator() ( const osg::Vec3 &  v1,
bool   
) [inline]

Definition at line 41 of file NodeUtils.cpp.

        {         
            compute( v1 );
        }
void anonymous_namespace{NodeUtils.cpp}::ComputeMaxNormalLength::set ( const osg::Vec3 &  normalECEF,
const osg::Matrixd &  local2world,
float *  maxNormalLen 
) [inline]

Definition at line 34 of file NodeUtils.cpp.

        {
            _normal       = normalECEF;
            _local2world  = local2world;
            _maxNormalLen = maxNormalLen;
        }

Member Data Documentation

osg::Matrixd anonymous_namespace{NodeUtils.cpp}::ComputeMaxNormalLength::_local2world

Definition at line 82 of file NodeUtils.cpp.

float* anonymous_namespace{NodeUtils.cpp}::ComputeMaxNormalLength::_maxNormalLen

Definition at line 83 of file NodeUtils.cpp.

osg::Vec3 anonymous_namespace{NodeUtils.cpp}::ComputeMaxNormalLength::_normal

Definition at line 81 of file NodeUtils.cpp.


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