- Timestamp:
- Feb 9, 2011, 9:35:35 PM (14 years ago)
- Location:
- osgVisual/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
osgVisual/trunk/include/object/object_updater.h
r221 r223 100 100 * @param lon_ 101 101 * @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_ 105 105 * @param label_ 106 106 */ 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_); 108 108 109 109 … … 117 117 * Names of the Slots the updater should use 118 118 */ 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; 120 120 121 121 }; -
osgVisual/trunk/include/object/visual_object.h
r222 r223 63 63 * you can configure a geometry off set in translation in translation and rotation 64 64 * For object mounted camera, you can configure the camera offset in rotation and translation. 65 * 66 * All angles are defined in degree. 65 67 * 66 68 * Derive from this class to implement your custom visual_object. -
osgVisual/trunk/src/object/object_updater.cpp
r221 r223 34 34 // try to search according variable in dataIO with direction TO_OBJ and copy value to visual_object. 35 35 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 )); 40 40 if(!updater_alt.empty()) 41 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 ));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 )); 48 48 if(!updater_label.empty()) 49 49 object_->updateLabelText("default", osgVisual::visual_dataIO::getInstance()->getSlotDataAsString(updater_label, osgVisual::dataIO_slot::TO_OBJ )); … … 71 71 } 72 72 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_)73 void 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_) 74 74 { 75 if(lat_ !="")76 updater_lat = lat_;75 if(lat_deg_!="") 76 updater_lat_deg = lat_deg_; 77 77 else 78 updater_lat = object_->getName()+"_POS_LAT";78 updater_lat_deg = object_->getName()+"_POS_LAT"; 79 79 80 if(lon_ !="")81 updater_lon = lon_;80 if(lon_deg_!="") 81 updater_lon_deg = lon_deg_; 82 82 else 83 updater_lon = object_->getName()+"_POS_LON";83 updater_lon_deg = object_->getName()+"_POS_LON"; 84 84 85 85 if(alt_!="") … … 88 88 updater_alt = object_->getName()+"_POS_ALT"; 89 89 90 if(rot_x_ !="")91 updater_rot_x = rot_x_;90 if(rot_x_deg_!="") 91 updater_rot_x_deg = rot_x_deg_; 92 92 else 93 updater_rot_x = object_->getName()+"_ROT_X";93 updater_rot_x_deg = object_->getName()+"_ROT_X"; 94 94 95 if(rot_y_ !="")96 updater_rot_y = rot_y_;95 if(rot_y_deg_!="") 96 updater_rot_y_deg = rot_y_deg_; 97 97 else 98 updater_rot_y = object_->getName()+"_ROT_Y";98 updater_rot_y_deg = object_->getName()+"_ROT_Y"; 99 99 100 if(rot_z_ !="")101 updater_rot_z = rot_z_;100 if(rot_z_deg_!="") 101 updater_rot_z_deg = rot_z_deg_; 102 102 else 103 updater_rot_z = object_->getName()+"_ROT_Z";103 updater_rot_z_deg = object_->getName()+"_ROT_Z"; 104 104 105 105 if(label_!="")
Note: See TracChangeset
for help on using the changeset viewer.