1
0
Fork 0
Commit graph

264 commits

Author SHA1 Message Date
Edward d'Auvergne
34a6cb3c74 SGSubsystem classes: Registration of all subsystems. 2019-07-01 14:51:32 +02:00
Edward d'Auvergne
d259c70560 SGSubsystem classes: Addition of staticSubsystemClassId() to all subsystems. 2019-07-01 14:51:32 +02:00
Edward d'Auvergne
fb5c36fc82 SGSubsystem classes: Renaming of the subsystem ID variables and functions. 2019-07-01 14:27:30 +02:00
Edward d'Auvergne
7a6e63ddb9 SGSubsystem classes: Subsystem and subsystem group API declaration standardisation.
This is a cleanup commit.
2019-07-01 14:27:30 +02:00
Edward d'Auvergne
60a2444766 SGSubsystem classes: Whitespace standardisation of the declarations.
This is a clean up commit prior to the subsystem API standardisation to simplify
the diffs.  It includes all SGSubsystem and SGSubsystemGroup derived classes.
2019-07-01 14:27:28 +02:00
Richard Harrison
9121079cfe Disable time easing if ctrl key pressed. 2019-04-28 19:40:26 +02:00
jean pellotier
faf06b42a3 preparation for the lag correction based on time sync, instead of fixed
lag compensation, this is the time manager part.
- introduction of a pure steady clock initialised from system clock at init
- the mp protocol clock have an offset available (will be used
to sync the players, in case ntpd is not accurate or inavailable)
- got a way to see drift between system clock and the fg steady clock, mainly
to see how differents OS behave ...
2018-12-18 02:38:46 +01:00
Richard Harrison
7795ba60ff Added time statistics for the simulation host.
These are the time statistics that are the simulation code, which is basically everything except the rendering.

For a while I've wondered how efficient each of my JSBSim models are, and how much of our valuable frame time is spent on simulation modules.

Ideally the simulation modules should be taking 2-3ms, anything longer indicates a need to consider optimising things more.

These are the new properties that are added by this change:

