- nodepath = viewpath;
- nodepath += "/config/x-offset-m";
- x_offset_m = fgGetDouble(nodepath.c_str());
- nodepath = viewpath;
- nodepath += "/config/y-offset-m";
- y_offset_m = fgGetDouble(nodepath.c_str());
- nodepath = viewpath;
- nodepath += "/config/z-offset-m";
- z_offset_m = fgGetDouble(nodepath.c_str());
- nodepath = viewpath;
- nodepath += "/config/pitch-offset-deg";
- pitch_offset_deg = fgGetDouble(nodepath.c_str());
- fgSetDouble(nodepath.c_str(),pitch_offset_deg);
- nodepath = viewpath;
- nodepath += "/config/heading-offset-deg";
- heading_offset_deg = fgGetDouble(nodepath.c_str());
- fgSetDouble(nodepath.c_str(),heading_offset_deg);
- nodepath = viewpath;
- nodepath += "/config/roll-offset-deg";
- roll_offset_deg = fgGetDouble(nodepath.c_str());
- fgSetDouble(nodepath.c_str(),roll_offset_deg);
- nodepath = viewpath;
- nodepath += "/config/default-field-of-view-deg";
- fov_deg = fgGetDouble(nodepath.c_str());
+ double heading_offset_deg = n->getDoubleValue("config/heading-offset-deg");
+ n->setDoubleValue("config/heading-offset-deg", heading_offset_deg);
+ double pitch_offset_deg = n->getDoubleValue("config/pitch-offset-deg");
+ n->setDoubleValue("config/pitch-offset-deg", pitch_offset_deg);
+ double roll_offset_deg = n->getDoubleValue("config/roll-offset-deg");
+ n->setDoubleValue("config/roll-offset-deg", roll_offset_deg);
+
+ double fov_deg = n->getDoubleValue("config/default-field-of-view-deg");
+ double near_m = n->getDoubleValue("config/ground-level-nearplane-m");
+
+ // supporting two types "lookat" = 1 and "lookfrom" = 0
+ const char *type = n->getStringValue("type");
+ if (!strcmp(type, "lookat")) {
+
+ bool at_model = n->getBoolValue("config/at-model");
+ int at_model_index = n->getIntValue("config/at-model-idx");
+
+ double damp_roll = n->getDoubleValue("config/at-model-roll-damping");
+ double damp_pitch = n->getDoubleValue("config/at-model-pitch-damping");
+ double damp_heading = n->getDoubleValue("config/at-model-heading-damping");
+
+ double target_x_offset_m = n->getDoubleValue("config/target-x-offset-m");
+ double target_y_offset_m = n->getDoubleValue("config/target-y-offset-m");
+ double target_z_offset_m = n->getDoubleValue("config/target-z-offset-m");