1
0
Fork 0
Commit graph

82 commits

Author SHA1 Message Date
Julian Smith
7550ff70d9 Nasal/view.nas: set new property /sim/current-view/multiplayer to 0 or 1.
Useful to have this information available as a simple property.
2019-08-29 00:11:51 +01:00
Julian Smith
81fc15d8e7 Nasal/view.nas: fix for regression in handling of /sim/current-view/?-offset-m.
resetViewPos(): set /sim/current-view/?-offset-m to
/sim/view[]/config/?-offset-m, not zeros.

This requires corresponding change to flightgear to compensate for the extra
offset, and fixes things when aircraft implement custom views by writing to
/sim/current-view/?-offset-m.
2019-08-12 18:02:02 +01:00
Julian Smith
f591120032 Disabled old 'Model View' selector by default.
It is now called 'Legacy multiplayer view selector', and enabled/disabled via
new checkbox in the 'View - View Options' dialogue.
2019-08-05 07:31:47 +01:00
Julian Smith
2e5e314a77 Nasal/view.nas:stepView(): also create /sim/current-view/view-number-raw.
This allows new view code to find the view configuration with non-sequential
view numbers (e.g. on 777).
2019-08-05 07:31:47 +01:00
Julian Smith
a10274665d Nasal/view.nas: pilot_view_limiter: protect against nil. 2019-08-05 07:31:47 +01:00
James Turner
0a68cbd93a Merge /u/jsb1685/fgdata/ branch next into next
https://sourceforge.net/p/flightgear/fgdata/merge-requests/151/
2019-07-22 15:54:56 +00:00
Henning Stahlke
aaa7888f6b add setViewByIndex to view.nas 2019-07-21 12:56:01 +02:00
Julian Smith
c80059ba53 Removed Model View so that Tower View AGL doesn't alter view numbers.
Due to Nasal/view.nas making a sequential copy of views, inserting new view
number 8 for Tower View AGL broke custom views, e.g. for aircraft 777).

