From 46b0613da28adf06e499c5d29466a1da7c8711f9 Mon Sep 17 00:00:00 2001 From: merspieler Date: Fri, 3 Aug 2018 01:40:28 +0200 Subject: [PATCH 1/5] Added autopush v1.0-rc Signed-off-by: merspieler --- A320-main.xml | 60 ++- AircraftConfig/autopush.xml | 297 ++++++++++++++ Models/Autopush/Effects/cursor.eff | 11 + Models/Autopush/cursor.ac | 589 ++++++++++++++++++++++++++++ Models/Autopush/cursor.png | Bin 0 -> 97 bytes Models/Autopush/cursor.xml | 34 ++ Models/Autopush/waypoint.ac | 238 +++++++++++ Models/Autopush/waypoint.xml | 34 ++ Nasal/autopush.nas | 136 +++++++ Nasal/autopush_driver.nas | 99 +++++ Nasal/autopush_route.nas | 224 +++++++++++ Nasal/dynarr.nas | 55 +++ Systems/a320-external-reactions.xml | 2 +- 13 files changed, 1771 insertions(+), 8 deletions(-) create mode 100644 AircraftConfig/autopush.xml create mode 100644 Models/Autopush/Effects/cursor.eff create mode 100644 Models/Autopush/cursor.ac create mode 100644 Models/Autopush/cursor.png create mode 100644 Models/Autopush/cursor.xml create mode 100644 Models/Autopush/waypoint.ac create mode 100644 Models/Autopush/waypoint.xml create mode 100644 Nasal/autopush.nas create mode 100644 Nasal/autopush_driver.nas create mode 100644 Nasal/autopush_route.nas create mode 100644 Nasal/dynarr.nas diff --git a/A320-main.xml b/A320-main.xml index 7f1be5e4..c0c5a3a3 100644 --- a/A320-main.xml +++ b/A320-main.xml @@ -28,10 +28,31 @@ - 5000 - 200 - 500 - 0 + 0 + + 1 + + + + 1.0 + 0.0 + 1.0 + 0.1 + 0.01 + 2.0 + 0.0 + 0.0 + + 5.5 + 5.5 + 5.0 + 0.03 + true + + + + Model View + @@ -223,8 +244,11 @@ - dialog-show - pushback + nasal + @@ -1501,6 +1525,28 @@ Aircraft/IDG-A32X/Nasal/icing.nas + + Nasal/autopush.nas + + + Nasal/autopush_driver.nas + + + Nasal/dynarr.nas + + + Nasal/autopush_route.nas + - + + + + + + + + + + + diff --git a/AircraftConfig/autopush.xml b/AircraftConfig/autopush.xml new file mode 100644 index 00000000..34bae813 --- /dev/null +++ b/AircraftConfig/autopush.xml @@ -0,0 +1,297 @@ + + + + + + + autopush + vbox + + + + hbox + + + + + + + true + + + + + + + + + + + true + vbox + center + top + + + left + + /sim/model/pushback/enabled + true + + dialog-apply + + + + + table + + + 0 + 0 + + left + + + + + + 0 + 2 + -1.0 + 1.0 + /sim/model/pushback/steer-cmd-norm + true + + dialog-apply + + + + + + + + + 1 + 0 + + left + + + + + + 1 + 2 + -25 + 25 + /sim/model/pushback/target-speed-km_h + true + + dialog-apply + + + + + + + + + 1 + 5 + 16 + /sim/model/pushback/target-speed-km_h + %3.0f + true + right + + + + 1 + 6 + + left + + + + + + + + table + + + 0 + 0 + + left + + + + + + + + 1 + 0 + + left + + + + + + + + 1 + 3 + + /sim/model/pushback/route/show + + dialog-apply + + + + + + + + diff --git a/Models/Autopush/Effects/cursor.eff b/Models/Autopush/Effects/cursor.eff new file mode 100644 index 00000000..e3bff206 --- /dev/null +++ b/Models/Autopush/Effects/cursor.eff @@ -0,0 +1,11 @@ + + + Effects/model-combined-deferred + + 1 + 1.0 1.0 1.0 + + cursor.png + + + diff --git a/Models/Autopush/cursor.ac b/Models/Autopush/cursor.ac new file mode 100644 index 00000000..f7ab7139 --- /dev/null +++ b/Models/Autopush/cursor.ac @@ -0,0 +1,589 @@ +AC3Db +MATERIAL "DefaultWhite" rgb 1.0000 1.0000 1.0000 amb 0.2000 0.2000 0.2000 emis 0.0000 0.0000 0.0000 spec 0.5000 0.5000 0.5000 shi 10 trans 0.0000 +MATERIAL "autopush cursor" rgb 1.0000 1.0000 1.0000 amb 0.0000 0.0000 0.0000 emis 0.0000 0.0000 0.0000 spec 0.0000 0.0000 0.0000 shi 50 trans 0.0000 +OBJECT world +name "Blender_export__cursor.ac" +kids 1 +OBJECT poly +name "Circle" +texture "cursor.png" +texrep 1 1 +numvert 128 +0.0000001 0.1999999 -0.7499999 +0.0000000 0.1999999 -1.0000000 +-0.0980171 0.1999999 -0.9951847 +-0.1950903 0.1999999 -0.9807853 +-0.2902847 0.1999999 -0.9569404 +-0.3826835 0.1999999 -0.9238795 +-0.4713967 0.1999999 -0.8819212 +-0.5555702 0.1999999 -0.8314696 +-0.6343933 0.1999999 -0.7730105 +-0.7071068 0.1999999 -0.7071068 +-0.7730104 0.1999999 -0.6343933 +-0.8314696 0.1999999 -0.5555703 +-0.8819212 0.1999999 -0.4713968 +-0.9238795 0.1999999 -0.3826834 +-0.9569404 0.1999999 -0.2902846 +-0.9807853 0.1999999 -0.1950902 +-0.9951847 0.1999999 -0.0980170 +-1.0000000 0.1999999 0.0000002 +-0.9951847 0.1999999 0.0980173 +-0.9807853 0.1999999 0.1950906 +-0.9569402 0.1999999 0.2902850 +-0.9238794 0.1999999 0.3826837 +-0.8819211 0.1999999 0.4713970 +-0.8314694 0.1999999 0.5555705 +-0.7730102 0.1999999 0.6343936 +-0.7071064 0.1999999 0.7071071 +-0.6343929 0.1999999 0.7730108 +-0.5555698 0.1999999 0.8314700 +-0.4713962 0.1999999 0.8819215 +-0.3826828 0.1999999 0.9238798 +-0.2902840 0.1999999 0.9569405 +-0.1950896 0.1999999 0.9807854 +-0.0980164 0.1999999 0.9951848 +0.0000008 0.1999999 1.0000000 +0.0980180 0.1999999 0.9951847 +0.1950912 0.1999999 0.9807851 +0.2902856 0.1999999 0.9569401 +0.3826843 0.1999999 0.9238791 +0.4713976 0.1999999 0.8819208 +0.5555711 0.1999999 0.8314691 +0.6343941 0.1999999 0.7730098 +0.7071076 0.1999999 0.7071060 +0.7730110 0.1999999 0.6343926 +0.8314700 0.1999999 0.5555696 +0.8819215 0.1999999 0.4713963 +0.9238797 0.1999999 0.3826831 +0.9569404 0.1999999 0.2902845 +0.9807853 0.1999999 0.1950904 +0.9951847 0.1999999 0.0980174 +1.0000000 0.1999999 0.0000005 +0.9951848 0.1999999 -0.0980165 +0.9807854 0.1999999 -0.1950895 +0.9569407 0.1999999 -0.2902837 +0.9238800 0.1999999 -0.3826823 +0.8819219 0.1999999 -0.4713955 +0.8314705 0.1999999 -0.5555689 +0.7730116 0.1999999 -0.6343918 +0.7071083 0.1999999 -0.7071053 +0.6343950 0.1999999 -0.7730090 +0.5555723 0.1999999 -0.8314682 +0.4713991 0.1999999 -0.8819200 +0.3826860 0.1999999 -0.9238784 +0.2902876 0.1999999 -0.9569395 +0.1950935 0.1999999 -0.9807847 +0.0980206 0.1999999 -0.9951844 +-0.0735127 0.1999999 -0.7463885 +-0.1463176 0.1999999 -0.7355889 +-0.2177134 0.1999999 -0.7177052 +-0.2870125 0.1999999 -0.6929096 +-0.3535474 0.1999999 -0.6614408 +-0.4166775 0.1999999 -0.6236022 +-0.4757948 0.1999999 -0.5797578 +-0.5303299 0.1999999 -0.5303301 +-0.5797577 0.1999999 -0.4757949 +-0.6236020 0.1999999 -0.4166776 +-0.6614408 0.1999999 -0.3535475 +-0.6929095 0.1999999 -0.2870125 +-0.7177051 0.1999999 -0.2177134 +-0.7355888 0.1999999 -0.1463176 +-0.7463884 0.1999999 -0.0735127 +-0.7499999 0.1999999 0.0000002 +-0.7463884 0.1999999 0.0735131 +-0.7355888 0.1999999 0.1463180 +-0.7177050 0.1999999 0.2177138 +-0.6929094 0.1999999 0.2870128 +-0.6614407 0.1999999 0.3535478 +-0.6236019 0.1999999 0.4166780 +-0.5797575 0.1999999 0.4757953 +-0.5303296 0.1999999 0.5303304 +-0.4757945 0.1999999 0.5797582 +-0.4166772 0.1999999 0.6236025 +-0.3535470 0.1999999 0.6614412 +-0.2870120 0.1999999 0.6929099 +-0.2177129 0.1999999 0.7177055 +-0.1463171 0.1999999 0.7355891 +-0.0735121 0.1999999 0.7463887 +0.0000008 0.1999999 0.7500001 +0.0735136 0.1999999 0.7463886 +0.1463185 0.1999999 0.7355889 +0.2177143 0.1999999 0.7177051 +0.2870134 0.1999999 0.6929094 +0.3535483 0.1999999 0.6614407 +0.4166785 0.1999999 0.6236019 +0.4757957 0.1999999 0.5797574 +0.5303308 0.1999999 0.5303296 +0.5797584 0.1999999 0.4757945 +0.6236026 0.1999999 0.4166773 +0.6614413 0.1999999 0.3535473 +0.6929099 0.1999999 0.2870124 +0.7177054 0.1999999 0.2177135 +0.7355891 0.1999999 0.1463179 +0.7463887 0.1999999 0.0735131 +0.7500001 0.1999999 0.0000004 +0.7463887 0.1999999 -0.0735123 +0.7355892 0.1999999 -0.1463170 +0.7177056 0.1999999 -0.2177127 +0.6929102 0.1999999 -0.2870116 +0.6614416 0.1999999 -0.3535465 +0.6236030 0.1999999 -0.4166766 +0.5797589 0.1999999 -0.4757938 +0.5303314 0.1999999 -0.5303289 +0.4757964 0.1999999 -0.5797567 +0.4166794 0.1999999 -0.6236011 +0.3535495 0.1999999 -0.6614400 +0.2870147 0.1999999 -0.6929088 +0.2177158 0.1999999 -0.7177045 +0.1463203 0.1999999 -0.7355884 +0.0735156 0.1999999 -0.7463882 +numsurf 64 +SURF 0X10 +mat 1 +refs 4 +25 0.080806 0.323223 +88 0.091854 0.367417 +87 0.088765 0.381051 +24 0.076687 0.341402 +SURF 0X10 +mat 1 +refs 4 +12 0.069880 0.617849 +75 0.083660 0.588387 +74 0.086025 0.604169 +11 0.073033 0.638893 +SURF 0X10 +mat 1 +refs 4 +51 0.186299 0.548772 +114 0.170974 0.536579 +113 0.171649 0.518378 +50 0.187199 0.524504 +SURF 0X10 +mat 1 +refs 4 +64 0.131126 0.748796 +127 0.129595 0.686597 +126 0.134145 0.683897 +63 0.137193 0.745196 +SURF 0X10 +mat 1 +refs 4 +11 0.073033 0.638893 +74 0.086025 0.604169 +73 0.088765 0.618949 +10 0.076687 0.658598 +SURF 0X10 +mat 1 +refs 4 +24 0.076687 0.341402 +87 0.088765 0.381051 +86 0.086025 0.395830 +23 0.073033 0.361107 +SURF 0X10 +mat 1 +refs 4 +37 0.148918 0.269030 +100 0.142938 0.326773 +99 0.138607 0.320574 +36 0.143143 0.260765 +SURF 0X10 +mat 1 +refs 4 +50 0.187199 0.524504 +113 0.171649 0.518378 +112 0.171875 0.500000 +49 0.187500 0.500000 +SURF 0X10 +mat 1 +refs 4 +63 0.137193 0.745196 +126 0.134145 0.683897 +125 0.138607 0.679426 +62 0.143143 0.739235 +SURF 0X10 +mat 1 +refs 4 +10 0.076687 0.658598 +73 0.088765 0.618949 +72 0.091854 0.632583 +9 0.080806 0.676777 +SURF 0X10 +mat 1 +refs 4 +23 0.073033 0.361107 +86 0.086025 0.395830 +85 0.083660 0.411613 +22 0.069880 0.382151 +SURF 0X10 +mat 1 +refs 4 +36 0.143143 0.260765 +99 0.138607 0.320574 +98 0.134145 0.316103 +35 0.137193 0.254804 +SURF 0X10 +mat 1 +refs 4 +49 0.187500 0.500000 +112 0.171875 0.500000 +111 0.171649 0.481622 +48 0.187199 0.475496 +SURF 0X10 +mat 1 +refs 4 +62 0.143143 0.739235 +125 0.138607 0.679426 +124 0.142938 0.673227 +61 0.148918 0.730970 +SURF 0X10 +mat 1 +refs 4 +9 0.080806 0.676777 +72 0.091854 0.632583 +71 0.095263 0.644939 +8 0.085350 0.693253 +SURF 0X10 +mat 1 +refs 4 +22 0.069880 0.382151 +85 0.083660 0.411613 +84 0.081693 0.428247 +21 0.067258 0.404329 +SURF 0X10 +mat 1 +refs 4 +35 0.137193 0.254804 +98 0.134145 0.316103 +97 0.129595 0.313403 +34 0.131126 0.251204 +SURF 0X10 +mat 1 +refs 4 +48 0.187199 0.475496 +111 0.171649 0.481622 +110 0.170974 0.463421 +47 0.186299 0.451227 +SURF 0X10 +mat 1 +refs 4 +61 0.148918 0.730970 +124 0.142938 0.673227 +123 0.147097 0.665360 +60 0.154463 0.720480 +SURF 0X10 +mat 1 +refs 4 +8 0.085350 0.693253 +71 0.095263 0.644939 +70 0.098958 0.655900 +7 0.090277 0.707867 +SURF 0X10 +mat 1 +refs 4 +21 0.067258 0.404329 +84 0.081693 0.428247 +83 0.080143 0.445572 +20 0.065191 0.427429 +SURF 0X10 +mat 1 +refs 4 +34 0.131126 0.251204 +97 0.129595 0.313403 +96 0.125000 0.312500 +33 0.125000 0.250000 +SURF 0X10 +mat 1 +refs 4 +47 0.186299 0.451227 +110 0.170974 0.463421 +109 0.169857 0.445572 +46 0.184809 0.427429 +SURF 0X10 +mat 1 +refs 4 +60 0.154463 0.720480 +123 0.147097 0.665360 +122 0.151043 0.655900 +59 0.159723 0.707867 +SURF 0X10 +mat 1 +refs 4 +7 0.090277 0.707867 +70 0.098958 0.655900 +69 0.102903 0.665360 +6 0.095538 0.720480 +SURF 0X10 +mat 1 +refs 4 +20 0.065191 0.427429 +83 0.080143 0.445572 +82 0.079026 0.463420 +19 0.063701 0.451227 +SURF 0X10 +mat 1 +refs 4 +33 0.125000 0.250000 +96 0.125000 0.312500 +95 0.120406 0.313403 +32 0.118874 0.251204 +SURF 0X10 +mat 1 +refs 4 +46 0.184809 0.427429 +109 0.169857 0.445572 +108 0.168307 0.428247 +45 0.182743 0.404329 +SURF 0X10 +mat 1 +refs 4 +59 0.159723 0.707867 +122 0.151043 0.655900 +121 0.154737 0.644939 +58 0.164650 0.693252 +SURF 0X10 +mat 1 +refs 4 +6 0.095538 0.720480 +69 0.102903 0.665360 +68 0.107062 0.673227 +5 0.101082 0.730970 +SURF 0X10 +mat 1 +refs 4 +19 0.063701 0.451227 +82 0.079026 0.463420 +81 0.078351 0.481622 +18 0.062801 0.475496 +SURF 0X10 +mat 1 +refs 4 +32 0.118874 0.251204 +95 0.120406 0.313403 +94 0.115855 0.316103 +31 0.112807 0.254804 +SURF 0X10 +mat 1 +refs 4 +45 0.182743 0.404329 +108 0.168307 0.428247 +107 0.166340 0.411613 +44 0.180120 0.382151 +SURF 0X10 +mat 1 +refs 4 +58 0.164650 0.693252 +121 0.154737 0.644939 +120 0.158146 0.632582 +57 0.169194 0.676776 +SURF 0X10 +mat 1 +refs 4 +5 0.101082 0.730970 +68 0.107062 0.673227 +67 0.111393 0.679426 +4 0.106857 0.739235 +SURF 0X10 +mat 1 +refs 4 +18 0.062801 0.475496 +81 0.078351 0.481622 +80 0.078125 0.500000 +17 0.062500 0.500000 +SURF 0X10 +mat 1 +refs 4 +31 0.112807 0.254804 +94 0.115855 0.316103 +93 0.111393 0.320574 +30 0.106857 0.260765 +SURF 0X10 +mat 1 +refs 4 +44 0.180120 0.382151 +107 0.166340 0.411613 +106 0.163975 0.395831 +43 0.176967 0.361108 +SURF 0X10 +mat 1 +refs 4 +57 0.169194 0.676776 +120 0.158146 0.632582 +119 0.161235 0.618949 +56 0.173313 0.658598 +SURF 0X10 +mat 1 +refs 4 +4 0.106857 0.739235 +67 0.111393 0.679426 +66 0.115855 0.683897 +3 0.112807 0.745196 +SURF 0X10 +mat 1 +refs 4 +17 0.062500 0.500000 +80 0.078125 0.500000 +79 0.078351 0.518378 +16 0.062801 0.524504 +SURF 0X10 +mat 1 +refs 4 +30 0.106857 0.260765 +93 0.111393 0.320574 +92 0.107062 0.326772 +29 0.101082 0.269030 +SURF 0X10 +mat 1 +refs 4 +43 0.176967 0.361108 +106 0.163975 0.395831 +105 0.161235 0.381051 +42 0.173313 0.341402 +SURF 0X10 +mat 1 +refs 4 +56 0.173313 0.658598 +119 0.161235 0.618949 +118 0.163975 0.604169 +55 0.176967 0.638892 +SURF 0X10 +mat 1 +refs 4 +3 0.112807 0.745196 +66 0.115855 0.683897 +65 0.120406 0.686597 +2 0.118874 0.748796 +SURF 0X10 +mat 1 +refs 4 +16 0.062801 0.524504 +79 0.078351 0.518378 +78 0.079026 0.536579 +15 0.063701 0.548773 +SURF 0X10 +mat 1 +refs 4 +29 0.101082 0.269030 +92 0.107062 0.326772 +91 0.102903 0.334640 +28 0.095538 0.279520 +SURF 0X10 +mat 1 +refs 4 +42 0.173313 0.341402 +105 0.161235 0.381051 +104 0.158146 0.367418 +41 0.169194 0.323223 +SURF 0X10 +mat 1 +refs 4 +55 0.176967 0.638892 +118 0.163975 0.604169 +117 0.166340 0.588387 +54 0.180120 0.617849 +SURF 0X10 +mat 1 +refs 4 +15 0.063701 0.548773 +78 0.079026 0.536579 +77 0.080143 0.554428 +14 0.065191 0.572571 +SURF 0X10 +mat 1 +refs 4 +28 0.095538 0.279520 +91 0.102903 0.334640 +90 0.098958 0.344099 +27 0.090277 0.292132 +SURF 0X10 +mat 1 +refs 4 +41 0.169194 0.323223 +104 0.158146 0.367418 +103 0.154737 0.355061 +40 0.164650 0.306747 +SURF 0X10 +mat 1 +refs 4 +54 0.180120 0.617849 +117 0.166340 0.588387 +116 0.168307 0.571753 +53 0.182743 0.595671 +SURF 0X10 +mat 1 +refs 4 +0 0.125000 0.687500 +1 0.125000 0.750000 +2 0.118874 0.748796 +65 0.120406 0.686597 +SURF 0X10 +mat 1 +refs 4 +14 0.065191 0.572571 +77 0.080143 0.554428 +76 0.081693 0.571753 +13 0.067258 0.595671 +SURF 0X10 +mat 1 +refs 4 +27 0.090277 0.292132 +90 0.098958 0.344099 +89 0.095263 0.355060 +26 0.085350 0.306747 +SURF 0X10 +mat 1 +refs 4 +40 0.164650 0.306747 +103 0.154737 0.355061 +102 0.151042 0.344099 +39 0.159723 0.292133 +SURF 0X10 +mat 1 +refs 4 +53 0.182743 0.595671 +116 0.168307 0.571753 +115 0.169857 0.554428 +52 0.184809 0.572571 +SURF 0X10 +mat 1 +refs 4 +13 0.067258 0.595671 +76 0.081693 0.571753 +75 0.083660 0.588387 +12 0.069880 0.617849 +SURF 0X10 +mat 1 +refs 4 +26 0.085350 0.306747 +89 0.095263 0.355060 +88 0.091854 0.367417 +25 0.080806 0.323223 +SURF 0X10 +mat 1 +refs 4 +39 0.159723 0.292133 +102 0.151042 0.344099 +101 0.147097 0.334640 +38 0.154462 0.279520 +SURF 0X10 +mat 1 +refs 4 +52 0.184809 0.572571 +115 0.169857 0.554428 +114 0.170974 0.536579 +51 0.186299 0.548772 +SURF 0X10 +mat 1 +refs 4 +1 0.125000 0.750000 +0 0.125000 0.687500 +127 0.129595 0.686597 +64 0.131126 0.748796 +SURF 0X10 +mat 1 +refs 4 +38 0.154462 0.279520 +101 0.147097 0.334640 +100 0.142938 0.326773 +37 0.148918 0.269030 +kids 0 diff --git a/Models/Autopush/cursor.png b/Models/Autopush/cursor.png new file mode 100644 index 0000000000000000000000000000000000000000..2d21ca3cc6205e0ec33a88c654cc941fb4bce27e GIT binary patch literal 97 zcmeAS@N?(olHy`uVBq!ia0vp^3P8-k#0(^#z819sQak}ZA+G-${{L@iXaM7ryyuL7 q;sTy7jv*Yf$tejOtj=zyBp77sIT-)#JSzm0WAJqKb6Mw<&;$UNL>k}# literal 0 HcmV?d00001 diff --git a/Models/Autopush/cursor.xml b/Models/Autopush/cursor.xml new file mode 100644 index 00000000..a91133a4 --- /dev/null +++ b/Models/Autopush/cursor.xml @@ -0,0 +1,34 @@ + + + + + cursor.ac + + + false + + + + scale + /sim/model/pushback/driver/D_min-m + 0.0 + 1.0 + + + + Circle + Effects/cursor + + + diff --git a/Models/Autopush/waypoint.ac b/Models/Autopush/waypoint.ac new file mode 100644 index 00000000..1fc9a18e --- /dev/null +++ b/Models/Autopush/waypoint.ac @@ -0,0 +1,238 @@ +AC3Db +MATERIAL "DefaultWhite" rgb 1.0000 1.0000 1.0000 amb 0.2000 0.2000 0.2000 emis 0.0000 0.0000 0.0000 spec 0.5000 0.5000 0.5000 shi 10 trans 0.0000 +MATERIAL "autopush cursor" rgb 1.0000 1.0000 1.0000 amb 0.0000 0.0000 0.0000 emis 0.0000 0.0000 0.0000 spec 0.0000 0.0000 0.0000 shi 50 trans 0.0000 +OBJECT world +name "Blender_export__waypoint.ac" +kids 1 +OBJECT poly +name "Circle" +texture "cursor.png" +texrep 1 1 +numvert 33 +0.0390178 0.2000000 -0.1961571 +0.0765364 0.2000000 -0.1847760 +0.1111138 0.2000000 -0.1662941 +0.1414212 0.2000000 -0.1414215 +0.1662938 0.2000000 -0.1111143 +0.1847758 0.2000000 -0.0765369 +0.1961570 0.2000000 -0.0390183 +0.2000000 0.2000000 -0.0000002 +0.1961571 0.2000000 0.0390179 +0.1847760 0.2000000 0.0765365 +0.1662940 0.2000000 0.1111139 +0.1414215 0.2000000 0.1414213 +0.1111141 0.2000000 0.1662939 +0.0765368 0.2000000 0.1847759 +0.0390181 0.2000000 0.1961570 +0.0000001 0.2000000 0.2000000 +-0.0390180 0.2000000 0.1961571 +-0.0765367 0.2000000 0.1847759 +-0.1111140 0.2000000 0.1662939 +-0.1414214 0.2000000 0.1414214 +-0.1662939 0.2000000 0.1111140 +-0.1847759 0.2000000 0.0765367 +-0.1961571 0.2000000 0.0390180 +-0.2000000 0.2000000 -0.0000000 +-0.1961571 0.2000000 -0.0390181 +-0.1847759 0.2000000 -0.0765367 +-0.1662939 0.2000000 -0.1111140 +-0.1414214 0.2000000 -0.1414214 +-0.1111140 0.2000000 -0.1662939 +-0.0765367 0.2000000 -0.1847759 +-0.0390181 0.2000000 -0.1961571 +0.0000000 0.2000000 -0.2000000 +0.0000000 0.2000000 0.0000000 +numsurf 32 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +18 0.090277 0.292133 +17 0.101082 0.269030 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +31 0.125000 0.750000 +30 0.112807 0.745197 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +4 0.176967 0.638893 +3 0.169194 0.676777 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +17 0.101082 0.269030 +16 0.112807 0.254804 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +30 0.112807 0.745197 +29 0.101082 0.730970 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +3 0.169194 0.676777 +2 0.159723 0.707868 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +16 0.112807 0.254804 +15 0.125000 0.250000 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +29 0.101082 0.730970 +28 0.090277 0.707868 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +2 0.159723 0.707868 +1 0.148918 0.730970 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +15 0.125000 0.250000 +14 0.137193 0.254804 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +28 0.090277 0.707868 +27 0.080806 0.676777 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +1 0.148918 0.730970 +0 0.137193 0.745197 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +14 0.137193 0.254804 +13 0.148918 0.269030 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +27 0.080806 0.676777 +26 0.073033 0.638893 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +0 0.137193 0.745197 +31 0.125000 0.750000 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +13 0.148918 0.269030 +12 0.159723 0.292133 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +26 0.073033 0.638893 +25 0.067258 0.595671 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +12 0.159723 0.292133 +11 0.169194 0.323224 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +25 0.067258 0.595671 +24 0.063701 0.548773 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +11 0.169194 0.323224 +10 0.176967 0.361108 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +24 0.063701 0.548773 +23 0.062500 0.500000 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +10 0.176967 0.361108 +9 0.182743 0.404329 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +23 0.062500 0.500000 +22 0.063701 0.451228 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +9 0.182743 0.404329 +8 0.186299 0.451228 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +22 0.063701 0.451228 +21 0.067258 0.404329 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +8 0.186299 0.451228 +7 0.187500 0.500000 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +21 0.067258 0.404329 +20 0.073033 0.361108 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +7 0.187500 0.500000 +6 0.186299 0.548773 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +20 0.073033 0.361108 +19 0.080806 0.323223 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +6 0.186299 0.548773 +5 0.182742 0.595671 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +19 0.080806 0.323223 +18 0.090277 0.292133 +SURF 0X0 +mat 1 +refs 3 +32 0.125000 0.500000 +5 0.182742 0.595671 +4 0.176967 0.638893 +kids 0 diff --git a/Models/Autopush/waypoint.xml b/Models/Autopush/waypoint.xml new file mode 100644 index 00000000..f35ac2f3 --- /dev/null +++ b/Models/Autopush/waypoint.xml @@ -0,0 +1,34 @@ + + + + + waypoint.ac + + + false + + + + scale + /sim/model/pushback/driver/D_min-m + 0.0 + 1.0 + + + + Circle + Effects/cursor + + + diff --git a/Nasal/autopush.nas b/Nasal/autopush.nas new file mode 100644 index 00000000..bcb44d76 --- /dev/null +++ b/Nasal/autopush.nas @@ -0,0 +1,136 @@ +# AUTOPUSH +# Basic pushback logic class. +# +# Copyright (c) 2018 Autopush authors: +# Michael Danilov +# Joshua Davidson http://github.com/it0uchpods +# Merspieler http://github.com/merspieler +# Distribute under the terms of GPLv2. + + +var _enabled = 0; +var _K_p = nil; +var _F_p = nil; +var _K_i = nil; +var _F_i = nil; +var _K_d = nil; +var _F_d = nil; +var _F = nil; +var _int = nil; +var _deltaV = nil; +var _T_f = nil; +var _K_yaw = nil; +var _yasim = 0; +var _time = nil; +# (ft / s^2) / ((km / h) / s) +var _unitconv = M2FT / 3.6; +var _debug = nil; + +var _loop = func() { + if (!getprop("/sim/model/pushback/available")) { + _stop(); + return; + } + var force = 0.0; + var x = 0.0; + var y = 0.0; + # Rollspeed is only adequate if the wheel is touching the ground. + if (getprop("/gear/gear[0]/wow")) { + var deltaV = getprop("/sim/model/pushback/target-speed-km_h"); + deltaV -= getprop("/gear/gear[0]/rollspeed-ms") * 3.6; + var dV = deltaV - _deltaV; + var time = getprop("/sim/time/elapsed-sec"); + var prop = math.min(math.max(_K_p * deltaV, -_F_p), _F_p); + var speedup = getprop("/sim/speed-up"); + dt = time - _time; + # XXX Sanitising dt. Smaller chance of freakout on lag spike. + if(dt > 0.0) { + if(dt < 0.05) { + _int = math.min(math.max(_int + _K_i * dV * dt, -_F_i), _F_i); + } + if(dt > 0.002) { + var deriv = math.min(math.max(_K_d * dV / dt, -_F_d), _F_d); + } + } + var accel = prop + _int + deriv; + if (_debug > 2) { + print("pushback prop " ~ prop ~ ", _int " ~ _int ~ ", deriv " ~ deriv); + } + _deltaV = deltaV; + _time = time; + if (!_yasim) { + force = accel * getprop("/fdm/jsbsim/inertia/weight-lbs") * _unitconv; + } else { + force = accel * getprop("/fdm/yasim/gross-weight-lbs") * _unitconv; + } + var yaw = getprop("/sim/model/pushback/yaw") * _K_yaw; + x = math.cos(yaw); + y = math.sin(yaw); + setprop("/sim/model/pushback/force-x", x); + setprop("/sim/model/pushback/force-y", y); + } + setprop("/sim/model/pushback/force-lbf", force); + if (_yasim) { + # The force is divided by YASim thrust="100000.0" setting. + setprop("/sim/model/pushback/force-x-yasim", x * force * 0.00001); + # YASim's y is to the left. + setprop("/sim/model/pushback/force-y-yasim", -y * force * 0.00001); + } +} + +var _timer = maketimer(0.0167, func{_loop()}); + +var _start = func() { + # Else overwritten by dialog. + settimer(func() { + setprop("/sim/model/pushback/target-speed-km_h", 0.0) + }, 0.1); + _K_p = getprop("/sim/model/pushback/K_p"); + _F_p = getprop("/sim/model/pushback/F_p"); + _K_i = getprop("/sim/model/pushback/K_i"); + _F_i = getprop("/sim/model/pushback/F_i"); + _K_d = getprop("/sim/model/pushback/K_d"); + _F_d = getprop("/sim/model/pushback/F_d"); + _F = getprop("/sim/model/pushback/F"); + _T_f = getprop("/sim/model/pushback/T_f"); + _K_yaw = getprop("/sim/model/pushback/yaw-mult") * D2R; + _yasim = (getprop("/sim/flight-model") == "yasim"); + _debug = getprop("/sim/model/pushback/debug") or 0; + _int = 0.0; + _deltaV = 0.0; + _time = getprop("/sim/time/elapsed-sec"); + setprop("/sim/model/pushback/connected", 1); + if (!_timer.isRunning) { + if (getprop("/sim/model/pushback/chocks")) { + setprop("/sim/model/pushback/chocks", 0); + screen.log.write("(pushback): Pushback connected, chocks removed. Please release brakes."); + } else { + screen.log.write("(pushback): Pushback connected, please release brakes."); + } + } + _timer.start(); +} + +var _stop = func() { + if (_timer.isRunning) { + screen.log.write("(pushback): Pushback and bypass pin removed."); + } + _timer.stop(); + setprop("/sim/model/pushback/force-lbf", 0.0); + if (_yasim) { + setprop("/sim/model/pushback/force-x-yasim", 0.0); + setprop("/sim/model/pushback/force-y-yasim", 0.0); + } + setprop("/sim/model/pushback/connected", 0); + setprop("/sim/model/pushback/enabled", 0); +} + +setlistener("/sim/model/pushback/enabled", func(p) { + var enabled = p.getValue(); + if ((enabled > _enabled) and getprop("/sim/model/pushback/available")) { + _start(); + } else if (enabled < _enabled) { + _stop(); + } + _enabled = enabled; +}); diff --git a/Nasal/autopush_driver.nas b/Nasal/autopush_driver.nas new file mode 100644 index 00000000..58845f37 --- /dev/null +++ b/Nasal/autopush_driver.nas @@ -0,0 +1,99 @@ +# AUTOPUSH +# Pushback driver class. +# +# Command the pushback to tow/push the aircraft. +# +# Copyright (c) 2018 Autopush authors: +# Michael Danilov +# Joshua Davidson http://github.com/it0uchpods +# Merspieler http://github.com/merspieler +# Distribute under the terms of GPLv2. + + +var _K_V = nil; +var _F_V = nil; +var _D_min = nil; +var _K_psi = nil; +var _debug = nil; + +var _route = nil; +var _push = nil; +var _sign = nil; +var _psi_park = nil; + +var _to_wp = nil; + + +var _loop = func() { + if (!getprop("/sim/model/pushback/connected")) { + stop(); + return; + } + var psi = getprop("/orientation/heading-deg") + _push * 180.0; + var (A, D) = courseAndDistance(_route[_to_wp]); + D *= NM2M; + # FIXME Use _K_V and total remaining distance. + var V = _F_V; + if ((D < _D_min) or (abs(geo.normdeg180(A - psi) > 90.0))) { + _to_wp += 1; + if (_to_wp == size(_route)) { + _done(); + autopush_route.clear(); + return; + } + if (_debug) { + print("pushback_driver wp " ~ _to_wp); + } + } + if (_debug > 1) { + print("pushback_driver psi_target " ~ geo.normdeg(A) ~ ", deltapsi " ~ _sign * geo.normdeg180(A - psi)); + } + setprop("/sim/model/pushback/target-speed-km_h", _sign * V); + steering = math.min(math.max(_sign * _K_psi * geo.normdeg180(A - psi), -1.0), 1.0); + setprop("/sim/model/pushback/steer-cmd-norm", steering); +} + +var _timer = maketimer(0.051, func{_loop()}); + +var _done = func() { + stop(); + screen.log.write("(pushback): Pushback complete, please set parking brake."); +} + +var start = func() { + if (_timer.isRunning) { + stop(); + } + if (!getprop("/sim/model/pushback/connected")) { + gui.popupTip("Pushback must be connected"); + return; + } + _route = autopush_route.route(); + if ((_route == nil) or size(_route) < 2) { + autopush_route.enter(1); + return; + } + _K_V = getprop("/sim/model/pushback/driver/K_V"); + _F_V = getprop("/sim/model/pushback/driver/F_V"); + _D_min = getprop("/sim/model/pushback/driver/D_min-m"); + _K_psi = getprop("/sim/model/pushback/driver/K_psi"); + _debug = getprop("/sim/model/pushback/debug") or 0; + var (psi_park, D_park) = courseAndDistance(_route[0], _route[1]); + var (psi_twy, D_twy) = courseAndDistance(_route[size(_route) - 2], _route[size(_route) - 1]); + _psi_park = psi_park; + _push = (abs(geo.normdeg180(getprop("/orientation/heading-deg") - psi_park)) > 90.0); + _sign = 1.0 - 2.0 * _push; + _to_wp = 0; + _timer.start(); + if (_sign < 0.0) { + screen.log.write("(pushback): Push back facing " ~ int(geo.normdeg(psi_twy + 180.0 - magvar())) ~ "."); + } else { + screen.log.write("(pushback): Tow facing " ~ int(geo.normdeg(psi_twy - magvar())) ~ "."); + } +} + +var stop = func() { + _timer.stop(); + setprop("/sim/model/pushback/target-speed-km_h", 0.0); + autopush_route.clear(); +} diff --git a/Nasal/autopush_route.nas b/Nasal/autopush_route.nas new file mode 100644 index 00000000..88bba25f --- /dev/null +++ b/Nasal/autopush_route.nas @@ -0,0 +1,224 @@ +# AUTOPUSH +# Visual entry of pushback route. +# +# Copyright (c) 2018 Autopush authors: +# Michael Danilov +# Joshua Davidson http://github.com/it0uchpods +# Merspieler http://github.com/merspieler +# Distribute under the terms of GPLv2. + + +var _listener = nil; +var _view_listener = nil; +var _user_points = dynarr.dynarr.new(4); +var _route = []; +var _view_index = nil; +var _user_point_models = []; +var _waypoint_models = []; +var _N = 0; +var _show = 0; +var _view_changed_or_external = 0; +var _start_immediately = nil; +var _D_min = nil; + +# TODO find a proper value or add a calculated value so we can get ridge +setprop("/demo/prec/", 10); + + +var _add = func(pos) { + if (_N) { + var (A, S) = courseAndDistance(_user_points.arr[_N - 1], pos); + if (S * NM2M < 3 * _D_min) { + gui.popupTip("Too close to the previous point,\ntry again"); + return; + } + } + _user_points.add(geo.Coord.new(pos)); + setsize(_user_point_models, _N + 1); + _user_point_models[_N] = geo.put_model("Models/Autopush/cursor.xml", pos, 0.0); + _N += 1; + if (_N == 1) { + gui.popupTip("Click waypoints, press \"Done\" to finish"); + } else { + _calculate_bezier(); + _place_waypoint_models(); + } +} + +var _stop = func(fail = 0) { + if (_listener != nil) { + removelistener(_listener); + _listener = nil; + if (!fail) { + settimer(func() { + _reset_view(); + if (_start_immediately) { + autopush_driver.start(); + } else { + gui.popupTip("Done"); + } + }, 1.0); + } else { + _reset_view(); + } + } +} + +var _place_user_point_models = func() { + _clear_user_point_models(); + setsize(_user_point_models, _N); + var user_points = _user_points.get_sliced(); + for (var ii = 1; ii < _N; ii += 1) { + _user_point_models[ii] = geo.put_model("Models/Autopush/cursor.xml", user_points[ii], 0.0); + } +} + +var _clear_user_point_models = func() { + for (var ii = 0; ii < size(_user_point_models); ii += 1) { + if (_user_point_models[ii] != nil) { + _user_point_models[ii].remove(); + _user_point_models[ii] = nil; + } + } + setsize(_user_point_models, 0); +} + +var _place_waypoint_models = func() { + _clear_waypoint_models(); + setsize(_waypoint_models, size(_route)); + for (var ii = 0; ii < size(_route); ii += 1) { + _waypoint_models[ii] = geo.put_model("Models/Autopush/waypoint.xml", _route[ii], 0.0); + } +} + +var _clear_waypoint_models = func() { + for (var ii = 0; ii < size(_waypoint_models); ii += 1) { + if (_waypoint_models[ii] != nil) { + _waypoint_models[ii].remove(); + _waypoint_models[ii] = nil; + } + } + setsize(_waypoint_models, 0); +} + +var _set_view = func() { + if(!getprop("/sim/current-view/internal")){ + _view_changed_or_external = 1; + return; + } + _view_index = getprop("/sim/current-view/view-number"); + setprop("/sim/current-view/view-number", view.indexof("Model View")); + _view_changed_or_external = 0; + _view_listener = setlistener("/sim/current-view/name", func { + _view_changed_or_external = 1; + }); +} + +var _reset_view = func() { + if (!_view_changed_or_external) { + setprop("/sim/current-view/view-number", _view_index); + } + if (_view_listener != nil) { + removelistener(_view_listener); + _view_listener = nil; + } + if (!_show) { + _clear_user_point_models(); + _clear_waypoint_models(); + } +} + +var _calculate_bezier = func() { + # add the first point cause it will be fix at this pos + _route = []; + user_points = _user_points.get_sliced(); + var route = dynarr.dynarr.new(); + route.add(geo.Coord.new(user_points[0])); + + PNumber = size(user_points); + + if (PNumber > 2) { + var pointList = []; + setsize(pointList, PNumber); + for (var i = 0; i < PNumber; i += 1) { + pointList[i] = []; + setsize(pointList[i], PNumber); + } + + pointList[0] = user_points; + + prec = getprop("/demo/prec"); + step = prec / 100; + + for (var i = step; i < 1; i+= step) { + # start iterating from 1 cause we don't need to iterate over Pn + for (var j = 1; j < PNumber; j += 1) { + for (var k = 0; k < PNumber - j; k += 1) { + pointList[j][k] = geo.Coord.new(pointList[j - 1][k]); + var dist = pointList[j - 1][k].distance_to(pointList[j - 1][k + 1]); + var course = pointList[j - 1][k].course_to(pointList[j - 1][k + 1]); + pointList[j][k].apply_course_distance(course, dist * i); + } + } + route.add(geo.Coord.new(pointList[PNumber - 1][0])); + } + } + + if (PNumber > 1) { + # append last user point to route + route.add(geo.Coord.new(user_points[-1])); + } + + _route = route.get_sliced(); +} + +setlistener("/sim/model/pushback/route/show", func(p) { + var show = p.getValue(); + if (_listener == nil) { + if (show > _show) { + _place_user_point_models(); + _place_waypoint_models(); + } else if (show < _show) { + _clear_user_point_models(); + _clear_waypoint_models(); + } + } + _show = show; +}); + + +var enter = func(start_immediately = 0) { + clear(); + _set_view(); + _D_min = getprop("/sim/model/pushback/driver/D_min-m"); + var wp = geo.aircraft_position(); + var H = geo.elevation(wp.lat(), wp.lon()); + if (H != nil) { + wp.set_alt(H); + } + _add(wp); + _listener = setlistener("/sim/signals/click", func { + _add(geo.click_position()); + }); + _start_immediately = start_immediately; +} + +var done = func() { + _stop(0); +} + +var clear = func() { + _stop(1); + _clear_user_point_models(); + _clear_waypoint_models(); + _N = 0; + _user_points = dynarr.dynarr.new(4); +} + +var route = func() { + if (_N < 2) { + return nil; + } + _calculate_bezier(); + return _route; +} diff --git a/Nasal/dynarr.nas b/Nasal/dynarr.nas new file mode 100644 index 00000000..1ae9a610 --- /dev/null +++ b/Nasal/dynarr.nas @@ -0,0 +1,55 @@ +# Class for dynamic arrays +# +# Copyright (c) 2018 dynamic arrays authors: +# Michael Danilov +# Merspieler http://gitlab.com/merspieler +# Distribute under the terms of GPLv2. + +## ERRATA +# delitation of objects + +## Useage +# to create a new object: var = dynarr.new(); +# to add elements: .add(); +# you can access the full stored array as: .arr +# to get only the used area of the array: var = .get_spliced() + +var dynarr = +{ + new: func(size = 8) + { + var this = {parents:[dynarr]}; + this.maxsize = size; + this.size = 0; + this.arr = setsize([], size); + + return this; + }, + + # add a new element to the array + add: func(obj) + { + # case there's no space left + if (me.size + 1 >= me.maxsize) + { + # double array size + me.maxsize *= 2; + me.arr = setsize(me.arr, me.maxsize); + } + + # add object and increase used counter + me.arr[me.size] = obj; + me.size += 1; + }, + + # returns only the filled part of the array or nil if array is empty + get_sliced: func() + { + if (me.size == 0) + { + return nil; + } + + return me.arr[0:me.size - 1]; + } +}; diff --git a/Systems/a320-external-reactions.xml b/Systems/a320-external-reactions.xml index 18f7a135..b9607ee2 100644 --- a/Systems/a320-external-reactions.xml +++ b/Systems/a320-external-reactions.xml @@ -8,7 +8,7 @@ --> - + 7.52385 0 From 40e50640922a220d7e3a7df4f743847750685b54 Mon Sep 17 00:00:00 2001 From: merspieler Date: Wed, 8 Aug 2018 22:30:48 +0200 Subject: [PATCH 2/5] Fixed appearing 'No node found' error Signed-off-by: merspieler --- Systems/pushback.xml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Systems/pushback.xml b/Systems/pushback.xml index abb72c46..a47b1b20 100644 --- a/Systems/pushback.xml +++ b/Systems/pushback.xml @@ -24,15 +24,6 @@ -gear/unit[0]/wheel-speed-fps - - systems/pushback/speed-error - /sim/model/pushback/kp - /sim/model/pushback/ki - /sim/model/pushback/kd - systems/pushback/linked - /sim/model/pushback/force - - From 9a3ac4e9c97e3dece79f6467efc93c27c0814c01 Mon Sep 17 00:00:00 2001 From: merspieler Date: Wed, 8 Aug 2018 23:28:44 +0200 Subject: [PATCH 3/5] Fixed missplaced pushback model Signed-off-by: merspieler --- Models/Services/Pushback/Douglas.xml | 90 ++++------------------------ 1 file changed, 11 insertions(+), 79 deletions(-) diff --git a/Models/Services/Pushback/Douglas.xml b/Models/Services/Pushback/Douglas.xml index 0a43106d..f872f582 100644 --- a/Models/Services/Pushback/Douglas.xml +++ b/Models/Services/Pushback/Douglas.xml @@ -79,24 +79,6 @@ - - - rotate - sim/model/pushback/position-norm - -90 - 90 -
- 0 - 0 - 0 -
- - 0 - 0 - 1 - -
- translate @@ -109,72 +91,22 @@ - - translate - sim/model/pushback/position-norm - - 1.0000000.000000 - 0.9500001.961477 - 0.9000003.910862 - 0.8500005.836134 - 0.8000007.725425 - 0.7500009.567086 - 0.70000011.349763 - 0.65000013.062464 - 0.60000014.694631 - 0.55000016.236201 - 0.50000017.677670 - 0.45000019.010149 - 0.40000020.225425 - 0.35000021.316004 - 0.30000022.275163 - 0.25000023.096988 - 0.20000023.776413 - 0.15000024.309248 - 0.10000024.692209 - 0.05000024.922933 - 0.00000025.000000 - - - -1 - 0 - 0 - - - - - translate - sim/model/pushback/position-norm - - 1.0000000.000000 - 0.9500000.077067 - 0.9000000.307791 - 0.8500000.690752 - 0.8000001.223587 - 0.7500001.903012 - 0.7000002.724837 - 0.6500003.683996 - 0.6000004.774575 - 0.5500005.989851 - 0.5000007.322330 - 0.4500008.763799 - 0.40000010.305369 - 0.35000011.937536 - 0.30000013.650238 - 0.25000015.432914 - 0.20000017.274575 - 0.15000019.163866 - 0.10000021.089138 - 0.05000023.038523 - 0.00000025.000000 - + rotate + gear/gear[0]/steering-norm + -70 +
+ 0 + 0 + 0 +
0 - -1 - 0 + 0 + 1
+ From a5f99de25485039b39ba1106599fa63cef16235a Mon Sep 17 00:00:00 2001 From: merspieler Date: Sun, 19 Aug 2018 16:23:54 +0200 Subject: [PATCH 4/5] Fixed problem with 'last' point beeing doubled Signed-off-by: merspieler --- Nasal/autopush_route.nas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Nasal/autopush_route.nas b/Nasal/autopush_route.nas index 88bba25f..0228495d 100644 --- a/Nasal/autopush_route.nas +++ b/Nasal/autopush_route.nas @@ -160,7 +160,9 @@ var _calculate_bezier = func() { pointList[j][k].apply_course_distance(course, dist * i); } } - route.add(geo.Coord.new(pointList[PNumber - 1][0])); + if (i + step < 1) { + route.add(geo.Coord.new(pointList[PNumber - 1][0])); + } } } From 50f0d6df2914fdfc387347ad20914388b590bd8d Mon Sep 17 00:00:00 2001 From: merspieler Date: Thu, 23 Aug 2018 16:37:44 +0200 Subject: [PATCH 5/5] Updated autopush to v1.0-rc2 Signed-off-by: merspieler --- AircraftConfig/autopush.xml | 36 +- Models/Autopush/Effects/cursor.eff | 11 - Models/Autopush/Goldhofert.xml | 132 +++++++ Models/Autopush/cursor.ac | 542 ++++++++++++++--------------- Models/Autopush/cursor.xml | 7 +- Models/Autopush/cursor_sharp.ac | 67 ++++ Models/Autopush/cursor_sharp.xml | 29 ++ Models/Autopush/waypoint.ac | 236 ++++++------- Models/Autopush/waypoint.xml | 7 +- Nasal/autopush.nas | 2 +- Nasal/autopush_driver.nas | 4 +- Nasal/autopush_route.nas | 112 ++++-- Nasal/dynarr.nas | 12 +- 13 files changed, 755 insertions(+), 442 deletions(-) delete mode 100644 Models/Autopush/Effects/cursor.eff create mode 100644 Models/Autopush/Goldhofert.xml create mode 100644 Models/Autopush/cursor_sharp.ac create mode 100644 Models/Autopush/cursor_sharp.xml diff --git a/AircraftConfig/autopush.xml b/AircraftConfig/autopush.xml index 34bae813..a9c880c0 100644 --- a/AircraftConfig/autopush.xml +++ b/AircraftConfig/autopush.xml @@ -8,7 +8,7 @@ Pushback dialog. Copyright (c) 2018 Autopush authors: Michael Danilov Joshua Davidson http://github.com/it0uchpods - Merspieler http://github.com/merspieler + Merspieler http://gitlab.com/merspieler Original code (c) FlightGear Distribute under the terms of GPLv2. @@ -252,7 +252,7 @@ Distribute under the terms of GPLv2. 1 0 - + left @@ -283,6 +283,7 @@ Distribute under the terms of GPLv2. 1 3 + left /sim/model/pushback/route/show @@ -290,6 +291,37 @@ Distribute under the terms of GPLv2. + + 2 + 0 + + left + + + + + + diff --git a/Models/Autopush/Effects/cursor.eff b/Models/Autopush/Effects/cursor.eff deleted file mode 100644 index e3bff206..00000000 --- a/Models/Autopush/Effects/cursor.eff +++ /dev/null @@ -1,11 +0,0 @@ - - - Effects/model-combined-deferred - - 1 - 1.0 1.0 1.0 - - cursor.png - - - diff --git a/Models/Autopush/Goldhofert.xml b/Models/Autopush/Goldhofert.xml new file mode 100644 index 00000000..2af4c67f --- /dev/null +++ b/Models/Autopush/Goldhofert.xml @@ -0,0 +1,132 @@ + + + + Models/Airport/Pushback/Goldhofert.ac + + + + + Models/Airport/Pushback/Goldhofert-warning-light.xml + + -2.908 + 0.260 + 1.326 + 0 + + + + + Models/Airport/Pushback/Goldhofert-warning-light.xml + + -1.781 + 0.260 + 1.326 + 90 + + + + + spin + wheelfl + wheelfr + + gear/gear[0]/rollspeed-ms + -16.3 +
+ -2.8976 + 0 + 0.5809 +
+ + 0 + 1 + 0 + +
+ + + spin + wheelrl + wheelrr + + gear/gear[0]/rollspeed-ms + -16.3 +
+ 2.0501 + 0 + 0.5735 +
+ + 0 + 1 + 0 + +
+ + + select + + + sim/model/pushback/connected + + + + + rotate + sim/model/pushback/yaw + + 60.0 +
+ 0 + 0 + 0 +
+ + 0 + 0 + -1 + +
+ + + translate + + gear/gear[0]/compression-ft + 0.3048 + + 0 + 0 + 1 + + + + + rotate + + orientation/pitch-deg + + -7.0 +
+ 0 + 0 + 0 +
+ + 0 + 1 + 0 + +
+
diff --git a/Models/Autopush/cursor.ac b/Models/Autopush/cursor.ac index f7ab7139..0b320677 100644 --- a/Models/Autopush/cursor.ac +++ b/Models/Autopush/cursor.ac @@ -1,589 +1,589 @@ AC3Db -MATERIAL "DefaultWhite" rgb 1.0000 1.0000 1.0000 amb 0.2000 0.2000 0.2000 emis 0.0000 0.0000 0.0000 spec 0.5000 0.5000 0.5000 shi 10 trans 0.0000 -MATERIAL "autopush cursor" rgb 1.0000 1.0000 1.0000 amb 0.0000 0.0000 0.0000 emis 0.0000 0.0000 0.0000 spec 0.0000 0.0000 0.0000 shi 50 trans 0.0000 +MATERIAL "autopush cursor" rgb 0.0000 0.0000 0.0000 amb 0.0000 0.0000 0.0000 emis 1.000 0.173 0.545 spec 0.0000 0.0000 0.0000 shi 50 trans 0.0000 OBJECT world -name "Blender_export__cursor.ac" +name "Blender_exporter_v2.26__cursor.ac" kids 1 OBJECT poly name "Circle" -texture "cursor.png" -texrep 1 1 +data 11 +Circle.mesh +crease 40.0 numvert 128 -0.0000001 0.1999999 -0.7499999 -0.0000000 0.1999999 -1.0000000 --0.0980171 0.1999999 -0.9951847 --0.1950903 0.1999999 -0.9807853 --0.2902847 0.1999999 -0.9569404 --0.3826835 0.1999999 -0.9238795 --0.4713967 0.1999999 -0.8819212 --0.5555702 0.1999999 -0.8314696 --0.6343933 0.1999999 -0.7730105 --0.7071068 0.1999999 -0.7071068 --0.7730104 0.1999999 -0.6343933 --0.8314696 0.1999999 -0.5555703 --0.8819212 0.1999999 -0.4713968 --0.9238795 0.1999999 -0.3826834 --0.9569404 0.1999999 -0.2902846 --0.9807853 0.1999999 -0.1950902 --0.9951847 0.1999999 -0.0980170 --1.0000000 0.1999999 0.0000002 --0.9951847 0.1999999 0.0980173 --0.9807853 0.1999999 0.1950906 --0.9569402 0.1999999 0.2902850 --0.9238794 0.1999999 0.3826837 --0.8819211 0.1999999 0.4713970 --0.8314694 0.1999999 0.5555705 --0.7730102 0.1999999 0.6343936 --0.7071064 0.1999999 0.7071071 --0.6343929 0.1999999 0.7730108 --0.5555698 0.1999999 0.8314700 --0.4713962 0.1999999 0.8819215 --0.3826828 0.1999999 0.9238798 --0.2902840 0.1999999 0.9569405 --0.1950896 0.1999999 0.9807854 --0.0980164 0.1999999 0.9951848 -0.0000008 0.1999999 1.0000000 -0.0980180 0.1999999 0.9951847 -0.1950912 0.1999999 0.9807851 -0.2902856 0.1999999 0.9569401 -0.3826843 0.1999999 0.9238791 -0.4713976 0.1999999 0.8819208 -0.5555711 0.1999999 0.8314691 -0.6343941 0.1999999 0.7730098 -0.7071076 0.1999999 0.7071060 -0.7730110 0.1999999 0.6343926 -0.8314700 0.1999999 0.5555696 -0.8819215 0.1999999 0.4713963 -0.9238797 0.1999999 0.3826831 -0.9569404 0.1999999 0.2902845 -0.9807853 0.1999999 0.1950904 -0.9951847 0.1999999 0.0980174 -1.0000000 0.1999999 0.0000005 -0.9951848 0.1999999 -0.0980165 -0.9807854 0.1999999 -0.1950895 -0.9569407 0.1999999 -0.2902837 -0.9238800 0.1999999 -0.3826823 -0.8819219 0.1999999 -0.4713955 -0.8314705 0.1999999 -0.5555689 -0.7730116 0.1999999 -0.6343918 -0.7071083 0.1999999 -0.7071053 -0.6343950 0.1999999 -0.7730090 -0.5555723 0.1999999 -0.8314682 -0.4713991 0.1999999 -0.8819200 -0.3826860 0.1999999 -0.9238784 -0.2902876 0.1999999 -0.9569395 -0.1950935 0.1999999 -0.9807847 -0.0980206 0.1999999 -0.9951844 --0.0735127 0.1999999 -0.7463885 --0.1463176 0.1999999 -0.7355889 --0.2177134 0.1999999 -0.7177052 --0.2870125 0.1999999 -0.6929096 --0.3535474 0.1999999 -0.6614408 --0.4166775 0.1999999 -0.6236022 --0.4757948 0.1999999 -0.5797578 --0.5303299 0.1999999 -0.5303301 --0.5797577 0.1999999 -0.4757949 --0.6236020 0.1999999 -0.4166776 --0.6614408 0.1999999 -0.3535475 --0.6929095 0.1999999 -0.2870125 --0.7177051 0.1999999 -0.2177134 --0.7355888 0.1999999 -0.1463176 --0.7463884 0.1999999 -0.0735127 --0.7499999 0.1999999 0.0000002 --0.7463884 0.1999999 0.0735131 --0.7355888 0.1999999 0.1463180 --0.7177050 0.1999999 0.2177138 --0.6929094 0.1999999 0.2870128 --0.6614407 0.1999999 0.3535478 --0.6236019 0.1999999 0.4166780 --0.5797575 0.1999999 0.4757953 --0.5303296 0.1999999 0.5303304 --0.4757945 0.1999999 0.5797582 --0.4166772 0.1999999 0.6236025 --0.3535470 0.1999999 0.6614412 --0.2870120 0.1999999 0.6929099 --0.2177129 0.1999999 0.7177055 --0.1463171 0.1999999 0.7355891 --0.0735121 0.1999999 0.7463887 -0.0000008 0.1999999 0.7500001 -0.0735136 0.1999999 0.7463886 -0.1463185 0.1999999 0.7355889 -0.2177143 0.1999999 0.7177051 -0.2870134 0.1999999 0.6929094 -0.3535483 0.1999999 0.6614407 -0.4166785 0.1999999 0.6236019 -0.4757957 0.1999999 0.5797574 -0.5303308 0.1999999 0.5303296 -0.5797584 0.1999999 0.4757945 -0.6236026 0.1999999 0.4166773 -0.6614413 0.1999999 0.3535473 -0.6929099 0.1999999 0.2870124 -0.7177054 0.1999999 0.2177135 -0.7355891 0.1999999 0.1463179 -0.7463887 0.1999999 0.0735131 -0.7500001 0.1999999 0.0000004 -0.7463887 0.1999999 -0.0735123 -0.7355892 0.1999999 -0.1463170 -0.7177056 0.1999999 -0.2177127 -0.6929102 0.1999999 -0.2870116 -0.6614416 0.1999999 -0.3535465 -0.6236030 0.1999999 -0.4166766 -0.5797589 0.1999999 -0.4757938 -0.5303314 0.1999999 -0.5303289 -0.4757964 0.1999999 -0.5797567 -0.4166794 0.1999999 -0.6236011 -0.3535495 0.1999999 -0.6614400 -0.2870147 0.1999999 -0.6929088 -0.2177158 0.1999999 -0.7177045 -0.1463203 0.1999999 -0.7355884 -0.0735156 0.1999999 -0.7463882 +0 0.2 -0.75 +0 0.2 -1 +-0.09802 0.2 -0.99518 +-0.19509 0.2 -0.98079 +-0.29028 0.2 -0.95694 +-0.38268 0.2 -0.92388 +-0.4714 0.2 -0.88192 +-0.55557 0.2 -0.83147 +-0.63439 0.2 -0.77301 +-0.70711 0.2 -0.70711 +-0.77301 0.2 -0.63439 +-0.83147 0.2 -0.55557 +-0.88192 0.2 -0.4714 +-0.92388 0.2 -0.38268 +-0.95694 0.2 -0.29028 +-0.98079 0.2 -0.19509 +-0.99518 0.2 -0.09802 +-1 0.2 0 +-0.99518 0.2 0.09802 +-0.98079 0.2 0.19509 +-0.95694 0.2 0.29028 +-0.92388 0.2 0.38268 +-0.88192 0.2 0.4714 +-0.83147 0.2 0.55557 +-0.77301 0.2 0.63439 +-0.70711 0.2 0.70711 +-0.63439 0.2 0.77301 +-0.55557 0.2 0.83147 +-0.4714 0.2 0.88192 +-0.38268 0.2 0.92388 +-0.29028 0.2 0.95694 +-0.19509 0.2 0.98079 +-0.09802 0.2 0.99518 +0 0.2 1 +0.09802 0.2 0.99518 +0.19509 0.2 0.98079 +0.29029 0.2 0.95694 +0.38268 0.2 0.92388 +0.4714 0.2 0.88192 +0.55557 0.2 0.83147 +0.63439 0.2 0.77301 +0.70711 0.2 0.70711 +0.77301 0.2 0.63439 +0.83147 0.2 0.55557 +0.88192 0.2 0.4714 +0.92388 0.2 0.38268 +0.95694 0.2 0.29028 +0.98079 0.2 0.19509 +0.99518 0.2 0.09802 +1 0.2 0 +0.99518 0.2 -0.09802 +0.98079 0.2 -0.19509 +0.95694 0.2 -0.29028 +0.92388 0.2 -0.38268 +0.88192 0.2 -0.4714 +0.83147 0.2 -0.55557 +0.77301 0.2 -0.63439 +0.70711 0.2 -0.70711 +0.6344 0.2 -0.77301 +0.55557 0.2 -0.83147 +0.4714 0.2 -0.88192 +0.38269 0.2 -0.92388 +0.29029 0.2 -0.95694 +0.19509 0.2 -0.98078 +0.09802 0.2 -0.99518 +-0.07351 0.2 -0.74639 +-0.14632 0.2 -0.73559 +-0.21771 0.2 -0.71771 +-0.28701 0.2 -0.69291 +-0.35355 0.2 -0.66144 +-0.41668 0.2 -0.6236 +-0.47579 0.2 -0.57976 +-0.53033 0.2 -0.53033 +-0.57976 0.2 -0.47579 +-0.6236 0.2 -0.41668 +-0.66144 0.2 -0.35355 +-0.69291 0.2 -0.28701 +-0.71771 0.2 -0.21771 +-0.73559 0.2 -0.14632 +-0.74639 0.2 -0.07351 +-0.75 0.2 0 +-0.74639 0.2 0.07351 +-0.73559 0.2 0.14632 +-0.71771 0.2 0.21771 +-0.69291 0.2 0.28701 +-0.66144 0.2 0.35355 +-0.6236 0.2 0.41668 +-0.57976 0.2 0.4758 +-0.53033 0.2 0.53033 +-0.47579 0.2 0.57976 +-0.41668 0.2 0.6236 +-0.35355 0.2 0.66144 +-0.28701 0.2 0.69291 +-0.21771 0.2 0.71771 +-0.14632 0.2 0.73559 +-0.07351 0.2 0.74639 +0 0.2 0.75 +0.07351 0.2 0.74639 +0.14632 0.2 0.73559 +0.21771 0.2 0.71771 +0.28701 0.2 0.69291 +0.35355 0.2 0.66144 +0.41668 0.2 0.6236 +0.4758 0.2 0.57976 +0.53033 0.2 0.53033 +0.57976 0.2 0.47579 +0.6236 0.2 0.41668 +0.66144 0.2 0.35355 +0.69291 0.2 0.28701 +0.71771 0.2 0.21771 +0.73559 0.2 0.14632 +0.74639 0.2 0.07351 +0.75 0.2 0 +0.74639 0.2 -0.07351 +0.73559 0.2 -0.14632 +0.71771 0.2 -0.21771 +0.69291 0.2 -0.28701 +0.66144 0.2 -0.35355 +0.6236 0.2 -0.41668 +0.57976 0.2 -0.47579 +0.53033 0.2 -0.53033 +0.4758 0.2 -0.57976 +0.41668 0.2 -0.6236 +0.35355 0.2 -0.66144 +0.28701 0.2 -0.69291 +0.21772 0.2 -0.7177 +0.14632 0.2 -0.73559 +0.07352 0.2 -0.74639 numsurf 64 SURF 0X10 -mat 1 +mat 0 refs 4 25 0.080806 0.323223 88 0.091854 0.367417 87 0.088765 0.381051 24 0.076687 0.341402 SURF 0X10 -mat 1 +mat 0 refs 4 -12 0.069880 0.617849 -75 0.083660 0.588387 +12 0.06988 0.617849 +75 0.08366 0.588387 74 0.086025 0.604169 11 0.073033 0.638893 SURF 0X10 -mat 1 +mat 0 refs 4 51 0.186299 0.548772 114 0.170974 0.536579 113 0.171649 0.518378 50 0.187199 0.524504 SURF 0X10 -mat 1 +mat 0 refs 4 64 0.131126 0.748796 127 0.129595 0.686597 126 0.134145 0.683897 63 0.137193 0.745196 SURF 0X10 -mat 1 +mat 0 refs 4 11 0.073033 0.638893 74 0.086025 0.604169 73 0.088765 0.618949 10 0.076687 0.658598 SURF 0X10 -mat 1 +mat 0 refs 4 24 0.076687 0.341402 87 0.088765 0.381051 -86 0.086025 0.395830 +86 0.086025 0.39583 23 0.073033 0.361107 SURF 0X10 -mat 1 +mat 0 refs 4 -37 0.148918 0.269030 +37 0.148918 0.26903 100 0.142938 0.326773 99 0.138607 0.320574 36 0.143143 0.260765 SURF 0X10 -mat 1 +mat 0 refs 4 50 0.187199 0.524504 113 0.171649 0.518378 -112 0.171875 0.500000 -49 0.187500 0.500000 +112 0.171875 0.5 +49 0.1875 0.5 SURF 0X10 -mat 1 +mat 0 refs 4 63 0.137193 0.745196 126 0.134145 0.683897 125 0.138607 0.679426 62 0.143143 0.739235 SURF 0X10 -mat 1 +mat 0 refs 4 10 0.076687 0.658598 73 0.088765 0.618949 72 0.091854 0.632583 9 0.080806 0.676777 SURF 0X10 -mat 1 +mat 0 refs 4 23 0.073033 0.361107 -86 0.086025 0.395830 -85 0.083660 0.411613 -22 0.069880 0.382151 +86 0.086025 0.39583 +85 0.08366 0.411613 +22 0.06988 0.382151 SURF 0X10 -mat 1 +mat 0 refs 4 36 0.143143 0.260765 99 0.138607 0.320574 98 0.134145 0.316103 35 0.137193 0.254804 SURF 0X10 -mat 1 +mat 0 refs 4 -49 0.187500 0.500000 -112 0.171875 0.500000 +49 0.1875 0.5 +112 0.171875 0.5 111 0.171649 0.481622 48 0.187199 0.475496 SURF 0X10 -mat 1 +mat 0 refs 4 62 0.143143 0.739235 125 0.138607 0.679426 124 0.142938 0.673227 -61 0.148918 0.730970 +61 0.148918 0.73097 SURF 0X10 -mat 1 +mat 0 refs 4 9 0.080806 0.676777 72 0.091854 0.632583 71 0.095263 0.644939 -8 0.085350 0.693253 +8 0.08535 0.693253 SURF 0X10 -mat 1 +mat 0 refs 4 -22 0.069880 0.382151 -85 0.083660 0.411613 +22 0.06988 0.382151 +85 0.08366 0.411613 84 0.081693 0.428247 21 0.067258 0.404329 SURF 0X10 -mat 1 +mat 0 refs 4 35 0.137193 0.254804 98 0.134145 0.316103 97 0.129595 0.313403 34 0.131126 0.251204 SURF 0X10 -mat 1 +mat 0 refs 4 48 0.187199 0.475496 111 0.171649 0.481622 110 0.170974 0.463421 47 0.186299 0.451227 SURF 0X10 -mat 1 +mat 0 refs 4 -61 0.148918 0.730970 +61 0.148918 0.73097 124 0.142938 0.673227 -123 0.147097 0.665360 -60 0.154463 0.720480 +123 0.147097 0.66536 +60 0.154463 0.72048 SURF 0X10 -mat 1 +mat 0 refs 4 -8 0.085350 0.693253 +8 0.08535 0.693253 71 0.095263 0.644939 -70 0.098958 0.655900 +70 0.098958 0.6559 7 0.090277 0.707867 SURF 0X10 -mat 1 +mat 0 refs 4 21 0.067258 0.404329 84 0.081693 0.428247 83 0.080143 0.445572 20 0.065191 0.427429 SURF 0X10 -mat 1 +mat 0 refs 4 34 0.131126 0.251204 97 0.129595 0.313403 -96 0.125000 0.312500 -33 0.125000 0.250000 +96 0.125 0.3125 +33 0.125 0.25 SURF 0X10 -mat 1 +mat 0 refs 4 47 0.186299 0.451227 110 0.170974 0.463421 109 0.169857 0.445572 46 0.184809 0.427429 SURF 0X10 -mat 1 +mat 0 refs 4 -60 0.154463 0.720480 -123 0.147097 0.665360 -122 0.151043 0.655900 +60 0.154463 0.72048 +123 0.147097 0.66536 +122 0.151043 0.6559 59 0.159723 0.707867 SURF 0X10 -mat 1 +mat 0 refs 4 7 0.090277 0.707867 -70 0.098958 0.655900 -69 0.102903 0.665360 -6 0.095538 0.720480 +70 0.098958 0.6559 +69 0.102903 0.66536 +6 0.095538 0.72048 SURF 0X10 -mat 1 +mat 0 refs 4 20 0.065191 0.427429 83 0.080143 0.445572 -82 0.079026 0.463420 +82 0.079026 0.46342 19 0.063701 0.451227 SURF 0X10 -mat 1 +mat 0 refs 4 -33 0.125000 0.250000 -96 0.125000 0.312500 +33 0.125 0.25 +96 0.125 0.3125 95 0.120406 0.313403 32 0.118874 0.251204 SURF 0X10 -mat 1 +mat 0 refs 4 46 0.184809 0.427429 109 0.169857 0.445572 108 0.168307 0.428247 45 0.182743 0.404329 SURF 0X10 -mat 1 +mat 0 refs 4 59 0.159723 0.707867 -122 0.151043 0.655900 +122 0.151043 0.6559 121 0.154737 0.644939 -58 0.164650 0.693252 +58 0.16465 0.693252 SURF 0X10 -mat 1 +mat 0 refs 4 -6 0.095538 0.720480 -69 0.102903 0.665360 +6 0.095538 0.72048 +69 0.102903 0.66536 68 0.107062 0.673227 -5 0.101082 0.730970 +5 0.101082 0.73097 SURF 0X10 -mat 1 +mat 0 refs 4 19 0.063701 0.451227 -82 0.079026 0.463420 +82 0.079026 0.46342 81 0.078351 0.481622 18 0.062801 0.475496 SURF 0X10 -mat 1 +mat 0 refs 4 32 0.118874 0.251204 95 0.120406 0.313403 94 0.115855 0.316103 31 0.112807 0.254804 SURF 0X10 -mat 1 +mat 0 refs 4 45 0.182743 0.404329 108 0.168307 0.428247 -107 0.166340 0.411613 -44 0.180120 0.382151 +107 0.16634 0.411613 +44 0.18012 0.382151 SURF 0X10 -mat 1 +mat 0 refs 4 -58 0.164650 0.693252 +58 0.16465 0.693252 121 0.154737 0.644939 120 0.158146 0.632582 57 0.169194 0.676776 SURF 0X10 -mat 1 +mat 0 refs 4 -5 0.101082 0.730970 +5 0.101082 0.73097 68 0.107062 0.673227 67 0.111393 0.679426 4 0.106857 0.739235 SURF 0X10 -mat 1 +mat 0 refs 4 18 0.062801 0.475496 81 0.078351 0.481622 -80 0.078125 0.500000 -17 0.062500 0.500000 +80 0.078125 0.5 +17 0.0625 0.5 SURF 0X10 -mat 1 +mat 0 refs 4 31 0.112807 0.254804 94 0.115855 0.316103 93 0.111393 0.320574 30 0.106857 0.260765 SURF 0X10 -mat 1 +mat 0 refs 4 -44 0.180120 0.382151 -107 0.166340 0.411613 +44 0.18012 0.382151 +107 0.16634 0.411613 106 0.163975 0.395831 43 0.176967 0.361108 SURF 0X10 -mat 1 +mat 0 refs 4 57 0.169194 0.676776 120 0.158146 0.632582 119 0.161235 0.618949 56 0.173313 0.658598 SURF 0X10 -mat 1 +mat 0 refs 4 4 0.106857 0.739235 67 0.111393 0.679426 66 0.115855 0.683897 3 0.112807 0.745196 SURF 0X10 -mat 1 +mat 0 refs 4 -17 0.062500 0.500000 -80 0.078125 0.500000 +17 0.0625 0.5 +80 0.078125 0.5 79 0.078351 0.518378 16 0.062801 0.524504 SURF 0X10 -mat 1 +mat 0 refs 4 30 0.106857 0.260765 93 0.111393 0.320574 92 0.107062 0.326772 -29 0.101082 0.269030 +29 0.101082 0.26903 SURF 0X10 -mat 1 +mat 0 refs 4 43 0.176967 0.361108 106 0.163975 0.395831 105 0.161235 0.381051 42 0.173313 0.341402 SURF 0X10 -mat 1 +mat 0 refs 4 56 0.173313 0.658598 119 0.161235 0.618949 118 0.163975 0.604169 55 0.176967 0.638892 SURF 0X10 -mat 1 +mat 0 refs 4 3 0.112807 0.745196 66 0.115855 0.683897 65 0.120406 0.686597 2 0.118874 0.748796 SURF 0X10 -mat 1 +mat 0 refs 4 16 0.062801 0.524504 79 0.078351 0.518378 78 0.079026 0.536579 15 0.063701 0.548773 SURF 0X10 -mat 1 +mat 0 refs 4 -29 0.101082 0.269030 +29 0.101082 0.26903 92 0.107062 0.326772 -91 0.102903 0.334640 -28 0.095538 0.279520 +91 0.102903 0.33464 +28 0.095538 0.27952 SURF 0X10 -mat 1 +mat 0 refs 4 42 0.173313 0.341402 105 0.161235 0.381051 104 0.158146 0.367418 41 0.169194 0.323223 SURF 0X10 -mat 1 +mat 0 refs 4 55 0.176967 0.638892 118 0.163975 0.604169 -117 0.166340 0.588387 -54 0.180120 0.617849 +117 0.16634 0.588387 +54 0.18012 0.617849 SURF 0X10 -mat 1 +mat 0 refs 4 15 0.063701 0.548773 78 0.079026 0.536579 77 0.080143 0.554428 14 0.065191 0.572571 SURF 0X10 -mat 1 +mat 0 refs 4 -28 0.095538 0.279520 -91 0.102903 0.334640 +28 0.095538 0.27952 +91 0.102903 0.33464 90 0.098958 0.344099 27 0.090277 0.292132 SURF 0X10 -mat 1 +mat 0 refs 4 41 0.169194 0.323223 104 0.158146 0.367418 103 0.154737 0.355061 -40 0.164650 0.306747 +40 0.16465 0.306747 SURF 0X10 -mat 1 +mat 0 refs 4 -54 0.180120 0.617849 -117 0.166340 0.588387 +54 0.18012 0.617849 +117 0.16634 0.588387 116 0.168307 0.571753 53 0.182743 0.595671 SURF 0X10 -mat 1 +mat 0 refs 4 -0 0.125000 0.687500 -1 0.125000 0.750000 +0 0.125 0.6875 +1 0.125 0.75 2 0.118874 0.748796 65 0.120406 0.686597 SURF 0X10 -mat 1 +mat 0 refs 4 14 0.065191 0.572571 77 0.080143 0.554428 76 0.081693 0.571753 13 0.067258 0.595671 SURF 0X10 -mat 1 +mat 0 refs 4 27 0.090277 0.292132 90 0.098958 0.344099 -89 0.095263 0.355060 -26 0.085350 0.306747 +89 0.095263 0.35506 +26 0.08535 0.306747 SURF 0X10 -mat 1 +mat 0 refs 4 -40 0.164650 0.306747 +40 0.16465 0.306747 103 0.154737 0.355061 102 0.151042 0.344099 39 0.159723 0.292133 SURF 0X10 -mat 1 +mat 0 refs 4 53 0.182743 0.595671 116 0.168307 0.571753 115 0.169857 0.554428 52 0.184809 0.572571 SURF 0X10 -mat 1 +mat 0 refs 4 13 0.067258 0.595671 76 0.081693 0.571753 -75 0.083660 0.588387 -12 0.069880 0.617849 +75 0.08366 0.588387 +12 0.06988 0.617849 SURF 0X10 -mat 1 +mat 0 refs 4 -26 0.085350 0.306747 -89 0.095263 0.355060 +26 0.08535 0.306747 +89 0.095263 0.35506 88 0.091854 0.367417 25 0.080806 0.323223 SURF 0X10 -mat 1 +mat 0 refs 4 39 0.159723 0.292133 102 0.151042 0.344099 -101 0.147097 0.334640 -38 0.154462 0.279520 +101 0.147097 0.33464 +38 0.154462 0.27952 SURF 0X10 -mat 1 +mat 0 refs 4 52 0.184809 0.572571 115 0.169857 0.554428 114 0.170974 0.536579 51 0.186299 0.548772 SURF 0X10 -mat 1 +mat 0 refs 4 -1 0.125000 0.750000 -0 0.125000 0.687500 +1 0.125 0.75 +0 0.125 0.6875 127 0.129595 0.686597 64 0.131126 0.748796 SURF 0X10 -mat 1 +mat 0 refs 4 -38 0.154462 0.279520 -101 0.147097 0.334640 +38 0.154462 0.27952 +101 0.147097 0.33464 100 0.142938 0.326773 -37 0.148918 0.269030 +37 0.148918 0.26903 kids 0 diff --git a/Models/Autopush/cursor.xml b/Models/Autopush/cursor.xml index a91133a4..1d97f260 100644 --- a/Models/Autopush/cursor.xml +++ b/Models/Autopush/cursor.xml @@ -7,7 +7,7 @@ Cursor model. Copyright (c) 2018 Autopush authors: Michael Danilov Joshua Davidson http://github.com/it0uchpods - Merspieler http://github.com/merspieler + Merspieler http://gitlab.com/merspieler Distribute under the terms of GPLv2. --> @@ -26,9 +26,4 @@ Distribute under the terms of GPLv2. 1.0
- - Circle - Effects/cursor - - diff --git a/Models/Autopush/cursor_sharp.ac b/Models/Autopush/cursor_sharp.ac new file mode 100644 index 00000000..e8992959 --- /dev/null +++ b/Models/Autopush/cursor_sharp.ac @@ -0,0 +1,67 @@ +AC3Db +MATERIAL "autopush cursor" rgb 0.0000 0.0000 0.0000 amb 0.0000 0.0000 0.0000 emis 1.000 0.173 0.545 spec 0.0000 0.0000 0.0000 shi 50 trans 0.0000 +OBJECT world +name "Blender_exporter_v2.26__cursor_sharp.ac" +kids 1 +OBJECT poly +name "Circle" +data 11 +Circle.mesh +crease 40.0 +numvert 12 +0 0.2 -0.75 +0 0.2 -1 +0.64952 0.2 -0.375 +0.86603 0.2 -0.5 +0.64952 0.2 0.375 +0.86603 0.2 0.5 +0 0.2 0.75 +0 0.2 1 +-0.64952 0.2 0.375 +-0.86603 0.2 0.5 +-0.64952 0.2 -0.375 +-0.86603 0.2 -0.5 +numsurf 6 +SURF 0X10 +mat 0 +refs 4 +0 0.125 0.6875 +2 0.171875 0.59375 +3 0.1875 0.625 +1 0.125 0.75 +SURF 0X10 +mat 0 +refs 4 +2 0.171875 0.59375 +4 0.171875 0.40625 +5 0.1875 0.375 +3 0.1875 0.625 +SURF 0X10 +mat 0 +refs 4 +4 0.171875 0.40625 +6 0.125 0.3125 +7 0.125 0.25 +5 0.1875 0.375 +SURF 0X10 +mat 0 +refs 4 +6 0.125 0.3125 +8 0.078125 0.40625 +9 0.0625 0.375 +7 0.125 0.25 +SURF 0X10 +mat 0 +refs 4 +8 0.078125 0.40625 +10 0.078125 0.59375 +11 0.0625 0.625 +9 0.0625 0.375 +SURF 0X10 +mat 0 +refs 4 +10 0.078125 0.59375 +0 0.125 0.6875 +1 0.125 0.75 +11 0.0625 0.625 +kids 0 diff --git a/Models/Autopush/cursor_sharp.xml b/Models/Autopush/cursor_sharp.xml new file mode 100644 index 00000000..2a79bb48 --- /dev/null +++ b/Models/Autopush/cursor_sharp.xml @@ -0,0 +1,29 @@ + + + + + cursor_sharp.ac + + + false + + + + scale + /sim/model/pushback/driver/D_min-m + 0.0 + 1.0 + + + diff --git a/Models/Autopush/waypoint.ac b/Models/Autopush/waypoint.ac index 1fc9a18e..443b4274 100644 --- a/Models/Autopush/waypoint.ac +++ b/Models/Autopush/waypoint.ac @@ -1,238 +1,238 @@ AC3Db -MATERIAL "DefaultWhite" rgb 1.0000 1.0000 1.0000 amb 0.2000 0.2000 0.2000 emis 0.0000 0.0000 0.0000 spec 0.5000 0.5000 0.5000 shi 10 trans 0.0000 -MATERIAL "autopush cursor" rgb 1.0000 1.0000 1.0000 amb 0.0000 0.0000 0.0000 emis 0.0000 0.0000 0.0000 spec 0.0000 0.0000 0.0000 shi 50 trans 0.0000 +MATERIAL "autopush cursor" rgb 0.0000 0.0000 0.0000 amb 0.0000 0.0000 0.0000 emis 1.000 0.173 0.545 spec 0.0000 0.0000 0.0000 shi 50 trans 0.0000 OBJECT world -name "Blender_export__waypoint.ac" +name "Blender_exporter_v2.26__waypoint.ac" kids 1 OBJECT poly name "Circle" -texture "cursor.png" -texrep 1 1 +data 11 +Circle.mesh +crease 40.0 numvert 33 -0.0390178 0.2000000 -0.1961571 -0.0765364 0.2000000 -0.1847760 -0.1111138 0.2000000 -0.1662941 -0.1414212 0.2000000 -0.1414215 -0.1662938 0.2000000 -0.1111143 -0.1847758 0.2000000 -0.0765369 -0.1961570 0.2000000 -0.0390183 -0.2000000 0.2000000 -0.0000002 -0.1961571 0.2000000 0.0390179 -0.1847760 0.2000000 0.0765365 -0.1662940 0.2000000 0.1111139 -0.1414215 0.2000000 0.1414213 -0.1111141 0.2000000 0.1662939 -0.0765368 0.2000000 0.1847759 -0.0390181 0.2000000 0.1961570 -0.0000001 0.2000000 0.2000000 --0.0390180 0.2000000 0.1961571 --0.0765367 0.2000000 0.1847759 --0.1111140 0.2000000 0.1662939 --0.1414214 0.2000000 0.1414214 --0.1662939 0.2000000 0.1111140 --0.1847759 0.2000000 0.0765367 --0.1961571 0.2000000 0.0390180 --0.2000000 0.2000000 -0.0000000 --0.1961571 0.2000000 -0.0390181 --0.1847759 0.2000000 -0.0765367 --0.1662939 0.2000000 -0.1111140 --0.1414214 0.2000000 -0.1414214 --0.1111140 0.2000000 -0.1662939 --0.0765367 0.2000000 -0.1847759 --0.0390181 0.2000000 -0.1961571 -0.0000000 0.2000000 -0.2000000 -0.0000000 0.2000000 0.0000000 +0.03902 0.2 -0.19616 +0.07654 0.2 -0.18478 +0.11111 0.2 -0.16629 +0.14142 0.2 -0.14142 +0.16629 0.2 -0.11111 +0.18478 0.2 -0.07654 +0.19616 0.2 -0.03902 +0.2 0.2 -0 +0.19616 0.2 0.03902 +0.18478 0.2 0.07654 +0.16629 0.2 0.11111 +0.14142 0.2 0.14142 +0.11111 0.2 0.16629 +0.07654 0.2 0.18478 +0.03902 0.2 0.19616 +0 0.2 0.2 +-0.03902 0.2 0.19616 +-0.07654 0.2 0.18478 +-0.11111 0.2 0.16629 +-0.14142 0.2 0.14142 +-0.16629 0.2 0.11111 +-0.18478 0.2 0.07654 +-0.19616 0.2 0.03902 +-0.2 0.2 0 +-0.19616 0.2 -0.03902 +-0.18478 0.2 -0.07654 +-0.16629 0.2 -0.11111 +-0.14142 0.2 -0.14142 +-0.11111 0.2 -0.16629 +-0.07654 0.2 -0.18478 +-0.03902 0.2 -0.19616 +0 0.2 -0.2 +0 0.2 0 numsurf 32 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 +32 0.125 0.5 18 0.090277 0.292133 -17 0.101082 0.269030 +17 0.101082 0.26903 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 -31 0.125000 0.750000 +32 0.125 0.5 +31 0.125 0.75 30 0.112807 0.745197 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 +32 0.125 0.5 4 0.176967 0.638893 3 0.169194 0.676777 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 -17 0.101082 0.269030 +32 0.125 0.5 +17 0.101082 0.26903 16 0.112807 0.254804 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 +32 0.125 0.5 30 0.112807 0.745197 -29 0.101082 0.730970 +29 0.101082 0.73097 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 +32 0.125 0.5 3 0.169194 0.676777 2 0.159723 0.707868 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 +32 0.125 0.5 16 0.112807 0.254804 -15 0.125000 0.250000 +15 0.125 0.25 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 -29 0.101082 0.730970 +32 0.125 0.5 +29 0.101082 0.73097 28 0.090277 0.707868 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 +32 0.125 0.5 2 0.159723 0.707868 -1 0.148918 0.730970 +1 0.148918 0.73097 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 -15 0.125000 0.250000 +32 0.125 0.5 +15 0.125 0.25 14 0.137193 0.254804 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 +32 0.125 0.5 28 0.090277 0.707868 27 0.080806 0.676777 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 -1 0.148918 0.730970 +32 0.125 0.5 +1 0.148918 0.73097 0 0.137193 0.745197 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 +32 0.125 0.5 14 0.137193 0.254804 -13 0.148918 0.269030 +13 0.148918 0.26903 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 +32 0.125 0.5 27 0.080806 0.676777 26 0.073033 0.638893 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 +32 0.125 0.5 0 0.137193 0.745197 -31 0.125000 0.750000 +31 0.125 0.75 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 -13 0.148918 0.269030 +32 0.125 0.5 +13 0.148918 0.26903 12 0.159723 0.292133 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 +32 0.125 0.5 26 0.073033 0.638893 25 0.067258 0.595671 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 +32 0.125 0.5 12 0.159723 0.292133 11 0.169194 0.323224 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 +32 0.125 0.5 25 0.067258 0.595671 24 0.063701 0.548773 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 +32 0.125 0.5 11 0.169194 0.323224 10 0.176967 0.361108 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 +32 0.125 0.5 24 0.063701 0.548773 -23 0.062500 0.500000 +23 0.0625 0.5 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 +32 0.125 0.5 10 0.176967 0.361108 9 0.182743 0.404329 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 -23 0.062500 0.500000 +32 0.125 0.5 +23 0.0625 0.5 22 0.063701 0.451228 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 +32 0.125 0.5 9 0.182743 0.404329 8 0.186299 0.451228 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 +32 0.125 0.5 22 0.063701 0.451228 21 0.067258 0.404329 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 +32 0.125 0.5 8 0.186299 0.451228 -7 0.187500 0.500000 +7 0.1875 0.5 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 +32 0.125 0.5 21 0.067258 0.404329 20 0.073033 0.361108 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 -7 0.187500 0.500000 +32 0.125 0.5 +7 0.1875 0.5 6 0.186299 0.548773 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 +32 0.125 0.5 20 0.073033 0.361108 19 0.080806 0.323223 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 +32 0.125 0.5 6 0.186299 0.548773 5 0.182742 0.595671 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 +32 0.125 0.5 19 0.080806 0.323223 18 0.090277 0.292133 SURF 0X0 -mat 1 +mat 0 refs 3 -32 0.125000 0.500000 +32 0.125 0.5 5 0.182742 0.595671 4 0.176967 0.638893 kids 0 diff --git a/Models/Autopush/waypoint.xml b/Models/Autopush/waypoint.xml index f35ac2f3..40e528ef 100644 --- a/Models/Autopush/waypoint.xml +++ b/Models/Autopush/waypoint.xml @@ -7,7 +7,7 @@ Waypoint model. Copyright (c) 2018 Autopush authors: Michael Danilov Joshua Davidson http://github.com/it0uchpods - Merspieler http://github.com/merspieler + Merspieler http://gitlab.com/merspieler Distribute under the terms of GPLv2. --> @@ -26,9 +26,4 @@ Distribute under the terms of GPLv2. 1.0 - - Circle - Effects/cursor - - diff --git a/Nasal/autopush.nas b/Nasal/autopush.nas index bcb44d76..18dbb4f5 100644 --- a/Nasal/autopush.nas +++ b/Nasal/autopush.nas @@ -4,7 +4,7 @@ # Copyright (c) 2018 Autopush authors: # Michael Danilov # Joshua Davidson http://github.com/it0uchpods -# Merspieler http://github.com/merspieler +# Merspieler http://gitlab.com/merspieler # Distribute under the terms of GPLv2. diff --git a/Nasal/autopush_driver.nas b/Nasal/autopush_driver.nas index 58845f37..53170c27 100644 --- a/Nasal/autopush_driver.nas +++ b/Nasal/autopush_driver.nas @@ -6,7 +6,7 @@ # Copyright (c) 2018 Autopush authors: # Michael Danilov # Joshua Davidson http://github.com/it0uchpods -# Merspieler http://github.com/merspieler +# Merspieler http://gitlab.com/merspieler # Distribute under the terms of GPLv2. @@ -72,6 +72,8 @@ var start = func() { if ((_route == nil) or size(_route) < 2) { autopush_route.enter(1); return; + }else{ + autopush_route.done(); } _K_V = getprop("/sim/model/pushback/driver/K_V"); _F_V = getprop("/sim/model/pushback/driver/F_V"); diff --git a/Nasal/autopush_route.nas b/Nasal/autopush_route.nas index 0228495d..606c9ff5 100644 --- a/Nasal/autopush_route.nas +++ b/Nasal/autopush_route.nas @@ -4,13 +4,14 @@ # Copyright (c) 2018 Autopush authors: # Michael Danilov # Joshua Davidson http://github.com/it0uchpods -# Merspieler http://github.com/merspieler +# Merspieler http://gitlab.com/merspieler # Distribute under the terms of GPLv2. var _listener = nil; var _view_listener = nil; var _user_points = dynarr.dynarr.new(4); +var _user_point_modes = dynarr.dynarr.new(4); # Modes: 0 = Bezier node, 1 = Bezier end/start node var _route = []; var _view_index = nil; var _user_point_models = []; @@ -21,9 +22,6 @@ var _view_changed_or_external = 0; var _start_immediately = nil; var _D_min = nil; -# TODO find a proper value or add a calculated value so we can get ridge -setprop("/demo/prec/", 10); - var _add = func(pos) { if (_N) { @@ -34,13 +32,35 @@ var _add = func(pos) { } } _user_points.add(geo.Coord.new(pos)); + + if (_user_point_modes.maxsize == 1 and _user_point_modes.size == 1) { + _user_point_modes.arr[0] = 0; + } else { + _user_point_modes.add(0); + } setsize(_user_point_models, _N + 1); _user_point_models[_N] = geo.put_model("Models/Autopush/cursor.xml", pos, 0.0); _N += 1; if (_N == 1) { gui.popupTip("Click waypoints, press \"Done\" to finish"); } else { - _calculate_bezier(); + _calculate_route(); + _place_waypoint_models(); + } +} + +var delete_last = func() { + if (_listener == nil) { + return; + } + if (_N > 1) { + _N -= 1; + _user_points.del(_N); + _user_point_modes.del(_N); + _user_point_models[_N].remove(); + _user_point_models[_N] = nil; + setsize(_user_point_models, _N); + _calculate_route(); _place_waypoint_models(); } } @@ -68,8 +88,12 @@ var _place_user_point_models = func() { _clear_user_point_models(); setsize(_user_point_models, _N); var user_points = _user_points.get_sliced(); - for (var ii = 1; ii < _N; ii += 1) { - _user_point_models[ii] = geo.put_model("Models/Autopush/cursor.xml", user_points[ii], 0.0); + for (var ii = 0; ii < _N; ii += 1) { + var model = "Models/Autopush/cursor.xml"; + if (_user_point_modes.arr[ii] == 1) { + model = "Models/Autopush/cursor_sharp.xml"; + } + _user_point_models[ii] = geo.put_model(model, user_points[ii], 0.0); } } @@ -128,16 +152,40 @@ var _reset_view = func() { } } -var _calculate_bezier = func() { - # add the first point cause it will be fix at this pos +var _calculate_route = func() { _route = []; user_points = _user_points.get_sliced(); var route = dynarr.dynarr.new(); + # add the first point cause it will be fix at this pos route.add(geo.Coord.new(user_points[0])); + n = size(user_points); + var base = 0; + for (var i = 0; i < n; i += 1) { + if (_user_point_modes.arr[i] == 1 or i == n - 1) { + if (i - base > 0) { + var bezier = _calculate_bezier(user_points[base:i]); + + var m = size(bezier); + for (var j = 0; j < m; j += 1) { + route.add(geo.Coord.new(bezier[j])); + } + } + base = i; + route.add(geo.Coord.new(user_points[i])); + } + } + + PNumber = size(user_points); + _route = route.get_sliced(); +} + +var _calculate_bezier = func(user_points) { + var route = dynarr.dynarr.new(); + PNumber = size(user_points); - if (PNumber > 2) { + if (PNumber > 1) { var pointList = []; setsize(pointList, PNumber); for (var i = 0; i < PNumber; i += 1) { @@ -147,10 +195,14 @@ var _calculate_bezier = func() { pointList[0] = user_points; - prec = getprop("/demo/prec"); - step = prec / 100; + var len = 0; + for (var i = 0; i < PNumber - 1; i += 1) { + len += user_points[i].distance_to(user_points[i + 1]); + } - for (var i = step; i < 1; i+= step) { + var step = _D_min / len; + + for (var i = step; i < 1 - step; i+= step) { # start iterating from 1 cause we don't need to iterate over Pn for (var j = 1; j < PNumber; j += 1) { for (var k = 0; k < PNumber - j; k += 1) { @@ -160,18 +212,12 @@ var _calculate_bezier = func() { pointList[j][k].apply_course_distance(course, dist * i); } } - if (i + step < 1) { - route.add(geo.Coord.new(pointList[PNumber - 1][0])); - } + pointList[PNumber - 1][0].set_alt(geo.elevation(pointList[PNumber - 1][0].lat(),pointList[PNumber - 1][0].lon())); + route.add(geo.Coord.new(pointList[PNumber - 1][0])); } } - if (PNumber > 1) { - # append last user point to route - route.add(geo.Coord.new(user_points[-1])); - } - - _route = route.get_sliced(); + return route.get_sliced(); } setlistener("/sim/model/pushback/route/show", func(p) { @@ -205,6 +251,25 @@ var enter = func(start_immediately = 0) { _start_immediately = start_immediately; } +var toggle_node = func() { + if (_listener == nil) { + return; + } + if (_user_point_modes.arr[_N - 1] == 0) { + _user_point_modes.arr[_N - 1] = 1; + } else { + _user_point_modes.arr[_N - 1] = 0; + } + if (_user_point_models[_N - 1] != nil) { + _user_point_models[_N - 1].remove(); + var model = "Models/Autopush/cursor.xml"; + if (_user_point_modes.arr[_N - 1] == 1) { + model = "Models/Autopush/cursor_sharp.xml"; + } + _user_point_models[_N - 1] = geo.put_model(model, _user_points.get_sliced()[_N - 1], 0.0); + } +} + var done = func() { _stop(0); } @@ -215,12 +280,13 @@ var clear = func() { _clear_waypoint_models(); _N = 0; _user_points = dynarr.dynarr.new(4); + _user_point_modes = dynarr.dynarr.new(1); } var route = func() { if (_N < 2) { return nil; } - _calculate_bezier(); + _calculate_route(); return _route; } diff --git a/Nasal/dynarr.nas b/Nasal/dynarr.nas index 1ae9a610..03518aa0 100644 --- a/Nasal/dynarr.nas +++ b/Nasal/dynarr.nas @@ -5,9 +5,6 @@ # Merspieler http://gitlab.com/merspieler # Distribute under the terms of GPLv2. -## ERRATA -# delitation of objects - ## Useage # to create a new object: var = dynarr.new(); # to add elements: .add(); @@ -42,6 +39,15 @@ var dynarr = me.size += 1; }, + # delete an element from the array + del: func(id) + { + me.size -= 1; + for(ii = id; ii < me.size - 1; ii += 1){ + me.arr[ii] = me.arr[ii + 1]; + } + }, + # returns only the filled part of the array or nil if array is empty get_sliced: func() {