Skip to content

Commit

Permalink
Release 1.1.1
Browse files Browse the repository at this point in the history
Limiters now use faceSize parameter of scene
  • Loading branch information
Erik Hughes committed Feb 21, 2017
1 parent ecf1c48 commit 5aafe37
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ coverage
# Compiled binary and documentation
build
docs
stages

# Dependency directories
node_modules
Expand Down
2 changes: 1 addition & 1 deletion dist/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui"><meta http-equiv="x-ua-compatible" content="ie=edge"><style>@-ms-viewport { width: device-width; }</style><title>VR 360 Player</title><link href="vr360player.css" rel="stylesheet"></head><body><div id="vr-360-player"></div><menu class="shown" id="controls"><input class="slider" type="range" min="-0.3" max="0.3" step="0.01" id="projection-x" style="display: none"><a class="icon_orientation_drag" id="sensor-toggler" style="display: none"></a><a class="icon_vr" id="mode-toggler"></a></menu><i id="crosshair" style="display: none"></i><script src="vr360player.js"></script><script>var player = new VR360Player.default(
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui"><meta http-equiv="x-ua-compatible" content="ie=edge"><style>@-ms-viewport { width: device-width; }</style><title>VR 360 Player</title><link href="vr360player.css" rel="stylesheet"></head><body><div id="vr-360-player"></div><menu class="shown" id="controls"><input class="slider" type="range" min="-0.3" max="0.3" step="0.01" id="projection-x" style="display: none;"><a class="icon_orientation_drag" id="sensor-toggler" style="display: none;"></a><a class="icon_vr" id="mode-toggler"></a></menu><i id="crosshair" style="display: none;"></i><script src="vr360player.js"></script><script>var player = new VR360Player.default(
document.getElementById('vr-360-player'),
'assets/stage.json'
);</script></body></html>
20 changes: 10 additions & 10 deletions dist/vr360player.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "vr-360-player",
"version": "1.1.0",
"version": "1.1.1",
"description": "Virtual reality 360 degree player for 36 Technology Ltd, INC. by Trutoo AB.",
"main": "build/vr360player.js",
"scripts": {
"start": "webpack-dev-server --content-base build --inline --progress --host 0.0.0.0 --port 9202",
"prestart": "rimraf build/ && copyfiles -u 2 src/assets/stage.json src/assets/tiles/** build/assets/",
"prestart": "rimraf build/ && copyfiles -u 2 'src/assets/stage.json' 'src/assets/tiles/**' 'build/assets/'",
"build:dev": "rimraf build/ && webpack --progress --profile --env.development",
"build:prod": "rimraf dist/ && webpack --progress --profile --bail --env.production",
"deploy": "npm run build:prod && ./deploy.sh"
Expand Down
21 changes: 11 additions & 10 deletions src/player/Entities/Scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ export interface ISceneData {
/** Class used to create a cubic image layer in the viewer. */
export default class Scene implements ILifeCycle {

static PANORAMA_LIMITER = Marzipano.RectilinearView.limit.traditional(
4096, 120 * Math.PI / 180);

static STEREOSCOPIC_LIMITER = Marzipano.RectilinearView.limit.traditional(
4096, 90 * Math.PI / 180);

/** DEPRECATED // Avoid until fixed
static PANORAMA_LIMITER = Marzipano.util.compose(
Marzipano.RectilinearView.limit.vfov(110 * Math.PI / 180, 110 * Math.PI / 180),
Expand All @@ -45,6 +39,7 @@ export default class Scene implements ILifeCycle {
Marzipano.RectilinearView.limit.pitch(-Math.PI / 2, Math.PI / 2));
*/


private _id: string;
private _name: string;
private _levels: Level[];
Expand All @@ -53,6 +48,9 @@ export default class Scene implements ILifeCycle {
private _linkHotspots: PairSet<LinkHotspot>[];
private _infoHotspots: PairSet<InfoHotspot>[];

private _panoramaLimiter: any;
private _stereoscopicLimiter: any;

private _player: Player;
private _geometry: any;
private _projectionCenter: Vector4;
Expand Down Expand Up @@ -81,11 +79,14 @@ export default class Scene implements ILifeCycle {
* Using data specified in [[ISceneData]] to create the scene's layers for both eyes and hotspots.
*/
onCreate(): boolean {
this._panoramaLimiter = Marzipano.RectilinearView.limit.traditional(this._faceSize, 120 * Math.PI / 180);
this._stereoscopicLimiter = Marzipano.RectilinearView.limit.traditional(this._faceSize, 90 * Math.PI / 180);

this._geometry = new Marzipano.CubeGeometry(this._levels);
this._projectionCenter = new Vector4(0, 0);
this._views = new PairSet(
new Marzipano.RectilinearView(this._initialViewParameters, Scene.PANORAMA_LIMITER),
new Marzipano.RectilinearView(this._initialViewParameters, Scene.STEREOSCOPIC_LIMITER)
new Marzipano.RectilinearView(this._initialViewParameters, this._panoramaLimiter),
new Marzipano.RectilinearView(this._initialViewParameters, this._stereoscopicLimiter)
);

this.createLayer(this._player.viewer.stage(), this._views.primary, 'left', { relativeWidth: 0.5, relativeX: 0 });
Expand All @@ -99,11 +100,11 @@ export default class Scene implements ILifeCycle {

// Change layer size depending on mode
if (this._player.mode instanceof PanoramaMode) {
this._views.primary.setLimiter(Scene.PANORAMA_LIMITER);
this._views.primary.setLimiter(this._panoramaLimiter);
this._layers.primary.setEffects({ rect: { relativeWidth: 1 } });
this._hotspots.primary.setRect(this._layers.primary.effects().rect);
} else {
this._views.primary.setLimiter(Scene.STEREOSCOPIC_LIMITER);
this._views.primary.setLimiter(this._stereoscopicLimiter);
this._layers.primary.setEffects({ rect: { relativeWidth: 0.5 } });
this._hotspots.primary.setRect(this._layers.primary.effects().rect);
stage.addLayer(this._layers.secondary);
Expand Down

0 comments on commit 5aafe37

Please sign in to comment.