Kaynağa Gözat

Merge remote-tracking branch 'upstream/master'

Conflicts:
	src/standalone/standalone.js
pull/169/head
Janne Cederberg 8 yıl önce
ebeveyn
işleme
851c6a6fee
2 değiştirilmiş dosya ile 10 ekleme ve 8 silme
  1. +3
    -3
      src/js/libpannellum.js
  2. +7
    -5
      src/standalone/standalone.js

+ 3
- 3
src/js/libpannellum.js Dosyayı Görüntüle

@@ -464,7 +464,7 @@ function Renderer(container, image, imageType, dynamic) {
z = Math.cos(horizonRoll) * Math.cos(horizonPitch) * Math.sin(pitch) +
Math.cos(pitch) * (-Math.cos(yaw) * Math.sin(horizonPitch) +
Math.cos(horizonPitch) * Math.sin(horizonRoll) * Math.sin(yaw));
pitch = Math.asin(z);
pitch = Math.asin(Math.max(Math.min(z, 1), -1));
yaw = Math.atan2(y, x);

// Calculate roll
@@ -474,9 +474,9 @@ function Renderer(container, image, imageType, dynamic) {
Math.cos(orig_pitch) * (Math.cos(horizonPitch) * Math.sin(horizonRoll) * Math.cos(orig_yaw) +
Math.sin(orig_yaw) * Math.sin(horizonPitch))],
w = [-Math.cos(pitch) * Math.sin(yaw), Math.cos(pitch) * Math.cos(yaw)];
var roll_adj = Math.acos((v[0]*w[0] + v[1]*w[1]) /
var roll_adj = Math.acos(Math.max(Math.min((v[0]*w[0] + v[1]*w[1]) /
(Math.sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]) *
Math.sqrt(w[0]*w[0]+w[1]*w[1])));
Math.sqrt(w[0]*w[0]+w[1]*w[1])), 1), -1));
if (v[2] < 0)
roll_adj = 2 * Math.PI - roll_adj;
roll += roll_adj;


+ 7
- 5
src/standalone/standalone.js Dosyayı Görüntüle

@@ -18,13 +18,15 @@ function parseURLParameters() {
for (var i = 0; i < URL.length; i++) {
var option = URL[i].split('=')[0];
var value = URL[i].split('=')[1];
if ( value == '' ) continue; // skip options with empty values in URL config
if (value == '')
continue; // Skip options with empty values in URL config
switch(option) {
case 'hfov': case 'pitch': case 'yaw': case 'haov': case 'vaov': case 'vOffset':
case 'minHfov': case 'maxHfov': case 'minPitch': case 'maxPitch': case 'minYaw': case 'maxYaw':
configFromURL[option] = value;
case 'hfov': case 'pitch': case 'yaw': case 'haov': case 'vaov':
case 'minHfov': case 'maxHfov': case 'minPitch': case 'maxPitch':
case 'minYaw': case 'maxYaw': case 'vOffset': case 'autoRotate':
configFromURL[option] = Number(value);
break;
case 'autoLoad': case 'autoRotate': case 'ignoreGPanoXMP':
case 'autoLoad': case 'ignoreGPanoXMP':
configFromURL[option] = JSON.parse(value);
break;
case 'tour':


Yükleniyor…
İptal
Kaydet