zoom differently o avoid bug

This commit is contained in:
James B. Pollack 2016-02-08 16:07:54 -08:00
parent 0368bfc4ee
commit 937ba3b796
2 changed files with 15 additions and 18 deletions

View file

@ -45,31 +45,27 @@
}
this.enterEntity = function(entityID) {
// print(' ENTERED A BOUNDARY ENTITY, SHOULD ZOOM', entityID)
print('JBP ENTERED A BOUNDARY ENTITY, SHOULD ZOOM', entityID)
var data = JSON.parse(Entities.getEntityProperties(this.entityId).userData);
// print(' DATA IS::' + data)
print('JBP DATA IS::' + data)
if (data != null) {
// print("Teleporting to (" + data.location.x + ", " + data.location.y + ", " + data.location.z + ")");
if (self.teleportSound.downloaded) {
//print("play sound");
MyAvatar.position = data.location;
Audio.playSound(self.teleportSound, self.soundOptions);
print("JBP Teleporting to (" + data.location.x + ", " + data.location.y + ", " + data.location.z + ")");
} else {
//print("not downloaded");
}
MyAvatar.position = data.location;
// if (data.hasOwnProperty('entryPoint') && data.hasOwnProperty('target')) {
// this.lookAtTarget(data.entryPoint, data.target);
// }
// else{
// this.lookAt(data.target, data.location);
if(data.hasOwnProperty('entryPoint')&&data.hasOwnProperty('target')){
this.lookAtTarget(data.entryPoint,data.target);
}
// }
}
}
this.lookAtTarget = function(entryPoint,target) {
print('JBP SHOULD LOOK AT TARGET')
var direction = Vec3.normalize(Vec3.subtract(entryPoint, target));
var pitch = Quat.angleAxis(Math.asin(-direction.y) * 180.0 / Math.PI, {
x: 1,

View file

@ -5,7 +5,7 @@
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
var version = 1016;
var version = 1021;
var cellLayout;
var baseLocation = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/";
@ -115,8 +115,9 @@ var scenes = [{
radius: 500,
number: 10,
userData: JSON.stringify({
entryPoint: locations.cellLayout[1],
target: locations.cellLayout[1],
location: locations.cellLayout[0],
location: locations.cellLayout[1],
baseURL: baseLocation
}),
script: "zoom.js?" + version,
@ -597,7 +598,7 @@ function ImportScene(scene) {
CreateInstances(scene);
CreateBoundary(scene);
CreateBackgroundAudio(scene.name, scene.location, scene.dimensions);
// CreateBackgroundAudio(scene.name, scene.location, scene.dimensions);
// print("done " + scene.name);