Changeset 10913

Show
Ignore:
Timestamp:
01/05/10 12:09:18 (8 years ago)
Author:
robert
Message:

Added set/getDistance() method

Location:
OpenSceneGraph/trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/include/osgGA/KeySwitchMatrixManipulator

    r7648 r10913  
    107107        virtual float getFusionDistanceValue() const { return _current->getFusionDistanceValue(); } 
    108108 
     109        /** Set the distance property. */ 
     110        void setDistance(double distance); 
     111 
     112        /** Get the distance property. */ 
     113        double getDistance() const; 
     114 
    109115 
    110116        virtual void setNode(osg::Node* n); 
  • OpenSceneGraph/trunk/include/osgGA/MatrixManipulator

    r10246 r10913  
    101101        virtual float getFusionDistanceValue() const { return 1.0f; } 
    102102 
     103        /** Set the distance parameter (used by TrackballManipulator etc.) */ 
     104        void setDistance(double /*distance*/) {} 
     105 
     106        /** Get the distance parameter. */ 
     107        virtual double getDistance() const { return 1.0; } 
     108 
    103109        /** Set the mask to use when set up intersection traversal such as used in manipulators that follow terrain or have collision detection. 
    104110          * The intersection traversal mask is useful for controlling what parts of the scene graph should be used for intersection purposes.*/ 
  • OpenSceneGraph/trunk/include/osgGA/TerrainManipulator

    r10255 r10913  
    5656        /** Get the FusionDistanceValue. Used by SceneView for setting up stereo convergence.*/ 
    5757        virtual float getFusionDistanceValue() const { return _distance; } 
     58 
     59        /** Set the distance of the trackball. */ 
     60        void setDistance(double distance) { _distance = distance; } 
     61 
     62        /** Get the distance of the trackball. */ 
     63        double getDistance() const { return _distance; } 
     64 
    5865 
    5966        /** Attach a node to the manipulator.  
  • OpenSceneGraph/trunk/src/osgGA/KeySwitchMatrixManipulator.cpp

    r7064 r10913  
    5757} 
    5858 
     59/** Set the distance parameter (used by TrackballManipulator etc.) */ 
     60void KeySwitchMatrixManipulator::setDistance(double distance) 
     61{ 
     62    for(KeyManipMap::iterator itr=_manips.begin(); 
     63        itr!=_manips.end(); 
     64        ++itr) 
     65    { 
     66        itr->second.second->setDistance(distance); 
     67    } 
     68} 
     69 
     70double KeySwitchMatrixManipulator::getDistance() const 
     71{ 
     72    if(!_current) 
     73    { 
     74        return _current->getDistance(); 
     75    } 
     76    else return 1.0; 
     77} 
     78 
    5979void KeySwitchMatrixManipulator::setNode(osg::Node* node) 
    6080{