when dragging the mouse with middle mouse button (MMB) pressed (reset
with MMB+LMB):
Add support for forward/backward moving (MMB+KbdCtrl). With this one can,
for example, read what's written on the backside of the cup of coffee
on top of the screen in the E3B's operator room, or walk around between
the passenger seats in the fokker70 searching for the toilet. :-)
- use extra function for resuming normal mode after lookat: dynamic_view.resume()
- add fov (field-of-view) to interface: me.fov_offset
- remove register_headshake and me.headshake; this can still be done via
normal register(). If only headshaking is to be added, while keeping default
plane view, do this:
dynamic_view.register(func {
default_plane();
me.x_offset = ...
me.y_offset = ...
me.z_offset = ...
});
- initialize /sim/time/delta-realtime-sec, so that the lowpass filter doesn't
complain if it's starter eraly (of course the results won't be correct
until the delta is real)
aircraft can plug a custom function. This function can access all internal
variables of the ViewManager class. It can set me.{x,y,z}_offset, and also
add offsets to me.{heading,pitch,roll}_offset. Example:
dynamic_view.register_headshake(func {
me.x_offset = rand() * 0.02; # Parkinson effect
});
The advantage of this implementation is that it doesn't break MMB drag
functionality, and that is can be frozen by mouse movements.
or of given frame
- add debug.string(<variable>). This returns the variable dump as
string.
- add var to module function variables to avoid collisions with module names
Remember: dynamic_view.lookat(heading, pitch, roll) moves view
smoothly to this direction, while dynamic_view.lookat() moves it back.
This can be used for quick view changes to the panel etc. It's currently
only used in the bo105 (flaps-up binding).
This isn't only more logical, it's also how SGPropertyNode::getBoolValue()
acts. The fix has potential to break code, but so far I haven't seen any
problems. I added a debug message to my copy and will for a while check
all cases that I run into. To check yourself, just add one line:
getBoolValue : func {
val = me.getValue();
+ if(val == nil) { debug.dump(me) }
if(me.getType() == "STRING" and val == "false") { 0 }
else { val != nil and val != 0 }
}
This will output a debug message to the terminal for each case where
formerly "true" was returned, and now "false" is.
"This patch allows all the AC using the kap140 to use one kap140.nas
which includes Roy's move to "bool" values as well as the check for
power used by the pa24-250." (dp)
- use Nasal features that were introduced after this code was first written:
* var for local variables (and to make clear when a variable is first used)
* += operator
* listeners to import seldom changing variables and to avoid waiting for
the FDM in a loop
This new code started as empty file where I added my stuff and then copied
parts from the old code, piece by piece. This is why the coding & indentation
style has changed. Functionally the code should basically be equivalent.
includes Instruments/fuel.xml. And *that* one creates tank[0] and tank[1]
for *all* aircraft, which is quite annoying. A generic panel should display
fuel numerically (like Lee's panels do) or as %.
can also write
<sim>
<aircraft-data>
<path>/sim/author</path>
<path>/sim/description</path>
<path>/sim/rtatus</path>
</aircraft-data>
</sim>
in a *-set.xml file instead of using Nasal (aircraft.data.add("/sim/author", ...)
- s/timeN/node/ to match the pattern described in the head comment
- make listener on-shot
- make 0 a valid saving interval, and 'nil' or no arg stop the loop
(this is for consistency with settimer() or aircraft.timer() intervals
- smaller fixes, cleanup