From 8b4393735d767f56c427c102a3965fc9ae3429b2 Mon Sep 17 00:00:00 2001 From: Anders Gidenstam Date: Wed, 13 Mar 2013 21:56:45 +0100 Subject: [PATCH] RAF_Mk9_bubble_sextant: Adapted to the new mouse movement handling. --- .../RAF_Mk9_bubble_sextant.nas | 66 ++--- .../RAF_Mk9_bubble_sextant/README | 225 ++++++++++-------- 2 files changed, 160 insertions(+), 131 deletions(-) diff --git a/Aircraft/Instruments-3d/RAF_Mk9_bubble_sextant/RAF_Mk9_bubble_sextant.nas b/Aircraft/Instruments-3d/RAF_Mk9_bubble_sextant/RAF_Mk9_bubble_sextant.nas index b67c49f91..92ec411dd 100644 --- a/Aircraft/Instruments-3d/RAF_Mk9_bubble_sextant/RAF_Mk9_bubble_sextant.nas +++ b/Aircraft/Instruments-3d/RAF_Mk9_bubble_sextant/RAF_Mk9_bubble_sextant.nas @@ -43,42 +43,44 @@ var toggle_look_through = func { ############################################################################### # Bindings for mouse X and Y movements. Install these to the appropriate # mouse mode and axes, e.g. in the -set file. -var mouseX = func { +var mouseXmove = func { if (!_initialized or !handling.enabled) return; - if(__kbd.alt.getValue()) { - var delta = 3*cmdarg().getNode("offset").getValue(); - if(__kbd.shift.getValue() and handling.enabled) { - # Roll adjustment - var orient = sextant.get_orientation(); - var roll = orient[2] - delta; - if(roll < -180) roll = -180; - if(roll > 180) roll = 180; - sextant.set_orientation(orient[0], orient[1], roll); - } else { - var view = "/sim/current-view/heading-offset-deg"; - var val = getprop(view) - delta; - if(val < 0) val = 0; - if(val > 360) val = 360; - setprop(view, val); - } - } + + var delta = 3*cmdarg().getNode("offset").getValue(); + var view = "/sim/current-view/heading-offset-deg"; + var val = getprop(view) - delta; + if(val < 0) val = 0; + if(val > 360) val = 360; + setprop(view, val); +} +var mouseXtilt = func { + if (!_initialized or !handling.enabled) return; + + var delta = 3*cmdarg().getNode("offset").getValue(); + # Roll adjustment + var orient = sextant.get_orientation(); + var roll = orient[2] - delta; + if(roll < -180) roll = -180; + if(roll > 180) roll = 180; + sextant.set_orientation(orient[0], orient[1], roll); } -var mouseY = func { +var mouseYmove = func { if (!_initialized or !handling.enabled) return; - if(__kbd.alt.getValue()) { - var delta = 3*cmdarg().getNode("offset").getValue(); - if(__kbd.shift.getValue() and handling.enabled) { - # Altitude adjustment - sextant.adjust_altitude_fine(delta); - } else { - var view = "/sim/current-view/pitch-offset-deg"; - var val = getprop(view) - delta; - if(val < -90) val = -90; - if(val > 90) val = 90; - setprop(view, val); - } - } + + var delta = 3*cmdarg().getNode("offset").getValue(); + var view = "/sim/current-view/pitch-offset-deg"; + var val = getprop(view) - delta; + if(val < -90) val = -90; + if(val > 90) val = 90; + setprop(view, val); +} +var mouseYaltitude = func { + if (!_initialized or !handling.enabled) return; + + var delta = 3*cmdarg().getNode("offset").getValue(); + # Altitude adjustment + sextant.adjust_altitude_fine(delta); } var RAD = math.pi/180; diff --git a/Aircraft/Instruments-3d/RAF_Mk9_bubble_sextant/README b/Aircraft/Instruments-3d/RAF_Mk9_bubble_sextant/README index 7460be0ef..c49740bd5 100644 --- a/Aircraft/Instruments-3d/RAF_Mk9_bubble_sextant/README +++ b/Aircraft/Instruments-3d/RAF_Mk9_bubble_sextant/README @@ -2,10 +2,10 @@ Bubble sextant for Celestial Navigation in FlightGear ----------------------------------------------------- -Copyright 2007 - 2010 Anders Gidenstam +Copyright (C) 2007 - 2013 Anders Gidenstam - * These programs are free software; you can redistribute them and/or modify - * them under the terms of the GNU General Public License as published by + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * @@ -24,121 +24,40 @@ much better, though, so have a look there both for introduction and more advanced topics. -Part 0 - Installing the tools: 3d bubble sextant model for FlightGear ---------------------------------------------------------------------- - - - The bubble sextant 3d model RAF_Mk9_bubble_sextant.xml need to be - loaded from the aircraft 3d model file and placed at the center of - the view it is intended to be used from. For example for a view located - 2.5 meter behind and 2.0 meter above the aircraft origin: - (Note that any offsets of the main 3d model needs to be accounted for - in translating the view position to a 3d model position and that the - axes order differs.) - - - - Bubble_sextant - Aircraft/Short_Empire/Instruments/BubbleSextant/RAF_Mk9_bubble_sextant.xml - - 2.50 - 0.50 - 2.00 - - - - - The Nasal module needs to be loaded from the main aircraft -set file. - The name of the view in which the sextant will be used and - the stowed (= inactive) location of the instrument needs to be set. - The stored location is specified in a frame axis parallel with the - aircraft frame but centered at the location given for the sextant - 3d model in the 3d model file. - For example: - - - Aircraft/Short_Empire/Instruments/BubbleSextant/RAF_Mk9_bubble_sextant.nas - - - - - - To allow fine control of the sextant using the mouse add the following - XML snippet to the aircraft's -set file. - It binds moves movements in mode 0/pointer mode to the sextant. - alt + move mouse - precision movement of view direction. - alt + shift + move mouse - up/down changes the altitude setting of the - sextant. - - left/right tilts the sextant to align with - the horizon. - - - - - - - - - nasal - - - - - - nasal - - - - - - - - - - To correctly measure the altitude of a heavenly body the instrument - must be level, i.e. the bubble must be centered. - The instrument is configured for an aim-then-level method, i.e. - one first center the view on the desired object then change the altitude - and tilt settings until the instrument is level. (I.e. changing altitude - behaves as if the user changes the setting and rotates the instrument so - that it remains aimed in the same direction). - - NOTE: Tilting of the instrument might still be somewhat buggy. - - Part 1 - Taking sextant sights in FlightGear -------------------------------------- +-------------------------------------------- What is needed? -- The celestial altitude (~angle from the horizon) for some (at least 2) - stars and the precise time of observation. +- An aircraft with the RAF mk9 bubble sextant instrument. + Short_Empire is one such aircraft. + +- Using the sextant one needs to measure and record the celestial altitude + (~angle from the horizon) for some (at least 2) stars and the precise time + of observation. How? +- For the Short_Empire: Go to the copilot view. + - Pick up the sextant by clicking on either of its handles. +- For the Short_Empire: move (using w,a,d,s) to the observation hatch + and open it by clicking on it. + - Enter the sextant view by clicking on the sextant eye piece. - Obtain a bubble by turning the bubble knob on the left side of the instrument. It is possible to reach the bubble knob while in sextant view. -- Aim the center of the view on the star. Alt + move mouse in pointer mode +- Aim the center of the view on the star. Shift + move mouse in pointer mode enables high precision view rotation. - Level the instrument. This is done by changing the altitude setting, first in 10 degree steps by the coarse motion knob on the right side of the instrument (reachable also while in sextant view) and then - with the slow motion knob (or alt+shift+move mouse up/down). - Tilt the instrument (alt+shift+move mouse right/left) as needed to + with the slow motion knob (or shift+ctrl+move mouse up/down). + Tilt the instrument (shift+ctrl+move mouse right/left) as needed to center the bubble. - Time + celestial altitude constitutes a sighting. Make sure that @@ -182,6 +101,114 @@ The Intercept method Further info and plotting sheets: http://www.efalk.org/Navigation/ + +Appendix - Installing the tools: 3d bubble sextant model for FlightGear +----------------------------------------------------------------------- + + - The bubble sextant 3d model RAF_Mk9_bubble_sextant.xml need to be + loaded from the aircraft 3d model file and placed at the center of + the view it is intended to be used from. For example for a view located + 2.5 meter behind and 2.0 meter above the aircraft origin: + (Note that any offsets of the main 3d model needs to be accounted for + in translating the view position to a 3d model position and that the + axes order differs.) + + + + Bubble_sextant + Aircraft/Instruments-3d/RAF_Mk9_bubble_sextant/RAF_Mk9_bubble_sextant.xml + + 2.50 + 0.50 + 2.00 + + + + - The Nasal module needs to be loaded from the main aircraft -set file. + The name of the view in which the sextant will be used and + the stowed (= inactive) location of the instrument needs to be set. + The stored location is specified in a frame axis parallel with the + aircraft frame but centered at the location given for the sextant + 3d model in the 3d model file. + For example: + + + Aircraft/Instruments-3d/RAF_Mk9_bubble_sextant/RAF_Mk9_bubble_sextant.nas + + + + + - To allow fine control of the sextant using the mouse add the following + XML snippet to the aircraft's -set file. + It binds moves movements in mode 0/pointer mode to the sextant. + alt + move mouse - precision movement of view direction. + alt + shift + move mouse - up/down changes the altitude setting of the + sextant. + - left/right tilts the sextant to align with + the horizon. + + + + + + + + + nasal + + + + + + nasal + + + + + + nasal + + + + + + nasal + + + + + + + + + + To correctly measure the altitude of a heavenly body the instrument + must be level, i.e. the bubble must be centered. + The instrument is configured for an aim-then-level method, i.e. + one first center the view on the desired object then change the altitude + and tilt settings until the instrument is level. (I.e. changing altitude + behaves as if the user changes the setting and rotates the instrument so + that it remains aimed in the same direction). + + NOTE: Tilting of the instrument might still be somewhat buggy. + + + References ----------