/sim/rendering/sim-frame-count        Number of frames since start (or last time
/sim/rendering/sim-frame-count-reset  Reset statistics. Can be useful to reset monitoring after a slow startup
/sim/rendering/sim-host-avg-ms        Average amount of time spent in the "simulation" rather than rendering. This attempts to take into consideration the
                                      frame rate throttling but when throttled this figure is less reliable.
/sim/rendering/sim-host-total-ms      Total milliseconds since reset
/sim/time/frame-wait-ms               Current frame wait to meet throttling rate.
2018-09-02 13:47:55 +02:00
Edward d'Auvergne
0b2152a8ad TestSuite: Removal of some ancient, unused test files.
These include Scenery/{maptest.cxx, test.cxx} and Time/{test_event.c, ttest.c,
win32test.c}.  These files, essentially untouched since added in 1999, are not
useful for conversion for the test suite.
2018-07-26 15:52:07 +02:00
jean pellotier
b9b280abd1 a new clock following real time pace, for mp protocol
the current timestamp used in mp protocol and in AImultiplayer is not a good one:
it can pause, or even change speed if we change warp value.
we want it to be used for network protocol lag and jitter estimation, and
a time flowing linearly on both side is needed, here's a first introduction
of this timestamp relates to real elapsed time.
here it's initialised to the system clock, then follow the monotonic clock.
in future improvement, it will allow time synchronisation betwen mp players,
to have a very good close formation flight experience.
2018-01-29 12:51:43 +01:00
James Turner
4d28146796 Give TimeManager a subsystem-name
Also modernise the lookups now this is added.
2018-01-29 10:46:08 +00:00
Richard Harrison
2c8aad12ba Model relative property tree root binding.
Change fgcommand to take an optional property tree root element.

This fixes the animation bindings to use the defined property tree root - to support multiplayer (or other) model that can bind to the correct part of the property tree.

Requires a corresponding fix in sg to allow the command methods to take an optional root parameter.

What this means is that when inside someone else's multiplayer model (e.g. backseat, or co-pilot), the multipalyer (AI) model will correctly modify properties inside the correct part of the property tree inside (/ai), rather than modifying the properties inside the same part of the tree as the non-ai model.

This means that a properly setup model will operate within it's own space in the property tree; and permit more generic multiplayer code to be written.

This is probably responsible for some of the pollution of the root property tree with MP aircraft properties.
2017-07-05 11:37:17 +02:00
Edward d'Auvergne
74622d9a04 Time: Calculation and exposure of the moon vector from the local position.
The new FGLight::updateObjects() function is now being passed into the global
events manager as a task rather than FGLight::updateSunPos().  The
updateSunPos() function has been renamed to updateBodyPos() and generalised for
any solar system body and is called twice by updateObjects(), once for the sun
and once for the moon.  The local position of the moon is then exposed at
"/ephemeris/moon/local/".
2016-11-08 11:16:24 +01:00
Edward d'Auvergne
6e62228c1d Time: The sun solver has been generalised to to handle any solar system body.
The functions fgSunPositionGST() and fgTimeSecondsUntilSunAngle() have been
renamed to fgBodyPositionGST() and fgBodyPositionGST() respectively, and both
require a new char argument specifying the body of interest.  This allows the
position of all solar system bodies to be calculated from the aircraft frame of
reference.
2016-11-08 11:16:24 +01:00
Edward d'Auvergne
0ba2e8708e Time: Renamed the sunsolver.cxx to bodysolver.cxx.
This is in preparation for generalising the code for handling all solar system bodies.
2016-11-08 11:16:24 +01:00
James Turner
6d0c2070fd Use future-proof SGPath APIs.
Remove uses of .str(), .c_str() and some other methods of SGPath.
Pass SGPath directly where possible, or explicitly convert to the
appropriate 8-bit encoding.
2016-06-28 10:08:38 +01:00
Erik Hofman
94f6db5857 Prevent rf2 from becoming inf 2016-05-25 10:30:34 +02:00
James Turner
de959a14f3 Rename Viewer/viewer.cxx to view
- keep class and file names in sync.
2016-02-17 21:25:39 +00:00
James Turner
f2bf30bcc7 Current time of day (warp) fixes:
- sim-speed-up (a/A keys) offsets warp correctly. This means at 4x speed
  up the warp will increase by 3 seconds for one elapsed real second.
  In practice this means simulation elements timed using sim ‘current time’
  will be correctly synchronised with those using simulated elapsed time.

  (AI traffic being a prime example of this)

- warp-delta (t/T keys) is independent of frame rate, and works when
  paused. The warp-delta values in the keybindings / GUI dialog
  will need to be updated since warp-delta in now seconds-per-second,
  as opposed to seconds-per-frame.
2016-01-10 22:10:10 -06:00
James Turner
52f39abc6b Apply /sim/speed-up to general subsystem dt
- consistent with pause (freeze), /sim/speed-up is now applied to the
  dt value for all subsystems, not just the FDM and some instruments.
  For example AI traffic can now be sped-up or slowed down.
- requires both an FGData and Simgear update.
2016-01-05 23:19:28 -06:00
Erik Hofman
2496bdecfa Tie the sun vector to the property tree 2015-06-26 09:53:03 +02:00
Torsten Dreyer
6f54ffc947 Allow easing of setting the time-offset
Configurable with properties:

/sim/time/warp-easing == false ? jump to new time offset (orig. behaviour)
/sim/time/warp-easing == true ? use easing parameter to adjust warp

/sim/time/warp-easing-duration-secs: time in seconds to reach the new value
/sim/time/warp-easing-method: easing method to apply. default: swing
2014-12-17 09:52:09 +01:00
James Turner
c6541e9c8f Remove some debug log calls.
All places which continuously log messages (either every frame or at
least every second) tending to swamp other log output.
2014-01-23 13:49:58 +00:00
James Turner
4dcd96c4af Remove dependency on command-mgr singleton
Use explicit instance (from globals)
2013-11-25 09:14:46 +00:00
James Turner
2455d86d8b Fix a propObj -> node conversion bug.
Thanks to Bertrand Coconnier for spotting this.
2013-11-18 08:40:34 +00:00
James Turner
9a77efacd9 Reset: drop FGLight prop refs on unbind() 2013-11-12 22:49:48 +00:00
James Turner
069a098909 Reset: use simple properties for TimeManager 2013-11-12 22:47:45 +00:00
James Turner
ad7a3e854d Reset: TimeManager can be unbound. 2013-10-29 23:01:58 +00:00
James Turner
52e5a9abe8 Reduce amount of log output at level=debug. 2013-09-28 14:47:20 +01:00
James Turner
df4f574951 Fix horizon sunrise/sunset effect position.
Fix sun position in default renderer. (Committing fix
provided after discussion on IRC + forum, no bug ID)
2013-08-07 16:30:20 +01:00
James Turner
0f26267647 Reduce a message severity. 2013-03-16 12:43:25 +00:00
ThorstenB
a784443a24 Remove static property dependencies
preventing us from wiping properties on reset/reinit/subsystem recreate.
(more work required for "native_gui" and "ATC-Outputs" protocols)
2012-11-18 16:35:54 +01:00
James Turner
649d579124 Helpers to access view position.
Avoid direct use of FGViewer in various places, by providing property-based accessors to the current view position.
2012-09-25 10:06:56 +01:00
James Turner
6c6452c62b Adapt to revised SGTime API
Convert SGTime users to pass SGGeod/SGPath instead of raw values.
2012-09-24 00:03:23 +01:00
ThorstenB
06170ddaae Handle scenery-override in a single place only. 2012-09-17 13:45:31 +02:00
ThorstenB
89b41395d8 Move viewer-related sources to separate folder.
Simple source directory clean-up, so "Main" folder contains fewer stuff
and the list of files in the editors a lot shorter.
2012-04-25 23:28:00 +02:00
ThorstenB
e24004b17b #589: 2D panels transparent at night. May also fix #591.
Since d91a617423 (vectory color calculations)
all 4 elements of a color were scaled with the respective brightness.
The caused some panels to be transparent at night etc.
Before the change, only the 3 RGB elements of the colors were scaled,
while the 4th element (alpha channel?) remained unaltered.
Commit restores the alpha elements to their original behaviour.
=> "Quick hack" for 2.6.0. Need s.o. to double check the initial changes
and commit something clean to "next".
2012-03-07 20:49:13 +01:00
ThorstenB
ba257eeecf More spring-cleaning fun.
Use tiedPropertyLists, instead of manual tie/unties.
2012-03-07 20:48:00 +01:00
ThorstenB
db098593be #591: Fix sky flickering at certain sun/view angles
Commit 5f0066c resulted in an incorrect angle calculation. At certain view/sun
angles "hor_rotation" and "rf1" would skip from the minimum to the maximum
value).
Also, an offset angle of 90 degrees (PI/2) is added, which seems to align
the sky effect with the sun position. Calculation is probably still wrong,
but seems less wrong than before - and the flickering is gone...
2012-03-07 20:43:52 +01:00
ThorstenB
0b049c877a #591: night-time rendering issues, avoid negative color values
Fog color became negative at certain sun angles (around midnight), which
resulted in weird sky dome coloring issues.
Hack: simply clamp the value for now.
2012-02-05 15:14:30 +01:00
Erik Hofman
699f4eeb38 fix a typo 2012-01-09 08:14:46 +01:00
Erik Hofman
5f0066c4c2 Fix the sun position and fog/ambient coloring misalignment 2012-01-08 16:28:43 +01:00
Erik Hofman
3abf0b5df1 remove some ugly while loops 2012-01-08 13:51:38 +01:00
Erik Hofman
d91a617423 vecotry color calculations 2012-01-08 12:09:46 +01:00
ThorstenB
dac00efbc7 Fix some compiler warnings.
Comment out unused code.
2012-01-02 23:16:17 +01:00
Erik Hofman
1fb790eb60 comment out unused variables and function and properly initialize variables 2011-12-19 16:50:21 +01:00
Erik Hofman
e6e09a8161 Also expose the true sun color in the property tree. 2011-12-17 10:57:08 +01:00
Erik Hofman
ff4c771759 Expose the cloud color in the property tree 2011-12-16 15:37:16 +01:00
James Turner
029226f8d4 Use property objects to avoid property look-ups during TimeManager updates. 2011-11-20 18:30:31 +00:00
ThorstenB
4b2506d709 Add new performance monitoring subsystem.
Rename some subsystems for naming consistency.
2011-11-19 15:37:49 +01:00