-
- set_orientation( viewOrientation );
-
- SGVec3d velocity(SGVec3d::zeros());
- if (!stationary()) {
- velocity = SGVec3d(_velocityNorthFPS->getDoubleValue(),
- _velocityEastFPS->getDoubleValue(),
- _velocityDownFPS->getDoubleValue() );
+ if (enabled)
+ {
+ SGGeod viewPosGeod(SGGeod::fromDegFt(_viewPosLon->getDoubleValue(),
+ _viewPosLat->getDoubleValue(),
+ _viewPosElev->getDoubleValue()));
+ SGVec3d cartPos = SGVec3d::fromGeod(viewPosGeod);
+
+ set_position(cartPos, viewPosGeod);
+
+ SGQuatd viewOrientation;
+ for (int i=0; i<4; ++i) {
+ viewOrientation[i] = _currentView->getChild("raw-orientation", i, true)->getDoubleValue();
+ }
+
+ set_orientation( viewOrientation );
+
+ SGVec3d velocity(SGVec3d::zeros());
+ if (!stationaryView()) {
+ velocity = SGVec3d(_velocityNorthFPS->getDoubleValue(),
+ _velocityEastFPS->getDoubleValue(),
+ _velocityDownFPS->getDoubleValue() );
+ }
+
+ set_velocity( velocity );
+
+ set_volume(_volume->getFloatValue());
+ SGSoundMgr::update(dt);