Hi,

I think I found a bug in osg 3.2.0
I needed to use osgUtil::SmoothingVisitor. For some reason my compiler couldn't 
find some of the functions so I just added SmoothingVisitor.cpp to my project 
(I may have taken that file from 3.2.1 rc2), and I got a big bug:

in the function normalize I got an ERR_BAD_ACCESS

Code:
void normalize()
    {
        if (!_normals) return;

        for(osg::Vec3Array::iterator itr = _normals->begin();
            itr != _normals->end();
            ++itr)
        {
            (*itr).normalize();
        }
    }



So I modified the function as follows:


Code:
 void normalize()
    {
        if (!_normals) return;
                unsigned long a,b;
                a=0;
                b=_normals->size();
                
        for(osg::Vec3Array::iterator itr = _normals->begin();
            itr != _normals->end()&&a<=(b+1);
            ++itr)
        {
                        if (a>=b){
                                std::cout<<std::hex<<long(itr.base())<<" 
"<<long(_normals->end().base())<<std::endl;
                        }
                        a++;
            (*itr).normalize();
        }
    }



And I got

Code:
101f1ce18 101f1ce1c
101f1ce24 101f1ce1c



So This means that the condition itr != _normals->end() is never false!

Is it something I am missing?

Thank you!

Cheers,
alexis

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=58934#58934





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to