1
0
Fork 0
Commit graph

89 commits

Author SHA1 Message Date
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
mfranz
c96fd4b089 - make stepView() read the <enabled> flag as bool
- some more 'var', as usual
2007-12-13 20:16:20 +00:00
mfranz
73bbdd280d treat "Cockpit View" like other views; limit view.stepView() step to 1 and -1 2007-11-20 11:34:54 +00:00
mfranz
eccdedf12c - ensure correct order of initialization
- only save aircraft view properties that are defined
- unset "userarchive" flags, just in case
2007-11-19 20:20:55 +00:00
mfranz
73aeb8d772 OK, and now it Really Works.
(Yes, that's one way to get a better place in the number-of-commits ranking. ;-)
2007-11-19 18:55:24 +00:00
mfranz
87e746a755 sheesh ... another little bug to fix: fixate path for settimer closure 2007-11-19 18:30:55 +00:00
mfranz
59e51fa533 refresh "enabled" state of aircraft views (or they'd last only until the next run) 2007-11-19 18:07:30 +00:00
mfranz
b8b665d347 work correctly if the stepView() step is >1 or <-1 (though such steps
don't really make much sense)
2007-11-19 17:08:47 +00:00
mfranz
10c875f75e make system and aircraft views configurable in Menu->Views->View Options.
These are then skipped with view.stepView(n), unless the second, optional
argument is set to 1:  view.stepView(n, 1);
Whether a view is enabled or not, is saved in $FG_ROOT/.fgfs/autosave.xml
(system views) or $FG_ROOT/.fgfs/aircraft-data/<aircraft>.xml
2007-11-19 16:26:15 +00:00
mfranz
d6be4c8303 make sure aircraft don't use reserved view indices (0..99)
I tried it the nice way, but it didn't work. Why is it important to
reserve indices for fgfs? Because someone has otherwise to go through
all aircraft in CVS and move aircraft specific views out of the way,
every time a system view gets added. Been there, done that.
2007-11-19 14:22:55 +00:00
mfranz
2ba2925cd0 add view manager which manages view handlers. fly-by-view is now implemented
as such a view handler. Views that don't use one aren't affected -- the view
manager doesn't run when they are active.
2007-11-06 21:49:33 +00:00
mfranz
2bcddab9b6 setlistener(): accessing the node via cmdarg() is now depreciated. Use
a regular function argument for that. Note the "n" in this example:

   setlistener("/sim/current-view/view-number", func(n) {
       setprop("/sim/hud/visibility", !n.getValue());
   }, 1);
2007-10-15 18:27:42 +00:00
mfranz
eafc9c3a1d rename index() to indexof() 2007-10-03 19:01:01 +00:00
mfranz
63dca5051a add index() function which returns view index by name. Identifying views
by name is safer and especially useful for aircraft specific views, where
the XML index doesn't match the view number.
2007-10-03 18:15:50 +00:00
mfranz
109f38812b don't reset viewPosition on view.resetView(). This would break
"seat adjustment" view MMB-dragging.
2007-08-01 21:28:58 +00:00
mfranz
3132b5c962 Fix mouse MMB+LMB: this reset to view[0] parameters independent of the
current view, so it was only usable in cockpit view, and messed up every
other view.
2007-08-01 21:10:04 +00:00
mfranz
886af1b68d fly-by: more variation of view points in air, with some limits on ground to
avoid irritating taxiing through the viewer or down view on the aircraft
2007-07-16 14:42:48 +00:00
mfranz
b2750d8a05 adapt for geo.nas changes (swapping lon & lat) 2007-06-18 10:23:14 +00:00
mfranz
fef7057bfc flyby: don't choke on <view>s without <name>, even though these are bugs 2007-06-03 20:54:31 +00:00
mfranz
02b4dc58e8 geo.nas:
- add put_model() function to place models at given lon/lat. If
  elevation is nil, then it will be put on the surface. The path is
  relative to $FG_ROOT.
- let geo.click_position() and geo.aircraft_position() return copies
  of the Coord class, not just a reference

view.nas: adaptation for geo.nas change; minor changes
2007-05-12 18:38:57 +00:00
mfranz
1a19f8a8e5 - make viewReset reset fly-by view
- cleanup
2007-05-11 21:16:35 +00:00
mfranz
f7a9ef4d37 - use heading instead of last course (works better in curves)
- stop at crash
2007-05-05 21:36:31 +00:00
mfranz
d225de2aea fix behavior for begin and end of replay 2007-05-05 15:07:54 +00:00
mfranz
d4e030f9c6 - don't update when aircraft stays within threshold distance
- randomize left/right, better parameters
- don't reset on pause
2007-05-04 22:48:40 +00:00
mfranz
66f9e552ba - first stab at fly-by view mode
- hack for the panView functions: work in paused mode, too!
2007-05-04 18:01:26 +00:00
mfranz
9785ce8e36 - make stepView robuster and view order changeable (via view.views vector)
- de-classify view.point
2007-05-04 17:19:31 +00:00
mfranz
9a0600b150 - replace "sprintf hack" by real sprintf
- add view manager for saving/restoring and moving/interpolating view
  axes & fov to absolute values. This is used for cockpit tutorials in
  $FG_ROOT/Nasal/tutorial.nas
2007-03-22 16:22:41 +00:00
mfranz
e8f6224875 add resetFOV function 2006-03-02 16:23:05 +00:00
andy
35ec004c5f Nasal bindings for Saitek X45.
Misc. fixes to Nasal command bindings.
2003-12-23 17:31:08 +00:00
andy
b2909de010 New Nasal code, with lots of input binding handlers in controls.nas.
Move the "tip popup" code from view.nas to a new gui.nas module, and
  make it generically useful.
Wire up flap steppings for the 747 as an example of per-aircraft
  flaps.
Realtime-based property slewing, to eliminate dependence of trim and
  view direction rates on frame rate.
2003-12-22 20:05:18 +00:00
andy
6c097f252a Turn off the zoom limit for now. Folks don't like it. 2003-12-09 17:02:00 +00:00
andy
dfb39d9099 Remove some debug code. Misc. cleanups. 2003-12-08 05:45:03 +00:00
andy
3677b96fad Bugfix to globals.fgcommand().
New Node.setValues() method which sets whole property trees from Nasal
data.

A view.nas module, which takes over handling of the X/x zoom keys.  It
clamps the FOV to a dynamically calculated maximum corresponding to
typical human visual accuity, and pops up a pretty dialog informing
you of the new FOV.
2003-12-08 02:09:19 +00:00