Ignore:
Timestamp:
Feb 9, 2011, 9:11:44 AM (13 years ago)
Author:
Torben Dannhauer
Message:

Object definition via XML file: Angels are now interpreted as degree.

File:
1 edited

Legend:

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

    r221 r222  
    116116                                std::string attr_name=reinterpret_cast<const char*>(attr->name);
    117117                                std::string attr_value=reinterpret_cast<const char*>(attr->children->content);
    118                                 if( attr_name == "lat" ) lat = util::strToDouble(attr_value);
    119                                 if( attr_name == "lon" ) lon = util::strToDouble(attr_value);
     118                                if( attr_name == "lat" ) lat = osg::DegreesToRadians(util::strToDouble(attr_value));
     119                                if( attr_name == "lon" ) lon = osg::DegreesToRadians(util::strToDouble(attr_value));
    120120                                if( attr_name == "alt" ) alt = util::strToDouble(attr_value);
    121121
     
    131131                                std::string attr_name=reinterpret_cast<const char*>(attr->name);
    132132                                std::string attr_value=reinterpret_cast<const char*>(attr->children->content);
    133                                 if( attr_name == "rot_x" ) rot_x = util::strToDouble(attr_value);
    134                                 if( attr_name == "rot_y" ) rot_y = util::strToDouble(attr_value);
    135                                 if( attr_name == "rot_z" ) rot_z = util::strToDouble(attr_value);
     133                                if( attr_name == "rot_x" ) rot_x = osg::DegreesToRadians(util::strToDouble(attr_value));
     134                                if( attr_name == "rot_y" ) rot_y = osg::DegreesToRadians(util::strToDouble(attr_value));
     135                                if( attr_name == "rot_z" ) rot_z = osg::DegreesToRadians(util::strToDouble(attr_value));
    136136
    137137                                attr = attr->next;
     
    217217                                                std::string attr_name=reinterpret_cast<const char*>(attr->name);
    218218                                                std::string attr_value=reinterpret_cast<const char*>(attr->children->content);
    219                                                 if( attr_name == "rot_x" ) cam_rot_x = util::strToDouble(attr_value);
    220                                                 if( attr_name == "rot_y" ) cam_rot_y = util::strToDouble(attr_value);
    221                                                 if( attr_name == "rot_z" ) cam_rot_z = util::strToDouble(attr_value);
     219                                                if( attr_name == "rot_x" ) cam_rot_x = osg::DegreesToRadians(util::strToDouble(attr_value));
     220                                                if( attr_name == "rot_y" ) cam_rot_y = osg::DegreesToRadians(util::strToDouble(attr_value));
     221                                                if( attr_name == "rot_z" ) cam_rot_z = osg::DegreesToRadians(util::strToDouble(attr_value));
    222222
    223223                                                attr = attr->next;
     
    251251                                                std::string attr_name=reinterpret_cast<const char*>(attr->name);
    252252                                                std::string attr_value=reinterpret_cast<const char*>(attr->children->content);
    253                                                 if( attr_name == "rot_x" ) geometry_rot_x = util::strToDouble(attr_value);
    254                                                 if( attr_name == "rot_y" ) geometry_rot_y = util::strToDouble(attr_value);
    255                                                 if( attr_name == "rot_z" ) geometry_rot_z = util::strToDouble(attr_value);
     253                                                if( attr_name == "rot_x" ) geometry_rot_x = osg::DegreesToRadians(util::strToDouble(attr_value));
     254                                                if( attr_name == "rot_y" ) geometry_rot_y = osg::DegreesToRadians(util::strToDouble(attr_value));
     255                                                if( attr_name == "rot_z" ) geometry_rot_z = osg::DegreesToRadians(util::strToDouble(attr_value));
    256256
    257257                                                attr = attr->next;
Note: See TracChangeset for help on using the changeset viewer.