Hi,

Hopefully someone can help me with the following problem.
I'm trying to add an osgEphemeris model to an osgGroup and it fails.

I compiled osgEphemeris succesfully in windows using VS9 and the following file 
work with the viewer:


osgEphemerisModel::EphemerisModel {
        Latitude 38.4765
        Longitude -122.493
        SkyDomeRadius 100000
    }


However, use the following code it fails:


// Load up the models specified on the command line
osg::ref_ptr<osg::Group> root = new osg::Group;

// Define the Ephemeris Model and its radius
osg::BoundingSphere bs = model->getBound();
osg::ref_ptr<osgEphemeris::EphemerisModel> ephemerisModel = new 
osgEphemeris::EphemerisModel;
ephemerisModel->setSkyDomeRadius( bs.radius()*2 );
ephemerisModel->setSkyDomeCenter( bs.center() );

root->addChild( ephemerisModel.get() );


Following the callstack indicates that it goes wrong when the parent for the 
osgEphemerisModel is specified:

        msvcp90d.dll!std::_Container_base_secure::_Orphan_all()  Line 223 + 0x5 
bytes   C++
>       osg62-osgd.dll!std::vector<osg::Group *,std::allocator<osg::Group *> 
> >::_Insert_n(std::_Vector_const_iterator<osg::Group 
> *,std::allocator<osg::Group *> > _Where=..., unsigned int _Count=1, 
> osg::Group * const & _Val=0x04c10c50)  Line 1200 + 0xb bytes       C++
        osg62-osgd.dll!std::vector<osg::Group *,std::allocator<osg::Group *> 
>::insert(std::_Vector_const_iterator<osg::Group *,std::allocator<osg::Group *> 
> _Where=..., osg::Group * const & _Val=0x04c10c50)  Line 878      C++
        osg62-osgd.dll!std::vector<osg::Group *,std::allocator<osg::Group *> 
>::push_back(osg::Group * const & _Val=0x04c10c50)  Line 823 + 0x40 bytes  C++
        osg62-osgd.dll!osg::Node::addParent(osg::Group * node=0x04c10c50)  Line 
101     C++
        osg62-osgd.dll!osg::Group::insertChild(unsigned int index=0, osg::Node 
* child=0x04c17008)  Line 100    C++
        osg62-osgd.dll!osg::Group::addChild(osg::Node * child=0x04c17008)  Line 
70      C++


Has someone an idea what I'm doing wrong?

Thank you very much!

Cheers,
Roy

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





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

Reply via email to