Changeset 228


Ignore:
Timestamp:
Feb 10, 2011, 2:18:04 PM (13 years ago)
Author:
Torben Dannhauer
Message:
 
Location:
osgVisual/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/trunk/include/core/visual_core.h

    r225 r228  
    113113        void trackNode( osg::Node* node_ );
    114114        void trackNode( int trackingID );
     115        int getCurrentTrackingID(){return currentTrackingID;};
    115116
    116117protected:
     
    183184
    184185        osg::ref_ptr<visual_debug_hud> hud;
     186
     187        int currentTrackingID;
    185188};
    186189
  • osgVisual/trunk/src/core/visual_core.cpp

    r227 r228  
    2323{
    2424        OSG_NOTIFY( osg::ALWAYS ) << "visual_core instantiated." << std::endl;
     25
     26        currentTrackingID = -1;
    2527}
    2628
     
    203205        keyswitchManipulator->addMatrixManipulator( '3', "Terrain", new osgGA::TerrainManipulator() );
    204206                nt = new osgGA::NodeTrackerManipulator();
     207                nt->setTrackNode(NULL);
    205208                keyswitchManipulator->addMatrixManipulator( '4', "NodeTrackerManipulator", nt );
    206209               
     
    294297                                                std::string attr_name=reinterpret_cast<const char*>(attr->name);
    295298                                                std::string attr_value=reinterpret_cast<const char*>(attr->children->content);
    296                                                 if( attr_name == "id" )
    297                                                         trackNode( util::strToInt(attr_value) );
     299                                                if( attr_name == "id" ) trackNode( util::strToInt(attr_value) );
     300
     301
    298302                                                attr = attr->next;
    299303                                        }
     
    553557        osg::ref_ptr<osg::Node> tmp = visual_object::findNodeByTrackingID(trackingID, rootNode);
    554558        if(tmp.valid())
     559        {
     560                currentTrackingID = trackingID;
    555561                trackNode(tmp);
    556 }
     562        }
     563}
  • osgVisual/trunk/src/manip_Spacemouse/manip_nodeTrackerSpaceMouse.cpp

    r221 r228  
    3939        RY=0;
    4040        RZ=0;
    41 
    4241}
    4342
     
    319318void NodeTrackerSpaceMouse::computeNodeCenterAndRotation(osg::Vec3d& nodeCenter, osg::Quat& nodeRotation) const
    320319{
     320        if (_trackNodePath.empty())
     321                return;
     322
    321323    osg::Matrixd localToWorld, worldToLocal;
    322324    osg::NodePath nodePath;
    323     if (_trackNodePath.getNodePath(nodePath))
     325       
     326    if (  _trackNodePath.getNodePath(nodePath))
    324327    {
    325328        worldToLocal = osg::computeWorldToLocal(nodePath);
Note: See TracChangeset for help on using the changeset viewer.