Skip to content

Commit

Permalink
Release 3.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mistic100 committed Mar 7, 2020
1 parent 8a112f8 commit 244ba61
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 31 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
The MIT License (MIT)

Copyright (c) 2015 Jérémy Heleine
Copyright (c) 2016-2019 Damien Sorel
Copyright (c) 2016-2020 Damien Sorel

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions dist/photo-sphere-viewer.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* Photo Sphere Viewer 3.5.1
* Photo Sphere Viewer 3.6.0
* Copyright (c) 2014-2015 Jérémy Heleine
* Copyright (c) 2015-2019 Damien "Mistic" Sorel
* Copyright (c) 2015-2020 Damien "Mistic" Sorel
* Licensed under MIT (https://opensource.org/licenses/MIT)
*/
.psv-container {
Expand Down
30 changes: 8 additions & 22 deletions dist/photo-sphere-viewer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* Photo Sphere Viewer 3.5.1
* Photo Sphere Viewer 3.6.0
* Copyright (c) 2014-2015 Jérémy Heleine
* Copyright (c) 2015-2019 Damien "Mistic" Sorel
* Copyright (c) 2015-2020 Damien "Mistic" Sorel
* Licensed under MIT (https://opensource.org/licenses/MIT)
*/
(function(root, factory) {
Expand Down Expand Up @@ -141,9 +141,9 @@ function PhotoSphereViewer(options) {
throw new PSVError('Canvas is not supported.');
}

// additional scripts if webgl not supported/disabled
if ((!PhotoSphereViewer.SYSTEM.isWebGLSupported || !this.config.webgl) && !PSVUtils.checkTHREE('CanvasRenderer', 'Projector')) {
throw new PSVError('Missing Three.js components: CanvasRenderer, Projector. Get them from three.js-examples package.');
// must support webgl
if (!PhotoSphereViewer.SYSTEM.isWebGLSupported) {
throw new PSVError('WebGL is not supported.');
}

// longitude range must have two values
Expand Down Expand Up @@ -1092,19 +1092,11 @@ PhotoSphereViewer.prototype._setTexture = function(texture) {
PhotoSphereViewer.prototype._createScene = function() {
this.raycaster = new THREE.Raycaster();

this.renderer = PhotoSphereViewer.SYSTEM.isWebGLSupported && this.config.webgl ? new THREE.WebGLRenderer() : new THREE.CanvasRenderer();
this.renderer = new THREE.WebGLRenderer();
this.renderer.setSize(this.prop.size.width, this.prop.size.height);
this.renderer.setPixelRatio(PhotoSphereViewer.SYSTEM.pixelRatio);

var cameraDistance = PhotoSphereViewer.SPHERE_RADIUS;
if (this.prop.isCubemap) {
cameraDistance *= Math.sqrt(3);
}
if (this.config.fisheye) {
cameraDistance += PhotoSphereViewer.SPHERE_RADIUS;
}

this.camera = new THREE.PerspectiveCamera(this.config.default_fov, this.prop.size.width / this.prop.size.height, 1, cameraDistance);
this.camera = new THREE.PerspectiveCamera(this.config.default_fov, this.prop.size.width / this.prop.size.height, 1, 3 * PhotoSphereViewer.SPHERE_RADIUS);
this.camera.position.set(0, 0, 0);

this.scene = new THREE.Scene();
Expand Down Expand Up @@ -1146,7 +1138,6 @@ PhotoSphereViewer.prototype._createSphere = function(scale) {

var material = new THREE.MeshBasicMaterial({
side: THREE.DoubleSide, // needs to be DoubleSide for CanvasRenderer
overdraw: PhotoSphereViewer.SYSTEM.isWebGLSupported && this.config.webgl ? 0 : 1
});

var mesh = new THREE.Mesh(geometry, material);
Expand Down Expand Up @@ -1188,15 +1179,11 @@ PhotoSphereViewer.prototype._createCubemap = function(scale) {
for (var i = 0; i < 6; i++) {
materials.push(new THREE.MeshBasicMaterial({
side: THREE.BackSide,
overdraw: PhotoSphereViewer.SYSTEM.isWebGLSupported && this.config.webgl ? 0 : 1
}));
}

var mesh = new THREE.Mesh(geometry, materials);
mesh.position.x -= PhotoSphereViewer.SPHERE_RADIUS * scale;
mesh.position.y -= PhotoSphereViewer.SPHERE_RADIUS * scale;
mesh.position.z -= PhotoSphereViewer.SPHERE_RADIUS * scale;
mesh.applyMatrix(new THREE.Matrix4().makeScale(1, 1, -1));
mesh.scale.set(1, 1, -1);

return mesh;
};
Expand Down Expand Up @@ -1499,7 +1486,6 @@ PhotoSphereViewer.DEFAULTS = {
caption: null,
usexmpdata: true,
pano_data: null,
webgl: true,
min_fov: 30,
max_fov: 90,
default_fov: null,
Expand Down
4 changes: 2 additions & 2 deletions dist/photo-sphere-viewer.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions dist/photo-sphere-viewer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "photo-sphere-viewer",
"version": "3.5.1",
"version": "3.6.0",
"authors": [
{
"name": "Jérémy Heleine",
Expand Down

0 comments on commit 244ba61

Please sign in to comment.