We no longer require Model View (it's identical to Helicopter view now), so
this way we can have Tower View AGL without altering sequential view numbers.
2019-07-20 22:01:05 +01:00
Julian Smith
3738d84d7b Nasal/view.nas: set /sim/viewp[]/config/root to point to multiplayer data.root.
This is required by view code.
2019-07-09 16:25:11 +01:00
Julian Smith
47415e20ce Pilot List dialogue now allows control of which aircraft to view.
I think this is more convenient than the normal model-view buttons / popup
list. [Though this is still there.]

Nasal/multiplayer.nas:
    Added new column 'view' with checkbox. Also added 'view self' button to
    titlebar to view the user's aircraft.

    Fix some bad indentation.

Nasal/view.nas:
    Changed /sim/current-view/model-view to contain just the callsign, not
    '<callsign> <model>', so that Nasal/multiplayer.nas can get the callsign
    reliably.
2019-07-09 16:25:11 +01:00
Julian Smith
9822b8ff8c Added multiplayer support to Helicopter View and Tower View etc.
We remember the multiplayer aircraft so that when switching between views,
multiplayer views (currently Helicopter, Model, Tower and Tower AGL) show the
same aircraft.

Nasal/view.nas: use /orientation/true-heading-deg in Model view and Tower AGL
view. This avoids problem when looking at multiplayer aircraft because there is
no /ai/models/multiplayer[]/orientation/heading-deg

Nasal/view.nas: improved handling of sim/current-view/{x,y,z}-offset-m. Changed
resetViewPos() to set these all to zero, because view's offsets are now
kept separate. Also removed setting of /sim/current-view/z-offset-m to
chase-distance - this is the wrong place now that views define the offset
explicitly.

Also added Tower View AGL support.
2019-07-09 16:25:11 +01:00
Philosopher
c0713db911 Fix screen width compensation
The reason it didn't work for me is that
/sim/rendering/camera-group/camera/viewport/ does not seem to contain
the actual dimensions of the view window... which is odd. Instead I'll
use /sim/startup/[xy]size (and make it into a method so I don't have to
change 3 lines next time :). Now that it works (again), it looks so much
better. Thanks to Alexis Bory for the original idea.
2014-11-27 22:17:22 -06:00
Philosopher
9a3bf2d0a7 Update view.screenWidthCompens
* make into singleton class
* make sure FOV changes take place *immediately* when required
* current FOV is scaled with changes, though being preserved: resizing
  window and going back ends up with the same FOV
2013-10-19 21:27:21 -05:00
Philosopher
819aa8a988 Fix for #1185 2013-09-30 13:53:10 -05:00
Thomas Geymayer
44050c8011 Delay pilot_view_limiter.start after reinit to prevent using wrong heading-offset 2013-06-22 17:11:22 +02:00
Anders Gidenstam
7b277810a8 Nasal/view.nas: Honour the configured directional offsets on view reset.
Thanks to Patrick Melanson, who noticed the problem and suggested the solution.
2013-05-28 22:35:32 +02:00
alexis
f069dfdc99 - Revert to previous behavior when changing view which shouldn't trigger a FOV reset. 2012-11-11 17:51:18 +01:00
Alexis
bc4371bcd4 view.ScreenWidthCompens() : optional FOV compensation for wider screens.
It keeps an equivalent of 55° FOV on a 4:3 zone centered on the screen
whichever is the screen width/height ratio. Works only if width >= height.
2012-10-04 22:15:52 +02:00
ThorstenB
5057b49ed9 #669: fix fly-by-view when aircraft skips position
Reposition when view position is too far away, i.e. due to replay,
relocation etc.
2012-05-03 00:00:56 +02:00
ThorstenB
e282a1e6ed fgdata/Nasal: avoid performance drop after sim reset/relocate
"/sim/signals/fdm-initialized" triggers _every_ time the FDM is reset,
so for every sim reset/relocate.
We need to uninstall the listeners after its first execution, or guard
certain parts of the initialization, to avoid starting multiple
"timer/update loops", or installing multiple property listeners.
Repeating "sim reset" often enough would eventually completely block/
overload the system.
2012-03-20 21:18:20 +01:00
ThorstenB
1d222c06a8 #683 Nasal error with mibs/video assistant 2012-02-25 15:43:20 +01:00
ThorstenB
a0256e47ed Fixed parentheses when checking conditional view-name property.
Avoids stepping through invalid views.
2011-07-03 16:06:14 +02:00
ThorstenB
f84ce36d90 Fixed issue with "unnamed view".
Do not show "unnamed views" (views have no name when they belong to
another aircraft).
2011-06-12 15:31:57 +02:00
ThorstenB
f2d2b8e8b1 issue #281: tutorial's view direction messed-up/unusable by outside views
When user switched to a different view mode (e.g. chase/helicopter/tower
view) before or during a tutorial, everything went wrong...
Need to control (save/restore/switch) the view number (view mode) during
tutorials.  Also adds an option to explicitly change view mode during
a tutorial, i.e. tutorials can switch to tower view, chase view, ... now.
2011-06-03 00:39:05 +02:00
Curtis L. Olson
1f4371245b Address Melchior's concern about view prediction depending on a particular
aircraft system, rather than "core" data.

Fix a long standing annoyance (for me anyway) when the fly-by-view is first
instantiated, it never put a point forward very far so the first transtion
came very quickly and abruptly.  Improve the forward prediction based on
ground speed and time when the view is reset (or switched to.)  I like this
a lot better personally.
2011-01-18 11:47:15 -06:00
Curtis L. Olson
8ed16a4de2 Project "fly-by" vantage point ahead based on ground track direction instead
of aircraft body heading.  This works better when there is significant
cross wind or side slipping.
2010-12-31 15:31:04 -06:00
Torsten Dreyer
351114b999 Fix line endings 2010-09-28 08:58:02 +02:00
Vivian Meazza
74df9856d7 Update
Signed-off-by: Vivian Meazza <vivian.meazza@lineone.net>
2010-07-05 13:25:53 +01:00
sydadams
91c90c0679 added the view zoom popup to the enable property. Might
need it's own menu entry
2009-10-15 05:21:54 +00:00
sydadams
a48eb09c7d Updated the view popup , and restored the original indentation 2009-10-09 00:21:32 +00:00
sydadams
4dbe45348c added a /sim/view-name-popup bool to enable / disable the viewname popup ... enabled by default 2009-10-08 02:21:18 +00:00
mfranz
a13361766b initialize view manager at nasal-dir-initialized sig (was: fdm-initialized) 2009-05-27 16:24:17 +00:00
mfranz
540b9368fe multiplayer.model: more containers, more data, variable renaming,
temporarily catching error exceptions, colored missing-ac message ...
2009-02-04 21:47:19 +00:00
mfranz
7985e6e984 model_view: add some orientation parameters 2009-02-01 21:59:41 +00:00
mfranz
a644007c67 disabling the dialog in screenshots is nice in theory, but doesn't really work 2009-01-31 22:01:42 +00:00
mfranz
8bb50c1871 model_view_handler: use multiplayer.model + add selection popup 2009-01-31 19:30:31 +00:00
mfranz
82d4864c24 model_view: remove stale/invalid entries 2009-01-31 10:24:08 +00:00
mfranz
e31acedcfa model_view: make it more reliable 2009-01-30 15:22:17 +00:00
mfranz
db1fcf2949 model_view: remove experimental mouse handling; cleanup 2009-01-30 12:05:29 +00:00
mfranz
cf69b0d01b model_view: ignore AI models for now (make that configurable?) 2009-01-30 00:16:14 +00:00
mfranz
6aa74d2e7a add model-view: switch through all AI/MP models via dialog in bottom/left corner 2009-01-29 23:57:57 +00:00
mfranz
dcb1321923 make constants D2R, R2D, M2FT, FT2M global 2008-11-20 11:24:45 +00:00
mfranz
efaeff5180 - make the limiter a tad faster
- fix comment
2008-04-21 21:39:45 +00:00
mfranz
ff6c9ec672 view_limiter: fix wrong starting offset 2008-04-15 16:55:40 +00:00
mfranz
c97010cefd make panViewDir use new limiter params & some parameter tweaks 2008-04-15 13:29:23 +00:00
mfranz
7fbeb50695 view_limiter:
- new parameter naming (left/right instead of min/max; signs are ignored)
- fix wrap-around skips
- use regular constructor so as not to confuse people  ;-)
2008-04-15 13:02:18 +00:00
mfranz
c4ebd9a0f2 - use separate view-limiter handler instances per view
- cleanup
2008-04-15 07:04:52 +00:00
mfranz
656340fa3d davidB21 + Vivian MEAZZA + /me: pilot view limiter
If a <view> contains a <limits> block, then a view handler gets attached to
it, which limits head turns to a given range, whereby headings beyond a given
threshold cause an additional sideways movement. This is turned off by default
for now.
2008-04-14 10:00:27 +00:00
mfranz
3e9a108288 make view.index (value of "/sim/current-view/view-number") and view.current
(a props.Node hash of the current view, e.g. /sim/view[100]/) available
2008-04-12 20:25:21 +00:00
mfranz
cce72f08a9 don't save view-enabled state of nameless views to aircraft config file
(the view may have been removed from the *-set.xml file)
2008-01-18 14:16:38 +00:00