Jim Wilson wrote:
It sounds like what you are doing might be more complicated than necessary. How about
adding a viewer instance onto the stack of viewers for each MP aircraft (as the MP
aircraft are instantiated)? Essentially I would suggest that you use the existing viewer
class as a building block rather than making it more complex. You could always add
multiple views for each MP aircraft if you want, and you can do things like add a
property to the viewer class that identifies MP related viewer objects in order for your
script to be able to cycle through just those. In any case the only information you
would need for this approach would be the "current view" property that already
exists. Adding new viewers on the fly might be something that needs to be added to the
viewmgr for this approach.
From my (limited) viewpoint it seems that the approaches you describe
are not exactly what I'm looking for. The easiest thing to do would be
to allow the already defined views to be available for any object you
are currently looking at, be it your own aircraft, a multiplayer
aircraft, or even another AI aircraft. I'm not sure if this can be
achieved by adding additional use to the list in the view manager.
Anyway, I have for the time being got things working using my own
"hacking" approach, adding 5 lines to viewer.cxx in
FGViewer::recalcLookAt () and doing the rest in Nasal, and I am now able
to apply the different views to the different multiplayer aircraft,
using 'v' to cycle views and 'V' to cycle aircraft.
During this I noticed two interesting points. First, the altitude of the
multiplayer aircraft was not exported to the proper tree, even though
the latitude and longitude was. I had to fix this in my local copy to
get things to work. Second, when using a viewpoint that is relative to
any other aircraft than your own, even by defining a static view in
preferences.xml of an AI aircraft, the movement of the viewpoint St to
be unsynchronised with the object you are looking at. This results in a
view where the aircraft seems to jump around, even when it is standing
completely still. I haven't figured out yet what is the cause, perhaps
it could be some rounding error?
--
Frank Olaf Sem-Jacobsen
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel