Merge pull request #7757 from imgntn/cellProduction

Move cellscience to production s3 bucket
This commit is contained in:
Brad Hefta-Gaub 2016-05-02 10:11:08 -07:00
commit d599d008c3
15 changed files with 615 additions and 158 deletions

View file

@ -6,7 +6,7 @@
//
var spriteURL = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/Sprites/nucleosomes_sprite.fbx";
var spriteURL = "https://hifi-production.s3.amazonaws.com/DomainContent/CellScience/Sprites/nucleosomes_sprite.fbx";
var spriteDimensions = {
x: 10,
y: 10,

View file

@ -13,7 +13,7 @@
z: -1
}
var baseURL = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/";
var baseURL = "https://hifi-production.s3.amazonaws.com/DomainContent/CellScience/";
var self = this;

View file

@ -0,0 +1,109 @@
// Copyright 2016 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
//
(function() {
var version = 12;
var baseURL = "https://hifi-production.s3.amazonaws.com/DomainContent/CellScience/";
var button;
var _this;
function NavButton() {
_this = this;
}
NavButton.prototype = {
button: null,
buttonImageURL: baseURL + "GUI/GUI_Cells.png?" + version,
hasButton: false,
entryPoint: {
x: 13500,
y: 13500,
z: 13500
},
target: {
x: 13501,
y: 13501,
z: 13501
},
preload: function(entityId) {
print('CELL PRELOAD CeLLS 1 ')
this.entityId = entityId;
this.addButton();
Controller.mousePressEvent.connect(this.onClick);
print('CELL PRELOAD CeLLS 2 ')
},
addButton: function() {
if (this.hasButton === false) {
print('CELL ADDBuTTON CeLLS 1 ')
var windowDimensions = Controller.getViewportDimensions();
var buttonWidth = 150;
var buttonHeight = 50;
var buttonPadding = 10;
var offset = 0;
var buttonPositionX = (offset + 1) * (buttonWidth + buttonPadding) + (windowDimensions.x / 2) - (buttonWidth * 3 + buttonPadding * 2.5);
var buttonPositionY = (windowDimensions.y - buttonHeight) - 50;
button = Overlays.addOverlay("image", {
x: buttonPositionX,
y: buttonPositionY,
width: buttonWidth,
height: buttonHeight,
imageURL: this.buttonImageURL,
visible: true,
alpha: 1.0
});
this.hasButton = true;
print('CELL ADDBuTTON CeLLS 2 button id is : ' +button)
} else {
print('CELL ADDBUTTON CeLLS FAIL - hasButton is' + this.hasButton)
}
},
onClick: function(event) {
//call to an internal function to get our scope back;
_this.handleClick(event);
},
handleClick: function(event) {
var clickedOverlay = Overlays.getOverlayAtPoint({
x: event.x,
y: event.y
});
if (clickedOverlay === button) {
this.lookAtTarget();
}
},
lookAtTarget: function() {
var direction = Vec3.normalize(Vec3.subtract(this.target, this.entryPoint));
var pitch = Quat.angleAxis(Math.asin(-direction.y) * 180.0 / Math.PI, {
x: 1,
y: 0,
z: 0
});
var yaw = Quat.angleAxis(Math.atan2(direction.x, direction.z) * 180.0 / Math.PI, {
x: 0,
y: 1,
z: 0
});
MyAvatar.goToLocation(this.target, true, yaw);
MyAvatar.headYaw = 0;
},
unload: function() {
this.hasButton = false;
Overlays.deleteOverlay(button);
Controller.mousePressEvent.disconnect(this.onClick);
}
}
return new NavButton();
});

View file

