|
FlightGear next
|
#include "config.h"#include <cstring>#include <algorithm>#include "NasalPositioned.hxx"#include <simgear/sg_inlines.h>#include <simgear/scene/material/mat.hxx>#include <simgear/magvar/magvar.hxx>#include <simgear/timing/sg_time.hxx>#include <simgear/bucket/newbucket.hxx>#include <Airports/runways.hxx>#include <Airports/airport.hxx>#include <Airports/dynamics.hxx>#include <Airports/parking.hxx>#include <Scripting/NasalSys.hxx>#include <Navaids/navlist.hxx>#include <Navaids/procedure.hxx>#include <Main/globals.hxx>#include <Main/fg_props.hxx>#include <Main/util.hxx>#include <Scenery/scenery.hxx>#include <ATC/CommStation.hxx>#include <Navaids/fix.hxx>#include <Autopilot/route_mgr.hxx>#include <Navaids/NavDataCache.hxx>#include "NasalFlightPlan.hxx"Go to the source code of this file.
Macros | |
| #define | HASHSET(s, l, n) |
Functions | |
| static void | positionedGhostDestroy (void *g) |
| static const char * | airportGhostGetMember (naContext c, void *g, naRef field, naRef *out) |
| static naGhostType PositionedGhostType = { positionedGhostDestroy, "positioned", nullptr, nullptr }; | |
| static const char * | navaidGhostGetMember (naContext c, void *g, naRef field, naRef *out) |
| static const char * | runwayGhostGetMember (naContext c, void *g, naRef field, naRef *out) |
| static const char * | fixGhostGetMember (naContext c, void *g, naRef field, naRef *out) |
| static const char * | commGhostGetMember (naContext c, void *g, naRef field, naRef *out) |
| static const char * | poiGhostGetMember (naContext c, void *g, naRef field, naRef *out) |
| static void | hashset (naContext c, naRef hash, const char *key, naRef val) |
| static naRef | stringToNasal (naContext c, const std::string &s) |
| FGPositioned * | positionedGhost (naRef r) |
| FGAirport * | airportGhost (naRef r) |
| static FGNavRecord * | navaidGhost (naRef r) |
| FGRunway * | runwayGhost (naRef r) |
| static FGTaxiway * | taxiwayGhost (naRef r) |
| static FGFix * | fixGhost (naRef r) |
| static POI * | poiGhost (naRef r) |
| naRef | ghostForAirport (naContext c, const FGAirport *apt) |
| naRef | ghostForNavaid (naContext c, const FGNavRecord *n) |
| naRef | ghostForRunway (naContext c, const FGRunway *r) |
| naRef | ghostForHelipad (naContext c, const FGHelipad *r) |
| naRef | ghostForTaxiway (naContext c, const FGTaxiway *r) |
| naRef | ghostForFix (naContext c, const FGFix *r) |
| naRef | ghostForComm (naContext c, const flightgear::CommStation *comm) |
| naRef | ghostForPOI (naContext c, const POI *r) |
| naRef | ghostForPositioned (naContext c, FGPositionedRef pos) |
| static bool | hashIsCoord (naRef h) |
| bool | geodFromHash (naRef ref, SGGeod &result) |
| int | geodFromArgs (naRef *args, int offset, int argc, SGGeod &result) |
| bool | vec3dFromHash (naRef ref, SGVec3d &result) |
| static naRef | f_carttogeod (naContext c, naRef me, int argc, naRef *args) |
| static naRef | f_geodtocart (naContext c, naRef me, int argc, naRef *args) |
Variables | |
| static naGhostType | AirportGhostType = { positionedGhostDestroy, "airport", airportGhostGetMember, nullptr } |
| static naGhostType | NavaidGhostType = { positionedGhostDestroy, "navaid", navaidGhostGetMember, nullptr } |
| static naGhostType | RunwayGhostType = { positionedGhostDestroy, "runway", runwayGhostGetMember, nullptr } |
| static naGhostType | HelipadGhostType = { positionedGhostDestroy, "helipad", runwayGhostGetMember, nullptr } |
| static naGhostType | TaxiwayGhostType = { positionedGhostDestroy, "taxiway", runwayGhostGetMember, nullptr } |
| static naGhostType | FixGhostType = { positionedGhostDestroy, "fix", fixGhostGetMember, nullptr } |
| static naGhostType | CommGhostType = {positionedGhostDestroy, "comm", commGhostGetMember, nullptr} |
| static naGhostType | POIGhostType = {positionedGhostDestroy, "poi", poiGhostGetMember, nullptr} |
| static naRef | airportPrototype |
| static naRef | geoCoordClass |
| static naRef | waypointPrototype |
f_get_cart_ground_intersection | |||||||||||
Returns where the given position in the specified direction will intersect with the ground Exposes the built in function to Nasal to allow a craft to ascertain whether or not a certain position and direction pair intersect with the ground. Useful for radars, terrain avoidance (GPWS), etc.
Example Usage: var end = geo.Coord.new(start);
end.apply_course_distance(heading, speed_horz_fps*FT2M);
end.set_alt(end.alt() - speed_down_fps*FT2M);
var dir_x = end.x() - start.x();
var dir_y = end.y() - start.y();
var dir_z = end.z() - start.z();
var xyz = { "x":start.x(), "y" : start.y(), "z" : start.z() };
var dir = { "x":dir_x, "y" : dir_y, "z" : dir_z };
var geod = get_cart_ground_intersection(xyz, dir);
if (geod != nil) {
end.set_latlon(geod.lat, geod.lon, geod.elevation);
var dist = start.direct_distance_to(end)*M2FT;
var time = dist / speed_fps;
setprop("/sim/model/radar/time-until-impact", time);
}
| |||||||||||
| struct { | |||||||||||
| const char * name | |||||||||||
| naCFunction func | |||||||||||
| } | funcs [] | ||||||||||
| static naRef | f_get_cart_ground_intersection (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_aircraftToCart (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_geodinfo (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_airportinfo (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_findAirportsWithinRange (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_findAirportsByICAO (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_airport_tower (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_airport_comms (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_airport_runway (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_airport_runwaysWithoutReciprocals (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_airport_sids (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_airport_stars (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_airport_approaches (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_airport_parking (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_airport_getSid (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_airport_getStar (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_airport_getApproach (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_airport_findBestRunway (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_airport_toString (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_navinfo (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_findNavaidsWithinRange (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_findNDBByFrequency (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_findNDBsByFrequency (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_findNavaidByFrequency (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_findNavaidsByFrequency (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_findCommByFrequency (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_findCommsByFrequency (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_findNavaidsByIdent (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_findFixesByIdent (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_findByIdent (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_magvar (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_courseAndDistance (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_formatLatLon (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_parseStringAsLatLonValue (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_greatCircleMove (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_tilePath (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_tileIndex (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_createWaypoint (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_deleteWaypoint (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| static naRef | f_waypoint_move (naContext c, naRef me, int argc, naRef *args) | ||||||||||
| void | shutdownNasalPositioned () | ||||||||||
| FGPositionedRef | positionedFromArg (naRef ref) | ||||||||||
| naRef | initNasalPositioned (naRef globals, naContext c) | ||||||||||
| void | postinitNasalPositioned (naRef globals, naContext c) | ||||||||||
| #define HASHSET | ( | s, | |
| l, | |||
| n ) |
| FGAirport * airportGhost | ( | naRef | r | ) |
Definition at line 106 of file NasalPositioned.cxx.
|
static |
static naGhostType PositionedGhostType = { positionedGhostDestroy, "positioned", nullptr, nullptr };
Definition at line 293 of file NasalPositioned.cxx.
|
static |
Definition at line 464 of file NasalPositioned.cxx.
|
static |
Definition at line 769 of file NasalPositioned.cxx.
|
static |
Definition at line 1126 of file NasalPositioned.cxx.
|
static |
Definition at line 984 of file NasalPositioned.cxx.
|
static |
Definition at line 1282 of file NasalPositioned.cxx.
|
static |
Definition at line 1267 of file NasalPositioned.cxx.
|
static |
Definition at line 1237 of file NasalPositioned.cxx.
|
static |
Definition at line 1252 of file NasalPositioned.cxx.
|
static |
Definition at line 1201 of file NasalPositioned.cxx.
|
static |
Definition at line 1017 of file NasalPositioned.cxx.
|
static |
Definition at line 1038 of file NasalPositioned.cxx.
|
static |
Definition at line 1054 of file NasalPositioned.cxx.
|
static |
Definition at line 1090 of file NasalPositioned.cxx.
|
static |
Definition at line 1297 of file NasalPositioned.cxx.
|
static |
Definition at line 968 of file NasalPositioned.cxx.
|
static |
Definition at line 874 of file NasalPositioned.cxx.
|
static |
Definition at line 671 of file NasalPositioned.cxx.
|
static |
Definition at line 1653 of file NasalPositioned.cxx.
|
static |
Definition at line 1760 of file NasalPositioned.cxx.
|
static |
Definition at line 1800 of file NasalPositioned.cxx.
|
static |
Definition at line 945 of file NasalPositioned.cxx.
|
static |
Definition at line 917 of file NasalPositioned.cxx.
|
static |
Definition at line 1609 of file NasalPositioned.cxx.
|
static |
Definition at line 1504 of file NasalPositioned.cxx.
|
static |
Definition at line 1531 of file NasalPositioned.cxx.
|
static |
Definition at line 1585 of file NasalPositioned.cxx.
|
static |
Definition at line 1447 of file NasalPositioned.cxx.
|
static |
Definition at line 1475 of file NasalPositioned.cxx.
|
static |
Definition at line 1558 of file NasalPositioned.cxx.
|
static |
Definition at line 1374 of file NasalPositioned.cxx.
|
static |
Definition at line 1403 of file NasalPositioned.cxx.
|
static |
Definition at line 1423 of file NasalPositioned.cxx.
|
static |
Definition at line 1676 of file NasalPositioned.cxx.
|
static |
Definition at line 805 of file NasalPositioned.cxx.
|
static |
Definition at line 688 of file NasalPositioned.cxx.
|
static |
Definition at line 740 of file NasalPositioned.cxx.
|
static |
Definition at line 1713 of file NasalPositioned.cxx.
|
static |
Definition at line 1637 of file NasalPositioned.cxx.
|
static |
Definition at line 1319 of file NasalPositioned.cxx.
|
static |
Definition at line 1697 of file NasalPositioned.cxx.
|
static |
Definition at line 1752 of file NasalPositioned.cxx.
|
static |
Definition at line 1744 of file NasalPositioned.cxx.
|
static |
Definition at line 1820 of file NasalPositioned.cxx.
|
static |
Definition at line 134 of file NasalPositioned.cxx.
|
static |
Definition at line 444 of file NasalPositioned.cxx.
| int geodFromArgs | ( | naRef * | args, |
| int | offset, | ||
| int | argc, | ||
| SGGeod & | result ) |
Definition at line 588 of file NasalPositioned.cxx.
| bool geodFromHash | ( | naRef | ref, |
| SGGeod & | result ) |
Definition at line 532 of file NasalPositioned.cxx.
| naRef ghostForAirport | ( | naContext | c, |
| const FGAirport * | apt ) |
Definition at line 170 of file NasalPositioned.cxx.
| naRef ghostForComm | ( | naContext | c, |
| const flightgear::CommStation * | comm ) |
Definition at line 230 of file NasalPositioned.cxx.
| naRef ghostForFix | ( | naContext | c, |
| const FGFix * | r ) |
Definition at line 220 of file NasalPositioned.cxx.
| naRef ghostForHelipad | ( | naContext | c, |
| const FGHelipad * | r ) |
Definition at line 200 of file NasalPositioned.cxx.
| naRef ghostForNavaid | ( | naContext | c, |
| const FGNavRecord * | n ) |
Definition at line 180 of file NasalPositioned.cxx.
| naRef ghostForPOI | ( | naContext | c, |
| const POI * | r ) |
Definition at line 240 of file NasalPositioned.cxx.
| naRef ghostForPositioned | ( | naContext | c, |
| FGPositionedRef | pos ) |
Definition at line 250 of file NasalPositioned.cxx.
| naRef ghostForRunway | ( | naContext | c, |
| const FGRunway * | r ) |
Definition at line 190 of file NasalPositioned.cxx.
| naRef ghostForTaxiway | ( | naContext | c, |
| const FGTaxiway * | r ) |
Definition at line 210 of file NasalPositioned.cxx.
|
static |
Definition at line 522 of file NasalPositioned.cxx.
|
static |
Definition at line 78 of file NasalPositioned.cxx.
| naRef initNasalPositioned | ( | naRef | globals, |
| naContext | c ) |
Definition at line 1902 of file NasalPositioned.cxx.
|
static |
Definition at line 113 of file NasalPositioned.cxx.
|
static |
Definition at line 382 of file NasalPositioned.cxx.
|
static |
Definition at line 150 of file NasalPositioned.cxx.
|
static |
Definition at line 494 of file NasalPositioned.cxx.
| FGPositionedRef positionedFromArg | ( | naRef | ref | ) |
Definition at line 1838 of file NasalPositioned.cxx.
| FGPositioned * positionedGhost | ( | naRef | r | ) |
Definition at line 92 of file NasalPositioned.cxx.
|
static |
Definition at line 158 of file NasalPositioned.cxx.
| void postinitNasalPositioned | ( | naRef | globals, |
| naContext | c ) |
Definition at line 1940 of file NasalPositioned.cxx.
| FGRunway * runwayGhost | ( | naRef | r | ) |
Definition at line 120 of file NasalPositioned.cxx.
|
static |
Definition at line 348 of file NasalPositioned.cxx.
| void shutdownNasalPositioned | ( | ) |
Definition at line 1834 of file NasalPositioned.cxx.
|
static |
Definition at line 85 of file NasalPositioned.cxx.
|
static |
Definition at line 127 of file NasalPositioned.cxx.
| bool vec3dFromHash | ( | naRef | ref, |
| SGVec3d & | result ) |
Definition at line 653 of file NasalPositioned.cxx.
|
static |
Definition at line 59 of file NasalPositioned.cxx.
|
static |
Definition at line 166 of file NasalPositioned.cxx.
|
static |
Definition at line 73 of file NasalPositioned.cxx.
|
static |
Definition at line 70 of file NasalPositioned.cxx.
| naCFunction func |
Definition at line 1869 of file NasalPositioned.cxx.
| struct { ... } funcs[] |
|
static |
Definition at line 167 of file NasalPositioned.cxx.
|
static |
Definition at line 66 of file NasalPositioned.cxx.
| const char* name |
Definition at line 1868 of file NasalPositioned.cxx.
|
static |
Definition at line 62 of file NasalPositioned.cxx.
|
static |
Definition at line 76 of file NasalPositioned.cxx.
|
static |
Definition at line 65 of file NasalPositioned.cxx.
|
static |
Definition at line 67 of file NasalPositioned.cxx.
|
static |
Definition at line 168 of file NasalPositioned.cxx.