making some changes

This commit is contained in:
Dante Ruiz 2018-08-09 16:29:37 -07:00
parent faa5411757
commit 353121be7d
2 changed files with 21 additions and 17 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View file

@ -15,7 +15,7 @@
(function() { (function() {
Script.include("/~/system/libraries/Xform.js"); Script.include("/~/system/libraries/Xform.js");
var DEBUG = true; var DEBUG = true;
var MAX_X_SIZE = 5; var MAX_X_SIZE = 4;
var EPSILON = 0.25; var EPSILON = 0.25;
var isVisible = false; var isVisible = false;
var STABILITY = 3.0; var STABILITY = 3.0;
@ -67,7 +67,6 @@
ignoreRayIntersection: true, ignoreRayIntersection: true,
drawInFront: true, drawInFront: true,
grabbable: false, grabbable: false,
parentID: MyAvatar.SELF_ID
}); });
var anchorOverlay = Overlays.addOverlay("cube", { var anchorOverlay = Overlays.addOverlay("cube", {
@ -79,7 +78,7 @@
orientation: Quat.multiply(Quat.fromVec3Degrees({x: 0, y: 180, z: 0}), MyAvatar.orientation), orientation: Quat.multiply(Quat.fromVec3Degrees({x: 0, y: 180, z: 0}), MyAvatar.orientation),
solid: true, solid: true,
drawInFront: true, drawInFront: true,
parentID: MyAvatar.SELF_ID parentID: loadingSphereID
}); });
@ -100,7 +99,6 @@
}); });
var domainText = ""; var domainText = "";
var domainDescription = Overlays.addOverlay("text3d", { var domainDescription = Overlays.addOverlay("text3d", {
name: "Loading-Hostname", name: "Loading-Hostname",
localPosition: { x: 0.0, y: 0.32, z: 0.0 }, localPosition: { x: 0.0, y: 0.32, z: 0.0 },
@ -150,7 +148,7 @@
var loadingBarPlacard = Overlays.addOverlay("image3d", { var loadingBarPlacard = Overlays.addOverlay("image3d", {
name: "Loading-Bar-Placard", name: "Loading-Bar-Placard",
localPosition: { x: 0.0 , y: -0.99, z: 0.07 }, localPosition: { x: 0.0, y: -0.99, z: 0.0 },
url: "http://hifi-content.s3.amazonaws.com/alexia/LoadingScreens/loadingBar_placard.png", url: "http://hifi-content.s3.amazonaws.com/alexia/LoadingScreens/loadingBar_placard.png",
alpha: 1, alpha: 1,
dimensions: { x: 4, y: 2.8}, dimensions: { x: 4, y: 2.8},
@ -165,10 +163,10 @@
var loadingBarProgress = Overlays.addOverlay("image3d", { var loadingBarProgress = Overlays.addOverlay("image3d", {
name: "Loading-Bar-Progress", name: "Loading-Bar-Progress",
localPosition: { x: 0.0 , y: -0.99, z: 0.0 }, localPosition: { x: 0.0, y: -0.99, z: 0.0 },
url: "http://hifi-content.s3.amazonaws.com/alexia/LoadingScreens/loadingBar_progress.png", url: Script.resourcesPath() + "images/loadingBar_v1.png",
alpha: 1, alpha: 1,
dimensions: { x: 4, y: 2.8}, dimensions: {x: 4, y: 2.8},
visible: isVisible, visible: isVisible,
emissive: true, emissive: true,
ignoreRayIntersection: false, ignoreRayIntersection: false,
@ -187,6 +185,8 @@
var timer = null; var timer = null;
var target = 0; var target = 0;
var connectionToDomainFailed = false;
function getAnchorLocalYOffset() { function getAnchorLocalYOffset() {
var loadingSpherePosition = Overlays.getProperty(loadingSphereID, "position"); var loadingSpherePosition = Overlays.getProperty(loadingSphereID, "position");
@ -219,6 +219,7 @@
startAudio(); startAudio();
target = 0; target = 0;
currentProgress = 0.1; currentProgress = 0.1;
connectionToDomainFailed = false;
timer = Script.setTimeout(update, BASIC_TIMER_INTERVAL_MS); timer = Script.setTimeout(update, BASIC_TIMER_INTERVAL_MS);
} }
} }
@ -313,9 +314,9 @@
MyAvatar.headOrientation = Quat.multiply(Quat.cancelOutRollAndPitch(MyAvatar.headOrientation), Quat.fromPitchYawRollDegrees(-3.0, 0, 0)); MyAvatar.headOrientation = Quat.multiply(Quat.cancelOutRollAndPitch(MyAvatar.headOrientation), Quat.fromPitchYawRollDegrees(-3.0, 0, 0));
} }
renderViewTask.getConfig("LightingModel")["enableAmbientLight"] = physicsEnabled; //renderViewTask.getConfig("LightingModel")["enableAmbientLight"] = physicsEnabled;
renderViewTask.getConfig("LightingModel")["enableDirectionalLight"] = physicsEnabled; //renderViewTask.getConfig("LightingModel")["enableDirectionalLight"] = physicsEnabled;
renderViewTask.getConfig("LightingModel")["enablePointLight"] = physicsEnabled; //renderViewTask.getConfig("LightingModel")["enablePointLight"] = physicsEnabled;
Overlays.editOverlay(loadingSphereID, mainSphereProperties); Overlays.editOverlay(loadingSphereID, mainSphereProperties);
Overlays.editOverlay(loadingToTheSpotID, properties); Overlays.editOverlay(loadingToTheSpotID, properties);
Overlays.editOverlay(domainNameTextID, properties); Overlays.editOverlay(domainNameTextID, properties);
@ -350,7 +351,7 @@
progress += MAX_X_SIZE * (deltaTime / 1000); progress += MAX_X_SIZE * (deltaTime / 1000);
print(progress); print(progress);
var properties = { var properties = {
localPosition: { x: -(progress / 1.98) + 2, y: -0.99, z: 0.0 }, localPosition: { x: -(progress / 2) + 2, y: -0.99, z: 0.0 },
dimensions: { dimensions: {
x: progress, x: progress,
y: 2.8 y: 2.8
@ -403,11 +404,11 @@
y: 2.8 y: 2.8
} }
}; };
print("progress: " + currentProgress);
Overlays.editOverlay(loadingBarProgress, properties); Overlays.editOverlay(loadingBarProgress, properties);
if (physicsEnabled && (currentProgress >= (MAX_X_SIZE - EPSILON))) { if (((physicsEnabled && (currentProgress >= (MAX_X_SIZE - EPSILON))) || connectionToDomainFailed)) {
print("----------> ending <--------"); print("----------> ending <--------");
updateOverlays(physicsEnabled); updateOverlays((physicsEnabled || connectionToDomainFailed));
endAudio(); endAudio();
timer = null; timer = null;
return; return;
@ -418,7 +419,10 @@
Overlays.mouseReleaseOnOverlay.connect(clickedOnOverlay); Overlays.mouseReleaseOnOverlay.connect(clickedOnOverlay);
location.hostChanged.connect(domainChanged); location.hostChanged.connect(domainChanged);
location.lookupResultsFinished.connect(function() { location.lookupResultsFinished.connect(function() {
print("connected: " + location.isConnected); Script.setTimeout(function() {
print("location connected: " + location.isConnected);
connectionToDomainFailed = !location.isConnected;
}, 300);
}); });
MyAvatar.sensorToWorldScaleChanged.connect(scaleInterstitialPage); MyAvatar.sensorToWorldScaleChanged.connect(scaleInterstitialPage);
@ -433,7 +437,7 @@
updateOverlays(toggle); updateOverlays(toggle);
if (!toggle) { if (!toggle) {
Script.setTimeout(updateProgress, BASIC_TIMER_INTERVAL_MS); //Script.setTimeout(updateProgress, BASIC_TIMER_INTERVAL_MS);
} }
}); });
} }