Nikolay Suslov 6 years ago
parent
commit
c86a8c778e
2 changed files with 10 additions and 9 deletions
  1. 2 1
      public/index.html
  2. 8 8
      public/vwf/view/arjs/aframe-ar.js

+ 2 - 1
public/index.html

@@ -9,7 +9,8 @@ Copyright (c) 2014-2018 Nikolai Suslov and the Krestianstvo.org project contribu
 <head>
 
     <meta charset="utf-8">
-    <meta name="viewport" content="initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> 
+    <!-- <meta name="viewport" content="initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" /> -->
+    <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=no">
     
     <title>Live Coding Space 0.2</title>
     <!-- <script type="text/javascript" src="/lib/page.js"></script> -->

+ 8 - 8
public/vwf/view/arjs/aframe-ar.js

@@ -4187,7 +4187,7 @@ THREE.WebAR.updateCameraMeshOrientation = function(vrDisplay, cameraMesh) {
 */
 THREE.WebAR.createVRSeeThroughCamera = function(vrDisplay, near, far) {
   var camera = new THREE.PerspectiveCamera( 60, 
-    window.visualViewport.width / window.visualViewport.height, near, far );
+    window.innerWidth / window.innerHeight, near, far );
   if (vrDisplay) {
     THREE.WebAR.resizeVRSeeThroughCamera(vrDisplay, camera);
   }
@@ -4200,9 +4200,9 @@ THREE.WebAR.createVRSeeThroughCamera = function(vrDisplay, near, far) {
 * @param {THREE.Camera} camera The ThreeJS camera instance to update its projection matrix depending on the current device orientation and see through camera properties.
 */
 THREE.WebAR.resizeVRSeeThroughCamera = function(vrDisplay, camera) {
-  camera.aspect = window.visualViewport.width / window.visualViewport.height;
+  camera.aspect = window.innerWidth / window.innerHeight;
   if (vrDisplay) {
-    var windowWidthBiggerThanHeight = window.visualViewport.width > window.visualViewport.height;
+    var windowWidthBiggerThanHeight = window.innerWidth > window.innerHeight;
     var seeThroughCamera = vrDisplay.getSeeThroughCamera();
     if (seeThroughCamera) {
       var cameraWidthBiggerThanHeight = 
@@ -6092,8 +6092,8 @@ ARjs.Source.prototype.domElementHeight = function(){
 
 ARjs.Source.prototype.onResizeElement = function(){
 	var _this = this
-	var screenWidth = window.visualViewport.width
-	var screenHeight = window.visualViewport.height
+	var screenWidth = window.innerWidth
+	var screenHeight = window.innerHeight
 
 	// sanity check
 	console.assert( arguments.length === 0 )
@@ -6146,7 +6146,7 @@ ARjs.Source.prototype.copyElementSizeTo = function(otherElement){
 
 ARjs.Source.prototype.copyElementSizeTo = function(otherElement){
 
-	if (window.visualViewport.width > window.visualViewport.height)
+	if (window.innerWidth > window.innerHeight)
 	{
 		//landscape
 		otherElement.style.width = this.domElement.style.width
@@ -6158,7 +6158,7 @@ ARjs.Source.prototype.copyElementSizeTo = function(otherElement){
 		//portrait
 		otherElement.style.height = this.domElement.style.height
 		otherElement.style.width = (parseInt(otherElement.style.height) * 4/3)+"px";
-		otherElement.style.marginLeft = ((window.visualViewport.width- parseInt(otherElement.style.width))/2)+"px";
+		otherElement.style.marginLeft = ((window.innerWidth- parseInt(otherElement.style.width))/2)+"px";
 		otherElement.style.marginTop = 0;
 	}
 
@@ -6207,7 +6207,7 @@ ARjs.Source.prototype.onResize	= function(arToolkitContext, renderer, camera){
 
 		this.copyElementSizeTo(arToolkitContext.arucoContext.canvas)	
 	}else if( trackingBackend === 'tango' ){
-		renderer.setSize( window.visualViewport.width, window.visualViewport.height )
+		renderer.setSize( window.innerWidth, window.innerHeight )
 	}else console.assert(false, 'unhandled trackingBackend '+trackingBackend)