This commit is contained in:
James B. Pollack 2016-02-08 13:43:41 -08:00
parent a80641a2c4
commit 325c7525c7
3 changed files with 45 additions and 22 deletions

View file

@ -61,29 +61,32 @@
} }
// this.lookAt(data.target, data.location); // this.lookAt(data.target, data.location);
if(data.hasOwnProperty('entryPoint')&&data.hasOwnProperty('target')){
this.lookAtTarget(data.entryPoint,data.target);
}
} }
} }
// this.lookAt = function(targetPosition, avatarPosition) { this.lookAtTarget = function(entryPoint,target) {
// print('GOING TO')
// var direction = Vec3.normalize(Vec3.subtract(MyAvatar.position, targetPosition));
// var pitch = Quat.angleAxis(Math.asin(-direction.y) * 180.0 / Math.PI, { var direction = Vec3.normalize(Vec3.subtract(entryPoint, target));
// x: 1, var pitch = Quat.angleAxis(Math.asin(-direction.y) * 180.0 / Math.PI, {
// y: 0, x: 1,
// z: 0 y: 0,
// }); z: 0
// var yaw = Quat.angleAxis(Math.atan2(direction.x, direction.z) * 180.0 / Math.PI, { });
// x: 0, var yaw = Quat.angleAxis(Math.atan2(direction.x, direction.z) * 180.0 / Math.PI, {
// y: 1, x: 0,
// z: 0 y: 1,
// }); z: 0
// print('JBP ZOOM DEBUG YO') });
// MyAvatar.goToLocation(avatarPosition, true, yaw);
// MyAvatar.headYaw = 0; MyAvatar.goToLocation(entryPoint, true, yaw);
// }
MyAvatar.headYaw = 0;
}

View file

@ -7,7 +7,7 @@ var soundMap = [{
y: 15850, y: 15850,
z: 15850 z: 15850
}, },
volume: 0.4, volume: 0.1,
loop: true loop: true
} }
}, { }, {
@ -19,7 +19,7 @@ var soundMap = [{
y: 15950, y: 15950,
z: 15950 z: 15950
}, },
volume: 0.4, volume: 0.1,
loop: true loop: true
} }
}, { }, {
@ -31,7 +31,7 @@ var soundMap = [{
y: 15650, y: 15650,
z: 15650 z: 15650
}, },
volume: 0.4, volume: 0.1,
loop: true loop: true
} }
}, { }, {
@ -43,7 +43,7 @@ var soundMap = [{
y: 15750, y: 15750,
z: 15750 z: 15750
}, },
volume: 0.4, volume: 0.1,
loop: true 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(); loadSounds();
startCheckDownloadedTimers(); startCheckDownloadedTimers();

View file

@ -115,6 +115,7 @@ var scenes = [{
radius: 500, radius: 500,
number: 10, number: 10,
userData: JSON.stringify({ userData: JSON.stringify({
entryPoint:locations.cellLayout[1],
location: locations.cellLayout[1], location: locations.cellLayout[1],
baseURL: baseLocation baseURL: baseLocation
}), }),