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..211e0d56b6 --- /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 +// + +var HIFI_PUBLIC_BUCKET = "https://s3.amazonaws.com/hifi-public/"; \ No newline at end of file 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/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/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/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/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