mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-13 20:07:07 +02:00
work
This commit is contained in:
parent
a80641a2c4
commit
325c7525c7
3 changed files with 45 additions and 22 deletions
|
@ -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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -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();
|
|
@ -115,6 +115,7 @@ var scenes = [{
|
|||
radius: 500,
|
||||
number: 10,
|
||||
userData: JSON.stringify({
|
||||
entryPoint:locations.cellLayout[1],
|
||||
location: locations.cellLayout[1],
|
||||
baseURL: baseLocation
|
||||
}),
|
||||
|
|
Loading…
Reference in a new issue