From 325c7525c7cd5dbb7f3ee597f5e4a3d89ba8c3f9 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Mon, 8 Feb 2016 13:43:41 -0800 Subject: [PATCH] work --- .../DomainContent/CellScience/Scripts/zoom.js | 39 ++++++++++--------- .../CellScience/backgroundMusicAC.js | 27 +++++++++++-- .../CellScience/importCellScience.js | 1 + 3 files changed, 45 insertions(+), 22 deletions(-) diff --git a/unpublishedScripts/DomainContent/CellScience/Scripts/zoom.js b/unpublishedScripts/DomainContent/CellScience/Scripts/zoom.js index 8b720b7fec..5e5a2d0e55 100644 --- a/unpublishedScripts/DomainContent/CellScience/Scripts/zoom.js +++ b/unpublishedScripts/DomainContent/CellScience/Scripts/zoom.js @@ -61,29 +61,32 @@ } // this.lookAt(data.target, data.location); - + if(data.hasOwnProperty('entryPoint')&&data.hasOwnProperty('target')){ + this.lookAtTarget(data.entryPoint,data.target); + } } } - // this.lookAt = function(targetPosition, avatarPosition) { - // print('GOING TO') - // var direction = Vec3.normalize(Vec3.subtract(MyAvatar.position, targetPosition)); + this.lookAtTarget = function(entryPoint,target) { - // var pitch = Quat.angleAxis(Math.asin(-direction.y) * 180.0 / Math.PI, { - // x: 1, - // y: 0, - // z: 0 - // }); - // var yaw = Quat.angleAxis(Math.atan2(direction.x, direction.z) * 180.0 / Math.PI, { - // x: 0, - // y: 1, - // z: 0 - // }); - // print('JBP ZOOM DEBUG YO') - // MyAvatar.goToLocation(avatarPosition, true, yaw); - // MyAvatar.headYaw = 0; - // } + var direction = Vec3.normalize(Vec3.subtract(entryPoint, target)); + var pitch = Quat.angleAxis(Math.asin(-direction.y) * 180.0 / Math.PI, { + x: 1, + y: 0, + z: 0 + }); + var yaw = Quat.angleAxis(Math.atan2(direction.x, direction.z) * 180.0 / Math.PI, { + x: 0, + y: 1, + z: 0 + }); + + MyAvatar.goToLocation(entryPoint, true, yaw); + + MyAvatar.headYaw = 0; + + } diff --git a/unpublishedScripts/DomainContent/CellScience/backgroundMusicAC.js b/unpublishedScripts/DomainContent/CellScience/backgroundMusicAC.js index b38390ed3c..0ee5b3bf32 100644 --- a/unpublishedScripts/DomainContent/CellScience/backgroundMusicAC.js +++ b/unpublishedScripts/DomainContent/CellScience/backgroundMusicAC.js @@ -7,7 +7,7 @@ var soundMap = [{ y: 15850, z: 15850 }, - volume: 0.4, + volume: 0.1, loop: true } }, { @@ -19,7 +19,7 @@ var soundMap = [{ y: 15950, z: 15950 }, - volume: 0.4, + volume: 0.1, loop: true } }, { @@ -31,7 +31,7 @@ var soundMap = [{ y: 15650, z: 15650 }, - volume: 0.4, + volume: 0.1, loop: true } }, { @@ -43,7 +43,7 @@ var soundMap = [{ y: 15750, z: 15750 }, - volume: 0.4, + volume: 0.1, loop: true } } @@ -93,5 +93,24 @@ function startCheckDownloadedTimers() { }); } +Script.scriptEnding.connect(function() { + soundMap.forEach(function(soundData) { + + if (soundData.hasOwnProperty("injector")) { + soundData.injector.stop(); + } + + if (soundData.hasOwnProperty("downloadTimer")) { + Script.clearInterval(soundData.downloadTimer); + } + + if (soundData.hasOwnProperty("playingInterval")) { + Script.clearInterval(soundData.playingInterval); + } + + }); + +}); + loadSounds(); startCheckDownloadedTimers(); \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/CellScience/importCellScience.js b/unpublishedScripts/DomainContent/CellScience/importCellScience.js index fe4a3389e1..6be5311f9d 100644 --- a/unpublishedScripts/DomainContent/CellScience/importCellScience.js +++ b/unpublishedScripts/DomainContent/CellScience/importCellScience.js @@ -115,6 +115,7 @@ var scenes = [{ radius: 500, number: 10, userData: JSON.stringify({ + entryPoint:locations.cellLayout[1], location: locations.cellLayout[1], baseURL: baseLocation }),