From 50f0d6df2914fdfc387347ad20914388b590bd8d Mon Sep 17 00:00:00 2001 From: merspieler Date: Thu, 23 Aug 2018 16:37:44 +0200 Subject: [PATCH] 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() {