Skip to content

Commit

Permalink
menus
Browse files Browse the repository at this point in the history
  • Loading branch information
jzitelli committed Aug 16, 2017
1 parent a305fc0 commit 9d16513
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 22 deletions.
26 changes: 22 additions & 4 deletions poolvr.css
@@ -1,7 +1,7 @@
#overlay {
position: absolute;
left: 1.25vw;
right: 78vw;
right: 77vw;
top: 2.25vw;
/*width: 85%;*/
/*right: 2vw;*/
Expand All @@ -28,6 +28,21 @@
/* align-content: center;
justify-content: center;*/
}
#vrDisplayIndicator, #vrGamepadIndicator {
font-size: 9pt;
text-align: center;
margin-left: 0.4em;
margin-bottom: 10vh;
padding: 0.75vh;
box-sizing: border-box;
color: #b5e853;
background-color: rgba(60, 20, 0, 0.6);
/* margin-left: 0.4em;
margin: 2vh;/*-bottom: 0.75vh;*/
/*align-content: center;
justify-content: center;*/
}

#webgl-canvas {
position: fixed;
width: 100%;
Expand All @@ -49,13 +64,16 @@
/*box-sizing: border-box;*/
padding-left: 1.0em;
padding-right: 1.0em;
padding-top: 0.75em;
padding-bottom: 0.75em;
padding-top: 0.25vh;
padding-bottom: 1.5vh;
margin: 1.25vh;
/* margin-left, margin-right: 40vh;
margin-top, margin-bottom: 19vh;
*/ text-align: right;
}
/*br {
padding-top, padding-bottom, margin-top, margin-bottom: 2vh;
}*/
body {
background-color: #010101;
margin: 0;
Expand All @@ -76,7 +94,7 @@ h1, h2, h3 {
}
h1 {
margin-left: 1.75vh;
margin-top: 1.75vh;
margin-top: 0.75vh;
font-size: 18pt;
}
h2 {
Expand Down
11 changes: 6 additions & 5 deletions poolvr.py
Expand Up @@ -11,7 +11,6 @@
from jinja2 import Environment, FileSystemLoader


import pool_table


_logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -42,8 +41,6 @@


WebVRConfig = {
#"ENABLE_LEAP_MOTION": False,
#"LEAP_MOTION_HOST": "192.168.1.200",
"FORCE_ENABLE_VR": False,
"K_FILTER": 0.98,
"PREDICTION_TIME_S": 0.010,
Expand All @@ -54,18 +51,21 @@
}


INCH2METER = 0.0254


POOLVR = {
'version': PACKAGE['version'],
'config': {
'gravity' : 9.8,
'gravity' : 9.81,
'useBasicMaterials' : True,
'useShadowMap' : False,
'useSpotLight' : True,
'usePointLight' : False,
'useTextGeomLogger' : True,
'L_table' : 2.3368,
'H_table' : 0.77,
'ball_diameter' : 2.25 * pool_table.INCH2METER,
'ball_diameter' : 2.25 * INCH2METER,
'soundVolume' : 0.0,
'toolOptions': {
'tipShape' : 'Cylinder',
Expand Down Expand Up @@ -127,6 +127,7 @@ def get_poolvr_config():


def render_poolvr_template(webvr_config=None, poolvr_config=None):
import pool_table
if webvr_config is None:
webvr_config = WebVRConfig
if poolvr_config is None:
Expand Down
36 changes: 23 additions & 13 deletions poolvr_template.html
Expand Up @@ -40,25 +40,35 @@ <h1>poolvr {{ version if version else '' }}</h1>{{version_content if version_con
<button id="fsButton">toggle fullscreen</button>
<br>
-->
<label><input type="checkbox" id="sound"/>Sound</label>
<div class="panel" id="soundPanel">
<h3>Sound:</h3>
<label><input type="checkbox" id="sound"/>enabled</label>
<label><input type="range" id="volume" min="0.0", max="1.0" step="any"/>vol.</label>
</div>

<label><input type="range" id="volume" min="0.0", max="1.0" step="any"/>vol.</label>
<div class="panel" id="vrPanel">
<h3>VR:</h3>
<span id="vrDisplayIndicator">VR display is not available</span>
<br>
<br>
<span id="vrGamepadIndicator">VR gamepad is not available</span>
</div>

<div class="panel" id="graphicsPanel">
<h3>Graphics:</h3>
<label><input type="checkbox" id="useBasicMaterials"/>EGA mode (max performance)</label>
<br>
<label><input type="checkbox" id="useSpotLight"/>Spot light</label>
<label><input type="checkbox" id="usePointLight"/>Point light</label>
<br>
<label><input type="checkbox" id="useShadowMap"/>Shadow maps</label>
<h3>Graphics:</h3>
<label><input type="checkbox" id="useBasicMaterials"/>EGA mode (max performance)</label>
<br>
<label><input type="checkbox" id="useSpotLight"/>Spot light</label>
<label><input type="checkbox" id="usePointLight"/>Point light</label>
<br>
<label><input type="checkbox" id="useShadowMap"/>Shadow maps</label>
</div>

<div class="panel" id="leapPanel">
<h3>Leap Motion:</h3>
<span id="leapIndicator">disconnected</span>
<br>
<label>Websocket address:<input id="leapAddress" type="text" maxlength="18"/></label>
<h3>Leap Motion:</h3>
<span id="leapIndicator">disconnected</span>
<br>
<label>Websocket address:<input id="leapAddress" type="text" maxlength="18"/></label>
</div>

</div>
Expand Down
2 changes: 2 additions & 0 deletions src/main.js
Expand Up @@ -118,6 +118,8 @@ POOLVR.onLoad = function () {
Gamepads.setGamepadCommands(gamepad.index, POOLVR.vrGamepadBCommands);
} else {
console.log('OpenVR controller A connected');
POOLVR.vrGamepadIndicator.textContent = gamepad.id + ' available';
POOLVR.vrGamepadIndicator.style['background-color'] = 'rgba(20, 160, 20, 0.8)';
gamepadA = gamepad;
Gamepads.setGamepadCommands(gamepad.index, POOLVR.vrGamepadACommands);
POOLVR.openVRTool.mesh.visible = true;
Expand Down
9 changes: 9 additions & 0 deletions src/menu.js
Expand Up @@ -59,6 +59,10 @@ POOLVR.setupMenu = function () {
volumeInput.value = POOLVR.config.soundVolume;
});

POOLVR.vrDisplayIndicator = document.getElementById('vrDisplayIndicator');

POOLVR.vrGamepadIndicator = document.getElementById('vrGamepadIndicator');

var useBasicMaterialsInput = document.getElementById('useBasicMaterials');
useBasicMaterialsInput.checked = POOLVR.config.useBasicMaterials;

Expand Down Expand Up @@ -165,6 +169,11 @@ POOLVR.setupMenu = function () {
vrButton.style.display = 'none';
vrButton.disabled = true;

} else {

POOLVR.vrDisplayIndicator.textContent = vrDisplay.displayName + ' available';
POOLVR.vrDisplayIndicator.style['background-color'] = 'rgba(20, 160, 20, 0.8)';

}

} ).catch( function (err) {
Expand Down

0 comments on commit 9d16513

Please sign in to comment.