mirror of
https://github.com/AleziaKurdis/Overte-community-apps.git
synced 2025-04-05 12:31:09 +02:00
Add files via upload
This commit is contained in:
parent
0e78eb06c0
commit
3e38aa4d07
4 changed files with 155 additions and 1 deletions
99
applications/gravimeter/gravimeter.html
Normal file
99
applications/gravimeter/gravimeter.html
Normal file
|
@ -0,0 +1,99 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Gravimeter</title>
|
||||
<script type="text/javascript">
|
||||
function getParameter(theParameter) {
|
||||
var params = window.location.search.substr(1).split('&');
|
||||
|
||||
for (var i = 0; i < params.length; i++) {
|
||||
var p=params[i].split('=');
|
||||
if (p[0] == theParameter) {
|
||||
return decodeURIComponent(p[1]);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
<style>
|
||||
|
||||
body{
|
||||
background-color: #43484f;
|
||||
}
|
||||
|
||||
font.maintitle{
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 40px;
|
||||
color: #FFFFFF;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
td{
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 18px;
|
||||
color: #FFFFFF;
|
||||
font-weight: 700;
|
||||
}
|
||||
input.x{
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 14px;
|
||||
color: #a30000;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
input.y{
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 14px;
|
||||
color: #007505;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
input.z{
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 14px;
|
||||
color: #000cba;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div align = 'center'><font class='maintitle'>GRAVIMETER</font><br><br>
|
||||
|
||||
|
||||
|
||||
<form name = "coord" id = "coord">
|
||||
|
||||
<table style='width:430px;'>
|
||||
<tr><td colspan='3'><br><br><br>GRAVITY ORIENTATION</td></tr>
|
||||
<tr>
|
||||
<td>X: <input name = "rx" id = "rx" class="x" type = "text" value = '0' size='6'></td>
|
||||
<td>Y: <input name = "ry" id = "ry" class="y" type = "text" value = '0' size='6'></td>
|
||||
<td>Z: <input name = "rz" id = "rz" class="z" type = "text" value = '0' size='6'></td>
|
||||
</tr>
|
||||
<tr><td colspan='3'><br><hr><br>POSITION</td></tr>
|
||||
<tr>
|
||||
<td>X: <input name = "x" id = "x" class="x" type = "text" value = '0' size='6'></td>
|
||||
<td>Y: <input name = "y" id = "y" class="y" type = "text" value = '0' size='6'></td>
|
||||
<td>Z: <input name = "z" id = "z" class="z" type = "text" value = '0' size='6'></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
document.coord.x.value = getParameter('px');
|
||||
document.coord.y.value = getParameter('py');
|
||||
document.coord.z.value = getParameter('pz');
|
||||
document.coord.rx.value = getParameter('rx');
|
||||
document.coord.ry.value = getParameter('ry');
|
||||
document.coord.rz.value = getParameter('rz');
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
55
applications/gravimeter/gravimeter.js
Normal file
55
applications/gravimeter/gravimeter.js
Normal file
|
@ -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);
|
||||
}());
|
BIN
applications/gravimeter/gravimeter_icon.png
Normal file
BIN
applications/gravimeter/gravimeter_icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
|
@ -1 +1 @@
|
|||
var metadata = {"applications":[{"directory":"doppelganger-mirror","name":"Doppelganger-Mirror","description":"Generate an double of your avatar that only you can see. This allows you to examine your avatar and see how you move. The doppelganger can be grabbed and positioned like you want.","jsfile":"doppelganger-mirror/app-doppleganger.js","icon":"doppelganger-mirror/doppleganger-i.svg","caption":"MIRROR"},{"directory":"spectator-camera","name":"Spectator Camera v2.5","description":"Give you a video camera that can display its image on your monitor screen for video capture. It can capture from the camera or from the VR Headset. It can also take classic and spherical 360 snapshots (equirectangular format). Definitely a must.","jsfile":"spectator-camera/spectatorCamera.js","icon":"spectator-camera/spectator-i.svg","caption":"SPECTATOR"}]};
|
||||
var metadata = {"applications":[{"directory":"doppelganger-mirror","name":"Doppelganger-Mirror","description":"Generate an double of your avatar that only you can see. This allows you to examine your avatar and see how you move. The doppelganger can be grabbed and positioned like you want.","jsfile":"doppelganger-mirror/app-doppleganger.js","icon":"doppelganger-mirror/doppleganger-i.svg","caption":"MIRROR"},{"directory":"spectator-camera","name":"Spectator Camera v2.5","description":"Give you a video camera that can display its image on your monitor screen for video capture. It can capture from the camera or from the VR Headset. It can also take classic and spherical 360 snapshots (equirectangular format). Definitely a must.","jsfile":"spectator-camera/spectatorCamera.js","icon":"spectator-camera/spectator-i.svg","caption":"SPECTATOR"},{"directory":"gravimeter","name":"Gravimeter","description":"This application returns a record of the orientation and the position of your avatar. This tool becomes very helpful when you want to build on a sphere with a radial gravity, where it\\'s arduous to evaluate the perpendicularity of the floor.","jsfile":"gravimeter/gravimeter.js","icon":"gravimeter/gravimeter_icon.png","caption":"GAVITY"}]};
|
Loading…
Reference in a new issue