mirror of
https://github.com/overte-org/overte.git
synced 2025-07-24 00:43:49 +02:00
don't show reticle if not wearing HMD, reset panel textures
This commit is contained in:
parent
987b75d8f7
commit
afe4a4e432
1 changed files with 40 additions and 18 deletions
|
@ -47,11 +47,15 @@ var elevatorSound = SoundCache.getSound(HIFI_PUBLIC_BUCKET + "sounds/Lobby/eleva
|
||||||
var currentMusakInjector = null;
|
var currentMusakInjector = null;
|
||||||
var currentSound = null;
|
var currentSound = null;
|
||||||
|
|
||||||
|
var inOculusMode = Menu.isOptionChecked("EnableVRMode");
|
||||||
|
|
||||||
function reticlePosition() {
|
function reticlePosition() {
|
||||||
var RETICLE_DISTANCE = 1;
|
var RETICLE_DISTANCE = 1;
|
||||||
return Vec3.sum(Camera.position, Vec3.multiply(Quat.getFront(Camera.orientation), RETICLE_DISTANCE));
|
return Vec3.sum(Camera.position, Vec3.multiply(Quat.getFront(Camera.orientation), RETICLE_DISTANCE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var MAX_NUM_PANELS = 21;
|
||||||
|
|
||||||
function drawLobby() {
|
function drawLobby() {
|
||||||
if (!panelWall) {
|
if (!panelWall) {
|
||||||
print("Adding overlays for the lobby panel wall and orb shell.");
|
print("Adding overlays for the lobby panel wall and orb shell.");
|
||||||
|
@ -65,7 +69,7 @@ function drawLobby() {
|
||||||
url: HIFI_PUBLIC_BUCKET + "models/sets/Lobby/LobbyPrototype/Lobby5_PanelsWithFrames.fbx",
|
url: HIFI_PUBLIC_BUCKET + "models/sets/Lobby/LobbyPrototype/Lobby5_PanelsWithFrames.fbx",
|
||||||
position: Vec3.sum(orbPosition, Vec3.multiplyQbyV(towardsMe, panelsCenterShift)),
|
position: Vec3.sum(orbPosition, Vec3.multiplyQbyV(towardsMe, panelsCenterShift)),
|
||||||
rotation: towardsMe,
|
rotation: towardsMe,
|
||||||
dimensions: panelsDimensions
|
dimensions: panelsDimensions,
|
||||||
};
|
};
|
||||||
|
|
||||||
var orbShellProps = {
|
var orbShellProps = {
|
||||||
|
@ -82,6 +86,7 @@ function drawLobby() {
|
||||||
orbShell = Overlays.addOverlay("model", orbShellProps);
|
orbShell = Overlays.addOverlay("model", orbShellProps);
|
||||||
|
|
||||||
// for HMD wearers, create a reticle in center of screen
|
// for HMD wearers, create a reticle in center of screen
|
||||||
|
if (inOculusMode) {
|
||||||
var CURSOR_SCALE = 0.025;
|
var CURSOR_SCALE = 0.025;
|
||||||
|
|
||||||
reticle = Overlays.addOverlay("billboard", {
|
reticle = Overlays.addOverlay("billboard", {
|
||||||
|
@ -92,6 +97,7 @@ function drawLobby() {
|
||||||
alpha: 1.0,
|
alpha: 1.0,
|
||||||
scale: CURSOR_SCALE
|
scale: CURSOR_SCALE
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// add an attachment on this avatar so other people see them in the lobby
|
// add an attachment on this avatar so other people see them in the lobby
|
||||||
MyAvatar.attach(HELMET_ATTACHMENT_URL, "Neck", {x: 0, y: 0, z: 0}, Quat.fromPitchYawRollDegrees(0, 0, 0), 1.15);
|
MyAvatar.attach(HELMET_ATTACHMENT_URL, "Neck", {x: 0, y: 0, z: 0}, Quat.fromPitchYawRollDegrees(0, 0, 0), 1.15);
|
||||||
|
@ -130,7 +136,6 @@ var MUSAK_VOLUME = 0.5;
|
||||||
|
|
||||||
function playNextMusak() {
|
function playNextMusak() {
|
||||||
if (panelWall) {
|
if (panelWall) {
|
||||||
print("PLAYING THE NEXT MUSAK!");
|
|
||||||
if (currentSound == latinSound) {
|
if (currentSound == latinSound) {
|
||||||
if (elevatorSound.downloaded) {
|
if (elevatorSound.downloaded) {
|
||||||
currentSound = elevatorSound;
|
currentSound = elevatorSound;
|
||||||
|
@ -166,9 +171,23 @@ function playRandomMusak() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function cleanupLobby() {
|
function cleanupLobby() {
|
||||||
|
|
||||||
|
// for each of the 21 placeholder textures, set them back to default so the cached model doesn't have changed textures
|
||||||
|
var panelTexturesReset = {};
|
||||||
|
panelTexturesReset["textures"] = {};
|
||||||
|
|
||||||
|
for (var j = 0; j < MAX_NUM_PANELS; j++) {
|
||||||
|
panelTexturesReset["textures"]["file" + (j + 1)] = HIFI_PUBLIC_BUCKET + "models/sets/Lobby/LobbyPrototype/Texture.jpg";
|
||||||
|
};
|
||||||
|
|
||||||
|
Overlays.editOverlay(panelWall, panelTexturesReset);
|
||||||
|
|
||||||
Overlays.deleteOverlay(panelWall);
|
Overlays.deleteOverlay(panelWall);
|
||||||
Overlays.deleteOverlay(orbShell);
|
Overlays.deleteOverlay(orbShell);
|
||||||
|
|
||||||
|
if (reticle) {
|
||||||
Overlays.deleteOverlay(reticle);
|
Overlays.deleteOverlay(reticle);
|
||||||
|
}
|
||||||
|
|
||||||
panelWall = false;
|
panelWall = false;
|
||||||
orbShell = false;
|
orbShell = false;
|
||||||
|
@ -240,10 +259,13 @@ function toggleEnvironmentRendering(shouldRender) {
|
||||||
|
|
||||||
function update(deltaTime) {
|
function update(deltaTime) {
|
||||||
maybeCleanupLobby();
|
maybeCleanupLobby();
|
||||||
|
if (panelWall) {
|
||||||
|
|
||||||
if (reticle) {
|
if (reticle) {
|
||||||
Overlays.editOverlay(reticle, {
|
Overlays.editOverlay(reticle, {
|
||||||
position: reticlePosition()
|
position: reticlePosition()
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// if the reticle is up then we may need to play the next musak
|
// if the reticle is up then we may need to play the next musak
|
||||||
if (!Audio.isInjectorPlaying(currentMusakInjector)) {
|
if (!Audio.isInjectorPlaying(currentMusakInjector)) {
|
||||||
|
|
Loading…
Reference in a new issue