@ -0,0 +1,115 @@
// Copyright 2016 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
//
// Copyright 2016 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
//
(function() {
var version = 12;
var baseURL = "https://hifi-production.s3.amazonaws.com/DomainContent/CellScience/";
var button;
var _this;
function NavButton() {
_this = this;
}
NavButton.prototype = {
button: null,
buttonImageURL: baseURL + "GUI/GUI_Hexokinase.png?" + version,
hasButton: false,
entryPoint: {
x: 3000,
y: 3000,
z: 13500
},
target: {
x: 2755,
y: 3121,
z: 13501
},
preload: function(entityId) {
print('CELL PRELOAD HEXOKINASE 1')
this.entityId = entityId;
this.addButton();
Controller.mousePressEvent.connect(this.onClick);
print('CELL PRELOAD HEXOKINASE 2')
},
addButton: function() {
if (this.hasButton === false) {
print('CELL ADDBUTTON HEXOKINASE 1')
var windowDimensions = Controller.getViewportDimensions();
var buttonWidth = 150;
var buttonHeight = 50;
var buttonPadding = 10;
var offset = 3;
var buttonPositionX = (offset + 1) * (buttonWidth + buttonPadding) + (windowDimensions.x / 2) - (buttonWidth * 3 + buttonPadding * 2.5);
var buttonPositionY = (windowDimensions.y - buttonHeight) - 50;
button = Overlays.addOverlay("image", {
x: buttonPositionX,
y: buttonPositionY,
width: buttonWidth,
height: buttonHeight,
imageURL: this.buttonImageURL,
visible: true,
alpha: 1.0
});
this.hasButton = true;
print('CELL ADDBUTTON HEXOKINASE 2 button id is : ' +button)
} else {
print('CELL ADDBUTTON HEXOKINASE FAIL hasButton is' + this.hasButton)
}
},
onClick: function(event) {
//call to an internal function to get our scope back;
_this.handleClick(event);
},
handleClick: function(event) {
var clickedOverlay = Overlays.getOverlayAtPoint({
x: event.x,
y: event.y
});
if (clickedOverlay === button) {
this.lookAtTarget();
}
},
lookAtTarget: function() {
var direction = Vec3.normalize(Vec3.subtract(this.target, this.entryPoint));
var pitch = Quat.angleAxis(Math.asin(-direction.y) * 180.0 / Math.PI, {
x: 1,
y: 0,
z: 0
});
var yaw = Quat.angleAxis(Math.atan2(direction.x, direction.z) * 180.0 / Math.PI, {
x: 0,
y: 1,
z: 0
});
MyAvatar.goToLocation(this.target, true, yaw);
MyAvatar.headYaw = 0;
},
unload: function() {
this.hasButton = false;
Overlays.deleteOverlay(button);
Controller.mousePressEvent.disconnect(this.onClick);
}
}
return new NavButton();
});

View file

@ -0,0 +1,109 @@
// Copyright 2016 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
//
(function() {
var version = 12;
var baseURL = "https://hifi-production.s3.amazonaws.com/DomainContent/CellScience/";
var button;
var _this;
function NavButton() {
_this = this;
}
NavButton.prototype = {
button: null,
buttonImageURL: baseURL + "GUI/GUI_CellLayout.png?" + version,
hasButton: false,
entryPoint: {
x: 3000,
y: 13500,
z: 3000
},
target: {
x: 3276.6,
y: 13703.3,
z: 4405.6
},
preload: function(entityId) {
print('CeLL PRELOAD INSIDECELL 1')
this.entityId = entityId;
this.addButton();
Controller.mousePressEvent.connect(this.onClick);
print('CeLL PRELOAD INSIDECELL 2')
},
addButton: function() {
if (this.hasButton === false) {
print('CELL ADDBUTTON INSIDECELL 1')
var windowDimensions = Controller.getViewportDimensions();
var buttonWidth = 150;
var buttonHeight = 50;
var buttonPadding = 10;
var offset = 1;
var buttonPositionX = (offset + 1) * (buttonWidth + buttonPadding) + (windowDimensions.x / 2) - (buttonWidth * 3 + buttonPadding * 2.5);
var buttonPositionY = (windowDimensions.y - buttonHeight) - 50;
button = Overlays.addOverlay("image", {
x: buttonPositionX,
y: buttonPositionY,
width: buttonWidth,
height: buttonHeight,
imageURL: this.buttonImageURL,
visible: true,
alpha: 1.0
});
this.hasButton = true;
print('CELL ADDBUTTON INSIDECELL 2 button id is : ' +button)
} else {
print('CELL ADDBUTTON INSIDECELL FAIL - hasButton is' + this.hasButton)
}
},
onClick: function(event) {
//call to an internal function to get our scope back;
_this.handleClick(event);
},
handleClick: function(event) {
var clickedOverlay = Overlays.getOverlayAtPoint({
x: event.x,
y: event.y
});
if (clickedOverlay === button) {
this.lookAtTarget();
}
},
lookAtTarget: function() {
var direction = Vec3.normalize(Vec3.subtract(this.target, this.entryPoint));
var pitch = Quat.angleAxis(Math.asin(-direction.y) * 180.0 / Math.PI, {
x: 1,
y: 0,
z: 0
});
var yaw = Quat.angleAxis(Math.atan2(direction.x, direction.z) * 180.0 / Math.PI, {
x: 0,
y: 1,
z: 0
});
MyAvatar.goToLocation(this.target, true, yaw);
MyAvatar.headYaw = 0;
},
unload: function() {
this.hasButton = false;
Overlays.deleteOverlay(button);
Controller.mousePressEvent.disconnect(this.onClick);
}
}
return new NavButton();
});

