Ignore:
Timestamp:
Feb 10, 2011, 11:49:39 AM (13 years ago)
Author:
Torben Dannhauer
Message:

TRacking nodes by XML config should work now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/trunk/src/core/visual_core.cpp

    r225 r226  
    288288                                if(cur_node->type == XML_ELEMENT_NODE && name == "trackmodel")
    289289                                {
    290                                         // Extract model to track
    291 
    292                                         trackNode( testObj4 );
     290                                        // Extract track-ID and track the model
     291                                        xmlAttr  *attr = cur_node->properties;
     292                                        while ( attr )
     293                                        {
     294                                                std::string attr_name=reinterpret_cast<const char*>(attr->name);
     295                                                std::string attr_value=reinterpret_cast<const char*>(attr->children->content);
     296                                                if( attr_name == "id" ) trackNode( util::strToInt(attr_value) );
     297                                                attr = attr->next;
     298                                        }
     299                                       
    293300                                }
    294301                        }
     
    543550void visual_core::trackNode( int trackingID )
    544551{
    545         osg::Node tmp = util::findNodeByTrackingID(trackingID);
     552        osg::ref_ptr<osg::Node> tmp = visual_object::findNodeByTrackingID(trackingID, rootNode);
    546553        if(tmp.valid())
    547554                trackNode(tmp);
Note: See TracChangeset for help on using the changeset viewer.