diff --git a/domain-server/resources/web/assignment/js/ace/ace.js b/domain-server/resources/web/assignment/js/ace/ace.js old mode 100755 new mode 100644 diff --git a/domain-server/resources/web/assignment/js/ace/mode-javascript.js b/domain-server/resources/web/assignment/js/ace/mode-javascript.js old mode 100755 new mode 100644 diff --git a/domain-server/resources/web/assignment/js/ace/snippets/javascript.js b/domain-server/resources/web/assignment/js/ace/snippets/javascript.js old mode 100755 new mode 100644 diff --git a/domain-server/resources/web/assignment/js/ace/theme-twilight.js b/domain-server/resources/web/assignment/js/ace/theme-twilight.js old mode 100755 new mode 100644 diff --git a/domain-server/resources/web/assignment/js/ace/worker-javascript.js b/domain-server/resources/web/assignment/js/ace/worker-javascript.js old mode 100755 new mode 100644 diff --git a/domain-server/resources/web/js/form2js.min.js b/domain-server/resources/web/js/form2js.min.js old mode 100755 new mode 100644 diff --git a/examples/ControlACs.js b/examples/ControlACs.js index 4ccf5cff59..bbdb1cc4ef 100644 --- a/examples/ControlACs.js +++ b/examples/ControlACs.js @@ -9,6 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); + // Set the following variables to the right value var NUM_AC = 3; // This is the number of AC. Their ID need to be unique and between 0 (included) and NUM_AC (excluded) var NAMES = new Array("Craig", "Clement", "Jeff"); // ACs names ordered by IDs (Default name is "ACx", x = ID + 1)) @@ -37,7 +39,7 @@ COLORS[HIDE] = { red: HIDE, green: 0, blue: 0 }; var windowDimensions = Controller.getViewportDimensions(); -var TOOL_ICON_URL = "http://s3-us-west-1.amazonaws.com/highfidelity-public/images/tools/"; +var TOOL_ICON_URL = HIFI_PUBLIC_BUCKET + "images/tools/"; var ALPHA_ON = 1.0; var ALPHA_OFF = 0.7; var COLOR_TOOL_BAR = { red: 0, green: 0, blue: 0 }; diff --git a/examples/ControlledAC.js b/examples/ControlledAC.js index 33fa629ff8..b19d27946a 100644 --- a/examples/ControlledAC.js +++ b/examples/ControlledAC.js @@ -9,8 +9,10 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); + // Set the following variables to the values needed -var filename = "http://s3-us-west-1.amazonaws.com/highfidelity-public/ozan/bartender.rec"; +var filename = HIFI_PUBLIC_BUCKET + "ozan/bartender.rec"; var playFromCurrentLocation = true; var useDisplayName = true; var useAttachments = true; diff --git a/examples/Recorder.js b/examples/Recorder.js index 533f9f7fab..8c784bcea2 100644 --- a/examples/Recorder.js +++ b/examples/Recorder.js @@ -9,6 +9,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); Script.include("libraries/toolBars.js"); var recordingFile = "recording.rec"; @@ -22,7 +23,7 @@ function setPlayerOptions() { } var windowDimensions = Controller.getViewportDimensions(); -var TOOL_ICON_URL = "http://s3-us-west-1.amazonaws.com/highfidelity-public/images/tools/"; +var TOOL_ICON_URL = HIFI_PUBLIC_BUCKET + "images/tools/"; var ALPHA_ON = 1.0; var ALPHA_OFF = 0.7; var COLOR_ON = { red: 128, green: 0, blue: 0 }; diff --git a/examples/airGuitar.js b/examples/airGuitar.js index 78c16be7bc..c0e06add30 100644 --- a/examples/airGuitar.js +++ b/examples/airGuitar.js @@ -10,6 +10,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); + function length(v) { return Math.sqrt(v.x * v.x + v.y * v.y + v.z * v.z); } @@ -26,28 +28,28 @@ function vMinus(a, b) { } // The model file to be used for the guitar -var guitarModel = "https://s3-us-west-1.amazonaws.com/highfidelity-public/models/attachments/guitar.fst"; +var guitarModel = HIFI_PUBLIC_BUCKET + "models/attachments/guitar.fst"; // Load sounds that will be played var chords = new Array(); // Nylon string guitar -chords[1] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Nylon+A.raw"); -chords[2] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Nylon+B.raw"); -chords[3] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Nylon+E.raw"); -chords[4] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Nylon+G.raw"); +chords[1] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Guitars/Guitar+-+Nylon+A.raw"); +chords[2] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Guitars/Guitar+-+Nylon+B.raw"); +chords[3] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Guitars/Guitar+-+Nylon+E.raw"); +chords[4] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Guitars/Guitar+-+Nylon+G.raw"); // Electric guitar -chords[5] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Metal+A+short.raw"); -chords[6] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Metal+B+short.raw"); -chords[7] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Metal+E+short.raw"); -chords[8] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Metal+G+short.raw"); +chords[5] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Guitars/Guitar+-+Metal+A+short.raw"); +chords[6] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Guitars/Guitar+-+Metal+B+short.raw"); +chords[7] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Guitars/Guitar+-+Metal+E+short.raw"); +chords[8] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Guitars/Guitar+-+Metal+G+short.raw"); // Steel Guitar -chords[9] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Steel+A.raw"); -chords[10] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Steel+B.raw"); -chords[11] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Steel+E.raw"); -chords[12] = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Steel+G.raw"); +chords[9] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Guitars/Guitar+-+Steel+A.raw"); +chords[10] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Guitars/Guitar+-+Steel+B.raw"); +chords[11] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Guitars/Guitar+-+Steel+E.raw"); +chords[12] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Guitars/Guitar+-+Steel+G.raw"); var NUM_CHORDS = 4; var NUM_GUITARS = 3; diff --git a/examples/audioBall.js b/examples/audioBall.js index 2a77a0999f..76f9aabec8 100644 --- a/examples/audioBall.js +++ b/examples/audioBall.js @@ -13,7 +13,9 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -var sound = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Animals/mexicanWhipoorwill.raw"); +Script.include("libraries/globals.js"); + +var sound = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Animals/mexicanWhipoorwill.raw"); var CHANCE_OF_PLAYING_SOUND = 0.01; var FACTOR = 0.75; diff --git a/examples/audioReflectorTools.js b/examples/audioReflectorTools.js index f299407e54..c5a88edd57 100644 --- a/examples/audioReflectorTools.js +++ b/examples/audioReflectorTools.js @@ -11,6 +11,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); var delayScale = 100.0; var fanoutScale = 10.0; @@ -94,7 +95,7 @@ var delaySlider = Overlays.addOverlay("image", { // alternate form of expressing bounds bounds: { x: 100, y: delayY, width: 150, height: sliderHeight}, subImage: { x: 46, y: 0, width: 200, height: 71 }, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/slider.png", + imageURL: HIFI_PUBLIC_BUCKET + "images/slider.png", color: { red: 255, green: 255, blue: 255}, alpha: 1 }); @@ -108,7 +109,7 @@ var delayThumb = Overlays.addOverlay("image", { y: delayY + 9, width: 18, height: 17, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/thumb.png", + imageURL: HIFI_PUBLIC_BUCKET + "images/thumb.png", color: { red: 255, green: 0, blue: 0}, alpha: 1 }); @@ -132,7 +133,7 @@ var fanoutSlider = Overlays.addOverlay("image", { // alternate form of expressing bounds bounds: { x: 100, y: fanoutY, width: 150, height: sliderHeight}, subImage: { x: 46, y: 0, width: 200, height: 71 }, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/slider.png", + imageURL: HIFI_PUBLIC_BUCKET + "images/slider.png", color: { red: 255, green: 255, blue: 255}, alpha: 1 }); @@ -146,7 +147,7 @@ var fanoutThumb = Overlays.addOverlay("image", { y: fanoutY + 9, width: 18, height: 17, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/thumb.png", + imageURL: HIFI_PUBLIC_BUCKET + "images/thumb.png", color: { red: 255, green: 255, blue: 0}, alpha: 1 }); @@ -171,7 +172,7 @@ var speedSlider = Overlays.addOverlay("image", { // alternate form of expressing bounds bounds: { x: 100, y: speedY, width: 150, height: sliderHeight}, subImage: { x: 46, y: 0, width: 200, height: 71 }, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/slider.png", + imageURL: HIFI_PUBLIC_BUCKET + "images/slider.png", color: { red: 255, green: 255, blue: 255}, alpha: 1 }); @@ -185,7 +186,7 @@ var speedThumb = Overlays.addOverlay("image", { y: speedY+9, width: 18, height: 17, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/thumb.png", + imageURL: HIFI_PUBLIC_BUCKET + "images/thumb.png", color: { red: 0, green: 255, blue: 0}, alpha: 1 }); @@ -210,7 +211,7 @@ var factorSlider = Overlays.addOverlay("image", { // alternate form of expressing bounds bounds: { x: 100, y: factorY, width: 150, height: sliderHeight}, subImage: { x: 46, y: 0, width: 200, height: 71 }, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/slider.png", + imageURL: HIFI_PUBLIC_BUCKET + "images/slider.png", color: { red: 255, green: 255, blue: 255}, alpha: 1 }); @@ -224,7 +225,7 @@ var factorThumb = Overlays.addOverlay("image", { y: factorY+9, width: 18, height: 17, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/thumb.png", + imageURL: HIFI_PUBLIC_BUCKET + "images/thumb.png", color: { red: 0, green: 0, blue: 255}, alpha: 1 }); @@ -249,7 +250,7 @@ var localFactorSlider = Overlays.addOverlay("image", { // alternate form of expressing bounds bounds: { x: 100, y: localFactorY, width: 150, height: sliderHeight}, subImage: { x: 46, y: 0, width: 200, height: 71 }, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/slider.png", + imageURL: HIFI_PUBLIC_BUCKET + "images/slider.png", color: { red: 255, green: 255, blue: 255}, alpha: 1 }); @@ -263,7 +264,7 @@ var localFactorThumb = Overlays.addOverlay("image", { y: localFactorY+9, width: 18, height: 17, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/thumb.png", + imageURL: HIFI_PUBLIC_BUCKET + "images/thumb.png", color: { red: 0, green: 128, blue: 128}, alpha: 1 }); @@ -288,7 +289,7 @@ var combFilterSlider = Overlays.addOverlay("image", { // alternate form of expressing bounds bounds: { x: 100, y: combFilterY, width: 150, height: sliderHeight}, subImage: { x: 46, y: 0, width: 200, height: 71 }, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/slider.png", + imageURL: HIFI_PUBLIC_BUCKET + "images/slider.png", color: { red: 255, green: 255, blue: 255}, alpha: 1 }); @@ -302,7 +303,7 @@ var combFilterThumb = Overlays.addOverlay("image", { y: combFilterY+9, width: 18, height: 17, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/thumb.png", + imageURL: HIFI_PUBLIC_BUCKET + "images/thumb.png", color: { red: 128, green: 128, blue: 0}, alpha: 1 }); @@ -328,7 +329,7 @@ var reflectiveSlider = Overlays.addOverlay("image", { // alternate form of expressing bounds bounds: { x: 100, y: reflectiveY, width: 150, height: sliderHeight}, subImage: { x: 46, y: 0, width: 200, height: 71 }, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/slider.png", + imageURL: HIFI_PUBLIC_BUCKET + "images/slider.png", color: { red: 255, green: 255, blue: 255}, alpha: 1 }); @@ -342,7 +343,7 @@ var reflectiveThumb = Overlays.addOverlay("image", { y: reflectiveY+9, width: 18, height: 17, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/thumb.png", + imageURL: HIFI_PUBLIC_BUCKET + "images/thumb.png", color: { red: 255, green: 255, blue: 255}, alpha: 1 }); @@ -367,7 +368,7 @@ var diffusionSlider = Overlays.addOverlay("image", { // alternate form of expressing bounds bounds: { x: 100, y: diffusionY, width: 150, height: sliderHeight}, subImage: { x: 46, y: 0, width: 200, height: 71 }, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/slider.png", + imageURL: HIFI_PUBLIC_BUCKET + "images/slider.png", color: { red: 255, green: 255, blue: 255}, alpha: 1 }); @@ -381,7 +382,7 @@ var diffusionThumb = Overlays.addOverlay("image", { y: diffusionY+9, width: 18, height: 17, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/thumb.png", + imageURL: HIFI_PUBLIC_BUCKET + "images/thumb.png", color: { red: 0, green: 255, blue: 255}, alpha: 1 }); @@ -406,7 +407,7 @@ var absorptionSlider = Overlays.addOverlay("image", { // alternate form of expressing bounds bounds: { x: 100, y: absorptionY, width: 150, height: sliderHeight}, subImage: { x: 46, y: 0, width: 200, height: 71 }, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/slider.png", + imageURL: HIFI_PUBLIC_BUCKET + "images/slider.png", color: { red: 255, green: 255, blue: 255}, alpha: 1 }); @@ -420,7 +421,7 @@ var absorptionThumb = Overlays.addOverlay("image", { y: absorptionY+9, width: 18, height: 17, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/thumb.png", + imageURL: HIFI_PUBLIC_BUCKET + "images/thumb.png", color: { red: 255, green: 0, blue: 255}, alpha: 1 }); @@ -445,7 +446,7 @@ var originalSlider = Overlays.addOverlay("image", { // alternate form of expressing bounds bounds: { x: 100, y: originalY, width: 150, height: sliderHeight}, subImage: { x: 46, y: 0, width: 200, height: 71 }, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/slider.png", + imageURL: HIFI_PUBLIC_BUCKET + "images/slider.png", color: { red: 255, green: 255, blue: 255}, alpha: 1 }); @@ -459,7 +460,7 @@ var originalThumb = Overlays.addOverlay("image", { y: originalY+9, width: 18, height: 17, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/thumb.png", + imageURL: HIFI_PUBLIC_BUCKET + "images/thumb.png", color: { red: 128, green: 128, blue: 0}, alpha: 1 }); @@ -484,7 +485,7 @@ var echoesSlider = Overlays.addOverlay("image", { // alternate form of expressing bounds bounds: { x: 100, y: echoesY, width: 150, height: sliderHeight}, subImage: { x: 46, y: 0, width: 200, height: 71 }, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/slider.png", + imageURL: HIFI_PUBLIC_BUCKET + "images/slider.png", color: { red: 255, green: 255, blue: 255}, alpha: 1 }); @@ -498,7 +499,7 @@ var echoesThumb = Overlays.addOverlay("image", { y: echoesY+9, width: 18, height: 17, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/thumb.png", + imageURL: HIFI_PUBLIC_BUCKET + "images/thumb.png", color: { red: 128, green: 128, blue: 0}, alpha: 1 }); diff --git a/examples/avatarCollision.js b/examples/avatarCollision.js index 5ade894365..6c0886464c 100644 --- a/examples/avatarCollision.js +++ b/examples/avatarCollision.js @@ -11,6 +11,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); + var SOUND_TRIGGER_CLEAR = 1000; // milliseconds var SOUND_TRIGGER_DELAY = 200; // milliseconds var soundExpiry = 0; @@ -20,28 +22,28 @@ audioOptions.volume = 0.5; audioOptions.position = { x: 0, y: 0, z: 0 }; var hitSounds = new Array(); -hitSounds[0] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit1.raw"); -hitSounds[1] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit2.raw"); -hitSounds[2] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit3.raw"); -hitSounds[3] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit4.raw"); -hitSounds[4] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit5.raw"); -hitSounds[5] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit6.raw"); -hitSounds[6] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit7.raw"); -hitSounds[7] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit8.raw"); -hitSounds[8] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit9.raw"); -hitSounds[9] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit10.raw"); -hitSounds[10] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit11.raw"); -hitSounds[11] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit12.raw"); -hitSounds[12] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit13.raw"); -hitSounds[13] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit14.raw"); -hitSounds[14] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit15.raw"); -hitSounds[15] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit16.raw"); -hitSounds[16] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit17.raw"); -hitSounds[17] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit18.raw"); -hitSounds[18] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit19.raw"); -hitSounds[19] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit20.raw"); -hitSounds[20] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit21.raw"); -hitSounds[21] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Collisions-hitsandslaps/Hit22.raw"); +hitSounds[0] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Collisions-hitsandslaps/Hit1.raw"); +hitSounds[1] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Collisions-hitsandslaps/Hit2.raw"); +hitSounds[2] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Collisions-hitsandslaps/Hit3.raw"); +hitSounds[3] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Collisions-hitsandslaps/Hit4.raw"); +hitSounds[4] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Collisions-hitsandslaps/Hit5.raw"); +hitSounds[5] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Collisions-hitsandslaps/Hit6.raw"); +hitSounds[6] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Collisions-hitsandslaps/Hit7.raw"); +hitSounds[7] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Collisions-hitsandslaps/Hit8.raw"); +hitSounds[8] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Collisions-hitsandslaps/Hit9.raw"); +hitSounds[9] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Collisions-hitsandslaps/Hit10.raw"); +hitSounds[10] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Collisions-hitsandslaps/Hit11.raw"); +hitSounds[11] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Collisions-hitsandslaps/Hit12.raw"); +hitSounds[12] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Collisions-hitsandslaps/Hit13.raw"); +hitSounds[13] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Collisions-hitsandslaps/Hit14.raw"); +hitSounds[14] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Collisions-hitsandslaps/Hit15.raw"); +hitSounds[15] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Collisions-hitsandslaps/Hit16.raw"); +hitSounds[16] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Collisions-hitsandslaps/Hit17.raw"); +hitSounds[17] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Collisions-hitsandslaps/Hit18.raw"); +hitSounds[18] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Collisions-hitsandslaps/Hit19.raw"); +hitSounds[19] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Collisions-hitsandslaps/Hit20.raw"); +hitSounds[20] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Collisions-hitsandslaps/Hit21.raw"); +hitSounds[21] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Collisions-hitsandslaps/Hit22.raw"); function playHitSound(mySessionID, theirSessionID, collision) { var now = new Date(); diff --git a/examples/bot.js b/examples/bot.js index e42d234abf..09c9a51cdd 100644 --- a/examples/bot.js +++ b/examples/bot.js @@ -12,6 +12,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); + function getRandomFloat(min, max) { return Math.random() * (max - min) + min; } @@ -110,9 +112,9 @@ if (botNumber <= 20) { // set the face model fst using the bot number // there is no need to change the body model - we're using the default -Avatar.faceModelURL = "https://s3-us-west-1.amazonaws.com/highfidelity-public/meshes/" + newFaceFilePrefix + ".fst"; -Avatar.skeletonModelURL = "https://s3-us-west-1.amazonaws.com/highfidelity-public/meshes/" + newBodyFilePrefix + ".fst"; -Avatar.billboardURL = "https://s3-us-west-1.amazonaws.com/highfidelity-public/meshes/billboards/bot" + botNumber + ".png"; +Avatar.faceModelURL = HIFI_PUBLIC_BUCKET + "meshes/" + newFaceFilePrefix + ".fst"; +Avatar.skeletonModelURL = HIFI_PUBLIC_BUCKET + "meshes/" + newBodyFilePrefix + ".fst"; +Avatar.billboardURL = HIFI_PUBLIC_BUCKET + "meshes/billboards/bot" + botNumber + ".png"; Agent.isAvatar = true; Agent.isListeningToAudioStream = true; @@ -223,7 +225,7 @@ function loadSounds() { "Walken1.raw", "Walken2.raw", "Z1.raw", "Z2.raw" ]; - var SOUND_BASE_URL = "https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Cocktail+Party+Snippets/Raws/"; + var SOUND_BASE_URL = HIFI_PUBLIC_BUCKET + "sounds/Cocktail+Party+Snippets/Raws/"; for (var i = 0; i < sound_filenames.length; i++) { sounds.push(new Sound(SOUND_BASE_URL + sound_filenames[i])); diff --git a/examples/botProceduralWayPoints.js b/examples/botProceduralWayPoints.js index 9f46177587..fc9c0dda74 100644 --- a/examples/botProceduralWayPoints.js +++ b/examples/botProceduralWayPoints.js @@ -20,7 +20,8 @@ // //For procedural walk animation -Script.include("http://s3-us-west-1.amazonaws.com/highfidelity-public/scripts/proceduralAnimationAPI.js"); +Script.include("libraries/globals.js"); +Script.include(HIFI_PUBLIC_BUCKET + "scripts/proceduralAnimationAPI.js"); var procAnimAPI = new ProcAnimAPI(); @@ -120,9 +121,9 @@ var newBodyFilePrefix = "bot" + botNumber; // set the face model fst using the bot number // there is no need to change the body model - we're using the default -Avatar.faceModelURL = "https://s3-us-west-1.amazonaws.com/highfidelity-public/meshes/" + newFaceFilePrefix + ".fst"; -Avatar.skeletonModelURL = "https://s3-us-west-1.amazonaws.com/highfidelity-public/meshes/" + newBodyFilePrefix + "_a.fst"; -Avatar.billboardURL = "https://s3-us-west-1.amazonaws.com/highfidelity-public/meshes/billboards/bot" + botNumber + ".png"; +Avatar.faceModelURL = HIFI_PUBLIC_BUCKET + "meshes/" + newFaceFilePrefix + ".fst"; +Avatar.skeletonModelURL = HIFI_PUBLIC_BUCKET + "meshes/" + newBodyFilePrefix + "_a.fst"; +Avatar.billboardURL = HIFI_PUBLIC_BUCKET + "meshes/billboards/bot" + botNumber + ".png"; Agent.isAvatar = true; Agent.isListeningToAudioStream = true; @@ -145,9 +146,9 @@ function loadSounds() { var footstep_filenames = ["FootstepW2Left-12db.wav", "FootstepW2Right-12db.wav", "FootstepW3Left-12db.wav", "FootstepW3Right-12db.wav", "FootstepW5Left-12db.wav", "FootstepW5Right-12db.wav"]; - var SOUND_BASE_URL = "https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Cocktail+Party+Snippets/Raws/"; + var SOUND_BASE_URL = HIFI_PUBLIC_BUCKET + "sounds/Cocktail+Party+Snippets/Raws/"; - var FOOTSTEP_BASE_URL = "http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Footsteps/"; + var FOOTSTEP_BASE_URL = HIFI_PUBLIC_BUCKET + "sounds/Footsteps/"; for (var i = 0; i < sound_filenames.length; i++) { sounds.push(new Sound(SOUND_BASE_URL + sound_filenames[i])); diff --git a/examples/bot_procedural.js b/examples/bot_procedural.js index 265b887e0a..f445162038 100644 --- a/examples/bot_procedural.js +++ b/examples/bot_procedural.js @@ -11,7 +11,8 @@ // //For procedural walk animation -Script.include("http://s3-us-west-1.amazonaws.com/highfidelity-public/scripts/proceduralAnimationAPI.js"); +Script.include("libraries/globals.js"); +Script.include(HIFI_PUBLIC_BUCKET + "scripts/proceduralAnimationAPI.js"); var procAnimAPI = new ProcAnimAPI(); @@ -82,9 +83,9 @@ var newBodyFilePrefix = "bot" + botNumber; // set the face model fst using the bot number // there is no need to change the body model - we're using the default -Avatar.faceModelURL = "https://s3-us-west-1.amazonaws.com/highfidelity-public/meshes/" + newFaceFilePrefix + ".fst"; -Avatar.skeletonModelURL = "https://s3-us-west-1.amazonaws.com/highfidelity-public/meshes/" + newBodyFilePrefix + "_a.fst"; -Avatar.billboardURL = "https://s3-us-west-1.amazonaws.com/highfidelity-public/meshes/billboards/bot" + botNumber + ".png"; +Avatar.faceModelURL = HIFI_PUBLIC_BUCKET + "meshes/" + newFaceFilePrefix + ".fst"; +Avatar.skeletonModelURL = HIFI_PUBLIC_BUCKET + "meshes/" + newBodyFilePrefix + "_a.fst"; +Avatar.billboardURL = HIFI_PUBLIC_BUCKET + "meshes/billboards/bot" + botNumber + ".png"; Agent.isAvatar = true; Agent.isListeningToAudioStream = true; @@ -107,9 +108,9 @@ function loadSounds() { var footstep_filenames = ["FootstepW2Left-12db.wav", "FootstepW2Right-12db.wav", "FootstepW3Left-12db.wav", "FootstepW3Right-12db.wav", "FootstepW5Left-12db.wav", "FootstepW5Right-12db.wav"]; - var SOUND_BASE_URL = "https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Cocktail+Party+Snippets/Raws/"; + var SOUND_BASE_URL = HIFI_PUBLIC_BUCKET + "sounds/Cocktail+Party+Snippets/Raws/"; - var FOOTSTEP_BASE_URL = "http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Footsteps/"; + var FOOTSTEP_BASE_URL = HIFI_PUBLIC_BUCKET + "sounds/Footsteps/"; for (var i = 0; i < sound_filenames.length; i++) { sounds.push(new Sound(SOUND_BASE_URL + sound_filenames[i])); diff --git a/examples/bot_randomExpression.js b/examples/bot_randomExpression.js index 2d2653e6d5..44d546e763 100644 --- a/examples/bot_randomExpression.js +++ b/examples/bot_randomExpression.js @@ -12,6 +12,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); + function getRandomFloat(min, max) { return Math.random() * (max - min) + min; } @@ -42,9 +44,9 @@ newBodyFilePrefix = "bot" + botNumber; // set the face model fst using the bot number // there is no need to change the body model - we're using the default -Avatar.faceModelURL = "https://s3-us-west-1.amazonaws.com/highfidelity-public/meshes/" + newFaceFilePrefix + ".fst"; -Avatar.skeletonModelURL = "https://s3-us-west-1.amazonaws.com/highfidelity-public/meshes/" + newBodyFilePrefix + ".fst"; -Avatar.billboardURL = "https://s3-us-west-1.amazonaws.com/highfidelity-public/meshes/billboards/bot" + botNumber + ".png"; +Avatar.faceModelURL = HIFI_PUBLIC_BUCKET + "meshes/" + newFaceFilePrefix + ".fst"; +Avatar.skeletonModelURL = HIFI_PUBLIC_BUCKET + "meshes/" + newBodyFilePrefix + ".fst"; +Avatar.billboardURL = HIFI_PUBLIC_BUCKET + "meshes/billboards/bot" + botNumber + ".png"; Agent.isAvatar = true; Agent.isListeningToAudioStream = true; diff --git a/examples/clap.js b/examples/clap.js index 6e70979c2e..9cc79a1c92 100644 --- a/examples/clap.js +++ b/examples/clap.js @@ -12,7 +12,9 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -var clapAnimation = "https://s3-us-west-1.amazonaws.com/highfidelity-public/animations/ClapAnimations/ClapHands_Standing.fbx"; +Script.include("libraries/globals.js"); + +var clapAnimation = HIFI_PUBLIC_BUCKET + "animations/ClapAnimations/ClapHands_Standing.fbx"; var ANIMATION_FRAMES_PER_CLAP = 10.0; var startEndFrames = []; startEndFrames.push({ start: 0, end: 10}); @@ -26,16 +28,16 @@ var lastClapFrame = 0; var lastAnimFrame = 0; var claps = []; -claps.push(new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/claps/BClap1Rvb.wav")); -claps.push(new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/claps/BClap2Rvb.wav")); -claps.push(new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/claps/BClap3Rvb.wav")); -claps.push(new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/claps/BClap4Rvb.wav")); -claps.push(new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/claps/BClap5Rvb.wav")); -claps.push(new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/claps/BClap6Rvb.wav")); -claps.push(new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/claps/BClap7Rvb.wav")); -claps.push(new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/claps/BClap8Rvb.wav")); -claps.push(new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/claps/BClap9Rvb.wav")); -claps.push(new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/claps/BClap10Rvb.wav")); +claps.push(new Sound(HIFI_PUBLIC_BUCKET + "sounds/claps/BClap1Rvb.wav")); +claps.push(new Sound(HIFI_PUBLIC_BUCKET + "sounds/claps/BClap2Rvb.wav")); +claps.push(new Sound(HIFI_PUBLIC_BUCKET + "sounds/claps/BClap3Rvb.wav")); +claps.push(new Sound(HIFI_PUBLIC_BUCKET + "sounds/claps/BClap4Rvb.wav")); +claps.push(new Sound(HIFI_PUBLIC_BUCKET + "sounds/claps/BClap5Rvb.wav")); +claps.push(new Sound(HIFI_PUBLIC_BUCKET + "sounds/claps/BClap6Rvb.wav")); +claps.push(new Sound(HIFI_PUBLIC_BUCKET + "sounds/claps/BClap7Rvb.wav")); +claps.push(new Sound(HIFI_PUBLIC_BUCKET + "sounds/claps/BClap8Rvb.wav")); +claps.push(new Sound(HIFI_PUBLIC_BUCKET + "sounds/claps/BClap9Rvb.wav")); +claps.push(new Sound(HIFI_PUBLIC_BUCKET + "sounds/claps/BClap10Rvb.wav")); var numberOfSounds = claps.length; var clappingNow = false; diff --git a/examples/drumStick.js b/examples/drumStick.js index 188661b000..d0560057c0 100644 --- a/examples/drumStick.js +++ b/examples/drumStick.js @@ -10,6 +10,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); + function length(v) { return Math.sqrt(v.x * v.x + v.y * v.y + v.z * v.z); } @@ -26,8 +28,8 @@ function vMinus(a, b) { // First, load two percussion sounds to be used on the sticks -var drum1 = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Drums/RackTomHi.raw"); -var drum2 = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Drums/RackTomLo.raw"); +var drum1 = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Drums/RackTomHi.raw"); +var drum2 = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Drums/RackTomLo.raw"); // State Machine: // 0 = not triggered diff --git a/examples/editModelExample.js b/examples/editModelExample.js index 1a17697db3..5a4efc0746 100644 --- a/examples/editModelExample.js +++ b/examples/editModelExample.js @@ -11,6 +11,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); + var count = 0; var moveUntil = 2000; var stopAfter = moveUntil + 100; @@ -31,12 +33,12 @@ var originalProperties = { green: 255, blue: 0 }, - modelURL: "http://highfidelity-public.s3-us-west-1.amazonaws.com/meshes/Feisar_Ship.FBX", - //modelURL: "http://highfidelity-public.s3-us-west-1.amazonaws.com/meshes/birarda/birarda_head.fbx", - //modelURL: "http://highfidelity-public.s3-us-west-1.amazonaws.com/meshes/pug.fbx", - //modelURL: "http://highfidelity-public.s3-us-west-1.amazonaws.com/meshes/newInvader16x16-large-purple.svo", - //modelURL: "http://highfidelity-public.s3-us-west-1.amazonaws.com/meshes/minotaur/mino_full.fbx", - //modelURL: "http://highfidelity-public.s3-us-west-1.amazonaws.com/meshes/Combat_tank_V01.FBX", + modelURL: HIFI_PUBLIC_BUCKET + "meshes/Feisar_Ship.FBX", + //modelURL: HIFI_PUBLIC_BUCKET + "meshes/birarda/birarda_head.fbx", + //modelURL: HIFI_PUBLIC_BUCKET + "meshes/pug.fbx", + //modelURL: HIFI_PUBLIC_BUCKET + "meshes/newInvader16x16-large-purple.svo", + //modelURL: HIFI_PUBLIC_BUCKET + "meshes/minotaur/mino_full.fbx", + //modelURL: HIFI_PUBLIC_BUCKET + "meshes/Combat_tank_V01.FBX", rotation: rotation }; diff --git a/examples/editModels.js b/examples/editModels.js index 1aa12529ce..9cdba8098f 100644 --- a/examples/editModels.js +++ b/examples/editModels.js @@ -22,9 +22,11 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); Script.include("libraries/toolBars.js"); + var windowDimensions = Controller.getViewportDimensions(); -var toolIconUrl = "http://highfidelity-public.s3-us-west-1.amazonaws.com/images/tools/"; +var toolIconUrl = HIFI_PUBLIC_BUCKET + "images/tools/"; var toolHeight = 50; var toolWidth = 50; @@ -45,14 +47,14 @@ var SPAWN_DISTANCE = 1; var DEFAULT_DIMENSION = 0.20; var modelURLs = [ - "http://highfidelity-public.s3-us-west-1.amazonaws.com/meshes/Feisar_Ship.FBX", - "http://highfidelity-public.s3-us-west-1.amazonaws.com/meshes/birarda/birarda_head.fbx", - "http://highfidelity-public.s3-us-west-1.amazonaws.com/meshes/pug.fbx", - "http://highfidelity-public.s3-us-west-1.amazonaws.com/meshes/newInvader16x16-large-purple.svo", - "http://highfidelity-public.s3-us-west-1.amazonaws.com/meshes/minotaur/mino_full.fbx", - "http://highfidelity-public.s3-us-west-1.amazonaws.com/meshes/Combat_tank_V01.FBX", - "http://highfidelity-public.s3-us-west-1.amazonaws.com/meshes/orc.fbx", - "http://highfidelity-public.s3-us-west-1.amazonaws.com/meshes/slimer.fbx" + HIFI_PUBLIC_BUCKET + "meshes/Feisar_Ship.FBX", + HIFI_PUBLIC_BUCKET + "meshes/birarda/birarda_head.fbx", + HIFI_PUBLIC_BUCKET + "meshes/pug.fbx", + HIFI_PUBLIC_BUCKET + "meshes/newInvader16x16-large-purple.svo", + HIFI_PUBLIC_BUCKET + "meshes/minotaur/mino_full.fbx", + HIFI_PUBLIC_BUCKET + "meshes/Combat_tank_V01.FBX", + HIFI_PUBLIC_BUCKET + "meshes/orc.fbx", + HIFI_PUBLIC_BUCKET + "meshes/slimer.fbx" ]; var jointList = MyAvatar.getJointNames(); @@ -1766,7 +1768,7 @@ var modelImporter = new ModelImporter(); function isLocked(properties) { // special case to lock the ground plane model in hq. if (location.hostname == "hq.highfidelity.io" && - properties.modelURL == "https://s3-us-west-1.amazonaws.com/highfidelity-public/ozan/Terrain_Reduce_forAlpha.fbx") { + properties.modelURL == HIFI_PUBLIC_BUCKET + "ozan/Terrain_Reduce_forAlpha.fbx") { return true; } return false; diff --git a/examples/editVoxels.js b/examples/editVoxels.js index 3543f062e7..e450f2d1d4 100644 --- a/examples/editVoxels.js +++ b/examples/editVoxels.js @@ -19,6 +19,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); + var editToolsOn = true; // starts out off var windowDimensions = Controller.getViewportDimensions(); @@ -94,61 +96,61 @@ function SoundArray() { } var addVoxelSound = new SoundArray(); -addVoxelSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Voxel+Add/VA+1.raw"); -addVoxelSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Voxel+Add/VA+2.raw"); -addVoxelSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Voxel+Add/VA+3.raw"); -addVoxelSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Voxel+Add/VA+4.raw"); -addVoxelSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Voxel+Add/VA+5.raw"); -addVoxelSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Voxel+Add/VA+6.raw"); +addVoxelSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Voxel+Add/VA+1.raw"); +addVoxelSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Voxel+Add/VA+2.raw"); +addVoxelSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Voxel+Add/VA+3.raw"); +addVoxelSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Voxel+Add/VA+4.raw"); +addVoxelSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Voxel+Add/VA+5.raw"); +addVoxelSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Voxel+Add/VA+6.raw"); var delVoxelSound = new SoundArray(); -delVoxelSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Voxel+Del/VD+A1.raw"); -delVoxelSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Voxel+Del/VD+A2.raw"); -delVoxelSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Voxel+Del/VD+A3.raw"); -delVoxelSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Voxel+Del/VD+B1.raw"); -delVoxelSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Voxel+Del/VD+B2.raw"); -delVoxelSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Voxel+Del/VD+B3.raw"); +delVoxelSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Voxel+Del/VD+A1.raw"); +delVoxelSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Voxel+Del/VD+A2.raw"); +delVoxelSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Voxel+Del/VD+A3.raw"); +delVoxelSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Voxel+Del/VD+B1.raw"); +delVoxelSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Voxel+Del/VD+B2.raw"); +delVoxelSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Voxel+Del/VD+B3.raw"); var resizeVoxelSound = new SoundArray(); -resizeVoxelSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Voxel+Size/V+Size+Minus.raw"); -resizeVoxelSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Voxel+Size/V+Size+Plus.raw"); +resizeVoxelSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Voxel+Size/V+Size+Minus.raw"); +resizeVoxelSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Voxel+Size/V+Size+Plus.raw"); var voxelSizeMinus = 0; var voxelSizePlus = 1; var swatchesSound = new SoundArray(); -swatchesSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Swatches/Swatch+1.raw"); -swatchesSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Swatches/Swatch+2.raw"); -swatchesSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Swatches/Swatch+3.raw"); -swatchesSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Swatches/Swatch+4.raw"); -swatchesSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Swatches/Swatch+5.raw"); -swatchesSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Swatches/Swatch+6.raw"); -swatchesSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Swatches/Swatch+7.raw"); -swatchesSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Swatches/Swatch+8.raw"); -swatchesSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Swatches/Swatch+9.raw"); +swatchesSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Swatches/Swatch+1.raw"); +swatchesSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Swatches/Swatch+2.raw"); +swatchesSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Swatches/Swatch+3.raw"); +swatchesSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Swatches/Swatch+4.raw"); +swatchesSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Swatches/Swatch+5.raw"); +swatchesSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Swatches/Swatch+6.raw"); +swatchesSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Swatches/Swatch+7.raw"); +swatchesSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Swatches/Swatch+8.raw"); +swatchesSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Swatches/Swatch+9.raw"); var undoSound = new SoundArray(); -undoSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Undo/Undo+1.raw"); -undoSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Undo/Undo+2.raw"); -undoSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Undo/Undo+3.raw"); +undoSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Undo/Undo+1.raw"); +undoSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Undo/Undo+2.raw"); +undoSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Undo/Undo+3.raw"); var scriptInitSound = new SoundArray(); -scriptInitSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Script+Init/Script+Init+A.raw"); -scriptInitSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Script+Init/Script+Init+B.raw"); -scriptInitSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Script+Init/Script+Init+C.raw"); -scriptInitSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Script+Init/Script+Init+D.raw"); +scriptInitSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Script+Init/Script+Init+A.raw"); +scriptInitSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Script+Init/Script+Init+B.raw"); +scriptInitSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Script+Init/Script+Init+C.raw"); +scriptInitSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Script+Init/Script+Init+D.raw"); var modeSwitchSound = new SoundArray(); -modeSwitchSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Mode+Switch/Mode+1.raw"); -modeSwitchSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Mode+Switch/Mode+2.raw"); -modeSwitchSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Mode+Switch/Mode+3.raw"); +modeSwitchSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Mode+Switch/Mode+1.raw"); +modeSwitchSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Mode+Switch/Mode+2.raw"); +modeSwitchSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Mode+Switch/Mode+3.raw"); var initialVoxelSound = new SoundArray(); -initialVoxelSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Initial+Voxel/Initial+V.raw"); +initialVoxelSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Initial+Voxel/Initial+V.raw"); var colorInheritSound = new SoundArray(); -colorInheritSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Color+Inherit/Inherit+A.raw"); -colorInheritSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Color+Inherit/Inherit+B.raw"); -colorInheritSound.addSound("https://highfidelity-public.s3.amazonaws.com/sounds/Voxel+Editing/Color+Inherit/Inherit+C.raw"); +colorInheritSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Color+Inherit/Inherit+A.raw"); +colorInheritSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Color+Inherit/Inherit+B.raw"); +colorInheritSound.addSound(HIFI_PUBLIC_BUCKET + "sounds/Voxel+Editing/Color+Inherit/Inherit+C.raw"); // previewAsVoxel - by default, we will preview adds/deletes/recolors as just 4 lines on the intersecting face. But if you // the preview to show a full voxel then set this to true and the voxel will be displayed for voxel editing @@ -213,7 +215,7 @@ var swatchesWidth = swatchWidth * numColors + numColors + swatchExtraPadding * 2 var swatchesX = (windowDimensions.x - (swatchesWidth + scaleSelectorWidth)) / 2; var swatchesY = windowDimensions.y - swatchHeight + 1; -var toolIconUrl = "http://highfidelity-public.s3-us-west-1.amazonaws.com/images/tools/"; +var toolIconUrl = HIFI_PUBLIC_BUCKET + "images/tools/"; // create the overlays, position them in a row, set their colors, and for the selected one, use a different source image // location so that it displays the "selected" marker diff --git a/examples/fallingSand.js b/examples/fallingSand.js index 4eccccdc5a..5018aeb9ca 100644 --- a/examples/fallingSand.js +++ b/examples/fallingSand.js @@ -12,12 +12,14 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); + var zFightingSizeAdjust = 0.002; // used to adjust preview voxels to prevent z fighting var previewLineWidth = 2.0; var voxelSize = 1; var windowDimensions = Controller.getViewportDimensions(); -var toolIconUrl = "http://highfidelity-public.s3-us-west-1.amazonaws.com/images/tools/"; +var toolIconUrl = HIFI_PUBLIC_BUCKET + "images/tools/"; var MAX_VOXEL_SCALE_POWER = 5; var MIN_VOXEL_SCALE_POWER = -8; diff --git a/examples/frisbee.js b/examples/frisbee.js index c069d03275..653a1d4b57 100644 --- a/examples/frisbee.js +++ b/examples/frisbee.js @@ -14,6 +14,8 @@ // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // + +Script.include("libraries/globals.js"); Script.include("libraries/toolBars.js"); const LEFT_PALM = 0; @@ -160,7 +162,7 @@ var currentMouseControl = false; var newSound = new Sound("https://dl.dropboxusercontent.com/u/1864924/hifi-sounds/throw.raw"); var catchSound = new Sound("https://dl.dropboxusercontent.com/u/1864924/hifi-sounds/catch.raw"); -var throwSound = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Switches%20and%20sliders/slider%20-%20whoosh1.raw"); +var throwSound = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Switches%20and%20sliders/slider%20-%20whoosh1.raw"); var simulatedFrisbees = []; diff --git a/examples/grenadeLauncher.js b/examples/grenadeLauncher.js index 0cac55baa7..dc25282448 100644 --- a/examples/grenadeLauncher.js +++ b/examples/grenadeLauncher.js @@ -14,6 +14,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); + function getRandomFloat(min, max) { return Math.random() * (max - min) + min; } @@ -34,11 +36,11 @@ var RELOAD_INTERVAL = 5; var showScore = false; // Load some sound to use for loading and firing -var fireSound = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guns/GUN-SHOT2.raw"); -var loadSound = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guns/Gun_Reload_Weapon22.raw"); -var impactSound = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guns/BulletImpact2.raw"); -var targetHitSound = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Space%20Invaders/hit.raw"); -var targetLaunchSound = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Space%20Invaders/shoot.raw"); +var fireSound = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Guns/GUN-SHOT2.raw"); +var loadSound = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Guns/Gun_Reload_Weapon22.raw"); +var impactSound = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Guns/BulletImpact2.raw"); +var targetHitSound = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Space%20Invaders/hit.raw"); +var targetLaunchSound = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Space%20Invaders/shoot.raw"); var gunModel = "http://public.highfidelity.io/models/attachments/HaloGun.fst"; @@ -67,7 +69,7 @@ var reticle = Overlays.addOverlay("image", { y: screenSize.y / 2 - 16, width: 32, height: 32, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/reticle.png", + imageURL: HIFI_PUBLIC_BUCKET + "images/reticle.png", color: { red: 255, green: 255, blue: 255}, alpha: 1 }); diff --git a/examples/growTrees.js b/examples/growTrees.js index 142c72300a..13d6cdc587 100644 --- a/examples/growTrees.js +++ b/examples/growTrees.js @@ -11,12 +11,14 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); + var zFightingSizeAdjust = 0.002; // used to adjust preview voxels to prevent z fighting var previewLineWidth = 2.0; var voxelSize = 1; var windowDimensions = Controller.getViewportDimensions(); -var toolIconUrl = "http://highfidelity-public.s3-us-west-1.amazonaws.com/images/tools/"; +var toolIconUrl = HIFI_PUBLIC_BUCKET + "images/tools/"; var MAX_VOXEL_SCALE_POWER = 5; var MIN_VOXEL_SCALE_POWER = -8; diff --git a/examples/gun.js b/examples/gun.js index a5c0ee83e0..6f1371e5d9 100644 --- a/examples/gun.js +++ b/examples/gun.js @@ -14,6 +14,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); + function getRandomFloat(min, max) { return Math.random() * (max - min) + min; } @@ -33,11 +35,11 @@ var RELOAD_INTERVAL = 5; var showScore = false; // Load some sound to use for loading and firing -var fireSound = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guns/GUN-SHOT2.raw"); -var loadSound = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guns/Gun_Reload_Weapon22.raw"); -var impactSound = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guns/BulletImpact2.raw"); -var targetHitSound = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Space%20Invaders/hit.raw"); -var targetLaunchSound = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Space%20Invaders/shoot.raw"); +var fireSound = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Guns/GUN-SHOT2.raw"); +var loadSound = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Guns/Gun_Reload_Weapon22.raw"); +var impactSound = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Guns/BulletImpact2.raw"); +var targetHitSound = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Space%20Invaders/hit.raw"); +var targetLaunchSound = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Space%20Invaders/shoot.raw"); var gunModel = "http://public.highfidelity.io/models/attachments/HaloGun.fst"; @@ -66,7 +68,7 @@ var reticle = Overlays.addOverlay("image", { y: screenSize.y / 2 - 16, width: 32, height: 32, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/reticle.png", + imageURL: HIFI_PUBLIC_BUCKET + "images/reticle.png", color: { red: 255, green: 255, blue: 255}, alpha: 1 }); diff --git a/examples/inWorldTestTone.js b/examples/inWorldTestTone.js index e4f34d87cd..590bb6c342 100644 --- a/examples/inWorldTestTone.js +++ b/examples/inWorldTestTone.js @@ -11,7 +11,9 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -var sound = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/220Sine.wav"); +Script.include("libraries/globals.js"); + +var sound = new Sound(HIFI_PUBLIC_BUCKET + "sounds/220Sine.wav"); var soundPlaying = false; diff --git a/examples/libraries/entitySelectionTool.js b/examples/libraries/entitySelectionTool.js index 5a0164ad1f..e07fb752e5 100644 --- a/examples/libraries/entitySelectionTool.js +++ b/examples/libraries/entitySelectionTool.js @@ -11,6 +11,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); + SelectionDisplay = (function () { var that = {}; @@ -100,7 +102,7 @@ SelectionDisplay = (function () { }); var grabberMoveUp = Overlays.addOverlay("billboard", { - url: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/up-arrow.png", + url: HIFI_PUBLIC_BUCKET + "images/up-arrow.png", position: { x:0, y: 0, z: 0}, color: { red: 0, green: 0, blue: 0 }, alpha: 1.0, diff --git a/examples/libraries/globals.js b/examples/libraries/globals.js new file mode 100644 index 0000000000..1bd851af77 --- /dev/null +++ b/examples/libraries/globals.js @@ -0,0 +1,11 @@ +// +// globals.js +// examples/libraries +// +// Copyright 2014 High Fidelity, Inc. +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + +HIFI_PUBLIC_BUCKET = "https://s3.amazonaws.com/hifi-public/"; diff --git a/examples/locationsMenu.js b/examples/locationsMenu.js index 24b0dabf46..30fa377a6f 100644 --- a/examples/locationsMenu.js +++ b/examples/locationsMenu.js @@ -9,6 +9,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); + var scriptUrl = "https://script.google.com/macros/s/AKfycbwIo4lmF-qUwX1Z-9eA_P-g2gse9oFhNcjVyyksGukyDDEFXgU/exec?action=listOwners&domain=alpha.highfidelity.io"; var LocationMenu = function(opts) { @@ -24,7 +26,7 @@ var LocationMenu = function(opts) { var disabledColor = { red: 64, green: 64, blue: 64}; var position = { x: 0, y: 0 }; - var locationIconUrl = "http://highfidelity-public.s3-us-west-1.amazonaws.com/images/tools/location.svg"; + var locationIconUrl = HIFI_PUBLIC_BUCKET + "images/tools/location.svg"; var toolHeight = 50; var toolWidth = 50; var visible = false; diff --git a/examples/move.js b/examples/move.js old mode 100755 new mode 100644 diff --git a/examples/myBalance.js b/examples/myBalance.js index bd48e8fd21..43f1f40eae 100644 --- a/examples/myBalance.js +++ b/examples/myBalance.js @@ -11,6 +11,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); + var Controller = Controller || {}; var Overlays = Overlays || {}; var Script = Script || {}; @@ -18,7 +20,7 @@ var Account = Account || {}; (function () { "use strict"; - var iconUrl = 'http://highfidelity-public.s3-us-west-1.amazonaws.com/images/tools/', + var iconUrl = HIFI_PUBLIC_BUCKET + 'images/tools/', overlayWidth = 150, overlayHeight = 50, overlayTopOffset = 15, diff --git a/examples/newEditEntities.js b/examples/newEditEntities.js index de39121e35..a223813347 100644 --- a/examples/newEditEntities.js +++ b/examples/newEditEntities.js @@ -11,6 +11,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); Script.include("libraries/stringHelpers.js"); Script.include("libraries/dataviewHelpers.js"); Script.include("libraries/httpMultiPart.js"); @@ -31,7 +32,7 @@ Script.include("libraries/entityPropertyDialogBox.js"); var entityPropertyDialogBox = EntityPropertyDialogBox; var windowDimensions = Controller.getViewportDimensions(); -var toolIconUrl = "http://highfidelity-public.s3-us-west-1.amazonaws.com/images/tools/"; +var toolIconUrl = HIFI_PUBLIC_BUCKET + "images/tools/"; var toolHeight = 50; var toolWidth = 50; @@ -45,14 +46,14 @@ var SPAWN_DISTANCE = 1; var DEFAULT_DIMENSION = 0.20; var modelURLs = [ - "http://highfidelity-public.s3-us-west-1.amazonaws.com/meshes/Feisar_Ship.FBX", - "http://highfidelity-public.s3-us-west-1.amazonaws.com/meshes/birarda/birarda_head.fbx", - "http://highfidelity-public.s3-us-west-1.amazonaws.com/meshes/pug.fbx", - "http://highfidelity-public.s3-us-west-1.amazonaws.com/meshes/newInvader16x16-large-purple.svo", - "http://highfidelity-public.s3-us-west-1.amazonaws.com/meshes/minotaur/mino_full.fbx", - "http://highfidelity-public.s3-us-west-1.amazonaws.com/meshes/Combat_tank_V01.FBX", - "http://highfidelity-public.s3-us-west-1.amazonaws.com/meshes/orc.fbx", - "http://highfidelity-public.s3-us-west-1.amazonaws.com/meshes/slimer.fbx" + HIFI_PUBLIC_BUCKET + "meshes/Feisar_Ship.FBX", + HIFI_PUBLIC_BUCKET + "meshes/birarda/birarda_head.fbx", + HIFI_PUBLIC_BUCKET + "meshes/pug.fbx", + HIFI_PUBLIC_BUCKET + "meshes/newInvader16x16-large-purple.svo", + HIFI_PUBLIC_BUCKET + "meshes/minotaur/mino_full.fbx", + HIFI_PUBLIC_BUCKET + "meshes/Combat_tank_V01.FBX", + HIFI_PUBLIC_BUCKET + "meshes/orc.fbx", + HIFI_PUBLIC_BUCKET + "meshes/slimer.fbx" ]; var mode = 0; @@ -310,7 +311,7 @@ var exportMenu = null; function isLocked(properties) { // special case to lock the ground plane model in hq. if (location.hostname == "hq.highfidelity.io" && - properties.modelURL == "https://s3-us-west-1.amazonaws.com/highfidelity-public/ozan/Terrain_Reduce_forAlpha.fbx") { + properties.modelURL == HIFI_PUBLIC_BUCKET + "ozan/Terrain_Reduce_forAlpha.fbx") { return true; } return false; diff --git a/examples/overlaysExample.js b/examples/overlaysExample.js index d0b3870803..2161b1c903 100644 --- a/examples/overlaysExample.js +++ b/examples/overlaysExample.js @@ -11,6 +11,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); // The "Swatches" example of this script will create 9 different image overlays, that use the color feature to // display different colors as color swatches. The overlays can be clicked on, to change the "selectedSwatch" variable @@ -51,7 +52,7 @@ for (s = 0; s < numberOfSwatches; s++) { width: 31, height: 54, subImage: { x: imageFromX, y: imageFromY, width: 30, height: 54 }, - imageURL: "http://highfidelity-public.s3-us-west-1.amazonaws.com/images/testing-swatches.svg", + imageURL: HIFI_PUBLIC_BUCKET + "images/testing-swatches.svg", color: swatchColors[s], alpha: 1 }); @@ -77,7 +78,7 @@ var toolA = Overlays.addOverlay("image", { width: 62, height: 40, subImage: { x: 0, y: 0, width: 62, height: 40 }, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/hifi-interface-tools.svg", + imageURL: HIFI_PUBLIC_BUCKET + "images/hifi-interface-tools.svg", color: { red: 255, green: 255, blue: 255}, visible: false }); @@ -87,7 +88,7 @@ var toolA = Overlays.addOverlay("image", { var slider = Overlays.addOverlay("image", { // alternate form of expressing bounds bounds: { x: 100, y: 300, width: 158, height: 35}, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/slider.png", + imageURL: HIFI_PUBLIC_BUCKET + "images/slider.png", color: { red: 255, green: 255, blue: 255}, alpha: 1 }); @@ -101,7 +102,7 @@ var thumb = Overlays.addOverlay("image", { y: 309, width: 18, height: 17, - imageURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/images/thumb.png", + imageURL: HIFI_PUBLIC_BUCKET + "images/thumb.png", color: { red: 255, green: 255, blue: 255}, alpha: 1 }); diff --git a/examples/particleBirds.js b/examples/particleBirds.js index 9492a321ce..6ed37aefe1 100644 --- a/examples/particleBirds.js +++ b/examples/particleBirds.js @@ -11,6 +11,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); + // Multiply vector by scalar function vScalarMult(v, s) { var rval = { x: v.x * s, y: v.y * s, z: v.z * s }; @@ -68,23 +70,23 @@ function addBird() var size; var which = Math.random(); if (which < 0.2) { - tweet = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Animals/bushtit_1.raw"); + tweet = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Animals/bushtit_1.raw"); color = { red: 100, green: 50, blue: 120 }; size = 0.08; } else if (which < 0.4) { - tweet = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Animals/rosyfacedlovebird.raw"); + tweet = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Animals/rosyfacedlovebird.raw"); color = { red: 100, green: 150, blue: 75 }; size = 0.09; } else if (which < 0.6) { - tweet = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Animals/saysphoebe.raw"); + tweet = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Animals/saysphoebe.raw"); color = { red: 84, green: 121, blue: 36 }; size = 0.05; } else if (which < 0.8) { - tweet = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Animals/mexicanWhipoorwill.raw"); + tweet = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Animals/mexicanWhipoorwill.raw"); color = { red: 23, green: 197, blue: 230 }; size = 0.12; } else { - tweet = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Animals/westernscreechowl.raw"); + tweet = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Animals/westernscreechowl.raw"); color = { red: 50, green: 67, blue: 144 }; size = 0.15; } diff --git a/examples/particleModelExample.js b/examples/particleModelExample.js index b489e704c9..d589e6bb31 100644 --- a/examples/particleModelExample.js +++ b/examples/particleModelExample.js @@ -11,6 +11,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); + var count = 0; var stopAfter = 100; @@ -20,7 +22,7 @@ var modelPropertiesA = { gravity: { x: 0, y: 0, z: 0 }, damping: 0, radius : 0.25, - modelURL: "http://highfidelity-public.s3-us-west-1.amazonaws.com/meshes/Feisar_Ship.FBX", + modelURL: HIFI_PUBLICK_BUCKET + "meshes/Feisar_Ship.FBX", lifetime: 20 }; @@ -30,7 +32,7 @@ var modelPropertiesB = { gravity: { x: 0, y: 0, z: 0 }, damping: 0, radius : 0.25, - modelURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/meshes/newInvader16x16.svo", + modelURL: HIFI_PUBLIC_BUCKET + "meshes/newInvader16x16.svo", modelScale: 450, modelTranslation: { x: -1.3, y: -1.3, z: -1.3 }, lifetime: 20 diff --git a/examples/playSound.js b/examples/playSound.js index 189c24e86f..4130db5b16 100644 --- a/examples/playSound.js +++ b/examples/playSound.js @@ -8,8 +8,10 @@ // Distributed under the Apache License, Version 2.0. // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +Script.include("libraries/globals.js"); + // First, load a sample sound from a URL -var bird = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Animals/bushtit_1.raw"); +var bird = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Animals/bushtit_1.raw"); function maybePlaySound(deltaTime) { if (Math.random() < 0.01) { diff --git a/examples/playSoundLoop.js b/examples/playSoundLoop.js index 30f8762248..3122f13f37 100644 --- a/examples/playSoundLoop.js +++ b/examples/playSoundLoop.js @@ -11,12 +11,13 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); // A few sample files you may want to try: -var sound = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Guitars/Guitar+-+Nylon+A.raw"); -//var sound = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/220Sine.wav"); -//var sound = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Cocktail+Party+Snippets/Bandcamp.wav"); +var sound = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Guitars/Guitar+-+Nylon+A.raw"); +//var sound = new Sound(HIFI_PUBLIC_BUCKET + "sounds/220Sine.wav"); +//var sound = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Cocktail+Party+Snippets/Bandcamp.wav"); var soundPlaying = false; var options = new AudioInjectionOptions(); diff --git a/examples/playSoundOrbit.js b/examples/playSoundOrbit.js index da7c746e8e..2c44a4535a 100644 --- a/examples/playSoundOrbit.js +++ b/examples/playSoundOrbit.js @@ -9,7 +9,9 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -var soundClip = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Voxels/voxel create 3.raw"); +Script.include("libraries/globals.js"); + +var soundClip = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Voxels/voxel create 3.raw"); var currentTime = 1.570079; // pi/2 var deltaTime = 0.05; diff --git a/examples/playSoundWave.js b/examples/playSoundWave.js index 419fd80cd2..f152effb47 100644 --- a/examples/playSoundWave.js +++ b/examples/playSoundWave.js @@ -9,7 +9,9 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -var soundClip = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Cocktail%20Party%20Snippets/Walken1.wav"); +Script.include("libraries/globals.js"); + +var soundClip = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Cocktail%20Party%20Snippets/Walken1.wav"); function playSound() { var options = new AudioInjectionOptions(); diff --git a/examples/radio.js b/examples/radio.js index 575d9d70c8..293867398a 100644 --- a/examples/radio.js +++ b/examples/radio.js @@ -9,9 +9,10 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); -var modelURL = "https://s3-us-west-1.amazonaws.com/highfidelity-public/models/entities/radio/Speakers.fbx"; -var soundURL = "https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/FamilyStereo.raw"; +var modelURL = HIFI_PUBLIC_BUCKET + "models/entities/radio/Speakers.fbx"; +var soundURL = HIFI_PUBLIC_BUCKET + "sounds/FamilyStereo.raw"; var AudioRotationOffset = Quat.fromPitchYawRollDegrees(0, -90, 0); var audioOptions = new AudioInjectionOptions(); diff --git a/examples/selectAudioDevice.js b/examples/selectAudioDevice.js index 23606f774c..a90f3da4cf 100644 --- a/examples/selectAudioDevice.js +++ b/examples/selectAudioDevice.js @@ -41,6 +41,9 @@ if (typeof String.prototype.trimEndsWith != 'function') { }; } +const INPUT_DEVICE_SETTING = "audio_input_device"; +const OUTPUT_DEVICE_SETTING = "audio_output_device"; + var selectedInputMenu = ""; var selectedOutputMenu = ""; @@ -48,9 +51,14 @@ function setupAudioMenus() { Menu.addMenu("Tools > Audio"); Menu.addSeparator("Tools > Audio","Output Audio Device"); + var outputDeviceSetting = Settings.getValue(OUTPUT_DEVICE_SETTING); var outputDevices = AudioDevice.getOutputDevices(); var selectedOutputDevice = AudioDevice.getOutputDevice(); - + if (outputDevices.indexOf(outputDeviceSetting) != -1 && selectedOutputDevice != outputDeviceSetting) { + if (AudioDevice.setOutputDevice(outputDeviceSetting)) { + selectedOutputDevice = outputDeviceSetting; + } + } for(var i = 0; i < outputDevices.length; i++) { var thisDeviceSelected = (outputDevices[i] == selectedOutputDevice); var menuItem = "Use " + outputDevices[i] + " for Output"; @@ -67,9 +75,14 @@ function setupAudioMenus() { Menu.addSeparator("Tools > Audio","Input Audio Device"); + var inputDeviceSetting = Settings.getValue(INPUT_DEVICE_SETTING); var inputDevices = AudioDevice.getInputDevices(); var selectedInputDevice = AudioDevice.getInputDevice(); - + if (inputDevices.indexOf(inputDeviceSetting) != -1 && selectedInputDevice != inputDeviceSetting) { + if (AudioDevice.setInputDevice(inputDeviceSetting)) { + selectedInputDevice = inputDeviceSetting; + } + } for(var i = 0; i < inputDevices.length; i++) { var thisDeviceSelected = (inputDevices[i] == selectedInputDevice); var menuItem = "Use " + inputDevices[i] + " for Input"; @@ -85,7 +98,8 @@ function setupAudioMenus() { } } -setupAudioMenus(); +// Have a small delay before the menu's get setup and the audio devices can switch to the last selected ones +Script.setTimeout(function() { setupAudioMenus(); }, 5000); function scriptEnding() { Menu.removeMenu("Tools > Audio"); @@ -101,15 +115,18 @@ function menuItemEvent(menuItem) { Menu.setIsOptionChecked(selectedOutputMenu, false); selectedOutputMenu = menuItem; Menu.setIsOptionChecked(selectedOutputMenu, true); - AudioDevice.setOutputDevice(selectedDevice); - + if (AudioDevice.setOutputDevice(selectedDevice)) { + Settings.setValue(OUTPUT_DEVICE_SETTING, selectedDevice); + } } else if (menuItem.endsWith(" for Input")) { var selectedDevice = menuItem.trimStartsWith("Use ").trimEndsWith(" for Input"); print("input audio selection..." + selectedDevice); Menu.setIsOptionChecked(selectedInputMenu, false); selectedInputMenu = menuItem; Menu.setIsOptionChecked(selectedInputMenu, true); - AudioDevice.setInputDevice(selectedDevice); + if (AudioDevice.setInputDevice(selectedDevice)) { + Settings.setValue(INPUT_DEVICE_SETTING, selectedDevice); + } } } } diff --git a/examples/spaceInvadersExample.js b/examples/spaceInvadersExample.js index 5d62102d71..862d731f90 100644 --- a/examples/spaceInvadersExample.js +++ b/examples/spaceInvadersExample.js @@ -11,6 +11,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); + var iteration = 0; var gameOver = false; @@ -82,13 +84,13 @@ var missileFired = false; var myMissile; // sounds -var hitSound = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Space%20Invaders/hit.raw"); -var shootSound = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Space%20Invaders/shoot.raw"); +var hitSound = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Space%20Invaders/hit.raw"); +var shootSound = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Space%20Invaders/shoot.raw"); var moveSounds = new Array(); -moveSounds[0] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Space%20Invaders/Lo1.raw"); -moveSounds[1] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Space%20Invaders/Lo2.raw"); -moveSounds[2] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Space%20Invaders/Lo3.raw"); -moveSounds[3] = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Space%20Invaders/Lo4.raw"); +moveSounds[0] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Space%20Invaders/Lo1.raw"); +moveSounds[1] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Space%20Invaders/Lo2.raw"); +moveSounds[2] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Space%20Invaders/Lo3.raw"); +moveSounds[3] = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Space%20Invaders/Lo4.raw"); var currentMoveSound = 0; var numberOfSounds = 4; var stepsPerSound = invaderStepsPerCycle / numberOfSounds; @@ -99,36 +101,36 @@ var soundInMyHead = true; // models... var invaderModels = new Array(); invaderModels[0] = { - modelURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/meshes/newInvader16x16-large-purple.svo", + modelURL: HIFI_PUBLIC_BUCKET + "meshes/newInvader16x16-large-purple.svo", modelScale: 450, modelTranslation: { x: -1.3, y: -1.3, z: -1.3 }, }; invaderModels[1] = { - modelURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/meshes/newInvader16x16-large-cyan.svo", + modelURL: HIFI_PUBLIC_BUCKET + "meshes/newInvader16x16-large-cyan.svo", modelScale: 450, modelTranslation: { x: -1.3, y: -1.3, z: -1.3 }, }; invaderModels[2] = { - modelURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/meshes/newInvader16x16-medium-cyan.svo", + modelURL: HIFI_PUBLIC_BUCKET + "meshes/newInvader16x16-medium-cyan.svo", modelScale: 450, modelTranslation: { x: -1.3, y: -1.3, z: -1.3 }, }; invaderModels[3] = { - modelURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/meshes/newInvader16x16-medium-green.svo", + modelURL: HIFI_PUBLIC_BUCKET + "meshes/newInvader16x16-medium-green.svo", modelScale: 450, modelTranslation: { x: -1.3, y: -1.3, z: -1.3 }, }; invaderModels[4] = { - modelURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/meshes/newInvader16x16-small-green.svo", + modelURL: HIFI_PUBLIC_BUCKET + "meshes/newInvader16x16-small-green.svo", modelScale: 450, modelTranslation: { x: -1.3, y: -1.3, z: -1.3 }, }; -//modelURL: "http://highfidelity-public.s3-us-west-1.amazonaws.com/meshes/Feisar_Ship.FBX", -//modelURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/meshes/invader.svo", -// "http://highfidelity-public.s3-us-west-1.amazonaws.com/meshes/spaceInvader3.fbx" +//modelURL: HIFI_PUBLIC_BUCKET + "meshes/Feisar_Ship.FBX", +//modelURL: HIFI_PUBLIC_BUCKET + "meshes/invader.svo", +// HIFI_PUBLIC_BUCKET + "meshes/spaceInvader3.fbx" function initializeMyShip() { myShipProperties = { @@ -138,7 +140,7 @@ function initializeMyShip() { damping: 0, radius: shipSize, color: { red: 0, green: 255, blue: 0 }, - modelURL: "https://s3-us-west-1.amazonaws.com/highfidelity-public/meshes/myCannon16x16.svo", + modelURL: HIFI_PUBLIC_BUCKET + "meshes/myCannon16x16.svo", modelScale: 450, modelTranslation: { x: -1.3, y: -1.3, z: -1.3 }, lifetime: itemLifetimes diff --git a/examples/squeezeHands.js b/examples/squeezeHands.js index f920692a3b..21da7f9c25 100644 --- a/examples/squeezeHands.js +++ b/examples/squeezeHands.js @@ -9,8 +9,10 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -var rightHandAnimation = "https://s3-us-west-1.amazonaws.com/highfidelity-public/animations/RightHandAnimPhilip.fbx"; -var leftHandAnimation = "https://s3-us-west-1.amazonaws.com/highfidelity-public/animations/LeftHandAnimPhilip.fbx"; +Script.include("libraries/globals.js"); + +var rightHandAnimation = HIFI_PUBLIC_BUCKET + "animations/RightHandAnimPhilip.fbx"; +var leftHandAnimation = HIFI_PUBLIC_BUCKET + "animations/LeftHandAnimPhilip.fbx"; var LEFT = 0; var RIGHT = 1; diff --git a/examples/toyball.js b/examples/toyball.js index e03fd67a5d..f79f3cb1f4 100644 --- a/examples/toyball.js +++ b/examples/toyball.js @@ -15,6 +15,8 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // +Script.include("libraries/globals.js"); + // maybe we should make these constants... var LEFT_PALM = 0; var LEFT_TIP = 1; @@ -39,7 +41,7 @@ var rightHandParticle; var newSound = new Sound("https://dl.dropboxusercontent.com/u/1864924/hifi-sounds/throw.raw"); var catchSound = new Sound("https://dl.dropboxusercontent.com/u/1864924/hifi-sounds/catch.raw"); -var throwSound = new Sound("http://highfidelity-public.s3-us-west-1.amazonaws.com/sounds/Switches%20and%20sliders/slider%20-%20whoosh1.raw"); +var throwSound = new Sound(HIFI_PUBLIC_BUCKET + "sounds/Switches%20and%20sliders/slider%20-%20whoosh1.raw"); var targetRadius = 1.0; diff --git a/interface/resources/shaders/SkyFromAtmosphere.vert b/interface/resources/shaders/SkyFromAtmosphere.vert index 31c1ea958a..e04868de1d 100644 --- a/interface/resources/shaders/SkyFromAtmosphere.vert +++ b/interface/resources/shaders/SkyFromAtmosphere.vert @@ -35,6 +35,7 @@ uniform vec3 v3CameraPos; // The camera's current position uniform vec3 v3LightPos; // The direction vector to the light source uniform vec3 v3InvWavelength; // 1 / pow(wavelength, 4) for the red, green, and blue channels +uniform float fOuterRadius; // The outer (atmosphere) radius uniform float fInnerRadius; // The inner (planetary) radius uniform float fKrESun; // Kr * ESun uniform float fKmESun; // Km * ESun @@ -44,6 +45,7 @@ uniform float fScale; // 1 / (fOuterRadius - fInnerRadius) uniform float fScaleDepth; // The scale depth (i.e. the altitude at which the atmosphere's average density is found) uniform float fScaleOverScaleDepth; // fScale / fScaleDepth + const int nSamples = 2; const float fSamples = 2.0; @@ -59,7 +61,7 @@ float scale(float fCos) void main(void) { // Get the ray from the camera to the vertex, and its length (which is the far point of the ray passing through the atmosphere) - position = gl_Vertex.xyz; + position = gl_Vertex.xyz * fOuterRadius; - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + gl_Position = gl_ModelViewProjectionMatrix * vec4(position, 1.0); } diff --git a/interface/resources/shaders/SkyFromSpace.vert b/interface/resources/shaders/SkyFromSpace.vert index 0c06c90cf8..6740d1909e 100644 --- a/interface/resources/shaders/SkyFromSpace.vert +++ b/interface/resources/shaders/SkyFromSpace.vert @@ -32,10 +32,12 @@ // Copyright (c) 2004 Sean O'Neil // +uniform float fOuterRadius; // The outer (atmosphere) radius + varying vec3 position; void main(void) { - position = gl_Vertex.xyz; - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + position = gl_Vertex.xyz * fOuterRadius; + gl_Position = gl_ModelViewProjectionMatrix * vec4(position, 1.0); } diff --git a/interface/resources/shaders/metavoxel_voxel_splat.frag b/interface/resources/shaders/metavoxel_voxel_splat.frag index d0d0661164..e7a33618cb 100644 --- a/interface/resources/shaders/metavoxel_voxel_splat.frag +++ b/interface/resources/shaders/metavoxel_voxel_splat.frag @@ -26,12 +26,20 @@ varying vec4 alphaValues; void main(void) { // determine the cube face to use for texture coordinate generation vec3 absNormal = abs(normal); - vec3 steps = step(absNormal.zzy, absNormal.xyx); - vec2 parameters = mix(vec2(0.0, steps.y), vec2(steps.x, steps.x), steps.z); + vec3 steps = smoothstep(absNormal.zzy - vec3(0.05, 0.05, 0.05), absNormal.zzy + vec3(0.05, 0.05, 0.05), absNormal.xyx); // blend the splat textures - gl_FragColor = (texture2D(diffuseMaps[0], mix(gl_TexCoord[0].xy, gl_TexCoord[0].zw, parameters)) * alphaValues.x + - texture2D(diffuseMaps[1], mix(gl_TexCoord[1].xy, gl_TexCoord[1].zw, parameters)) * alphaValues.y + - texture2D(diffuseMaps[2], mix(gl_TexCoord[2].xy, gl_TexCoord[2].zw, parameters)) * alphaValues.z + - texture2D(diffuseMaps[3], mix(gl_TexCoord[3].xy, gl_TexCoord[3].zw, parameters)) * alphaValues.w); + vec4 base0 = texture2D(diffuseMaps[0], gl_TexCoord[0].xy); + vec4 base1 = texture2D(diffuseMaps[1], gl_TexCoord[1].xy); + vec4 base2 = texture2D(diffuseMaps[2], gl_TexCoord[2].xy); + vec4 base3 = texture2D(diffuseMaps[3], gl_TexCoord[3].xy); + gl_FragColor = + mix(mix(base0, texture2D(diffuseMaps[0], gl_TexCoord[0].xw), steps.y), + mix(base0, texture2D(diffuseMaps[0], gl_TexCoord[0].zw), steps.x), steps.z) * alphaValues.x + + mix(mix(base1, texture2D(diffuseMaps[1], gl_TexCoord[1].xw), steps.y), + mix(base1, texture2D(diffuseMaps[1], gl_TexCoord[1].zw), steps.x), steps.z) * alphaValues.y + + mix(mix(base2, texture2D(diffuseMaps[2], gl_TexCoord[2].xw), steps.y), + mix(base2, texture2D(diffuseMaps[2], gl_TexCoord[2].zw), steps.x), steps.z) * alphaValues.z + + mix(mix(base3, texture2D(diffuseMaps[3], gl_TexCoord[3].xw), steps.y), + mix(base3, texture2D(diffuseMaps[3], gl_TexCoord[3].zw), steps.x), steps.z) * alphaValues.w; } diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 0551886abb..215848b355 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -883,7 +883,11 @@ void Application::keyPressEvent(QKeyEvent* event) { break; case Qt::Key_W: - _myAvatar->setDriveKeys(FWD, 1.f); + if (isOption && !isShifted && !isMeta) { + Menu::getInstance()->triggerOption(MenuOption::Wireframe); + } else { + _myAvatar->setDriveKeys(FWD, 1.f); + } break; case Qt::Key_S: @@ -2902,10 +2906,8 @@ void Application::displaySide(Camera& whichCamera, bool selfAvatarOnly) { // draw a red sphere float originSphereRadius = 0.05f; glColor3f(1,0,0); - glPushMatrix(); - glutSolidSphere(originSphereRadius, 15, 15); - glPopMatrix(); - + _geometryCache.renderSphere(originSphereRadius, 15, 15); + // draw the audio reflector overlay { PerformanceTimer perfTimer("audio"); diff --git a/interface/src/BuckyBalls.cpp b/interface/src/BuckyBalls.cpp index 1bc093283a..0ea73556c5 100644 --- a/interface/src/BuckyBalls.cpp +++ b/interface/src/BuckyBalls.cpp @@ -11,6 +11,7 @@ #include "BuckyBalls.h" +#include "Application.h" #include "Util.h" #include "world.h" #include "devices/SixenseManager.h" @@ -171,7 +172,7 @@ void BuckyBalls::render() { } glPushMatrix(); glTranslatef(_bballPosition[i].x, _bballPosition[i].y, _bballPosition[i].z); - glutSolidSphere(_bballRadius[i], 15, 15); + Application::getInstance()->getGeometryCache()->renderSphere(_bballRadius[i], 15, 15); glPopMatrix(); } } diff --git a/interface/src/Environment.cpp b/interface/src/Environment.cpp index 67337f963c..631e3da1cf 100644 --- a/interface/src/Environment.cpp +++ b/interface/src/Environment.cpp @@ -261,10 +261,10 @@ void Environment::renderAtmosphere(Camera& camera, const EnvironmentData& data) glDepthMask(GL_FALSE); glDisable(GL_DEPTH_TEST); - glutSolidSphere(data.getAtmosphereOuterRadius(), 100, 50); + Application::getInstance()->getGeometryCache()->renderSphere(1.f, 100, 50); //Draw a unit sphere glDepthMask(GL_TRUE); program->release(); - glPopMatrix(); + glPopMatrix(); } diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 80f3b7770e..5f2e3d767a 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -385,7 +385,7 @@ Menu::Menu() : 0, appInstance->getGlowEffect(), SLOT(cycleRenderMode())); - addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Wireframe, 0, false); + addCheckableActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::Wireframe, Qt::ALT | Qt::Key_W, false); addActionToQMenuAndActionHash(renderOptionsMenu, MenuOption::LodTools, Qt::SHIFT | Qt::Key_L, this, SLOT(lodTools())); QMenu* avatarDebugMenu = developerMenu->addMenu("Avatar"); diff --git a/interface/src/MetavoxelSystem.cpp b/interface/src/MetavoxelSystem.cpp index f82fba98a0..7faf1a5bf4 100644 --- a/interface/src/MetavoxelSystem.cpp +++ b/interface/src/MetavoxelSystem.cpp @@ -2423,7 +2423,7 @@ void SphereRenderer::renderUnclipped(const glm::vec4& color, Mode mode) { glm::vec3 axis = glm::axis(rotation); glRotatef(glm::degrees(glm::angle(rotation)), axis.x, axis.y, axis.z); - glutSolidSphere(sphere->getScale(), 10, 10); + Application::getInstance()->getGeometryCache()->renderSphere(sphere->getScale(), 10, 10); glPopMatrix(); } diff --git a/interface/src/ScriptsModel.cpp b/interface/src/ScriptsModel.cpp index 9c206fe9f6..8bea122338 100644 --- a/interface/src/ScriptsModel.cpp +++ b/interface/src/ScriptsModel.cpp @@ -21,7 +21,7 @@ #include "ScriptsModel.h" -static const QString S3_URL = "http://highfidelity-public.s3-us-west-1.amazonaws.com"; +static const QString S3_URL = "https://s3.amazonaws.com/hifi-public"; static const QString PUBLIC_URL = "http://public.highfidelity.io"; static const QString MODELS_LOCATION = "scripts/"; diff --git a/interface/src/Stars.cpp b/interface/src/Stars.cpp old mode 100755 new mode 100644 diff --git a/interface/src/Stars.h b/interface/src/Stars.h old mode 100755 new mode 100644 diff --git a/interface/src/Util.cpp b/interface/src/Util.cpp index b219509ccd..9d7f5518d0 100644 --- a/interface/src/Util.cpp +++ b/interface/src/Util.cpp @@ -27,6 +27,7 @@ #include "ui/TextRenderer.h" #include "VoxelConstants.h" #include "world.h" +#include "Application.h" #include "Util.h" @@ -112,13 +113,13 @@ void drawVector(glm::vec3 * vector) { glPushMatrix(); glColor3f(1,0,0); glTranslatef(vector->x, 0, 0); - glutSolidSphere(0.02, 10, 10); + Application::getInstance()->getGeometryCache()->renderSphere(0.02f, 10, 10); glColor3f(0,1,0); glTranslatef(-vector->x, vector->y, 0); - glutSolidSphere(0.02, 10, 10); + Application::getInstance()->getGeometryCache()->renderSphere(0.02f, 10, 10); glColor3f(0,0,1); glTranslatef(0, -vector->y, vector->z); - glutSolidSphere(0.02, 10, 10); + Application::getInstance()->getGeometryCache()->renderSphere(0.02f, 10, 10); glPopMatrix(); } @@ -155,22 +156,22 @@ void renderWorldBox() { glPushMatrix(); glTranslatef(MARKER_DISTANCE, 0, 0); glColor3fv(red); - glutSolidSphere(MARKER_RADIUS, 10, 10); + Application::getInstance()->getGeometryCache()->renderSphere(MARKER_RADIUS, 10, 10); glPopMatrix(); glPushMatrix(); glTranslatef(0, MARKER_DISTANCE, 0); glColor3fv(green); - glutSolidSphere(MARKER_RADIUS, 10, 10); + Application::getInstance()->getGeometryCache()->renderSphere(MARKER_RADIUS, 10, 10); glPopMatrix(); glPushMatrix(); glTranslatef(0, 0, MARKER_DISTANCE); glColor3fv(blue); - glutSolidSphere(MARKER_RADIUS, 10, 10); + Application::getInstance()->getGeometryCache()->renderSphere(MARKER_RADIUS, 10, 10); glPopMatrix(); glPushMatrix(); glColor3fv(gray); glTranslatef(MARKER_DISTANCE, 0, MARKER_DISTANCE); - glutSolidSphere(MARKER_RADIUS, 10, 10); + Application::getInstance()->getGeometryCache()->renderSphere(MARKER_RADIUS, 10, 10); glPopMatrix(); } diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index 2b72fe2c23..0477f6e04e 100644 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -399,7 +399,7 @@ void Avatar::render(const glm::vec3& cameraPosition, RenderMode renderMode, bool } else { glTranslatef(_position.x, getDisplayNamePosition().y + LOOK_AT_INDICATOR_OFFSET, _position.z); } - glutSolidSphere(LOOK_AT_INDICATOR_RADIUS, 15, 15); + Application::getInstance()->getGeometryCache()->renderSphere(LOOK_AT_INDICATOR_RADIUS, 15, 15); glPopMatrix(); } } @@ -427,7 +427,8 @@ void Avatar::render(const glm::vec3& cameraPosition, RenderMode renderMode, bool glPushMatrix(); glTranslatef(_position.x, _position.y, _position.z); glScalef(height, height, height); - glutSolidSphere(sphereRadius, 15, 15); + Application::getInstance()->getGeometryCache()->renderSphere(sphereRadius, 15, 15); + glPopMatrix(); } } diff --git a/interface/src/avatar/Avatar.h b/interface/src/avatar/Avatar.h old mode 100755 new mode 100644 diff --git a/interface/src/avatar/Hand.cpp b/interface/src/avatar/Hand.cpp index 5ef1fbafea..d29e7312ff 100644 --- a/interface/src/avatar/Hand.cpp +++ b/interface/src/avatar/Hand.cpp @@ -114,7 +114,7 @@ void Hand::render(bool isMine, Model::RenderMode renderMode) { glPushMatrix(); glTranslatef(position.x, position.y, position.z); glColor3f(0.0f, 1.0f, 0.0f); - glutSolidSphere(PALM_COLLISION_RADIUS * _owningAvatar->getScale(), 10, 10); + Application::getInstance()->getGeometryCache()->renderSphere(PALM_COLLISION_RADIUS * _owningAvatar->getScale(), 10, 10); glPopMatrix(); } } @@ -179,7 +179,7 @@ void Hand::renderHandTargets(bool isMine) { Avatar::renderJointConnectingCone(root, offsetFromPalm, PALM_DISK_RADIUS, 0.0f); glPushMatrix(); glTranslatef(root.x, root.y, root.z); - glutSolidSphere(PALM_BALL_RADIUS, 20.0f, 20.0f); + Application::getInstance()->getGeometryCache()->renderSphere(PALM_BALL_RADIUS, 20.0f, 20.0f); glPopMatrix(); } } diff --git a/interface/src/avatar/Hand.h b/interface/src/avatar/Hand.h old mode 100755 new mode 100644 diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index aae1907b76..a31c25b572 100644 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -399,7 +399,7 @@ void MyAvatar::renderDebugBodyPoints() { glPushMatrix(); glColor4f(0, 1, 0, .5f); glTranslatef(position.x, position.y, position.z); - glutSolidSphere(0.2, 10, 10); + Application::getInstance()->getGeometryCache()->renderSphere(0.2, 10, 10); glPopMatrix(); // Head Sphere @@ -407,7 +407,7 @@ void MyAvatar::renderDebugBodyPoints() { glPushMatrix(); glColor4f(0, 1, 0, .5f); glTranslatef(position.x, position.y, position.z); - glutSolidSphere(0.15, 10, 10); + Application::getInstance()->getGeometryCache()->renderSphere(0.15, 10, 10); glPopMatrix(); } diff --git a/interface/src/avatar/SkeletonModel.cpp b/interface/src/avatar/SkeletonModel.cpp index a1fccf1a10..a791d01d53 100644 --- a/interface/src/avatar/SkeletonModel.cpp +++ b/interface/src/avatar/SkeletonModel.cpp @@ -554,9 +554,9 @@ void SkeletonModel::renderRagdoll() { glTranslatef(position.x, position.y, position.z); // draw each point as a yellow hexagon with black border glColor4f(0.0f, 0.0f, 0.0f, alpha); - glutSolidSphere(radius2, BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); + Application::getInstance()->getGeometryCache()->renderSphere(radius2, BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); glColor4f(1.0f, 1.0f, 0.0f, alpha); - glutSolidSphere(radius1, BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); + Application::getInstance()->getGeometryCache()->renderSphere(radius1, BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); glPopMatrix(); } glPopMatrix(); @@ -847,7 +847,7 @@ void SkeletonModel::renderBoundingCollisionShapes(float alpha) { endPoint = endPoint - _translation; glTranslatef(endPoint.x, endPoint.y, endPoint.z); glColor4f(0.6f, 0.6f, 0.8f, alpha); - glutSolidSphere(_boundingShape.getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); + Application::getInstance()->getGeometryCache()->renderSphere(_boundingShape.getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); // draw a yellow sphere at the capsule startpoint glm::vec3 startPoint; @@ -856,7 +856,7 @@ void SkeletonModel::renderBoundingCollisionShapes(float alpha) { glm::vec3 axis = endPoint - startPoint; glTranslatef(-axis.x, -axis.y, -axis.z); glColor4f(0.8f, 0.8f, 0.6f, alpha); - glutSolidSphere(_boundingShape.getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); + Application::getInstance()->getGeometryCache()->renderSphere(_boundingShape.getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); // draw a green cylinder between the two points glm::vec3 origin(0.0f); @@ -889,7 +889,7 @@ void SkeletonModel::renderJointCollisionShapes(float alpha) { glTranslatef(position.x, position.y, position.z); // draw a grey sphere at shape position glColor4f(0.75f, 0.75f, 0.75f, alpha); - glutSolidSphere(shape->getBoundingRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); + Application::getInstance()->getGeometryCache()->renderSphere(shape->getBoundingRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); } else if (shape->getType() == CAPSULE_SHAPE) { CapsuleShape* capsule = static_cast(shape); @@ -898,8 +898,8 @@ void SkeletonModel::renderJointCollisionShapes(float alpha) { capsule->getEndPoint(endPoint); endPoint = endPoint - simulationTranslation; glTranslatef(endPoint.x, endPoint.y, endPoint.z); - glColor4f(0.6f, 0.6f, 0.8f, alpha); - glutSolidSphere(capsule->getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); + glColor4f(0.6f, 0.6f, 0.8f, alpha); + Application::getInstance()->getGeometryCache()->renderSphere(capsule->getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); // draw a yellow sphere at the capsule startpoint glm::vec3 startPoint; @@ -907,8 +907,8 @@ void SkeletonModel::renderJointCollisionShapes(float alpha) { startPoint = startPoint - simulationTranslation; glm::vec3 axis = endPoint - startPoint; glTranslatef(-axis.x, -axis.y, -axis.z); - glColor4f(0.8f, 0.8f, 0.6f, alpha); - glutSolidSphere(capsule->getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); + glColor4f(0.8f, 0.8f, 0.6f, alpha); + Application::getInstance()->getGeometryCache()->renderSphere(capsule->getRadius(), BALL_SUBDIVISIONS, BALL_SUBDIVISIONS); // draw a green cylinder between the two points glm::vec3 origin(0.0f); diff --git a/interface/src/renderer/DeferredLightingEffect.cpp b/interface/src/renderer/DeferredLightingEffect.cpp index 585fa9b31c..f1668629da 100644 --- a/interface/src/renderer/DeferredLightingEffect.cpp +++ b/interface/src/renderer/DeferredLightingEffect.cpp @@ -51,7 +51,7 @@ void DeferredLightingEffect::releaseSimpleProgram() { void DeferredLightingEffect::renderSolidSphere(float radius, int slices, int stacks) { bindSimpleProgram(); - glutSolidSphere(radius, slices, stacks); + Application::getInstance()->getGeometryCache()->renderSphere(radius, slices, stacks); releaseSimpleProgram(); } diff --git a/interface/src/renderer/GeometryCache.cpp b/interface/src/renderer/GeometryCache.cpp index 7c3c2dc1ca..107dac62f5 100644 --- a/interface/src/renderer/GeometryCache.cpp +++ b/interface/src/renderer/GeometryCache.cpp @@ -110,6 +110,114 @@ void GeometryCache::renderHemisphere(int slices, int stacks) { glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); } + +void GeometryCache::renderSphere(float radius, int slices, int stacks) { + VerticesIndices& vbo = _sphereVBOs[IntPair(slices, stacks)]; + int vertices = slices * (stacks - 1) + 2; + const int NUM_VERTICES_PER_TRIANGLE = 3; + const int NUM_TRIANGLES_PER_QUAD = 2; + int indices = slices * NUM_TRIANGLES_PER_QUAD * NUM_VERTICES_PER_TRIANGLE * (stacks - 1) + slices * NUM_TRIANGLES_PER_QUAD * NUM_VERTICES_PER_TRIANGLE; + if (vbo.first == 0) { + const int NUM_COORDS_PER_VERTEX = 3; + GLfloat* vertexData = new GLfloat[vertices * NUM_COORDS_PER_VERTEX]; + GLfloat* vertex = vertexData; + + // south pole + *(vertex++) = 0.0f; + *(vertex++) = 0.0f; + *(vertex++) = -1.0f; + + //add stacks vertices climbing up Y axis + for (int i = 1; i < stacks; i++) { + float phi = PI * (float)i / (float)(stacks) - PI_OVER_TWO; + float z = sinf(phi), radius = cosf(phi); + + for (int j = 0; j < slices; j++) { + float theta = TWO_PI * (float)j / (float)slices; + + *(vertex++) = sinf(theta) * radius; + *(vertex++) = cosf(theta) * radius; + *(vertex++) = z; + } + } + + // north pole + *(vertex++) = 0.0f; + *(vertex++) = 0.0f; + *(vertex++) = 1.0f; + + glGenBuffers(1, &vbo.first); + glBindBuffer(GL_ARRAY_BUFFER, vbo.first); + const int BYTES_PER_VERTEX = NUM_COORDS_PER_VERTEX * sizeof(GLfloat); + glBufferData(GL_ARRAY_BUFFER, vertices * BYTES_PER_VERTEX, vertexData, GL_STATIC_DRAW); + delete[] vertexData; + + GLushort* indexData = new GLushort[indices]; + GLushort* index = indexData; + + // South cap + GLushort bottom = 0; + GLushort top = 1; + for (int i = 0; i < slices; i++) { + *(index++) = bottom; + *(index++) = top + i; + *(index++) = top + (i + 1) % slices; + } + + // (stacks - 2) ribbons + for (int i = 0; i < stacks - 2; i++) { + bottom = i * slices + 1; + top = bottom + slices; + for (int j = 0; j < slices; j++) { + int next = (j + 1) % slices; + + *(index++) = bottom + j; + *(index++) = top + next; + *(index++) = top + j; + + *(index++) = bottom + j; + *(index++) = bottom + next; + *(index++) = top + next; + } + } + + // north cap + bottom = (stacks - 2) * slices + 1; + top = bottom + slices; + for (int i = 0; i < slices; i++) { + *(index++) = bottom + i; + *(index++) = bottom + (i + 1) % slices; + *(index++) = top; + } + + glGenBuffers(1, &vbo.second); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vbo.second); + const int BYTES_PER_INDEX = sizeof(GLushort); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, indices * BYTES_PER_INDEX, indexData, GL_STATIC_DRAW); + delete[] indexData; + + } else { + glBindBuffer(GL_ARRAY_BUFFER, vbo.first); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vbo.second); + } + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_NORMAL_ARRAY); + + glVertexPointer(3, GL_FLOAT, 0, 0); + glNormalPointer(GL_FLOAT, 0, 0); + + glPushMatrix(); + glScalef(radius, radius, radius); + glDrawRangeElementsEXT(GL_TRIANGLES, 0, vertices - 1, indices, GL_UNSIGNED_SHORT, 0); + glPopMatrix(); + + glDisableClientState(GL_VERTEX_ARRAY); + glDisableClientState(GL_NORMAL_ARRAY); + + glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0); +} + void GeometryCache::renderSquare(int xDivisions, int yDivisions) { VerticesIndices& vbo = _squareVBOs[IntPair(xDivisions, yDivisions)]; int xVertices = xDivisions + 1; diff --git a/interface/src/renderer/GeometryCache.h b/interface/src/renderer/GeometryCache.h index 647e0592fd..e0ada10e5b 100644 --- a/interface/src/renderer/GeometryCache.h +++ b/interface/src/renderer/GeometryCache.h @@ -39,6 +39,7 @@ public: virtual ~GeometryCache(); void renderHemisphere(int slices, int stacks); + void renderSphere(float radius, int slices, int stacks); void renderSquare(int xDivisions, int yDivisions); void renderHalfCylinder(int slices, int stacks); void renderGrid(int xDivisions, int yDivisions); @@ -67,6 +68,7 @@ private: typedef QPair VerticesIndices; QHash _hemisphereVBOs; + QHash _sphereVBOs; QHash _squareVBOs; QHash _halfCylinderVBOs; QHash _gridBuffers; diff --git a/interface/src/starfield/Config.h b/interface/src/starfield/Config.h old mode 100755 new mode 100644 diff --git a/interface/src/starfield/Controller.cpp b/interface/src/starfield/Controller.cpp old mode 100755 new mode 100644 diff --git a/interface/src/starfield/Controller.h b/interface/src/starfield/Controller.h old mode 100755 new mode 100644 diff --git a/interface/src/starfield/data/GpuVertex.cpp b/interface/src/starfield/data/GpuVertex.cpp old mode 100755 new mode 100644 diff --git a/interface/src/starfield/data/GpuVertex.h b/interface/src/starfield/data/GpuVertex.h old mode 100755 new mode 100644 diff --git a/interface/src/starfield/data/InputVertex.cpp b/interface/src/starfield/data/InputVertex.cpp old mode 100755 new mode 100644 diff --git a/interface/src/starfield/data/InputVertex.h b/interface/src/starfield/data/InputVertex.h old mode 100755 new mode 100644 diff --git a/interface/src/starfield/data/Tile.h b/interface/src/starfield/data/Tile.h old mode 100755 new mode 100644 diff --git a/interface/src/starfield/renderer/Renderer.cpp b/interface/src/starfield/renderer/Renderer.cpp old mode 100755 new mode 100644 diff --git a/interface/src/starfield/renderer/Renderer.h b/interface/src/starfield/renderer/Renderer.h old mode 100755 new mode 100644 diff --git a/interface/src/starfield/renderer/Tiling.h b/interface/src/starfield/renderer/Tiling.h old mode 100755 new mode 100644 diff --git a/interface/src/starfield/renderer/VertexOrder.cpp b/interface/src/starfield/renderer/VertexOrder.cpp old mode 100755 new mode 100644 diff --git a/interface/src/starfield/renderer/VertexOrder.h b/interface/src/starfield/renderer/VertexOrder.h old mode 100755 new mode 100644 diff --git a/interface/src/ui/AddressBarDialog.cpp b/interface/src/ui/AddressBarDialog.cpp index 4043d5acb3..26505af0be 100644 --- a/interface/src/ui/AddressBarDialog.cpp +++ b/interface/src/ui/AddressBarDialog.cpp @@ -27,36 +27,39 @@ void AddressBarDialog::setupUI() { const QString DIALOG_STYLESHEET = "font-family: Helvetica, Arial, sans-serif;"; const QString ADDRESSBAR_PLACEHOLDER = "Go to: domain, @user, #location"; - const QString ADDRESSBAR_STYLESHEET = "padding: 0 10px;"; - const QString ADDRESSBAR_FONT_FAMILY = "Helvetica,Arial,sans-serif"; - const int ADDRESSBAR_FONT_SIZE = 20; + const QString ADDRESSBAR_STYLESHEET = "padding: 5px 10px; font-size: 20px;"; const int ADDRESSBAR_MIN_WIDTH = 200; const int ADDRESSBAR_MAX_WIDTH = 615; - const int ADDRESSBAR_HEIGHT = 54; + const int ADDRESSBAR_HEIGHT = 42; const int ADDRESSBAR_STRETCH = 60; - const int BUTTON_SPACER_SIZE = 10; + const int BUTTON_SPACER_SIZE = 5; const int DEFAULT_SPACER_SIZE = 20; const int ADDRESS_LAYOUT_RIGHT_MARGIN = 10; - const int GO_BUTTON_SIZE = 55; + const int GO_BUTTON_SIZE = 42; const int CLOSE_BUTTON_SIZE = 16; const QString CLOSE_BUTTON_ICON = "styles/close.svg"; - const int DIALOG_HEIGHT = 100; + const int DIALOG_HEIGHT = 62; const int DIALOG_INITIAL_WIDTH = 560; setModal(true); +#ifndef Q_OS_MAC + setWindowModality(Qt::ApplicationModal); +#else setWindowModality(Qt::WindowModal); - setHideOnBlur(false); +#endif QSizePolicy sizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); setSizePolicy(sizePolicy); setMinimumSize(QSize(DIALOG_INITIAL_WIDTH, DIALOG_HEIGHT)); + setMaximumHeight(DIALOG_HEIGHT); setStyleSheet(DIALOG_STYLESHEET); _verticalLayout = new QVBoxLayout(this); + _verticalLayout->setContentsMargins(0, 0, 0, 0); _addressLayout = new QHBoxLayout(); _addressLayout->setContentsMargins(0, 0, ADDRESS_LAYOUT_RIGHT_MARGIN, 0); @@ -69,14 +72,13 @@ void AddressBarDialog::setupUI() { _addressLayout->addItem(_leftSpacer); _addressLineEdit = new QLineEdit(this); + _addressLineEdit->setAttribute(Qt::WA_MacShowFocusRect, 0); _addressLineEdit->setPlaceholderText(ADDRESSBAR_PLACEHOLDER); QSizePolicy sizePolicyLineEdit(QSizePolicy::Preferred, QSizePolicy::Fixed); sizePolicyLineEdit.setHorizontalStretch(ADDRESSBAR_STRETCH); _addressLineEdit->setSizePolicy(sizePolicyLineEdit); _addressLineEdit->setMinimumSize(QSize(ADDRESSBAR_MIN_WIDTH, ADDRESSBAR_HEIGHT)); _addressLineEdit->setMaximumSize(QSize(ADDRESSBAR_MAX_WIDTH, ADDRESSBAR_HEIGHT)); - QFont font(ADDRESSBAR_FONT_FAMILY, ADDRESSBAR_FONT_SIZE); - _addressLineEdit->setFont(font); _addressLineEdit->setStyleSheet(ADDRESSBAR_STYLESHEET); _addressLayout->addWidget(_addressLineEdit); @@ -106,6 +108,7 @@ void AddressBarDialog::setupUI() { _closeButton->setMaximumSize(QSize(CLOSE_BUTTON_SIZE, CLOSE_BUTTON_SIZE)); QIcon icon(Application::resourcesPath() + CLOSE_BUTTON_ICON); _closeButton->setIcon(icon); + _closeButton->setIconSize(QSize(CLOSE_BUTTON_SIZE, CLOSE_BUTTON_SIZE)); _closeButton->setFlat(true); _addressLayout->addWidget(_closeButton, 0, Qt::AlignRight); @@ -118,6 +121,7 @@ void AddressBarDialog::setupUI() { void AddressBarDialog::showEvent(QShowEvent* event) { _goButton->setIcon(QIcon(Application::resourcesPath() + ADDRESSBAR_GO_BUTTON_ICON)); _addressLineEdit->setText(QString()); + _addressLineEdit->setFocus(); FramelessDialog::showEvent(event); } diff --git a/interface/src/ui/LoginDialog.cpp b/interface/src/ui/LoginDialog.cpp index 6583e170d3..916e067ae8 100644 --- a/interface/src/ui/LoginDialog.cpp +++ b/interface/src/ui/LoginDialog.cpp @@ -36,8 +36,7 @@ LoginDialog::LoginDialog(QWidget* parent) : _ui->errorLabel->setVisible(false); setModal(true); - setWindowModality(Qt::WindowModal); - setHideOnBlur(false); + setWindowModality(Qt::ApplicationModal); connect(&AccountManager::getInstance(), &AccountManager::loginComplete, this, &LoginDialog::handleLoginCompleted); diff --git a/interface/src/ui/UpdateDialog.cpp b/interface/src/ui/UpdateDialog.cpp index ace022b683..33024586be 100644 --- a/interface/src/ui/UpdateDialog.cpp +++ b/interface/src/ui/UpdateDialog.cpp @@ -23,8 +23,8 @@ UpdateDialog::UpdateDialog(QWidget *parent, const QString& releaseNotes, const Q Ui::Dialog dialogUI; dialogUI.setupUi(this); - QString updateRequired = QString("You are currently running build %1, the latest build released is %2. \ - Please download and install the most recent release to access the latest features and bug fixes.") + QString updateRequired = QString("You are currently running build %1, the latest build released is %2." + "\n\nPlease download and install the most recent release to access the latest features and bug fixes.") .arg(Application::getInstance()->applicationVersion(), latestVersion); setAttribute(Qt::WA_DeleteOnClose); diff --git a/interface/src/ui/overlays/Sphere3DOverlay.cpp b/interface/src/ui/overlays/Sphere3DOverlay.cpp index 93eaa6e0a6..7c162c7957 100644 --- a/interface/src/ui/overlays/Sphere3DOverlay.cpp +++ b/interface/src/ui/overlays/Sphere3DOverlay.cpp @@ -15,6 +15,7 @@ #include #include "Sphere3DOverlay.h" +#include "Application.h" #include "renderer/GlowEffect.h" Sphere3DOverlay::Sphere3DOverlay() { @@ -34,7 +35,6 @@ void Sphere3DOverlay::render() { const float MAX_COLOR = 255.0f; glColor4f(color.red / MAX_COLOR, color.green / MAX_COLOR, color.blue / MAX_COLOR, alpha); - glDisable(GL_LIGHTING); glm::vec3 position = getPosition(); @@ -58,7 +58,7 @@ void Sphere3DOverlay::render() { glScalef(dimensions.x, dimensions.y, dimensions.z); //Application::getInstance()->getDeferredLightingEffect()->renderSolidCube(1.0f); if (_isSolid) { - glutSolidSphere(1.0f, SLICES, SLICES); + Application::getInstance()->getGeometryCache()->renderSphere(1.0f, SLICES, SLICES); } else { glutWireSphere(1.0f, SLICES, SLICES); } diff --git a/interface/ui/updateDialog.ui b/interface/ui/updateDialog.ui index b0f1e63cb9..fc375e17c2 100644 --- a/interface/ui/updateDialog.ui +++ b/interface/ui/updateDialog.ui @@ -10,7 +10,7 @@ 0 0 750 - 300 + 213 @@ -22,75 +22,25 @@ background-color: rgb(255, 255, 255); - - - - 0 - 0 - 751 - 71 - - - - Qt::LeftToRight - - - false - - - background-color: rgb(236, 236, 236); - - - QFrame::StyledPanel - - - QFrame::Plain - - - 0 - - - - - 240 - 10 - 271 - 41 - - - - - Arial - 36 - PreferAntialias - false - - - - color: rgb(51, 51, 51); - - - Update Required - - - - 100 - 110 - 561 - 61 + 50 + 20 + 641 + 111 Arial - 18 - 50 - false + -1 + + font-family: Arial; +font-size: 20px; + @@ -102,9 +52,9 @@ 360 - 240 - 364 - 40 + 160 + 374 + 42 @@ -115,15 +65,15 @@ background-color: #333333; - border-width: 0; - border-radius: 9px; - border-radius: 9px; - font-family: Arial; - font-size: 18px; - font-weight: 100; - color: #b7b7b7; - width: 120px; - height: 40px; +border-width: 0; +border-radius: 9px; +border-radius: 9px; +font-family: Arial; +font-size: 18px; +font-weight: 100; +color: #b7b7b7; +width: 120px; +height: 40px; Download @@ -137,15 +87,15 @@ background-color: #333333; - border-width: 0; - border-radius: 9px; - border-radius: 9px; - font-family: Arial; - font-size: 18px; - font-weight: 100; - color: #b7b7b7; - width: 120px; - height: 40px; +border-width: 0; +border-radius: 9px; +border-radius: 9px; +font-family: Arial; +font-size: 18px; +font-weight: 100; +color: #b7b7b7; +width: 120px; +height: 40px; Skip Version @@ -159,15 +109,15 @@ background-color: #333333; - border-width: 0; - border-radius: 9px; - border-radius: 9px; - font-family: Arial; - font-size: 18px; - font-weight: 100; - color: #b7b7b7; - width: 120px; - height: 40px; +border-width: 0; +border-radius: 9px; +border-radius: 9px; +font-family: Arial; +font-size: 18px; +font-weight: 100; +color: #b7b7b7; +width: 120px; +height: 40px; Close diff --git a/libraries/avatars/src/AvatarData.h b/libraries/avatars/src/AvatarData.h old mode 100755 new mode 100644 diff --git a/libraries/avatars/src/HandData.h b/libraries/avatars/src/HandData.h old mode 100755 new mode 100644 diff --git a/libraries/embedded-webserver/src/HTTPConnection.cpp b/libraries/embedded-webserver/src/HTTPConnection.cpp old mode 100755 new mode 100644 diff --git a/libraries/embedded-webserver/src/HTTPManager.cpp b/libraries/embedded-webserver/src/HTTPManager.cpp old mode 100755 new mode 100644 diff --git a/libraries/embedded-webserver/src/HTTPManager.h b/libraries/embedded-webserver/src/HTTPManager.h old mode 100755 new mode 100644 diff --git a/libraries/octree/src/Plane.cpp b/libraries/octree/src/Plane.cpp old mode 100755 new mode 100644 diff --git a/libraries/octree/src/Plane.h b/libraries/octree/src/Plane.h old mode 100755 new mode 100644 diff --git a/tests/octree/src/ModelTests.cpp b/tests/octree/src/ModelTests.cpp index 405b4a95d3..f6bef3e533 100644 --- a/tests/octree/src/ModelTests.cpp +++ b/tests/octree/src/ModelTests.cpp @@ -62,7 +62,7 @@ void EntityTests::entityTreeTests(bool verbose) { properties.setPosition(positionAtCenterInMeters); // TODO: Fix these unit tests. //properties.setRadius(halfMeter); - //properties.setModelURL("https://s3-us-west-1.amazonaws.com/highfidelity-public/ozan/theater.fbx"); + //properties.setModelURL("https://s3.amazonaws.com/hifi-public/ozan/theater.fbx"); tree.addEntity(entityID, properties); @@ -269,7 +269,7 @@ void EntityTests::entityTreeTests(bool verbose) { // TODO: fix these unit tests //properties.setRadius(halfMeter); - //properties.setModelURL("https://s3-us-west-1.amazonaws.com/highfidelity-public/ozan/theater.fbx"); + //properties.setModelURL("https://s3.amazonaws.com/hifi-public/ozan/theater.fbx"); if (extraVerbose) { qDebug() << "iteration:" << i diff --git a/tools/samples/cube1.hio b/tools/samples/cube1.hio old mode 100755 new mode 100644 diff --git a/tools/samples/oneRedVoxel.hio b/tools/samples/oneRedVoxel.hio old mode 100755 new mode 100644 diff --git a/tools/samples/single.hio b/tools/samples/single.hio old mode 100755 new mode 100644