Changeset 230 for osgVisual/trunk/src/manip_Spacemouse
- Timestamp:
- Feb 13, 2011, 3:19:38 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
osgVisual/trunk/src/manip_Spacemouse/manip_nodeTrackerSpaceMouse.cpp
r229 r230 316 316 } 317 317 318 void NodeTrackerSpaceMouse::computeNodeWorldToLocal(osg::Matrixd& worldToLocal) const 319 { 320 osg::NodePath nodePath; 321 if (_trackNodePath.getNodePath(nodePath)) 322 { 323 worldToLocal = osg::computeWorldToLocal(nodePath); 324 } 325 } 326 327 void NodeTrackerSpaceMouse::computeNodeLocalToWorld(osg::Matrixd& localToWorld) const 328 { 329 osg::NodePath nodePath; 330 if (_trackNodePath.getNodePath(nodePath)) 331 { 332 localToWorld = osg::computeLocalToWorld(nodePath); 333 } 334 335 } 336 318 337 void NodeTrackerSpaceMouse::computeNodeCenterAndRotation(osg::Vec3d& nodeCenter, osg::Quat& nodeRotation) const 319 338 { … … 321 340 return; 322 341 323 osg::Matrixd localToWorld, worldToLocal; 342 osg::Matrixd localToWorld; 343 computeNodeLocalToWorld(localToWorld); 344 324 345 osg::NodePath nodePath; 325 326 346 if (_trackNodePath.getNodePath(nodePath) && !nodePath.empty()) 327 {328 worldToLocal = osg::computeWorldToLocal(nodePath);329 localToWorld = osg::computeLocalToWorld(nodePath);330 347 nodeCenter = osg::Vec3d(nodePath.back()->getBound().center())*localToWorld; 331 }332 348 else 333 349 nodeCenter = osg::Vec3d(0.0f,0.0f,0.0f)*localToWorld;
Note: See TracChangeset
for help on using the changeset viewer.