Merge branch 'master' of https://github.com/highfidelity/hifi into attenuation_zones

This commit is contained in:
Atlante45 2014-10-06 14:12:57 -07:00
commit ace8b98064
96 changed files with 545 additions and 371 deletions

0
domain-server/resources/web/assignment/js/ace/ace.js Executable file → Normal file
View file

View file

View file

View file

View file

0
domain-server/resources/web/js/form2js.min.js vendored Executable file → Normal file
View file

View file

@ -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 };

View file

@ -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;

View file

@ -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 };

View file

@ -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;

View file

@ -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;

View file

@ -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
});

View file

@ -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();

View file

@ -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]));

View file

@ -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]));

View file

@ -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]));

View file

@ -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;

View file

@ -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;

View file

@ -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

View file

@ -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
};

View file

@ -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;

View file

@ -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

View file

@ -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;

View file

@ -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 = [];

View file

@ -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
});

View file

@ -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;

View file

@ -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
});

View file

@ -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;

View file

@ -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,

View file

@ -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/";

View file

@ -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;

0
examples/move.js Executable file → Normal file
View file

View file

@ -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,

View file

@ -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;

View file

@ -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
});

View file

@ -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;
}

View file

@ -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

View file

@ -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) {

View file

@ -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();

View file

@ -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;

View file

@ -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();

View file

@ -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();

View file

@ -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);
}
}
}
}

View file

@ -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

View file

@ -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;

View file

@ -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;

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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;
}

View file

@ -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");

View file

@ -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();
}
}

View file

@ -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();
}

View file

@ -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");

View file

@ -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();
}

View file

@ -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/";

0
interface/src/Stars.cpp Executable file → Normal file
View file

0
interface/src/Stars.h Executable file → Normal file
View file

View file

@ -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();
}

View file

@ -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();
}
}

0
interface/src/avatar/Avatar.h Executable file → Normal file
View file

View file

@ -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();
}
}

0
interface/src/avatar/Hand.h Executable file → Normal file
View file

View file

@ -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();
}

View file

@ -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<CapsuleShape*>(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);

View file

@ -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();
}

View file

@ -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;

View file

@ -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<GLuint, GLuint> VerticesIndices;
QHash<IntPair, VerticesIndices> _hemisphereVBOs;
QHash<IntPair, VerticesIndices> _sphereVBOs;
QHash<IntPair, VerticesIndices> _squareVBOs;
QHash<IntPair, VerticesIndices> _halfCylinderVBOs;
QHash<IntPair, QOpenGLBuffer> _gridBuffers;

0
interface/src/starfield/Config.h Executable file → Normal file
View file

0
interface/src/starfield/Controller.cpp Executable file → Normal file
View file

0
interface/src/starfield/Controller.h Executable file → Normal file
View file

0
interface/src/starfield/data/GpuVertex.cpp Executable file → Normal file
View file

0
interface/src/starfield/data/GpuVertex.h Executable file → Normal file
View file

0
interface/src/starfield/data/InputVertex.cpp Executable file → Normal file
View file

0
interface/src/starfield/data/InputVertex.h Executable file → Normal file
View file

0
interface/src/starfield/data/Tile.h Executable file → Normal file
View file

0
interface/src/starfield/renderer/Renderer.cpp Executable file → Normal file
View file

0
interface/src/starfield/renderer/Renderer.h Executable file → Normal file
View file

0
interface/src/starfield/renderer/Tiling.h Executable file → Normal file
View file

0
interface/src/starfield/renderer/VertexOrder.cpp Executable file → Normal file
View file

0
interface/src/starfield/renderer/VertexOrder.h Executable file → Normal file
View file

View file

@ -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);
}

View file

@ -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);

View file

@ -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);

View file

@ -15,6 +15,7 @@
#include <SharedUtil.h>
#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);
}

View file

@ -10,7 +10,7 @@
<x>0</x>
<y>0</y>
<width>750</width>
<height>300</height>
<height>213</height>
</rect>
</property>
<property name="cursor">
@ -22,75 +22,25 @@
<property name="styleSheet">
<string notr="true">background-color: rgb(255, 255, 255);</string>
</property>
<widget class="QFrame" name="frame">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>751</width>
<height>71</height>
</rect>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(236, 236, 236);</string>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="lineWidth">
<number>0</number>
</property>
<widget class="QLabel" name="updateDialog">
<property name="geometry">
<rect>
<x>240</x>
<y>10</y>
<width>271</width>
<height>41</height>
</rect>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>36</pointsize>
<stylestrategy>PreferAntialias</stylestrategy>
<kerning>false</kerning>
</font>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(51, 51, 51);</string>
</property>
<property name="text">
<string>Update Required</string>
</property>
</widget>
</widget>
<widget class="QLabel" name="updateContent">
<property name="geometry">
<rect>
<x>100</x>
<y>110</y>
<width>561</width>
<height>61</height>
<x>50</x>
<y>20</y>
<width>641</width>
<height>111</height>
</rect>
</property>
<property name="font">
<font>
<family>Arial</family>
<pointsize>18</pointsize>
<weight>50</weight>
<bold>false</bold>
<pointsize>-1</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">font-family: Arial;
font-size: 20px;</string>
</property>
<property name="text">
<string/>
</property>
@ -102,9 +52,9 @@
<property name="geometry">
<rect>
<x>360</x>
<y>240</y>
<width>364</width>
<height>40</height>
<y>160</y>
<width>374</width>
<height>42</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
@ -115,15 +65,15 @@
</property>
<property name="styleSheet">
<string notr="true"> 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;</string>
border-width: 0;
border-radius: 9px;
border-radius: 9px;
font-family: Arial;
font-size: 18px;
font-weight: 100;
color: #b7b7b7;
width: 120px;
height: 40px;</string>
</property>
<property name="text">
<string>Download</string>
@ -137,15 +87,15 @@
</property>
<property name="styleSheet">
<string notr="true"> 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;</string>
border-width: 0;
border-radius: 9px;
border-radius: 9px;
font-family: Arial;
font-size: 18px;
font-weight: 100;
color: #b7b7b7;
width: 120px;
height: 40px;</string>
</property>
<property name="text">
<string>Skip Version</string>
@ -159,15 +109,15 @@
</property>
<property name="styleSheet">
<string notr="true"> 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;</string>
border-width: 0;
border-radius: 9px;
border-radius: 9px;
font-family: Arial;
font-size: 18px;
font-weight: 100;
color: #b7b7b7;
width: 120px;
height: 40px;</string>
</property>
<property name="text">
<string>Close</string>

0
libraries/avatars/src/AvatarData.h Executable file → Normal file
View file

0
libraries/avatars/src/HandData.h Executable file → Normal file
View file

0
libraries/embedded-webserver/src/HTTPConnection.cpp Executable file → Normal file
View file

0
libraries/embedded-webserver/src/HTTPManager.cpp Executable file → Normal file
View file

0
libraries/embedded-webserver/src/HTTPManager.h Executable file → Normal file
View file

0
libraries/octree/src/Plane.cpp Executable file → Normal file
View file

0
libraries/octree/src/Plane.h Executable file → Normal file
View file

View file

@ -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

0
tools/samples/cube1.hio Executable file → Normal file
View file

0
tools/samples/oneRedVoxel.hio Executable file → Normal file
View file

0
tools/samples/single.hio Executable file → Normal file
View file