Show
Ignore:
Timestamp:
01/31/10 13:55:29 (3 years ago)
Author:
robert
Message:

From Jan Peciva, "I am sending improved version of Inventor plugin. Attaching just
modified files, while GroupSoLOD.h and .cpp was deleted. Please, delete
it from repository, it is not used any longer and I doubt if it is
probably not used for anything meaningful for a while. In the new code,
there is no GroupSoLOD. Please, delete it.

I am using new plugin version for about 1.5 month so I consider it
stable by myself.

List of changes:
- rewritten Inventor state stack
- shaders support
- light attenuation support
- support for reading from stream (readNode(std::istream& fin, options))
- improved grouping node handling (SoSeparator?, SoGroup?,...)
- fixed transformation bug when two SoShapes/Drawables? with different transformations are placed bellow one grouping node
- introduced preprocessing to handle more advanced usage schemes of SoLOD and SoSwitch? nodes
- unused code clean up
- improved notify messages
- animation callbacks fixes
- FindInventor?.cmake improved finding routines, support for Coin3 and Coin4"

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/Inventor/ShuttleCallback.cpp

    r6051 r11032  
    33#include "ShuttleCallback.h" 
    44 
    5 ShuttleCallback::ShuttleCallback(const osg::Vec3& startPos,  
     5ShuttleCallback::ShuttleCallback(const osg::Vec3& startPos, 
    66                                 const osg::Vec3& endPos, 
    77                                 float frequency) 
     
    1010    _endPos = endPos; 
    1111    _frequency = frequency; 
    12      
     12 
    1313    _previousTraversalNumber = -1; 
    1414    _previousTime = -1.0; 
     
    2626 
    2727    const osg::FrameStamp* fs = nv->getFrameStamp(); 
    28     if (!fs)  
    29         return;  
    30      
     28    if (!fs) 
     29        return; 
     30 
    3131    // ensure that we do not operate on this node more than 
    3232    // once during this traversal.  This is an issue since node 
     
    3535    { 
    3636        double currentTime = fs->getSimulationTime(); 
     37        if (_previousTime == -1.) 
     38            _previousTime = currentTime; 
    3739        _angle += (currentTime - _previousTime) * 2 * osg::PI * _frequency; 
    38          
    39         double frac = 0.5 + 0.5 * sin(_angle); 
     40 
     41        double frac = 0.5 - 0.5 * cos(_angle); 
    4042 
    4143        osg::Vec3 position = _startPos * (1.0 - frac) + _endPos * frac; 
     
    4345        // update the specified transform 
    4446        transform->setMatrix(osg::Matrix::translate(position)); 
    45              
     47 
    4648        _previousTraversalNumber = nv->getTraversalNumber(); 
    4749        _previousTime = currentTime; 
     
    5254 
    5355} 
     56