photo-sphere-viewer
Advanced tools
Comparing version 4.5.0 to 4.5.1
/*! | ||
* Photo Sphere Viewer 4.5.0 | ||
* Photo Sphere Viewer 4.5.1 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -444,4 +444,2 @@ * @copyright 2015-2022 Damien "Mistic" Sorel | ||
this.__cleanup(); | ||
if (this.prop.geom) { | ||
@@ -495,2 +493,4 @@ this.prop.geom.setAttribute('uv', this.prop.originalUvs.clone()); | ||
this.__cleanup(); | ||
if (textureData.texture) { | ||
@@ -513,2 +513,13 @@ for (var i = 0; i < 6; i++) { | ||
} | ||
} else { | ||
var _material = new THREE.MeshBasicMaterial({ | ||
opacity: 0, | ||
transparent: true | ||
}); | ||
for (var _i = 0; _i < 6; _i++) { | ||
for (var _j = 0; _j < NB_GROUPS_BY_FACE; _j++) { | ||
this.materials.push(_material); | ||
} | ||
} | ||
} // this.psv.renderer.scene.add(createWireFrame(this.prop.geom)); | ||
@@ -761,2 +772,3 @@ | ||
CubemapTilesAdapter.supportsTransition = false; | ||
CubemapTilesAdapter.supportsPreload = false; | ||
@@ -763,0 +775,0 @@ exports.CubemapTilesAdapter = CubemapTilesAdapter; |
/*! | ||
* Photo Sphere Viewer 4.5.0 | ||
* Photo Sphere Viewer 4.5.1 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -242,2 +242,3 @@ * @copyright 2015-2022 Damien "Mistic" Sorel | ||
CubemapAdapter.supportsTransition = true; | ||
CubemapAdapter.supportsPreload = true; | ||
@@ -244,0 +245,0 @@ exports.CUBE_ARRAY = CUBE_ARRAY; |
/*! | ||
* Photo Sphere Viewer 4.5.0 | ||
* Photo Sphere Viewer 4.5.1 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -488,4 +488,2 @@ * @copyright 2015-2022 Damien "Mistic" Sorel | ||
this.__cleanup(); | ||
if (this.prop.geom) { | ||
@@ -565,10 +563,19 @@ this.prop.geom.setAttribute('uv', this.prop.originalUvs.clone()); | ||
this.__cleanup(); | ||
var material; | ||
if (textureData.texture) { | ||
var material = new THREE.MeshBasicMaterial({ | ||
material = new THREE.MeshBasicMaterial({ | ||
map: textureData.texture | ||
}); | ||
} else { | ||
material = new THREE.MeshBasicMaterial({ | ||
opacity: 0, | ||
transparent: true | ||
}); | ||
} | ||
for (var i = 0; i < this.NB_GROUPS; i++) { | ||
this.materials.push(material); | ||
} | ||
for (var i = 0; i < this.NB_GROUPS; i++) { | ||
this.materials.push(material); | ||
} // this.psv.renderer.scene.add(createWireFrame(this.prop.geom)); | ||
@@ -895,2 +902,3 @@ | ||
EquirectangularTilesAdapter.supportsTransition = false; | ||
EquirectangularTilesAdapter.supportsPreload = false; | ||
@@ -897,0 +905,0 @@ exports.EquirectangularTilesAdapter = EquirectangularTilesAdapter; |
@@ -562,2 +562,7 @@ import { Texture, Vector3, Euler, Mesh, Intersection } from 'three'; | ||
/** | ||
* @summary Indicates if the adapter supports preload | ||
*/ | ||
static supportsPreload: boolean; | ||
constructor(parent: Viewer); | ||
@@ -564,0 +569,0 @@ |
/*! | ||
* Photo Sphere Viewer 4.5.0 | ||
* Photo Sphere Viewer 4.5.1 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -338,3 +338,3 @@ * @copyright 2015-2022 Damien "Mistic" Sorel | ||
// get the 4 points necessary to compute the current movement | ||
// one point before and two points before current | ||
// one point before and two points after the current | ||
var workPoints = []; | ||
@@ -374,7 +374,10 @@ | ||
workPoints2.push([workPoints[_i][0] + k * 2 * Math.PI, workPoints[_i][1]]); | ||
} // only keep the curve for the current movement | ||
} | ||
var curve = this.__getCurvePoints(workPoints2, 0.6, NUM_STEPS); // __debugCurve(this.markers, curve); | ||
// only keep the curve for the current movement | ||
this.state.curve = this.__getCurvePoints(workPoints2, 0.6, NUM_STEPS).slice(NUM_STEPS, NUM_STEPS * 2); | ||
this.state.curve = curve.slice(NUM_STEPS, NUM_STEPS * 2); | ||
if (this.state.idx !== -1) { | ||
@@ -452,3 +455,3 @@ this.state.remainingPause = this.keypoints[this.state.idx].pause; | ||
latitude: this.state.startPt[1] + (this.state.endPt[1] - this.state.startPt[1]) * progress | ||
}, true); | ||
}); | ||
} | ||
@@ -455,0 +458,0 @@ /** |
/*! | ||
* Photo Sphere Viewer 4.5.0 | ||
* Photo Sphere Viewer 4.5.1 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -4,0 +4,0 @@ * @copyright 2015-2022 Damien "Mistic" Sorel |
/*! | ||
* Photo Sphere Viewer 4.5.0 | ||
* Photo Sphere Viewer 4.5.1 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -4,0 +4,0 @@ * @copyright 2015-2022 Damien "Mistic" Sorel |
/*! | ||
* Photo Sphere Viewer 4.5.0 | ||
* Photo Sphere Viewer 4.5.1 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -4,0 +4,0 @@ * @copyright 2015-2022 Damien "Mistic" Sorel |
/*! | ||
* Photo Sphere Viewer 4.5.0 | ||
* Photo Sphere Viewer 4.5.1 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -4,0 +4,0 @@ * @copyright 2015-2022 Damien "Mistic" Sorel |
/*! | ||
* Photo Sphere Viewer 4.5.0 | ||
* Photo Sphere Viewer 4.5.1 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -4,0 +4,0 @@ * @copyright 2015-2022 Damien "Mistic" Sorel |
/*! | ||
* Photo Sphere Viewer 4.5.0 | ||
* Photo Sphere Viewer 4.5.1 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -1269,3 +1269,3 @@ * @copyright 2015-2022 Damien "Mistic" Sorel | ||
if (!this.config.preload || !this.isServerSide()) { | ||
if (!this.config.preload) { | ||
return; | ||
@@ -1272,0 +1272,0 @@ } |
/*! | ||
* Photo Sphere Viewer 4.5.0 | ||
* Photo Sphere Viewer 4.5.1 | ||
* @copyright 2014-2015 Jérémy Heleine | ||
@@ -4,0 +4,0 @@ * @copyright 2015-2022 Damien "Mistic" Sorel |
{ | ||
"name": "photo-sphere-viewer", | ||
"version": "4.5.0", | ||
"version": "4.5.1", | ||
"description": "A JavaScript library to display Photo Sphere panoramas", | ||
@@ -98,4 +98,4 @@ "homepage": "https://photo-sphere-viewer.js.org", | ||
"dev:serve": "live-server --watch=dist,example --open=example", | ||
"dev:watch": "npm run compile:prepare && npm run compile:rollup -- --watch" | ||
"dev:watch": "npm run compile -- --watch" | ||
} | ||
} |
@@ -31,2 +31,10 @@ import { PSVError } from '../PSVError'; | ||
/** | ||
* @summary Indicates if the adapter supports preload | ||
* @type {boolean} | ||
* @readonly | ||
* @static | ||
*/ | ||
static supportsPreload = false; | ||
/** | ||
* @param {PSV.Viewer} psv | ||
@@ -33,0 +41,0 @@ */ |
@@ -71,2 +71,3 @@ import * as THREE from 'three'; | ||
static supportsTransition = false; | ||
static supportsPreload = false; | ||
@@ -201,4 +202,2 @@ /** | ||
this.__cleanup(); | ||
if (this.prop.geom) { | ||
@@ -245,2 +244,4 @@ this.prop.geom.setAttribute('uv', this.prop.originalUvs.clone()); | ||
setTexture(mesh, textureData) { | ||
this.__cleanup(); | ||
if (textureData.texture) { | ||
@@ -262,3 +263,12 @@ for (let i = 0; i < 6; i++) { | ||
} | ||
else { | ||
const material = new THREE.MeshBasicMaterial({ opacity: 0, transparent: true }); | ||
for (let i = 0; i < 6; i++) { | ||
for (let j = 0; j < NB_GROUPS_BY_FACE; j++) { | ||
this.materials.push(material); | ||
} | ||
} | ||
} | ||
// this.psv.renderer.scene.add(createWireFrame(this.prop.geom)); | ||
@@ -265,0 +275,0 @@ |
@@ -36,2 +36,3 @@ import * as THREE from 'three'; | ||
static supportsTransition = true; | ||
static supportsPreload = true; | ||
@@ -38,0 +39,0 @@ /** |
@@ -91,2 +91,3 @@ import * as THREE from 'three'; | ||
static supportsTransition = false; | ||
static supportsPreload = false; | ||
@@ -242,4 +243,2 @@ /** | ||
this.__cleanup(); | ||
if (this.prop.geom) { | ||
@@ -305,8 +304,14 @@ this.prop.geom.setAttribute('uv', this.prop.originalUvs.clone()); | ||
setTexture(mesh, textureData) { | ||
this.__cleanup(); | ||
let material; | ||
if (textureData.texture) { | ||
const material = new THREE.MeshBasicMaterial({ map: textureData.texture }); | ||
material = new THREE.MeshBasicMaterial({ map: textureData.texture }); | ||
} | ||
else { | ||
material = new THREE.MeshBasicMaterial({ opacity: 0, transparent: true }); | ||
} | ||
for (let i = 0; i < this.NB_GROUPS; i++) { | ||
this.materials.push(material); | ||
} | ||
for (let i = 0; i < this.NB_GROUPS; i++) { | ||
this.materials.push(material); | ||
} | ||
@@ -313,0 +318,0 @@ |
@@ -23,2 +23,3 @@ import * as THREE from 'three'; | ||
static supportsTransition = true; | ||
static supportsPreload = true; | ||
@@ -25,0 +26,0 @@ /** |
@@ -275,3 +275,3 @@ import { AbstractPlugin, CONSTANTS, PSVError, utils } from '../..'; | ||
// get the 4 points necessary to compute the current movement | ||
// one point before and two points before current | ||
// one point before and two points after the current | ||
const workPoints = []; | ||
@@ -316,5 +316,7 @@ if (this.state.idx === -1) { | ||
const curve = this.__getCurvePoints(workPoints2, 0.6, NUM_STEPS); | ||
// __debugCurve(this.markers, curve); | ||
// only keep the curve for the current movement | ||
this.state.curve = this.__getCurvePoints(workPoints2, 0.6, NUM_STEPS) | ||
.slice(NUM_STEPS, NUM_STEPS * 2); | ||
this.state.curve = curve.slice(NUM_STEPS, NUM_STEPS * 2); | ||
@@ -390,3 +392,3 @@ if (this.state.idx !== -1) { | ||
latitude : this.state.startPt[1] + (this.state.endPt[1] - this.state.startPt[1]) * progress, | ||
}, true); | ||
}); | ||
} | ||
@@ -462,1 +464,37 @@ | ||
} | ||
let debugMarkers = []; | ||
function __debugCurve(markers, curve) { // eslint-disable-line no-unused-vars | ||
debugMarkers.forEach((marker) => { | ||
try { | ||
markers.removeMarker(marker.id); | ||
} | ||
catch (e) { | ||
// noop | ||
} | ||
}); | ||
debugMarkers = [ | ||
markers.addMarker({ | ||
id : 'autorotate-path', | ||
polylineRad: curve, | ||
svgStyle : { | ||
stroke : 'white', | ||
strokeWidth: '2px', | ||
}, | ||
}), | ||
]; | ||
curve.forEach((pos, i) => { | ||
debugMarkers.push(markers.addMarker({ | ||
id : 'autorotate-path-' + i, | ||
circle : 5, | ||
longitude: pos[0], | ||
latitude : pos[1], | ||
svgStyle : { | ||
fill: 'black', | ||
}, | ||
})); | ||
}); | ||
} |
@@ -680,3 +680,3 @@ import * as THREE from 'three'; | ||
__preload(node) { | ||
if (!this.config.preload || !this.isServerSide()) { | ||
if (!this.config.preload) { | ||
return; | ||
@@ -683,0 +683,0 @@ } |
@@ -544,2 +544,3 @@ import * as THREE from 'three'; | ||
__startMove(evt) { | ||
this.psv.stopAutorotate(); | ||
this.psv.stopAnimation() | ||
@@ -546,0 +547,0 @@ .then(() => { |
@@ -124,5 +124,10 @@ import * as THREE from 'three'; | ||
preloadPanorama(panorama) { | ||
return this.psv.adapter.loadTexture(panorama); | ||
if (this.psv.adapter.constructor.supportsPreload) { | ||
return this.psv.adapter.loadTexture(panorama); | ||
} | ||
else { | ||
return Promise.resolve(); | ||
} | ||
} | ||
} |
@@ -725,3 +725,2 @@ import * as THREE from 'three'; | ||
this.dynamics.position.setValue(cleanPosition); | ||
this.stopAutorotate(); | ||
} | ||
@@ -728,0 +727,0 @@ |
@@ -21,2 +21,7 @@ import { Mesh } from 'three'; | ||
/** | ||
* @summary Indicates if the adapter supports preload | ||
*/ | ||
static supportsPreload: boolean; | ||
constructor(parent: Viewer); | ||
@@ -23,0 +28,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2004135
33721