Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 17, 2008, 12:10:23 AM (16 years ago)
Author:
rgrieder
Message:
  • "gravity" xml parameter got missed in Scene
  • fixed issue with rotationrate and rotationaxis in MobileEntity
  • updated msvc files
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation/src/orxonox/objects/worldentities/MobileEntity.cc

    r2485 r2491  
    6464
    6565        XMLPortParamTemplate(MobileEntity, "velocity",     setVelocity,     getVelocity,     xmlelement, mode, const Vector3&);
    66         XMLPortParamTemplate(MobileEntity, "rotationaxis", setRotationAxis, getRotationAxis, xmlelement, mode, const Vector3&);
    67         XMLPortParam(MobileEntity, "rotationrate", setRotationRate, getRotationRate, xmlelement, mode);
     66
     67        Vector3 rotationAxis(this->getRotationAxis());
     68        Degree rotationRate = this->getRotationRate();
     69        XMLPortParamVariable(MobileEntity, "rotationaxis", rotationAxis, xmlelement, mode);
     70        XMLPortParamVariable(MobileEntity, "rotationrate", rotationRate, xmlelement, mode);
     71        if (mode == XMLPort::LoadObject)
     72        {
     73            if (rotationAxis == Vector3::ZERO)
     74                this->setAngularVelocity(Vector3::ZERO);
     75            else
     76                this->setAngularVelocity(rotationAxis.normalisedCopy() * rotationRate.valueRadians());
     77        }
    6878    }
    6979
Note: See TracChangeset for help on using the changeset viewer.