Changeset 228 for osgVisual/trunk
- Timestamp:
- Feb 10, 2011, 2:18:04 PM (14 years ago)
- Location:
- osgVisual/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
osgVisual/trunk/include/core/visual_core.h
r225 r228 113 113 void trackNode( osg::Node* node_ ); 114 114 void trackNode( int trackingID ); 115 int getCurrentTrackingID(){return currentTrackingID;}; 115 116 116 117 protected: … … 183 184 184 185 osg::ref_ptr<visual_debug_hud> hud; 186 187 int currentTrackingID; 185 188 }; 186 189 -
osgVisual/trunk/src/core/visual_core.cpp
r227 r228 23 23 { 24 24 OSG_NOTIFY( osg::ALWAYS ) << "visual_core instantiated." << std::endl; 25 26 currentTrackingID = -1; 25 27 } 26 28 … … 203 205 keyswitchManipulator->addMatrixManipulator( '3', "Terrain", new osgGA::TerrainManipulator() ); 204 206 nt = new osgGA::NodeTrackerManipulator(); 207 nt->setTrackNode(NULL); 205 208 keyswitchManipulator->addMatrixManipulator( '4', "NodeTrackerManipulator", nt ); 206 209 … … 294 297 std::string attr_name=reinterpret_cast<const char*>(attr->name); 295 298 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 298 302 attr = attr->next; 299 303 } … … 553 557 osg::ref_ptr<osg::Node> tmp = visual_object::findNodeByTrackingID(trackingID, rootNode); 554 558 if(tmp.valid()) 559 { 560 currentTrackingID = trackingID; 555 561 trackNode(tmp); 556 } 562 } 563 } -
osgVisual/trunk/src/manip_Spacemouse/manip_nodeTrackerSpaceMouse.cpp
r221 r228 39 39 RY=0; 40 40 RZ=0; 41 42 41 } 43 42 … … 319 318 void NodeTrackerSpaceMouse::computeNodeCenterAndRotation(osg::Vec3d& nodeCenter, osg::Quat& nodeRotation) const 320 319 { 320 if (_trackNodePath.empty()) 321 return; 322 321 323 osg::Matrixd localToWorld, worldToLocal; 322 324 osg::NodePath nodePath; 323 if (_trackNodePath.getNodePath(nodePath)) 325 326 if ( _trackNodePath.getNodePath(nodePath)) 324 327 { 325 328 worldToLocal = osg::computeWorldToLocal(nodePath);
Note: See TracChangeset
for help on using the changeset viewer.