X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAIModel%2FAIShip.cxx;h=3d2263629c9d43372edec0a65f34e53e9a66d8f5;hb=afcdbd3158503773644aa07dd86cd92d67946bd4;hp=df0ce649ba8369104c17e83c213cd25a333817a5;hpb=3eff9a14c992a3ae29ce021040bf6a5e560a3ff1;p=flightgear.git diff --git a/src/AIModel/AIShip.cxx b/src/AIModel/AIShip.cxx index df0ce649b..3d2263629 100644 --- a/src/AIModel/AIShip.cxx +++ b/src/AIModel/AIShip.cxx @@ -146,111 +146,74 @@ void FGAIShip::reinit() void FGAIShip::bind() { FGAIBase::bind(); - props->tie("surface-positions/rudder-pos-deg", + tie("surface-positions/rudder-pos-deg", SGRawValuePointer(&_rudder)); - props->tie("controls/heading-lock", + tie("controls/heading-lock", SGRawValuePointer(&_hdg_lock)); - props->tie("controls/tgt-speed-kts", + tie("controls/tgt-speed-kts", SGRawValuePointer(&tgt_speed)); - props->tie("controls/tgt-heading-degs", + tie("controls/tgt-heading-degs", SGRawValuePointer(&tgt_heading)); - props->tie("controls/constants/rudder", + tie("controls/constants/rudder", SGRawValuePointer(&_rudder_constant)); - props->tie("controls/constants/roll-factor", + tie("controls/constants/roll-factor", SGRawValuePointer(&_roll_factor)); - props->tie("controls/constants/roll", + tie("controls/constants/roll", SGRawValuePointer(&_roll_constant)); - props->tie("controls/constants/rudder", + tie("controls/constants/rudder", SGRawValuePointer(&_rudder_constant)); - props->tie("controls/constants/speed", + tie("controls/constants/speed", SGRawValuePointer(&_speed_constant)); - props->tie("waypoint/range-nm", + tie("waypoint/range-nm", SGRawValuePointer(&_wp_range)); - props->tie("waypoint/brg-deg", + tie("waypoint/brg-deg", SGRawValuePointer(&_course)); - props->tie("waypoint/rangerate-nm-sec", + tie("waypoint/rangerate-nm-sec", SGRawValuePointer(&_range_rate)); - props->tie("waypoint/new", + tie("waypoint/new", SGRawValuePointer(&_new_waypoint)); - props->tie("waypoint/missed", + tie("waypoint/missed", SGRawValuePointer(&_missed)); - props->tie("waypoint/missed-count-sec", + tie("waypoint/missed-count-sec", SGRawValuePointer(&_missed_count)); - props->tie("waypoint/missed-range-nm", + tie("waypoint/missed-range-nm", SGRawValuePointer(&_missed_range)); - props->tie("waypoint/missed-time-sec", + tie("waypoint/missed-time-sec", SGRawValuePointer(&_missed_time_sec)); - props->tie("waypoint/wait-count-sec", + tie("waypoint/wait-count-sec", SGRawValuePointer(&_wait_count)); - props->tie("waypoint/xtrack-error-ft", + tie("waypoint/xtrack-error-ft", SGRawValuePointer(&_xtrack_error)); - props->tie("waypoint/waiting", + tie("waypoint/waiting", SGRawValuePointer(&_waiting)); - props->tie("waypoint/lead-angle-deg", + tie("waypoint/lead-angle-deg", SGRawValuePointer(&_lead_angle)); - props->tie("waypoint/tunnel", + tie("waypoint/tunnel", SGRawValuePointer(&_tunnel)); - props->tie("waypoint/alt-curr-m", + tie("waypoint/alt-curr-m", SGRawValuePointer(&_curr_alt)); - props->tie("waypoint/alt-prev-m", + tie("waypoint/alt-prev-m", SGRawValuePointer(&_prev_alt)); - props->tie("submodels/serviceable", + tie("submodels/serviceable", SGRawValuePointer(&_serviceable)); - props->tie("controls/turn-radius-ft", + tie("controls/turn-radius-ft", SGRawValuePointer(&turn_radius_ft)); - props->tie("controls/turn-radius-corrected-ft", + tie("controls/turn-radius-corrected-ft", SGRawValuePointer(&_rd_turn_radius_ft)); - props->tie("controls/constants/lead-angle/gain", + tie("controls/constants/lead-angle/gain", SGRawValuePointer(&_lead_angle_gain)); - props->tie("controls/constants/lead-angle/limit-deg", + tie("controls/constants/lead-angle/limit-deg", SGRawValuePointer(&_lead_angle_limit)); - props->tie("controls/constants/lead-angle/proportion", + tie("controls/constants/lead-angle/proportion", SGRawValuePointer(&_proportion)); - props->tie("controls/fixed-turn-radius-ft", + tie("controls/fixed-turn-radius-ft", SGRawValuePointer(&_fixed_turn_radius)); - props->tie("controls/restart", + tie("controls/restart", SGRawValuePointer(&_restart)); - props->tie("velocities/speed-kts", - SGRawValuePointer(&speed)); + tie("velocities/speed-kts", + SGRawValuePointer(&speed)); } -void FGAIShip::unbind() { - FGAIBase::unbind(); - props->untie("surface-positions/rudder-pos-deg"); - props->untie("controls/heading-lock"); - props->untie("controls/tgt-speed-kts"); - props->untie("controls/tgt-heading-degs"); - props->untie("controls/constants/roll"); - props->untie("controls/constants/rudder"); - props->untie("controls/constants/roll-factor"); - props->untie("controls/constants/speed"); - props->untie("waypoint/range-nm"); - props->untie("waypoint/range-brg-deg"); - props->untie("waypoint/rangerate-nm-sec"); - props->untie("waypoint/new"); - props->untie("waypoint/missed"); - props->untie("waypoint/missed-count-sec"); - props->untie("waypoint/missed-time-sec"); - props->untie("waypoint/missed-range"); - props->untie("waypoint/wait-count-sec"); - props->untie("waypoint/lead-angle-deg"); - props->untie("waypoint/xtrack-error-ft"); - props->untie("waypoint/waiting"); - props->untie("waypoint/tunnel"); - props->untie("waypoint/alt-curr-m"); - props->untie("waypoint/alt-prev-m"); - props->untie("submodels/serviceable"); - props->untie("controls/turn-radius-ft"); - props->untie("controls/turn-radius-corrected-ft"); - props->untie("controls/constants/lead-angle/gain"); - props->untie("controls/constants/lead-angle/limit-deg"); - props->untie("controls/constants/lead-angle/proportion"); - props->untie("controls/fixed-turn-radius-ft"); - props->untie("controls/constants/speed"); - props->untie("controls/restart"); - props->untie("velocities/speed-kts"); - -} void FGAIShip::update(double dt) { //SG_LOG(SG_AI, SG_ALERT, "updating Ship: " << _name <get_sim_time_sec()); @@ -1087,7 +1050,7 @@ void FGAIShip::setWPPos() { if (curr->getOn_ground()){ if (globals->get_scenery()->get_elevation_m(SGGeod::fromGeodM(wppos, 3000), - elevation_m, &_material, 0)){ + elevation_m, NULL, 0)){ wppos.setElevationM(elevation_m); }