View file

@ -0,0 +1,108 @@
// Copyright 2016 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
//
(function() {
var version = 12;
var baseURL = "https://hifi-production.s3.amazonaws.com/DomainContent/CellScience/";
var button;
var _this;
function NavButton() {
_this = this;
}
NavButton.prototype = {
button: null,
buttonImageURL: baseURL + "GUI/GUI_Ribosome.png?" + version,
hasButton: false,
entryPoint: {
x: 13500,
y: 3000,
z: 3000
},
target: {
x: 3276.6,
y: 13703.3,
z: 4405.6
},
preload: function(entityId) {
print('CELL PRELOAD RIBOSOME 1')
this.entityId = entityId;
this.addButton();
Controller.mousePressEvent.connect(this.onClick);
print('CELL PRELOAD RIBOSOME 2')
},
addButton: function() {
if (this.hasButton === false) {
print('CELL ADBUTTON RIBOSOME 1')
var windowDimensions = Controller.getViewportDimensions();
var buttonWidth = 150;
var buttonHeight = 50;
var buttonPadding = 10;
var offset = 2;
var buttonPositionX = (offset + 1) * (buttonWidth + buttonPadding) + (windowDimensions.x / 2) - (buttonWidth * 3 + buttonPadding * 2.5);
var buttonPositionY = (windowDimensions.y - buttonHeight) - 50;
button = Overlays.addOverlay("image", {
x: buttonPositionX,
y: buttonPositionY,
width: buttonWidth,
height: buttonHeight,
imageURL: this.buttonImageURL,
visible: true,
alpha: 1.0
});
this.hasButton = true;
print('CELL ADDBUTTON RIBOSOME 2 button id is : ' +button)
} else {
print('CELL ADDBUTTON RIBOSOME FAIL - hasButton is' + this.hasButton)
}
},
onClick: function(event) {
//call to an internal function to get our scope back;
_this.handleClick(event);
},
handleClick: function(event) {
var clickedOverlay = Overlays.getOverlayAtPoint({
x: event.x,
y: event.y
});
if (clickedOverlay === button) {
this.lookAtTarget();
}
},
lookAtTarget: function() {
var direction = Vec3.normalize(Vec3.subtract(this.target, this.entryPoint));
var pitch = Quat.angleAxis(Math.asin(-direction.y) * 180.0 / Math.PI, {
x: 1,
y: 0,
z: 0
});
var yaw = Quat.angleAxis(Math.atan2(direction.x, direction.z) * 180.0 / Math.PI, {
x: 0,
y: 1,
z: 0
});
MyAvatar.goToLocation(this.target, true, yaw);
MyAvatar.headYaw = 0;
},
unload: function() {
this.hasButton = false;
Overlays.deleteOverlay(button);
Controller.mousePressEvent.disconnect(this.onClick);
}
}
return new NavButton();
});

View file

