Bladeren bron

Change `horizonPitch` and `horizonRoll` parameters from radians to degrees to match other parameters.

pull/234/head
Matthew Petroff 8 jaren geleden
bovenliggende
commit
f21d3b614d
2 gewijzigde bestanden met toevoegingen van 6 en 5 verwijderingen
  1. +2
    -1
      doc/json-config-parameters.md
  2. +4
    -4
      src/js/pannellum.js

+ 2
- 1
doc/json-config-parameters.md Bestand weergeven

@@ -137,7 +137,8 @@ Specifies a URL for a preview image to display before the panorama is loaded.

### `horizonPitch` and `horizonRoll` (number)

Specifies pitch / roll of image horizon (for correcting non-leveled panoramas).
Specifies pitch / roll of image horizon, in degrees (for correcting
non-leveled panoramas).


### `hotSpots` (array)


+ 4
- 4
src/js/pannellum.js Bestand weergeven

@@ -491,9 +491,9 @@ function parseGPanoXMP(image) {
}
if (xmp.horizonPitch !== null && xmp.horizonRoll !== null) {
if (specifiedPhotoSphereExcludes.indexOf('horizonPitch') < 0)
config.horizonPitch = xmp.horizonPitch / 180 * Math.PI;
config.horizonPitch = xmp.horizonPitch;
if (specifiedPhotoSphereExcludes.indexOf('horizonRoll') < 0)
config.horizonRoll = xmp.horizonRoll / 180 * Math.PI;
config.horizonRoll = xmp.horizonRoll;
}
// TODO: add support for initial view settings
@@ -1388,9 +1388,9 @@ function renderInit() {
try {
var params = {};
if (config.horizonPitch !== undefined)
params.horizonPitch = config.horizonPitch;
params.horizonPitch = config.horizonPitch * Math.PI / 180;
if (config.horizonRoll !== undefined)
params.horizonRoll = config.horizonRoll;
params.horizonRoll = config.horizonRoll * Math.PI / 180;
renderer.init(panoImage, config.type, config.dynamic, config.haov * Math.PI / 180, config.vaov * Math.PI / 180, config.vOffset * Math.PI / 180, renderInitCallback, params);
if (config.dynamic !== true) {
// Allow image to be garbage collected


Laden…
Annuleren
Opslaan