Changeset 222


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.

Location:
osgVisual/trunk
Files:
2 edited

Legend:

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

    r221 r222  
    387387// Position
    388388        /**
    389          * Latitude of the object.
     389         * Latitude of the object in RAD.
    390390         */
    391391        double lat;
    392392
    393393        /**
    394          * Longitude of the object.
     394         * Longitude of the object in RAD.
    395395         */
    396396        double lon;
    397397
    398398        /**
    399          * Altitude of the object over the ellipsoid.
     399         * Altitude of the object over the ellipsoid in meter.
    400400         */
    401401        double alt;
     
    403403// Attitude
    404404        /**
    405          * Azimuth angle (Rotation along Z axis, "heading") of the object
     405         * Azimuth angle (Rotation along Z axis, "heading") of the object in RAD.
    406406         */
    407407        double azimuthAngle_psi;
    408408
    409409        /**
    410          * Pitch ("nose relative to horizon") angle of the object
     410         * Pitch ("nose relative to horizon") angle of the object in RAD.
    411411         */
    412412        double pitchAngle_theta;
    413413
    414414        /**
    415          * Bank angle of the object.
     415         * Bank angle of the object in RAD.
    416416         */
    417417        double bankAngle_phi;
  • 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.