Changeset 209 for osgVisual/trunk/src


Ignore:
Timestamp:
Jan 27, 2011, 9:31:58 PM (14 years ago)
Author:
Torben Dannhauer
Message:
 
Location:
osgVisual/trunk/src/object
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/trunk/src/object/object_updater.cpp

    r88 r209  
    3535
    3636       
    37         object_->lat = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(object_->getName()+"_POS_LAT", osgVisual::dataIO_slot::TO_OBJ ));
    38         object_->lon = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(object_->getName()+"_POS_LON", osgVisual::dataIO_slot::TO_OBJ ));
    39         object_->alt = osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(object_->getName()+"_POS_ALT", osgVisual::dataIO_slot::TO_OBJ );
    40         object_->azimuthAngle_psi = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(object_->getName()+"_ROT_Z", osgVisual::dataIO_slot::TO_OBJ ));
    41         object_->pitchAngle_theta = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(object_->getName()+"_ROT_Y", osgVisual::dataIO_slot::TO_OBJ ));
    42         object_->bankAngle_phi = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(object_->getName()+"_ROT_X", osgVisual::dataIO_slot::TO_OBJ ));
     37        object_->lat = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_lat, osgVisual::dataIO_slot::TO_OBJ ));
     38        object_->lon = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_lon, osgVisual::dataIO_slot::TO_OBJ ));
     39        object_->alt = osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_alt, osgVisual::dataIO_slot::TO_OBJ );
     40        object_->azimuthAngle_psi = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_rot_z, osgVisual::dataIO_slot::TO_OBJ ));
     41        object_->pitchAngle_theta = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_rot_y, osgVisual::dataIO_slot::TO_OBJ ));
     42        object_->bankAngle_phi = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_rot_x, osgVisual::dataIO_slot::TO_OBJ ));
    4343
    4444        //object_->setCameraOffsetTranslation(0.0, -150.0, 50.0);       // Trans: (rechts davon, longitudinal, vertikal)
     
    4646        object_->setCameraOffsetRotation( osg::DegreesToRadians(0.0), osg::DegreesToRadians(-15.0), osg::DegreesToRadians(-90.0) );
    4747       
    48 
     48std::string updater_label;
    4949
    5050        // Finally execute nested PreUpdater
     
    6969                updater = updater_;
    7070}
     71
     72void object_updater::setUpdaterSlotNames( osgVisual::visual_object* object_, std::string lat_, std::string lon_, std::string alt_, std::string rot_x_, std::string rot_y_, std::string rot_z_, std::string label_)
     73{
     74        if(lat_!="")
     75                updater_lat = lat_;
     76        else
     77                updater_lat = object_->getName()+"_POS_LAT";
     78
     79        if(lon_!="")
     80                updater_lon = lon_;
     81        else
     82                updater_lon = object_->getName()+"_POS_LON";
     83
     84        if(alt_!="")
     85                updater_alt = alt_;
     86        else
     87                updater_alt = object_->getName()+"_POS_ALT";
     88
     89        if(rot_x_!="")
     90                updater_rot_x = rot_x_;
     91        else
     92                updater_rot_x = object_->getName()+"_ROT_X";
     93
     94        if(rot_y_!="")
     95                updater_rot_y = rot_y_;
     96        else
     97                updater_rot_y = object_->getName()+"_ROT_Y";
     98
     99        if(rot_z_!="")
     100                updater_rot_z = rot_z_;
     101        else
     102                updater_rot_z = object_->getName()+"_ROT_Z";
     103
     104        if(label_!="")
     105                updater_label = label_;
     106        else
     107                updater_label = object_->getName()+"_LABEL";
     108}
  • osgVisual/trunk/src/object/visual_object.cpp

    r208 r209  
    362362        }
    363363
    364         //if(updater.valid())
    365         //{
    366  //             object->addUpdater( updater ); 
    367         //      std::string updater_lat="", updater_lon="", updater_alt="", updater_rot_x="", updater_rot_y="", updater_rot_z="", updater_label="";
    368         //}
    369 
    370 
    371        
     364        if(updater.valid())
     365        {
     366                updater->setUpdaterSlotNames( object, updater_lat, updater_lon, updater_alt, updater_rot_x, updater_rot_y, updater_rot_z, updater_label);
     367        }
     368
    372369        OSG_NOTIFY( osg::ALWAYS ) << "Done." << std::endl;
    373370        return object;
Note: See TracChangeset for help on using the changeset viewer.