@ -14,7 +14,7 @@
Script.include(utilsScript);
var self = this;
var baseURL = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/";
var baseURL = "https://hifi-production.s3.amazonaws.com/DomainContent/CellScience/";
this.preload = function(entityId) {
this.entityId = entityId;

View file

@ -6,7 +6,7 @@
//
(function() {
var baseURL = "https://hifi-content.s3.amazonaws.com/hifi-content/DomainContent/CellScience/";
var baseURL = "https://hifi-production.s3.amazonaws.com/hifi-production/DomainContent/CellScience/";
var self = this;
this.buttonImageURL = baseURL + "GUI/play_audio.svg?2";
@ -50,6 +50,7 @@
self.sound = SoundCache.getSound(this.soundURL);
}
}
this.addButton = function() {
this.windowDimensions = Controller.getViewportDimensions();

View file

@ -8,7 +8,7 @@
(function() {
var self = this;
var baseURL = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/";
var baseURL = "https://hifi-production.s3.amazonaws.com/DomainContent/CellScience/";
var version = 3;
this.preload = function(entityId) {

View file

@ -22,7 +22,12 @@
this.initialize = function(entityID) {
// print(' should initialize')
var properties = Entities.getEntityProperties(entityID);
if (properties.userData.length === 0 || properties.hasOwnProperty('userData') === false) {
if (properties.hasOwnProperty('userData') === false) {
self.initTimeout = Script.setTimeout(function() {
// print(' no user data yet, try again in one second')
self.initialize(entityID);
}, 1000)
} else if (properties.userData.length === 0) {
self.initTimeout = Script.setTimeout(function() {
// print(' no user data yet, try again in one second')
self.initialize(entityID);
@ -39,7 +44,7 @@
volume: 0.5
};
self.teleportSound = SoundCache.getSound("https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/Audio/whoosh.wav");
self.teleportSound = SoundCache.getSound("https://hifi-production.s3.amazonaws.com/DomainContent/CellScience/Audio/whoosh.wav");
// print(" portal destination is " + self.portalDestination);
}
}

View file

@ -1,6 +1,6 @@
var soundMap = [{
name: 'Cells',
url: "http://hifi-content.s3.amazonaws.com/DomainContent/CellScience/Audio/Cells.wav",
url: "http://hifi-production.s3.amazonaws.com/DomainContent/CellScience/Audio/Cells.wav",
audioOptions: {
position: {
x: 15850,
@ -12,7 +12,7 @@ var soundMap = [{
}
}, {
name: 'Cell Layout',
url: "http://hifi-content.s3.amazonaws.com/DomainContent/CellScience/Audio/CellLayout.wav",
url: "http://hifi-production.s3.amazonaws.com/DomainContent/CellScience/Audio/CellLayout.wav",
audioOptions: {
position: {
x: 15950,
@ -24,7 +24,7 @@ var soundMap = [{
}
}, {
name: 'Ribsome',
url: "http://hifi-content.s3.amazonaws.com/DomainContent/CellScience/Audio/Ribosome.wav",
url: "http://hifi-production.s3.amazonaws.com/DomainContent/CellScience/Audio/Ribosome.wav",
audioOptions: {
position: {
x: 15650,
@ -36,7 +36,7 @@ var soundMap = [{
}
}, {
name: 'Hexokinase',
url: "http://hifi-content.s3.amazonaws.com/DomainContent/CellScience/Audio/Hexokinase.wav",
url: "http://hifi-production.s3.amazonaws.com/DomainContent/CellScience/Audio/Hexokinase.wav",
audioOptions: {
position: {
x: 15750,

View file

@ -9,12 +9,8 @@ var numDynein = 2;
var numKinesin = 2;
var percentOnMainMT = 100;
var baseLocation;
if (USE_LOCAL_HOST === true) {
baseLocation = "http://localhost:8080/";
} else {
baseLocation = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/"
}
baseLocation = "https://hifi-production.s3.amazonaws.com/DomainContent/CellScience/"
var WORLD_OFFSET = {
x: 0,

View file

@ -18,7 +18,6 @@ function offsetVectorToWorld(vector) {
newVector = Vec3.sum(vector, WORLD_OFFSET);
print('JBP NEW VECTOR IS:: ' + JSON.stringify(newVector))
return newVector
}

View file

@ -17,7 +17,6 @@ function offsetVectorToWorld(vector) {
newVector = Vec3.sum(vector, WORLD_OFFSET);
print('JBP NEW VECTOR IS:: ' + JSON.stringify(newVector))
return newVector
}