diff --git a/poolvr.css b/poolvr.css index e3763f9..186c5d6 100644 --- a/poolvr.css +++ b/poolvr.css @@ -1,7 +1,7 @@ #overlay { position: absolute; left: 1.25vw; - right: 78vw; + right: 77vw; top: 2.25vw; /*width: 85%;*/ /*right: 2vw;*/ @@ -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%; @@ -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; @@ -76,7 +94,7 @@ h1, h2, h3 { } h1 { margin-left: 1.75vh; - margin-top: 1.75vh; + margin-top: 0.75vh; font-size: 18pt; } h2 { diff --git a/poolvr.py b/poolvr.py index c1fb861..4e86a86 100644 --- a/poolvr.py +++ b/poolvr.py @@ -11,7 +11,6 @@ from jinja2 import Environment, FileSystemLoader -import pool_table _logger = logging.getLogger(__name__) @@ -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, @@ -54,10 +51,13 @@ } +INCH2METER = 0.0254 + + POOLVR = { 'version': PACKAGE['version'], 'config': { - 'gravity' : 9.8, + 'gravity' : 9.81, 'useBasicMaterials' : True, 'useShadowMap' : False, 'useSpotLight' : True, @@ -65,7 +65,7 @@ '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', @@ -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: diff --git a/poolvr_template.html b/poolvr_template.html index 1892210..4ae437a 100644 --- a/poolvr_template.html +++ b/poolvr_template.html @@ -40,25 +40,35 @@

poolvr {{ version if version else '' }}

{{version_content if version_con
--> - +
+

Sound:

+ + +
- +
+

VR:

+ VR display is not available +
+
+ VR gamepad is not available +
-

Graphics:

- -
- - -
- +

Graphics:

+ +
+ + +
+
-

Leap Motion:

- disconnected -
- +

Leap Motion:

+ disconnected +
+
diff --git a/src/main.js b/src/main.js index b130677..3cc59ba 100644 --- a/src/main.js +++ b/src/main.js @@ -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; diff --git a/src/menu.js b/src/menu.js index 4179668..b031e4b 100644 --- a/src/menu.js +++ b/src/menu.js @@ -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; @@ -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) {