SimGear change. It changes all the SG_xxxx to be the 'real' includes, and gets
rid of many #ifdef SG_HAVE_STD_INCLUDES. As an added bonus, rather than
replacing 'SG_USING_NAMESPACE(std)' with 'using namespace std', I just fixed
the small number of places to use std:: explicitly. So we're no longer polluting
the global namespace with the entire contents of std, in many cases.
There is one more 'mechanical' change to come - getting rid of SG_USING_STD(X),
but I want to keep that separate from everything else. (There's another
mechnical change, replacing <math.h> with <cmath> and so on *everywhere*, but
one step at a time)
PLETE_FUNCTIONAL from SimGear and FlightGear.
As a result, SG_HAVE_STD_INCLUDES is now *always* set, so I will get the boring
fixes for that done, but separately. I'm still auditing the other things in comp
ilers.h - there's a lot that can die now BORLAND is gone.
- remove the OSX_BUNDLE crap *I* introduced years ago - we're always a a bun
dle on Mac now.
- fix up the default fg-root on Mac to be FlightGear.app/Contents/Resources/
data - i.e the location used by the macflightgear.org distro, and indeed the obv
ious 'correct' location. Not sure why I didn't use that in the first place, back
in the day.
- remove the CPSForegroundEnable hack. For one thing, we're a bundle and don
't need it, and for another, osgViewer on Mac does the same logic using a newer,
public API rather than a hack into the OS.
- remove the strange logic for doing fgOSInit 'early' (in bootstrap rather t
han main) when running from the command line on Mac; again this is obsolete, and
no one seems to know why it was ever necessary. I guess it was an interaction w
ith SDL when running without a bundle.
- (not Mac related) remove obsolete code bracketed by ENABLE_PLIB_JOYSTICK a
nd USE_GLIDE (neither of which are ever set, even from config.h that I can see)
in main.cxx
Various other patches that have been lingering around for a while:
* Moved trafficcontrol.[ch]xx from the Airports directory to ATC, where
it really belongs.
* AI aircraft will request startup clearance, and ground control will
approve.
* Starting AI Aircraft will be pushed back to a predefined holding point
on the ground network, and wait a while before taxiing out to the runway
- drop unused parts (MouseQuat/GuiQuat)
- move "old-reinit-dialog" fgcommand to fg_command.cxx under new name
"reset" for now. (May later get merged with fgcommand "reinit".)
- move reInit() to fg_init.cxx: This was used by Shift-Esc and
Menu->File-Reset (via fgcommand "old-reinit-dialog"). We have already
a similar function fgReInitSubsystems() in fg_init.cxx, so these two
functions will probably get merged later.)
where chosen to match the SGPropertyNode::WRITE/READ symbol names and
should make it more consistent, but this isn't really something that
should be exposed to the Nasal developer.)
we know the stack trace), it's better to use a separate function for
it, as this can be used conditionally, as in:
setlistener("/the/property", func(n) {
if (n.getValue() < 0) # who's writing negative numbers to /the/property?!
abort(); # let's check the backtrace ...
});
and its function called. This is useful for debugging purposes, to get
a core dump which unveils which C++ code was writing to the property.
This isn't any more of a security problem as other Nasal code that
makes fgfs crash, such as: var x = func call(x); x(); The difference
is that the listener doesn't use up all memory before and is much quicker.
- don't allow to do that from any XML file. This is to prevent malign
code from writing a new fg-home in ~/.fgfs/autosave.xml or other files
in ~/.fgfs/.
After the changes that moved the GUI and HUD to a slave camera, the
texture-based fonts wouldn't display. The main fixes here are making
sure that the TXF textures are all loaded into the font cache early,
and explicitly setting the active texture unit in the GUI / HUD
drawImplementation.
- don't keep oodles of class member variables public (eek!)
- use ::hasValue() instead of ::getType() != SGPropertyNode::NONE
- consistency fixes and cosmetics
Switch to defining PU_USE_NONE and providing our own callback
functions to pui for "get window" and "get window size." A new
WindowSystemAdapter class assigns ID numbers to windows for the
purpose of identifying them to plib; the window size can be extracted
from the osg::GraphicsContext class in all the different
implementations (osgViewer, glut, sdl).
Implement a GraphicsContextOperation that runs code in a particular
graphics context, perhaps in another thread, and provides an
isFinished() method to test if the operation has finished. This allows
us to initialize plib PUI properly if there are multiple graphics
contexts without using fgMakeCurrent(). fgMakeCurrent() can't work in
multi-threaded OSG configurations.
Eliminate fgMakeCurrent() and all its uses, either by using
GraphicsContextOperation or by seeing that it is not necessary.
Attach the GUI camera as a slave camera.
Don't manipulate the OSG state in the drawImplementation() functions
for SGHUDAndPanelDrawable and SGPuDrawable; it's not needed.
Attached patch adds support for multiple FIXes with the same name.
Applies to both branches.
New functionality is in query_and_offset, which now returns the FIX
closest to the passed in location.
Updated route manager to take advantage of this.
Otherwise, query functions return an unspecified member from the set
of identically named FIXes. (This was previously the one occurring
last in the database file, but I don't think anybody counted on that.)
- it's unused
- it's hardcoded (we already got rid of all other hardcoded dialogs)
- we'll have to consider switching to osgWidget, which is planned to
get imported into osg. It's unlikely that we add *more* of PLIB
in the meantime.
"the [...] patch (for fg) increases the time before invisible geometry (i.e.
geometry not inside the view frustrum) gets deleted. default was 10 seconds
which i am increasing to 2 minutes."
on the '*'-key, but allow to cycle it by setting
/sim/rendering/on-screen-statistics to "true"
- move that function to the Debug menu (no more key assigned!)
- add "print-statistics" menu entry
under some circumstances. The history of this patch is somewhat unclear,
but was brought to my attention by Martin Spott, while preparing for the
Lelystad FSWeekend show. See also my posting on FlightGear devel, on
November 22, 2007 "(Multiplayer Local Echo Patch)", but wasn't committed
then because I/we assumed that had been superseded by other code
modifications. The local echo problem still persists, however, albeit
under specific circumstances. The current patch reportedly prevents this
from happening.
and the pushback code:
- Traffic manager starts modelload requests immediately upon program
loading
- Only create legs 1 (push back) or five (cruise) of AI traffic.
- AIAircraft's rather obsessive behavior to circle around a waypoint is
largely resolved
- More realistic ground steering for AI aircraft.
Thanks to Vivian Meazza for debugging this. The output deque for
FGDigitalFilter was not being kept long enough for the
doubleExponential filter. Reads from output[1] could cause a crash.
From Till:
i started the project at the end of february with a simple idea: move all
3d-model loading to the DatabasePager-thread. my first attempts looked
promising, though they were a little too optimistic (or naive?). the patch
has evolved a lot since.
currently it does the following things:
1. revive SGModelLib, move functions for xml-model-loading there
2. replace all calls to sgLoad3dModel with calls to either
SGModelLib::loadModel() or SGModelLib::loadPagedModel()
almost all models will be loaded by the DatabasePager. the few exceptions are:
your own plane, shared models in scenery, random objects, AIBallistic models.
3. simplify mode-loading functions (avoid passing around fg_root)
4. avoid supurious MatrixTransform nodes in loaded models
5. fix some memory leaks
Introduce a convenience member function in wxRadarBg for creating an
SGPropertyNode and initializing it in one step. Use this in
agRadar. This eliminates buggy behavior when the necessary radar
properties aren't defined.
$ fgfs --version
2.0pre-20080314
FG_ROOT=/usr/local/share/FlightGear
FG_HOME=/home/foo/.fgfs
... assuming that VERSION in config.h is "2.0pre-20080314". Which it isn't.
Instead it's "1.0.0" since yesterday, and was "0.9.10" before that. This
has yet to be discussed, and I'll add the option to options.xml later.
Reindent to Stroustrup style.
Make FGPrecipitationMgr an SGSubsystem and remove all references to it
in main.cxx and renderer.cxx.
Use SGGeod::makeZUpFrame instead of a private function in
tileentry.cxx. Rewrite that function, WorldCoordinate, to use
makeZUpFrame too.
Makes it possible to start at a parking location defined in the AI/Airports/*/parking.xml files, using the parkpos command line option.
Note that the name to pass is the concatenation of the "name" and "number" fields in the xml.
This allows Nasal managed views thanks to the proximity of the
event manager (which executes Nasal loops). The io manager must
come after the view manager to avoid jitter in network replay.
As discussed with Tim on irc: Here is a quick fix for the memory-hungry tile
manager. Due to bugs in FGNewCache, old tiles were never deleted.
I left the timestamp-updates in the cull-traversal. but imho things work
just as well when timestamps are updated in FGNewCache::insert_tile() and
FGNewCache::get_tile()
Lee has added two new filter types, "gain" and "reciprocal". These filters can
read their gain factor from a property. In the process we also added minimum
and maximum output clamps that are applicable to all filters.
I added the ability to configure adaptive controllers i.e. the controller gain
can be tied to a property, so that it can be changed at runtime. This
requires a change in the xml structure of the autopilot configuration file:
<Kp>
<prop>/autopilot/KAP140/settings/ROL/Kp</prop>
<value>0.10</value>
</Kp> <!-- proportional gain -->
The old method <Kp>0.10</Kp> still works so as to not break all existing
autopilots, but it will output a warning to use the new method.
Please find attatched a new version of xmlauto.cxx.
Remove the call to build() in reinit(). This prevents build() from being
called twice when Reload Autopilot is selected from the Debug menu.
I've also added the ability to define an enabled property for the filters.
It's used like the PID controllers. If there is no enabled tag then the
filter defaults to enabled so that nothing should get broken by this change.
This ability can be used to create a filter between the output of a PID
controller and the property that it controls (a control surface). By putting
a noise spike filter between the output of a controller and the control
surface that it controls, we can simulate the limited movement rate that is
inherent in autopilot servos.
This patch contains bugfixes from my previous patch
(i made mistakes when using "diff" utility last time):
1. Now ATC do not tells us to go around because of
traffic on RWy, when that traffic is WE.
2. Now ATC don't say that we must follow ourself
(like "GFS, number two, follow GFS on final").
And new Tower-ATC features:
1. Requesting departure clearance. When you are
on taxiway, you can request departure clearance.
Tower will answer with something like:
"Line up runway two eight right".
TODO: check if any AI-Planes on final and tell
something like: "After the landing AI-CALLSIGN
line up runway two eight right".
2. Requesting take-off clearance. If you are on
runway, you can tell to ATC that you are ready
for take-off. So, Tower will tell you that you
are cleared for take-off (or immediate take-off).
3. Reporting landing gear position on final by pilot.
If you are on aircraft, which landing gear can
be UP, when reporting final you will tell
"Gear down, ready to land".
4. Reporting landing gear position on final by ATC.
When i was newbie and was flying on Cessna 310, i
ALWAYS forgot landing gears on final. Now if you are on
final and forgot landing gear, Tower will tell you:
"LANDING GEAR APPEARS UP" or "Check wheels down and
locked". So you will have some time to push gear
down or execute missed approach ;)
5. ATIS phonetic ID in requesting landing message.
In FG pilots says: "for full stop with ATIS" everytime
(when airport doesn't have ATIS too). But in real life
pilot saying phonetic ID of ATIS message. Now we have:
"for full stop, information alpha ... / ... zulu".
If airport doesn't have ATIS, pilot don't say this.
TODO: add this feature to AI-Planes too.
6. Advising weather condition in airport by Tower.
If you are requesting take-off or landing in airport
that doesn't have ATIS service, Tower will tell you
about wind direction and speed, visibility and QFE.
7. Reporting downwind if missed approach. When some AI-Plane
is on final FG's ATC tell you to "continue approach".
And then you lost radio transmission. Now ATC says:
"continue approach and report left/right downwind".
And now we have "Report Downwind" entry (button)
in "ATC Communication" form.
This also fixes distortion weirdness in the osgviewer version. That
was caused by osg::GraphicsContext getting in the act on resize events
and adding its own scaling to the projectionOffset of slave cameras!
The LOD far range on the tile entry scenegraph node was initialized to
0. This meant that any traverals of active children that happened
before the tile manager updated the node would ignore the node
altogether. Among these is the groundcache traversal which was failing
at startup even though scenery was loaded.
Also added a function to dump scene graph nodes to files; very handy
in gdb.
Make an OSG file reader for .stg files.
New class flightgear::SceneryPager, which is a subclass
osg::DatabasePager to handle explicit delete requests.
Modify FGNewCache, FGTileEntry, and FGTileManager to use
SceneryPager. Mostly this involved removing the queues that talked to
FGTileLoader.
Calculate accurate tile timestamps from the time they are traversed in
the cull stage (which means that they are visible) instead of updating
them periodically.
Replace tile entry transform and range node with one LOD node
This fixes a race condition when teleporting somewhere outside of the
currently loaded scenery. Before, if there was no valid scenery, an
aircraft might end up at the center of the earth...
Instead of just reporting that the magic number, length, etc. of a
multiplayer packet is invalid, abort processing this packet. Also,
check if enough space remains to send a property string.
are not available out-of-the-box on all systems and keyboards, and should
therefore not be used in files committed to CVS. This makes them well
suited for local key bindings, as they aren't likely to get overwritten
with later releases. SDL supports Meta and Super, OSG supports only Meta,
and GLUT supports neither.
(Somehow this part escaped the previous commit. :-)
are not available out-of-the-box on all systems and keyboards, and should
therefore not be used in files committed to CVS. This makes them well
suited for local key bindings, as they aren't likely to get overwritten
with later releases. SDL supports Meta and Super, OSG supports only Meta,
and GLUT supports neither.
This uses the osgViewer infrastructure instead of setting up and osg::SceneView.
When the same change is made for glut, much of render.cxx can be deleted.
Some cleanup in tileentry.cxx, but mostly code to implement loading of tiles
and their models without reference to FGTileEntry or SGBucket structures.
Also, don't do deferred model loading; load them when the tile is loaded.
_material was uninitialized. This was causing a segfault with
as-yet-to-be-checked-in paging code; I don't know if it ever resulted
in a segfault with the old tile loader, but it certainly could have.
file. Possible uses of this functionality could include converting the
model to some other format or coordinate system for use in some other
visualization or simulation.
This is required to make sure the same letter key gets released,
which got the press event. (After Ctrl-press -> a-press -> Ctrl-release
a-release we want the Ctrl-a binding released, not the a binding.)
- add key listener interface for direct key access from Nasal space
This removes some jitter in cases where Nasal is used to set up view
parameters from FDM data, such as position and orientation. (The event
subsystem handles Nasal's settimer() calls.)
This was correct in the old repository and in revision 1.1 of the new,
but then broken in revision 1.2. After that, "lookat" and "lookfrom"
mode used different coordinate systems, and the "Adjust View Distance"
didn't work correctly in "lookat" mode.
"I have been investigating the Concorde IVSI problem. I came to the
conclusion that the trouble is that the environment altitude and thus
the pressure (which is calculated from that) is lagging by 1 frame.
Normally that wouldn't be a problem, but the IVSI calculates rate of
change and it will use the new dt with the old value difference,
thereby arriving at bad results if dt changes (and it does)."
invocations, but left it in place for miscellaneous allocation work.
Contexts cache allocated objects in a temps vector and only clear it
out when they are used.
Also, fix a type warning while I'm in there.
version
* Delete ai list objects in ~ATC/AIMgr.cxx:AIMgr::~AIMgr()
* Delete colors in GUI/new_gui.cxx: NewGui::~NewGui.cxx
* Delete memory allocated to the class member "route" in
Instrumentation/gps.cxx
* Delete all globals (except a few "unsafe" ones that still cause segfaults
and need further examination.
* Use an SGShared pointer for navaid memory allocation, so that pointers to
individual navaid objects can be included safely in multiple navaid lists
- simplify listener purging and fix removelistener() return value for
one-shot listeners
- listener: inherit virtualness
- s/handler/code/ in listener code to be consistent with NasalSys::call
argument:
setlistener(<property>, <func> [, <initial=0> [, <persistent=1>]])
This definition defaults to the old behavior. The fourth argument can
be set to zero, in which case the function is only called when the
node value has actually changed. It should really default to zero, but
then all callers would have to be reviewed, which is a bit too dangerous
"shortly" before a release.
0 -> trigger whenever property is written to (even if it's the old value; default)
1 -> like 0, but also trigger the function initially
2 -> trigger initially, but then only on changes
AMIBO 34.973889 021.658056 ARLOS 34.625278 023.000000 1 095 195 M871-MT E-MT W-N4
... where unexpected ids follow (here E-MT W-N4). The loader didn't skipeol.
The additional values are for a first quick&dirty fix just dropped.
remove all those 41 hacks if possible. Metrowerks is under category
"Defunct software companies" in Wikipedia, its compiler was known to
work on PowerPC (which we don't support, anway, right?) and on some
Unices. The hacks are in CVS since the first commit 2002/9/10 (old
repository!) and probably were in the code long before that. Any
platform where such a broken compiler is still used, will hardly
be suitable to run fgfs at all.
them under /sim/presets/ but they aren't save there, and as fgInitPosition
and its subroutines overwrite them, we lose the information about what the
user really wanted. This is a temporary solution -- it really belongs into
options.cxx.
the next airport or airport with METAR station, but about any type of
airport
- as a side effect this change makes it also 30 to 50% faster :-)
In the long run this linear search shall be replaced with a spatial
algorithm (like octree), which will be a much bigger performance gain.
- preserve information from apt.dat about whether an airport is a "normal"
airport, a seaport, or a heliport. Do it without wasting another byte
in the FGAirport structure (saves 50kB of memory). Yes, I know bitfields. :-)
Turn OPENSCENEGRAPH_MAJOR_VERSION, OPENSCENEGRAPH_MINOR_VERSION and
OPENSCENEGRAPH_PATCH_VERSION into a single number for comparisons in the
preprocessor.
the runway length/width/surface material, so that fgfs doesn't drop one on
the ridiculous grass stripe parallel to the grown up concrete runway
(LOWL, LOXZ, ...). The weighting factors are for now made configurable,
so that they are easier to adjust. This can later be made static.
(will soon get forward ported to fg/osg)
Usage: airportinfo("KSFO");
airportinfo(37, 122); # airport closest to lat/lon
airportinfo(); # airport closest to current position
Returns nil on error, or a data hash otherwise. Example:
# length of runway 28R
var len = airportinfo("KSFO").runways["10L"].length;
Note that only one side of a runway is returned.
This fixes a bug that caused both the x and y values of the mouse to
be reset when the cursor was recentered due to hitting the screen
edge.
Based on a suggested patch from Stuart Buchanan
Anders said:
With Stuart's help I've looked closer at this and I think I've tracked
down the cause of the problem:
At least on my computer the sort() call on line 234 in
Environment/environment_ctrl.cxx sorts the vector entries by memory
address instead of altitude, i.e. the custom comparison predicate is not
used. This causes the tables of environment conditions to be reordered
into a wrong order at some weather updates, depending, basically,
on where the memory allocator places the objects. (Btw. why are they are
freshly allocated for each update?)
and "isOnRunway".
- Added initial support for AI controlled pushback operations, making use of the
current editing capabilities of TaxiDraw CVS / New_GUI_CODE. The current
implementation is slightly more computationally intensive than strictly
required, due to the currently inability of taxidraw to link one specific
pushBack point to to a particular startup location. FlightGear now determines
this dynamically, and once we have that functionality in TaxiDraw, the
initialization part of createPushBack() can be further simplified.
- Smoother transition from pushback to taxi. No more skipping of waypoints, and
aircraft wait for two minutes at pushback point.
- The classes FGTaxiNode, FGTaxiSegment, and FGParking, now have copy
constructors, and assignment operators.
- Removed declaration of undefined constructor FGTaxiNode(double, double, int)
- Array boundry checks and cleanup.
- Modified Dijkstra path search algoritm to solve partial problems. Currently
limited to include pushback points and routes only, but can probably be
extended to a more general approach.
- Added initial support for giving certain routes in the network a penalty, in
order to discourage the use of certain routes over others.
"interpolates METAR changes over time as follows:
1) Wind changes are interpolated as vectors, so the change is much more
natural than before - no-longer will your aircraft be suddenly shoved to
one side.
2) Visibility is interpolated as an X-value, which looks pretty neat.
3) Cloud heights and thicknesses are interpolated if they are close to the
aircraft. Cloud textures are not."
- support optional <preamble> and <postamble> which are written right
after opening and before closing respectively. This can be used for a header
line or an XML header.
- unescape <preamble>, <postamble>, <format>, <line_separator>, <var_separator>
so that \t, \n, \r, \f, \v, \xnn, \nnn can be used directly (\a and \b are
ignored; use \\ for the backslash) The long names ("carriagereturn") are still
supported for <var_separator>, but one can just use \r, or \r\n too.
- don't abort when a chunk doesn't have a <node>. This is useful for adding
constant chunks which consist only of a <format>, such as XML tags.
src/FDM/flight.cxx src/FDM/flight.hxx
src/FDM/LaRCsim/LaRCsim.cxx src/FDM/SP/ADA.cxx
src/Scenery/scenery.cxx src/Scenery/scenery.hxx:
Remove obviously unused variables from FGInterface, make use of
SGMath functions. No longer use plib math functions in FGInterface.
own preferential runway support. In future versions, we might want to
condider having a more generic mechanism for this.
- Keep a history of active runway for each class, so that runway assignments
are more consistent after whether updates or time-related schedule changes.
On most Unix platforms like FreeBSD, Solaris, IRIX (AIX is even worse)
- just not on Linux - the linker wants to know about _all_ required
libraries. So even if a shared library "libosgViewer" itself is linked
against "libosgGA" and "libosgText", you still have to name these in
order to build an "fgfs" binary.
Currently, other libraries like "-losgDB" and "-losgUtil" are
explicitly mentioned on the "fgfs" linker command, but "-losgGA" and
"-losgText" are not. This simple patch lets the linker honour
everything that's required
- Airports Directory
Thomas Foerster: Pulls out the FGTaxiNode implementation into gnnode.cxx.
Melchior / Durk: Copy Constructor and assignment operator for FGTaxiRoute
- AIModels Directory
Durk / Melchior / Czaba Halasz: Ensure that all derived classes use AIBase
member 'callsign'. Adapted, moved and deleted getter/setter functions where
necessary
Czaba Halasz: Fix AIBase model path vs. submodel path consistency.
- Traffic Directory and AIModels CreateFlightPlanCruise
DT: Temporary revert parts of the position estimation code.
(reported by Csaba Halaszi /helijah)
2) Decrease AI aircraft Heading error tolerance to 1% of its
original value. This is necessary to mitigate spinning and
makes for actual "on-runway" landings.
src/AIModel/AIFlightPlan.hxx
src/AIModel/AIFlightPlanCreateCruise.cxx
src/AIModel/AITanker.cxx src/Traffic/Schedule.cxx:
Move member variables that should better be in function local
scope into the functions. Make more use of SGMath functions.
of the extra space *required*) in a rowspan object being redistributed
back into the span, leading to a near-doubling of the size for small
objects with large span ranges.
Fixed bug due to longstanding inconsistency in FGAirport
getter functions return types.
Durk Talsma: Fixed traffic record initialization bug that occured
when taxiing traffic was waiting for traffic on runway
I refactored the XML loading code out of FGAirportDynamics and
FGRunwayPreference. I also added a new class XMLLoader, which serves as a
facade to the loader functions. Further I changed FGRunwayPreference to just
keep a FGAirport ref, which is more concise and closer to the right(tm)
solution than storing the airport data a second time ;-)
I refactored the XML loading code out of FGAirportDynamics and
FGRunwayPreference. I also added a new class XMLLoader, which serves as a
facade to the loader functions. Further I changed FGRunwayPreference to just
keep a FGAirport ref, which is more concise and closer to the right(tm)
solution than storing the airport data a second time ;-)
"This patch fixes the use of the keypad with numlock in the osgViewer
version of FlightGear."
"This also restores the handling of resize events while trying to stay
out of the way of the multiple display code."
parser. Advantages over xml.nas: (reviewed and OK'ed by Andy)
- faster (33% ... only. I had hoped for more.)
- more standards compliant
- should support UTF
- I don't have to support it. ;-)
Usage: parsexml(<path> [, <start-tag> [, <end-tag> [, <data> [, <pi>]]]]);
<path> is an absolute file path, the rest are optional callback functions.
Example:
parsexml("/tmp/foo.xml", nil, nil, func(d) { print("DATA FOUND: ", d) });
where type is one of string (default), double, float, long, int, bool
Using only the first letter works, too.
--prop:foo=123 ... sets property foo to string 123 (old behavior)
--prop:string:foo=123 ... verbose version of above
--prop:s:foo=123 ... slightly less verbose version of above
--prop:bool:foo=1 ... makes property a bool of value 'true'
I hope this isn't considered a silly gimmick. I need this often and maybe
other developers do, too. It's useful in cases where the difference really
matters. if (getprop("/foo")), for instance, is TRUE even when the property
contains string "false", as all strings are TRUE.
efficiently performing "Dijkstra algorithm".
Durk Talsma: Added the detection of "circular" wait situations in the AI
ground network. A circular wait is a situation where aircraft a waits for
b; b waits for c; and c (in turn) waits for a. The checkCircularWaits
function detects these situations.
The current "solution" to a circular wait is rather crude: Remove the
aircraft from the scene. A proper solution needs a lot more work, however,
and at least this patch stops the AI system from clogging up. in case of a
circular wait.
data for AI traffic. Default performance classes are still available as a
backup. This database will allow the calculation of aircraft-specific
take-off speed and estimate runway lenght requirements. Further added
rudimentary support for take-off and landing rotation of AIAircraft.
together -- there's only *one* instrument node now
- don't take "random" tacan, but <tacan-source> from the instrumentation
config (or /instrumentation/tacan[0] by default)
- don't take "random" display-controls from /instrumentation/tacan[0]
- default name is now "radar" (formerly "wxradar")
* it says it's a warning (while in fact it's just saying what it's doing)
* the user can't do much here (yes, flying slower, but it doesn't say that :-)
* scrolling those countless messages in the terminal puts stress on the CPU
in a time when it's apparently already struggling
- re-enable od_gauge ("owner drawn" render-to-texture instruments)
- implement radar in c++ (unlimited number of clouds/ai/mp/... objects,
better performance)
or nil if no terrain intersection could be made (tile not loaded yet).
<matdata> is a hash with information about the surface material, or nil
if no material is assigned (shouldn't really happen, but one never knows).
Example:
var ac = geo.aircraft_position();
var data = geoddata(ac.lat(), ac.lon());
debug.dump(data);
# which outputs
[ 294.5862574369132, { light_coverage : 0, bumpiness : 0, load_resistance : 1e+30,
solid : 1, names : [ "pc_taxiway", "dirt_rwytaxiway" ], friction_factor : 1,
rolling_friction : 0.02 } ]
With this information it can be determined how far an object would sink in,
if the coordinate is on a runway, etc.
foreach (var n; data[1].names)
if (string.match(n, "p[ac]_*"))
im_on_a_runway();
/sim/screneryloaded-override was "true". At least one subsystem (od_gauge)
waits for /sim/sceneryloaded to bypass CPU intensive code until the scenery
is up. This broke e.g. the RTT-radar when using /sim/screneryloaded-override
--prop:sim/sceneryloaded-override=true has the effect that fgfs
doesn't show the splash screen until the scenery is loaded, but shows
the OTW view (scenery/aircraft) at the earliest possible moment. This is
useful for developers who often need to run fgfs only to check some minor
detail, while not caring about stuttering caused by scenery loading.
simple SG_LOG instead. The user didn't call the fgcommand, so why should
s/he be bothered with that? And the actually caller of the command gets a
return value and can pop up a dialog if it thinks it's necessary.
Why /sim/fg-current at all? Because we have a file selector dialog
(still unfinished), and one might like to start it from the current
directory, to find saved flights/screenshots/whatever.
FGManipulator.*:
"This patch works around a bug in OSG's handling of modifier keys. The
symptom of the bug is that modifier keys don't appear to be released."
fg_os_osgviewer.cxx:
"This patch fixes the test for support of cursor changes in OSG 2.0."
because this allows to load from FG_HOME. To reduce security risks, always
append an ".xml" extension if there was none. Makes it hard to read /etc/secret
and to overwrite ~/.bashrc. :-)
IRC wanted this to be scritable) and add it back (as a tip popup) via
a little nasal in the keyboard handler. Also put the synthesis of
property nodes back into fgcommand(), because I got cold feet.
missing, for sanity. Note that this will pass the resulting NULL
pointer through into the underlying SGCommand handlers, some of which
may be unprepared for it. So basically this is now yet another way
you can use Nasal to exercise bugs and hose your sim; no biggie.
- if no <impact-reports> node is defined for a particular submodel, then
write the path to /ai/models/model-impact instead
- don't tie() properties that are only ever set a single time, if at all!
- better variable names
src/Scenery/tileentry.cxx: Jonathan Wagner:
Removes black dots by accounting for radius of nodes
when calculating visible nodes for traversal without removing the
optimization. Confirmed fix with a few people on IRC.
src/GUI/gui.h src/GUI/gui_funcs.cxx src/Main/fg_commands.cxx
src/Main/renderer.cxx src/Main/renderer.hxx: Tim Moore:
These patches implement a command to dump the entire OSG scene graph as
a .osg text file. While large, this allows debuggers to really see
what's happening in the scene graph.
configure.ac src/Main/Makefile.am src/Main/fg_os.cxx
src/Main/fg_os.hxx src/Main/fg_os_sdl.cxx src/Main/main.cxx
src/Main/renderer.cxx src/Main/renderer.hxx
src/Network/jpg-httpd.cxx
Added Files:
src/Main/FGManipulator.cxx src/Main/FGManipulator.hxx
src/Main/fg_os_osgviewer.cxx:
Tim Moore: Make use of osgViewer.
a report node in the submodels config:
<impact-reports>/sim/model/cow/impact</impact-reports>
When an impact happens, then the path of the submodel will be written to
this node. An attached listener function can evaluate the impact properties.
at all is that this method is meant to be deprecated. But if it doesn't
say that, and there's no generic replacement at all, then it's rather
pointless.
- simplify parameter initialization (The old code copied from Instrumentation/
but has been simplified there in the same manner a few months ago
The new method is less picky about additional nodes ane outputs less
pointless alerts. If there shall really be a check for that, then
this should be a separate function. But it's nowhere else done in fgfs.
recover instead
- it was apparently planned to run the updated loop only every 1000th
frame, but the counter isn't reset, so it runs every frame
- use SG_LOG instead of cerr
- don't add redundant slashes in SGPath::append()
throwing an instance of 'sg_io_exception'\nAbandon". And this is caused
by compiling fgfs/sg without exception support (unlikely) or linking
against a libSDL/libglut that was compiled/linked without execption
support. While we can't fix that, we can tell the users who's to blame. :-)
- handle const char * exceptions
"minor update for the rotor FDM. It results in a more realistic
calculation of the phase shift of rotor and therefor in a little bit
more realistic flight behavior.
(Additionally you can modify the initial position of the rotor and some
(not finished) modifications for the jet ranger rotor)."
show "secret" values, that is: values of nodes with children. These
can be used like all normal (leaf) properties, but their values were
until now only shown in writeProperties() dumps. Also show the
number of attached listeners. Example: foo = 'bar' (string, AU, L3).
dialog.cxx: add warning message for broken <format>s; cosmetics
- props is easy to mix up with the --prop option (for setting properties)
- the name is unspecific and inconsistent: other option names describe
the protocol -- the way to get the properties. How is, for example,
--httpd less about prop(ertie)s?
- two identical options easily confuse people, as can be seen in The
FlightGear Manual, where --telnet and --props were described differently
/sim/view[*] that it finds. It's not only unnecessary that view definitions
have subsequent indices, but aircraft are now *requested* to use indices
100++. /sim/view[0] .. /sim/view[99] are reserved for the system. (Not
that we'd ever need that many, This is just a convention, it's nowhere
hard-coded.)
- replace the string operations for property paths by method calls & other
improvements
because nasal's f_interpolate() may be called in Nasal at times when the
GENERAL subsystem group is being deconstructed; access it by addressing
the group directly, as using globals->get_subsystem() does then not
work any more then; yeah, it's all for a rare border case ... :-)
NasalSys.cxx more robust instead. The reason for the crash was that during
fgfs shutdown destroyed subsystems (GENERAL group) still need Nasal access
(for AI Model destruction listeners), but at that point globals->get_subsystem()
can't even deliver the "nasal" subsystem (INIT group). One way to solve that
problem would have been to replace globals->get_subsystem("nasal") by
globals->get_subsystem_mgr()->get_group(SGSubsystemMgr::INIT)->get_subsystem("nasal"),
but Andy decided to store a pointer to the active "nasal" subsysten in
NasalSys.cxx instead, as the "nasal" subsystem needs to be accessed in
every single Nasal extension function, and multiple "nasal" subsystems are
out of the question, anyway.
we need to explicitly destroy that here, too, so that it has guaranteed
access to the Nasal subsystem. Otherwise we get a segfault on exit. When
the next subsystem needs this special treatement (radar?), we should
introduce a new subsystem group (in addition to INIT and GENERAL)
"FATAL: PUI: No Live Interface! Forgot to call puInit ?"
We shouldn't use the splash progress message before guiInit().
Leave the "idle_state" step for now, to keep the similarity
with fg/plib as big as possible. This can be dropped later.
Patch to enable atc chatter (and any other arbitrary "message" audio file)
to be played at any specified volume. (Previously these messages were always
played at a hardcoded volume of 1.0)
- loop up file name in the cache at startup. If it's found, check if the
file exists and use it, otherwise scan $FG_ROOT/Aircraft/ as usual,
and create a new cache while doing that. Rebuild cache on FG_ROOT change.
getAttribute("archive") returns 1 if the attribute is set, and 0 otherwise.
Allow to query and to set all properties by not specifying an attribute
string: getAttribute() returns all attributes bit coded in an integer,
and setAttribute(attr) sets all attributes. No assumptions may be made
about the meaning of the bits -- they can be changed in future fgfs releases.
The only valid use is to compare or set attribute numbers obtained in the
same fgfs run. This is meant for allowing full copies of property branches.
Also add getAttribute query strings "children" for the number of children,
and "alias".
- fix breakage due to former commit (AIManager.cxx, r1.72)
- make AI properties available in AIBase
- add <valid> property for animations/nasal scripts
- support more MP and AI targets
- add target select and altitude display
their XML wrapper/animation file. They can access their /ai/models node
via cmdarg() function. Example:
<nasal>
<load>
print("Hi, I'm the Nimitz. My data are under ",
cmdarg().getPath());
</load>
<unload>
...
</unload>
</nasal>
Note, however, that the <unload> block is only called on exit at the moment,
not when the tile is unloaded.
"""
"Flight plans" which can start at a given time (gmt)
WAITUNTIL tokens which pause the flight plans until a given time (gmt)
Submodels can now be attached to any AI objects (except submodels - it can
be done, but in my experimental code it's too expensive in frame rate atm)
"No-roll" attribute added to Ballistic objects - useful for wakes and the
like
"Random" attribute added to Ballistic objects (adds =- 5% to the Cd) -
useful for smoke, exhausts
If the <trigger> tag is not specified the Ballistic object/s will be
released at start-up (cannot be stopped)
Submodels are not released from AI Objects if the AI Object is more than 15
miles away.
"""
mf: minor code and formatting fixes; submodels.?xx were FUBAR and are thus
astyle formatted;
NOTE that <name> tags END, EOF, WAIT, WAITUNTIL are *depreciated*.
Don't get too used to them. This will have to be moved from the "name"
to regular engries.
Nasal now supports calls to "subcontexts" and errors can be thrown
across them, leading to complete stack traces when call() is used,
instead of the truncated ones we now see.
Vectors can now be concatenated using the ~ operator that used to work
only for strings.
Better runtime error messages in general due to a fancier
naRuntimeError() implementation
A big data size shrink on 64 bit systems; the size of a naRef dropped
by a factor of two.
"Braceless code blocks" have been added to the parser, so you can
write expressions like "if(a) b();" just like in C. Note that there's
still a parser bug in there that fails when you nest a braced block
within a braceless one.
Character constants that appear in Nasal source code can now be
literal multibyte UTF8 characters (this was always supported for
string literals, but character constants were forced to be a single
byte).
New modules: "bits", "thread", "utf8" and (gulp...) "io". The bits
library might be useful to FlightGear, the utf8 one probably not as
Plib does not support wide character text rendering. The thread
library will work fine for spawning threads to do Nasal stuff, but
obviously contact with the rest of FlightGear must be
hand-synchronized as FlightGear isn't threadsafe. The io library is
no doubt the most useful, as it exposes all the basic stdio.h
facilities; it's also frighteningly dangerous when combined with
networked code...
have no children (in which case they default to 1px thickness & stretch).
This allows to just write <hrule/> instead of <hrule><dummy/></hrule>.
One can still use <hrule><pref-height>3</pref-height></hrule>, of course.
layout.cxx: drop silly do??Box calls for hrule/vrule (yes, I wrote that :-)
discard the display part. The curly braces wouldn't be spoken anyway,
and the | would be spoken as "vertical bar", which is completely
useless (which is why it had been disabled in the past already).
"Implement 'flightplans' for AIShips. This patch also introduces the concept
of a 'WAIT' token for AIShips: when the flightplan reaches a 'WAIT', the
AIShip stops and pauses for the specified time (secs)."
"""
Fix Y2K bug triggering string overflow
sim_control_.date_string is a char[7], so it can contain "yymmdd" and
the terminating '\0'. However, nowtime->tm_year is 107 for the year 2007,
so you'll end up with a 7 digit number and the string written to
sim_control_.date_string is longer than sim_control_.date_string is.
Ouch!
"""
mf: ... and sim_control_.date_string isn't even used.
done for performance reasons, but print() should be able to output any
valid string, and when SG_LOG uses strings and streams already, then we
can use that here, too. (Not discussed with Andy yet.)
before the property tree is stored away for reinit, so the signal would
be emitted again on reset.
- fix inconsistent style that sneaked in with a previous patch
in $FG_ROOT/Nasal/* were loaded and executed, and thus all Nasal library
functions are available. This was in the past only done with settimer(..., 0),
constructions, but suchlike triggered timer functions are executed
*after* aircraft specific Nasal files were loaded, so they can't be
used for internal library initialization, where e.g. props.Node() is
already needed.
"""
- ground properties (e.g. feel bumpiness and the reduced friction of
grass or go swimming with the beaver)
- initial load for yasim gears (to get rid of the jitter the beaver has
on ground)
- glider/winch/aerotow (do winch start with YASim glider or do aerotow
over the net) I will place a how-to on the wiki soon, here very short:
use the sgs233y (or the bocian if you have AJ (up ot now) non-GPL
bocian)
winch start: Ctrl-w for placing the winch, hold w to winch, press
Shift-w to release the tow
aerotow: Place the glider within 60m to a MP-aircraft, press
Ctrl-t to tow to this aircraft. If the MP-aircraft is the
J3 and the patch is installed on both sides, the J3 feels the
forces, too. The J3-pilot has to taxi very slow up to the
moment, the glider starts moving. Increase the throttle gently.
Don't lift the J3 early, wait for the glider being lifted,
lift gently.
"""
(including all subdirs and with max depth!), but only the outmost level.
There are no *-set.xml files in deeper nested dirs, and with an ever growing
number of aircraft the search just lasts too long.
Here is a patch for two bugs in the AI/multiplayer part:
1. Cannot find model file *.ac error message (was only a false message,
anything worked correctly, the model was loaded from the correct path
afterwards).
2. Often many multiplayer aircrafts are missing in the property-tree.
(but I need them for aerotowing). There is still another bug: The
property in some circumstances seems not to be cleaned up after logout
of a multiplayer. I have added a workaround for this, but I don't now,
if it 100% works (should have no side effects, just aerotow would not
work sometimes). For testing I need more traffic on the mp-server.
src/Input/input.cxx src/Main/renderer.cxx
src/Main/renderer.hxx src/Scenery/scenery.cxx
src/Scenery/scenery.hxx: Move scenery picking into the renderer.
There is most of the required data defined. Also we can better use
the pick visitor that will be needed with th upcommung panel code.
src/FDM/groundcache.cxx src/FDM/groundcache.hxx: Store the material
that was used to get the croase agl level and return that material
in case we need to make use of that croase value.
options.cxx: Olaf Flebbe: Fix some problems with --help --verbose
caused by the usage of snprintf. Elimate snprintf usage in favour
plain std::string manipulations.
data/AI/Aircraft/*/*.xml and read traffic information from these files.
Current code still mimicks old behavior by reading data/Traffic/fgtraffic.xml
The latter functionality will be disabled once we have some traffic containing
files in data/AI/Aircraft.
earth model instead of WGS84. WGS84 precision is overkill for what the
traffic manager requires, and also keeps locking up while computing
course and distance for anti podal points in New Zealand vs. south west
france.
utils/Modeller/Makefile.am src/FDM/YASim/Makefile.am:
Remove -lssg from the linker lines.
Do no longer build threedconvert. A very similar functionality
is available with osgvconv. But leave threedconvert in place
if somebody will need that ...
I found a small conspicuity in YASim. The destructor of the fdm was
never called, therefore a modification of the heli fdm (not in cvs) did
not work after reset (I tie some properties and untie them in the
destructor, but the destructor was not called and the tieing failed
after reset. I don't know if any other parts of YASim need their
destructors, at least it wastes memory.
Another small fix I have made to the turbulence.cpp. The code needed,
that (a-floor(a)) is >=0 and <1. This is analytical correct, but
numerical only for "small" values. In normal fg-operation a in this
function is always small, but with unrealistic parameters in the
aircraft config file it is not and then fg crashes (instead a crash of
the aircraft or cataputling it far away).
"bind the visibility-property of the SGSky object to a property
named /envirionment/effective-visibility-m. This property is needed to decide
if the aircraft is within clouds or not. I use this property also for the
structural icing code."
- Ground network slow-down finally works as expected
(although occasionally causing a traffic jam)
- Hold position instruction now really sets speed to zero, in addition
it actually works now for crossing and two-way traffic
- Attempt to limit execution time of ground network trace algorithm
to make performance acceptable at high-density networks
- Removed remaining terminal messages
- Various minor tweaks and clean-ups
Time/tmp.cxx Main/viewer.hxx Main/viewer.cxx Main/renderer.cxx
Get rid of an other OSGFIXME. The view matrix had some plib specials
included. The viewer is now updated for that.