Changeset 229 for osgVisual


Ignore:
Timestamp:
Feb 13, 2011, 2:00:53 PM (14 years ago)
Author:
Torben Dannhauer
Message:

Fixed NodeTrackerManipulators?: Now the don't crash even if they are activated without a valid node to track.

Location:
osgVisual/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/trunk/bin/osgVisualConfig.xml

    r227 r229  
    7171        </geometry>
    7272      </model>
    73       <trackmodel id="2" updater_slot=""></trackmodel>
     73      <trackmodel id="1" updater_slot=""></trackmodel>
    7474    </models>
    7575    <datetime day="0" month="0" year="0" hour="12" minute="30"></datetime>
  • osgVisual/trunk/include/manip_Spacemouse/manip_nodeTrackerSpaceMouse.h

    r221 r229  
    271271
    272272                /**
    273                  * Pointer to Space Navigator interfacce class.
     273                 * Pointer to Space Navigator interface class.
    274274                 */
    275275                SpaceMouse* _spaceMouse;
  • osgVisual/trunk/src/manip_Spacemouse/manip_nodeTrackerSpaceMouse.cpp

    r228 r229  
    324324    osg::NodePath nodePath;
    325325       
    326     if (  _trackNodePath.getNodePath(nodePath))
    327     {
    328         worldToLocal = osg::computeWorldToLocal(nodePath);
    329         localToWorld = osg::computeLocalToWorld(nodePath);
     326        if (_trackNodePath.getNodePath(nodePath) && !nodePath.empty())
     327        {
     328                worldToLocal = osg::computeWorldToLocal(nodePath);
     329                localToWorld = osg::computeLocalToWorld(nodePath);
    330330        nodeCenter = osg::Vec3d(nodePath.back()->getBound().center())*localToWorld;
    331     }
     331        }
    332332    else
    333     {
    334333        nodeCenter = osg::Vec3d(0.0f,0.0f,0.0f)*localToWorld;
    335     }
    336334
    337335
Note: See TracChangeset for help on using the changeset viewer.