Ignore:
Timestamp:
Feb 1, 2011, 8:14:45 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

    r210 r215  
    3434        //      try to search according variable in dataIO with direction TO_OBJ and copy value to visual_object.
    3535
    36        
    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 ));
    43         object_->updateLabelText("autoupdated", osgVisual::visual_dataIO::getInstance()->getSlotDataAsString(updater_label, osgVisual::dataIO_slot::TO_OBJ ));
     36        if(!updater_lat.empty())
     37                object_->lat = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_lat, osgVisual::dataIO_slot::TO_OBJ ));
     38        if(!updater_lon.empty())
     39                object_->lon = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_lon, osgVisual::dataIO_slot::TO_OBJ ));
     40        if(!updater_alt.empty())
     41                object_->alt = osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_alt, osgVisual::dataIO_slot::TO_OBJ );
     42        if(!updater_rot_z.empty())
     43                object_->azimuthAngle_psi = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_rot_z, osgVisual::dataIO_slot::TO_OBJ ));
     44        if(!updater_rot_y.empty())
     45                object_->pitchAngle_theta = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_rot_y, osgVisual::dataIO_slot::TO_OBJ ));
     46        if(!updater_rot_x.empty())
     47                object_->bankAngle_phi = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_rot_x, osgVisual::dataIO_slot::TO_OBJ ));
     48        if(!updater_label.empty())
     49                object_->updateLabelText("autoupdated", osgVisual::visual_dataIO::getInstance()->getSlotDataAsString(updater_label, osgVisual::dataIO_slot::TO_OBJ ));
    4450
    4551        // Finally execute nested PreUpdater
  • osgVisual/trunk/src/object/visual_object.cpp

    r210 r215  
    5959        geometry = new osg::Group();
    6060        this->addChild( geometry );
     61        unsetGeometry();        // adds an osg::Node as geometry to make the visual_object trackable for node trackers.
    6162
    6263        // Labelnode hinzufügen
     
    7576                return NULL;
    7677
    77         OSG_NOTIFY( osg::ALWAYS ) << __FUNCTION__ << "Try to creating a new Model.." << std::endl;
     78        OSG_NOTIFY( osg::ALWAYS ) << __FUNCTION__ << " - Try to creating a new Model.." << std::endl;
    7879       
    7980        // Prepare Variables
     
    342343
    343344
    344 
    345 
    346345        osgVisual::visual_object* object = new osgVisual::visual_object( sceneRoot_, objectname );
    347346        object->lat = lat;
     
    462461        // remove old geometry
    463462        geometry->removeChildren(0, geometry->getNumChildren());
     463
     464        // Set std OSG Node to allow tracking of an osgVisual without
     465        geometry->addChild( new osg::Node() );
    464466}
    465467
Note: See TracChangeset for help on using the changeset viewer.