mirror of
https://github.com/overte-org/overte.git
synced 2025-07-23 08:03:50 +02:00
zoom differently o avoid bug
This commit is contained in:
parent
0368bfc4ee
commit
937ba3b796
2 changed files with 15 additions and 18 deletions
|
@ -45,31 +45,27 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
this.enterEntity = function(entityID) {
|
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);
|
var data = JSON.parse(Entities.getEntityProperties(this.entityId).userData);
|
||||||
// print(' DATA IS::' + data)
|
print('JBP DATA IS::' + data)
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
// print("Teleporting to (" + data.location.x + ", " + data.location.y + ", " + data.location.z + ")");
|
print("JBP 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);
|
|
||||||
|
|
||||||
} else {
|
MyAvatar.position = data.location;
|
||||||
//print("not downloaded");
|
|
||||||
}
|
// 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) {
|
this.lookAtTarget = function(entryPoint,target) {
|
||||||
|
print('JBP SHOULD LOOK AT TARGET')
|
||||||
var direction = Vec3.normalize(Vec3.subtract(entryPoint, target));
|
var direction = Vec3.normalize(Vec3.subtract(entryPoint, target));
|
||||||
var pitch = Quat.angleAxis(Math.asin(-direction.y) * 180.0 / Math.PI, {
|
var pitch = Quat.angleAxis(Math.asin(-direction.y) * 180.0 / Math.PI, {
|
||||||
x: 1,
|
x: 1,
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
|
|
||||||
var version = 1016;
|
var version = 1021;
|
||||||
var cellLayout;
|
var cellLayout;
|
||||||
var baseLocation = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/";
|
var baseLocation = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/";
|
||||||
|
|
||||||
|
@ -115,8 +115,9 @@ var scenes = [{
|
||||||
radius: 500,
|
radius: 500,
|
||||||
number: 10,
|
number: 10,
|
||||||
userData: JSON.stringify({
|
userData: JSON.stringify({
|
||||||
|
entryPoint: locations.cellLayout[1],
|
||||||
target: locations.cellLayout[1],
|
target: locations.cellLayout[1],
|
||||||
location: locations.cellLayout[0],
|
location: locations.cellLayout[1],
|
||||||
baseURL: baseLocation
|
baseURL: baseLocation
|
||||||
}),
|
}),
|
||||||
script: "zoom.js?" + version,
|
script: "zoom.js?" + version,
|
||||||
|
@ -597,7 +598,7 @@ function ImportScene(scene) {
|
||||||
CreateInstances(scene);
|
CreateInstances(scene);
|
||||||
CreateBoundary(scene);
|
CreateBoundary(scene);
|
||||||
|
|
||||||
CreateBackgroundAudio(scene.name, scene.location, scene.dimensions);
|
// CreateBackgroundAudio(scene.name, scene.location, scene.dimensions);
|
||||||
|
|
||||||
// print("done " + scene.name);
|
// print("done " + scene.name);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue