Changeset 223 for osgVisual


Ignore:
Timestamp:
Feb 9, 2011, 9:35:35 PM (13 years ago)
Author:
Torben Dannhauer
Message:
 
Location:
osgVisual/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/trunk/include/object/object_updater.h

    r221 r223  
    100100         * @param lon_
    101101         * @param alt_
    102          * @param rot_x_
    103          * @param rot_y_ 
    104          * @param rot_z_ 
     102         * @param rot_x_deg_
     103         * @param rot_y_deg_
     104         * @param rot_z_deg_
    105105         * @param label_
    106106         */
    107         void 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_);
     107        void setUpdaterSlotNames( osgVisual::visual_object* object_, std::string lat_deg_, std::string lon_deg_, std::string alt_, std::string rot_x_deg_, std::string rot_y_deg_, std::string rot_z_deg_, std::string label_);
    108108
    109109
     
    117117         * Names of the Slots the updater should use
    118118         */
    119         std::string updater_lat, updater_lon, updater_alt, updater_rot_x, updater_rot_y, updater_rot_z, updater_label;
     119        std::string updater_lat_deg, updater_lon_deg, updater_alt, updater_rot_x_deg, updater_rot_y_deg, updater_rot_z_deg, updater_label;
    120120
    121121};
  • osgVisual/trunk/include/object/visual_object.h

    r222 r223  
    6363 * you can configure a geometry off set in translation in translation and rotation
    6464 * For object mounted camera, you can configure the camera offset in rotation and translation.
     65 *
     66 * All angles are defined in degree.
    6567 *
    6668 * Derive from this class to implement your custom visual_object.
  • osgVisual/trunk/src/object/object_updater.cpp

    r221 r223  
    3434        //      try to search according variable in dataIO with direction TO_OBJ and copy value to visual_object.
    3535
    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 ));
     36        if(!updater_lat_deg.empty())
     37                object_->lat = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_lat_deg, osgVisual::dataIO_slot::TO_OBJ ));
     38        if(!updater_lon_deg.empty())
     39                object_->lon = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_lon_deg, osgVisual::dataIO_slot::TO_OBJ ));
    4040        if(!updater_alt.empty())
    4141                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 ));
     42        if(!updater_rot_z_deg.empty())
     43                object_->azimuthAngle_psi = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_rot_z_deg, osgVisual::dataIO_slot::TO_OBJ ));
     44        if(!updater_rot_y_deg.empty())
     45                object_->pitchAngle_theta = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_rot_y_deg, osgVisual::dataIO_slot::TO_OBJ ));
     46        if(!updater_rot_x_deg.empty())
     47                object_->bankAngle_phi = osg::DegreesToRadians(osgVisual::visual_dataIO::getInstance()->getSlotDataAsDouble(updater_rot_x_deg, osgVisual::dataIO_slot::TO_OBJ ));
    4848        if(!updater_label.empty())
    4949                object_->updateLabelText("default", osgVisual::visual_dataIO::getInstance()->getSlotDataAsString(updater_label, osgVisual::dataIO_slot::TO_OBJ ));
     
    7171}
    7272
    73 void 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_)
     73void object_updater::setUpdaterSlotNames( osgVisual::visual_object* object_, std::string lat_deg_, std::string lon_deg_, std::string alt_, std::string rot_x_deg_, std::string rot_y_deg_, std::string rot_z_deg_, std::string label_)
    7474{
    75         if(lat_!="")
    76                 updater_lat = lat_;
     75        if(lat_deg_!="")
     76                updater_lat_deg = lat_deg_;
    7777        else
    78                 updater_lat = object_->getName()+"_POS_LAT";
     78                updater_lat_deg = object_->getName()+"_POS_LAT";
    7979
    80         if(lon_!="")
    81                 updater_lon = lon_;
     80        if(lon_deg_!="")
     81                updater_lon_deg = lon_deg_;
    8282        else
    83                 updater_lon = object_->getName()+"_POS_LON";
     83                updater_lon_deg = object_->getName()+"_POS_LON";
    8484
    8585        if(alt_!="")
     
    8888                updater_alt = object_->getName()+"_POS_ALT";
    8989
    90         if(rot_x_!="")
    91                 updater_rot_x = rot_x_;
     90        if(rot_x_deg_!="")
     91                updater_rot_x_deg = rot_x_deg_;
    9292        else
    93                 updater_rot_x = object_->getName()+"_ROT_X";
     93                updater_rot_x_deg = object_->getName()+"_ROT_X";
    9494
    95         if(rot_y_!="")
    96                 updater_rot_y = rot_y_;
     95        if(rot_y_deg_!="")
     96                updater_rot_y_deg = rot_y_deg_;
    9797        else
    98                 updater_rot_y = object_->getName()+"_ROT_Y";
     98                updater_rot_y_deg = object_->getName()+"_ROT_Y";
    9999
    100         if(rot_z_!="")
    101                 updater_rot_z = rot_z_;
     100        if(rot_z_deg_!="")
     101                updater_rot_z_deg = rot_z_deg_;
    102102        else
    103                 updater_rot_z = object_->getName()+"_ROT_Z";
     103                updater_rot_z_deg = object_->getName()+"_ROT_Z";
    104104
    105105        if(label_!="")
Note: See TracChangeset for help on using the changeset viewer.