Make 3D progress bar match up with notifications

This commit is contained in:
David Rowe 2015-02-03 10:39:07 -08:00
parent fdf4aeaeab
commit 46352d34ce

View file

@ -39,11 +39,14 @@
bar3D = {},
ENABLE_VR_MODE_MENU_ITEM = "Enable VR Mode",
PROGRESS_3D_DIRECTION = 0.0, // Degrees from avatar orientation.
PROGRESS_3D_DISTANCE = 0.63, // Horizontal distance from avatar position.
PROGRESS_3D_ELEVATION = -0.783, // Height of top middle of top notification relative to avatar eyes.
PROGRESS_3D_DISTANCE = 0.602, // Horizontal distance from avatar position.
PROGRESS_3D_ELEVATION = -0.8, // Height of top middle of top notification relative to avatar eyes.
PROGRESS_3D_YAW = 0.0, // Degrees relative to notifications direction.
PROGRESS_3D_PITCH = -60.0, // Degrees from vertical.
SCALE_3D = 0.0021; // Scale the SVGs for 3D display.
SCALE_3D = 0.0017, // Scale the bar SVG for 3D display.
BACKGROUND_3D_SIZE = { x: 0.76, y: 0.08 }, // Match up with the 3D background with those of notifications.js notices.
BACKGROUND_3D_COLOR = { red: 2, green: 2, blue: 2 },
BACKGROUND_3D_ALPHA = 0.7;
function fade() {
@ -66,10 +69,17 @@
visible = false;
}
Overlays.editOverlay(isOnHMD ? background3D.overlay : background2D.overlay, {
if (isOnHMD) {
Overlays.editOverlay(background3D.overlay, {
backgroundAlpha: alpha * BACKGROUND_3D_ALPHA,
visible: visible
});
} else {
Overlays.editOverlay(background2D.overlay, {
alpha: alpha,
visible: visible
});
}
Overlays.editOverlay(isOnHMD ? bar3D.overlay : bar2D.overlay, {
alpha: alpha,
visible: visible
@ -135,12 +145,14 @@
function createOverlays() {
if (isOnHMD) {
background3D.overlay = Overlays.addOverlay("billboard", {
url: BACKGROUND_URL,
scale: SCALE_3D * BACKGROUND_WIDTH,
background3D.overlay = Overlays.addOverlay("rectangle3d", {
size: BACKGROUND_3D_SIZE,
color: BACKGROUND_3D_COLOR,
alpha: BACKGROUND_3D_ALPHA,
solid: true,
isFacingAvatar: false,
visible: false,
alpha: 0.0
ignoreRayIntersection: true
});
bar3D.overlay = Overlays.addOverlay("billboard", {
url: BAR_URL,
@ -148,7 +160,8 @@
scale: SCALE_3D * BAR_WIDTH,
isFacingAvatar: false,
visible: false,
alpha: 0.0
alpha: 0.0,
ignoreRayIntersection: true
});
} else {