From 3e38aa4d076ee6b8fdb8aa25e1775a3146c4c9c3 Mon Sep 17 00:00:00 2001 From: Keb Helion <60008426+KebHelion@users.noreply.github.com> Date: Fri, 14 Feb 2020 23:16:41 -0500 Subject: [PATCH] Add files via upload --- applications/gravimeter/gravimeter.html | 99 ++++++++++++++++++++ applications/gravimeter/gravimeter.js | 55 +++++++++++ applications/gravimeter/gravimeter_icon.png | Bin 0 -> 1133 bytes applications/metadata.js | 2 +- 4 files changed, 155 insertions(+), 1 deletion(-) create mode 100644 applications/gravimeter/gravimeter.html create mode 100644 applications/gravimeter/gravimeter.js create mode 100644 applications/gravimeter/gravimeter_icon.png diff --git a/applications/gravimeter/gravimeter.html b/applications/gravimeter/gravimeter.html new file mode 100644 index 0000000..9688910 --- /dev/null +++ b/applications/gravimeter/gravimeter.html @@ -0,0 +1,99 @@ + + + + Gravimeter + + + + + +
GRAVIMETER

+ + + +
+ + + + + + + + + + + + + + + +



GRAVITY ORIENTATION
X: Y: Z:



POSITION
X: Y: Z:
+
+
+ + + \ No newline at end of file diff --git a/applications/gravimeter/gravimeter.js b/applications/gravimeter/gravimeter.js new file mode 100644 index 0000000..cb4d2c1 --- /dev/null +++ b/applications/gravimeter/gravimeter.js @@ -0,0 +1,55 @@ +"use strict"; + +// gravimeter.js +// +// By Alezia Kurdis, June 2019. +// +// This application returns the orientation and the position of your avatar. +// This data becomes very helpful when you want to build on a sphere with a radial gravity +// where it is difficult to evaluate the perpendicularity of the floor. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// +(function() { + + var MainPath = Script.resolvePath('').split("gravimeter.js")[0]; + var APP_NAME = "GRAVITY"; + var APP_URL = MainPath + "gravimeter.html"; + var APP_ICON = MainPath + "gravimeter_icon.png"; + + + var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system"); + var button = tablet.addButton({ + text: APP_NAME, + icon: APP_ICON + }); + + var ProcessInterval; + + function clicked(){ + displayData(); + + + + } + button.clicked.connect(clicked); + + function displayData(){ + var AvatarPosition = MyAvatar.position; + + var grav = Quat.safeEulerAngles(MyAvatar.orientation); + + + tablet.gotoWebScreen(APP_URL + "?px=" + Math.round(AvatarPosition.x) + "&py=" + Math.round(AvatarPosition.y) + "&pz=" + Math.round(AvatarPosition.z) + "&rx=" + (Math.round(grav.x * 100)/100) + "&ry=" + (Math.round(grav.y * 100)/100) + "&rz=" + (Math.round(grav.z * 100)/100)); + + } + + + + function cleanup() { + tablet.removeButton(button); + } + + Script.scriptEnding.connect(cleanup); +}()); \ No newline at end of file diff --git a/applications/gravimeter/gravimeter_icon.png b/applications/gravimeter/gravimeter_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..f5c80544641c26ae39302c7d911d75b9be07c1d1 GIT binary patch literal 1133 zcmX9+YfMuI6h8NnQo)wi@+#Kuj*iy`S%spEhu&i83z3!}!)=+RBUJ5tYQuXBliLwkvMVNuotF1yL)oI3IMW`|%~`rSSqEg5CBpFU@`zexRQ1NzygzUT?GK!835A$4tp^G;2Wj+QUFJD?F;R003be5 z7Ul!g!~#$jfPeh})B}J@F~Fn_Afpo?vfQ?QP!51isASTjs+;VQ^=L-Z-oe;MFJwPO` zgW`sa=Ay3}wnmV^Dib32EaPMnox3$cQhv+wUEZo+QwcFowIm8~7dco@G`}=4_Kp4c zAaTfcrK$8OAQFu*amd@ax9t93tlb#1%e>R-9}viJd5g+)9B_^Y?ph_1`E3MSB=s95 z=R#;;cA1~hA<^g2NxuGK_NUtcaZ1P|;paH=;&^3!o%pqY**7ujrCBBJrrxUJOEw7~ zPy>8Vqjg6`m6PBB6?xm{}XLEFM%N9`3y&+-qL@RH|?Z5E*>c`Zw>l?j> zU8Pno1>Jk%pHa^;I3Jd_dQfjXnPpX8yNy=OFiFskh*oGuicyC+qTs@XT4ICTvsf+r z20sx`MiG?#UTg7NdDk#Uc7QERI>>dlw$V>c0|&-ZfAO<>uP2?8JASQSujYG={0hi)uXJt8>em^YuS#lEad6L`_G~U|La&>X#BLkV>)L_H~dm&K1RIFWl$i z@-#_1G2dEaTrvfE;t>BQEaaW4*^b8<2WLHQ0kdsE#Ve{^#;rhS`S$%Wj>HSO$~%eW7g%Ko`R2 XO<#O`B=h750DvlYjqHaU-S+