move cellscience to production

This commit is contained in:
James B. Pollack 2016-04-25 10:16:39 -07:00
parent 0f8842f582
commit 8899ac71a1
11 changed files with 161 additions and 148 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 = { var spriteDimensions = {
x: 10, x: 10,
y: 10, y: 10,

View file

@ -13,7 +13,7 @@
z: -1 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; var self = this;

View file

@ -14,7 +14,7 @@
Script.include(utilsScript); Script.include(utilsScript);
var self = this; 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.preload = function(entityId) {
this.entityId = entityId; this.entityId = entityId;

View file

@ -6,7 +6,7 @@
// //
(function() { (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; var self = this;
this.buttonImageURL = baseURL + "GUI/play_audio.svg?2"; this.buttonImageURL = baseURL + "GUI/play_audio.svg?2";
@ -50,6 +50,7 @@
self.sound = SoundCache.getSound(this.soundURL); self.sound = SoundCache.getSound(this.soundURL);
} }
}
this.addButton = function() { this.addButton = function() {
this.windowDimensions = Controller.getViewportDimensions(); this.windowDimensions = Controller.getViewportDimensions();

View file

@ -8,7 +8,7 @@
(function() { (function() {
var self = this; 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; var version = 3;
this.preload = function(entityId) { this.preload = function(entityId) {

View file

@ -22,7 +22,12 @@
this.initialize = function(entityID) { this.initialize = function(entityID) {
// print(' should initialize') // print(' should initialize')
var properties = Entities.getEntityProperties(entityID); 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() { self.initTimeout = Script.setTimeout(function() {
// print(' no user data yet, try again in one second') // print(' no user data yet, try again in one second')
self.initialize(entityID); self.initialize(entityID);
@ -39,7 +44,7 @@
volume: 0.5 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); // print(" portal destination is " + self.portalDestination);
} }
} }

View file

@ -1,6 +1,6 @@
var soundMap = [{ var soundMap = [{
name: 'Cells', 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: { audioOptions: {
position: { position: {
x: 15850, x: 15850,
@ -12,7 +12,7 @@ var soundMap = [{
} }
}, { }, {
name: 'Cell Layout', 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: { audioOptions: {
position: { position: {
x: 15950, x: 15950,
@ -24,7 +24,7 @@ var soundMap = [{
} }
}, { }, {
name: 'Ribsome', 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: { audioOptions: {
position: { position: {
x: 15650, x: 15650,
@ -36,7 +36,7 @@ var soundMap = [{
} }
}, { }, {
name: 'Hexokinase', 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: { audioOptions: {
position: { position: {
x: 15750, x: 15750,

View file

@ -38,7 +38,7 @@ function transformToSmallerWorld(vector) {
} }
var cellLayout; var cellLayout;
var baseLocation = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/"; var baseLocation = "https://hifi-production.s3.amazonaws.com/DomainContent/CellScience/";
var utilsScript = Script.resolvePath('Scripts/utils.js'); var utilsScript = Script.resolvePath('Scripts/utils.js');
Script.include(utilsScript); Script.include(utilsScript);
@ -219,6 +219,7 @@ var scenes = [{
grabbable: false grabbable: false
} }
}), }),
script: null,
visible: true visible: true
}, { //golgi vesicles }, { //golgi vesicles
model: "vesicle", model: "vesicle",
@ -240,7 +241,7 @@ var scenes = [{
grabbable: false grabbable: false
} }
}), }),
script: "", script: null,
visible: true visible: true
}, { //golgi vesicles }, { //golgi vesicles
model: "vesicle", model: "vesicle",
@ -262,6 +263,7 @@ var scenes = [{
grabbable: false grabbable: false
} }
}), }),
script: null,
visible: true visible: true
}, { }, {
model: "vesicle", model: "vesicle",
@ -283,7 +285,7 @@ var scenes = [{
grabbable: false grabbable: false
} }
}), }),
script: "", script: null,
visible: true visible: true
}, { //outer vesicles }, { //outer vesicles
model: "vesicle", model: "vesicle",
@ -305,7 +307,7 @@ var scenes = [{
grabbable: false grabbable: false
} }
}), }),
script: "", script: null,
visible: true visible: true
}, { //outer vesicles }, { //outer vesicles
model: "vesicle", model: "vesicle",
@ -327,6 +329,7 @@ var scenes = [{
grabbable: false grabbable: false
} }
}), }),
script: null,
visible: true visible: true
}, { //outer vesicles }, { //outer vesicles
model: "vesicle", model: "vesicle",
@ -348,6 +351,7 @@ var scenes = [{
grabbable: false grabbable: false
} }
}), }),
script: null,
visible: true visible: true
}, { }, {
model: "hexokinase", model: "hexokinase",
@ -469,7 +473,7 @@ var scenes = [{
grabbable: false grabbable: false
} }
}), }),
script: "", script: null,
visible: true visible: true
}], }],
boundary: { boundary: {
@ -518,7 +522,7 @@ var scenes = [{
grabbable: false grabbable: false
} }
}), }),
script: "", script: null,
visible: true visible: true
}], }],
boundary: { boundary: {
@ -863,15 +867,8 @@ function getPointOnSphereOfRadius(radius, number, totalNumber) {
} }
function CreateEntity(name, position, rotation, dimensions, url, script, userData, visible) { function CreateEntity(name, position, rotation, dimensions, url, script, userData, visible) {
var scriptLocation;
if (script === "") {
scriptLocation = "";
} else {
scriptLocation = baseLocation + "Scripts/" + script;
}
//print(' SCRIPT LOCATION IN CREATE ENTITY' + scriptLocation) var entityProps = {
Entities.addEntity({
type: "Model", type: "Model",
name: name, name: name,
position: position, position: position,
@ -895,11 +892,19 @@ function CreateEntity(name, position, rotation, dimensions, url, script, userDat
startAutomatically: true startAutomatically: true
}), }),
userData: userData, userData: userData,
script: scriptLocation,
collisionless: true, collisionless: true,
shapeType: "compound", shapeType: "compound",
compoundShapeURL: url compoundShapeURL: url
}); }
if (script !== null) {
if (script !== "" && typeof script !== undefined) {
entityProps.script = baseLocation + "Scripts/" + script;
}
}
Entities.addEntity(entityProps);
// print("added " + name + " at (" + position.x + ", " + position.y + ", " + position.z + ")"); // print("added " + name + " at (" + position.x + ", " + position.y + ", " + position.z + ")");
@ -9005,7 +9010,7 @@ Script.setTimeout(function(){
for (var i = 0; i < scenes.length; i++) { for (var i = 0; i < scenes.length; i++) {
// print('setting up scene. first, delete' + JSON.stringify(scenes[i])) // print('setting up scene. first, delete' + JSON.stringify(scenes[i]))
// deleteAllInRadius(scenes[i].location, scenes[i].zone.dimensions.x);
CreateNavigationButton(scenes[i], i); CreateNavigationButton(scenes[i], i);
ImportScene(scenes[i]); ImportScene(scenes[i]);
@ -9018,3 +9023,11 @@ createLayoutLights();
}, 3500) }, 3500)
// Script.scriptEnding.connect(function() {
// Entities.addingEntity.disconnect(makeUngrabbable);
// });
// Script.setTimeout(function() {
// print('JBP stopping cell science import');
// Script.stop();
// }, 30000)

View file

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

View file

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

View file

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