mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-07-24 17:06:44 +02:00
Merge pull request #7296 from imgntn/cellscience
Various Cellscience Fixes
This commit is contained in:
commit
7cdd3d5b3e
5 changed files with 137 additions and 71 deletions
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
this.initialize = function(entityId) {
|
this.initialize = function(entityId) {
|
||||||
var properties = Entities.getEntityProperties(entityId);
|
var properties = Entities.getEntityProperties(entityId);
|
||||||
if (properties.userData.length === 0 || properties.hasOwnProperty('userData') === false) {
|
if (properties.userData.length === 0 || properties.hasOwnProperty('userData') === false || properties.userData==="") {
|
||||||
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);
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -8,7 +8,7 @@
|
||||||
var numDynein = 2;
|
var numDynein = 2;
|
||||||
var numKinesin = 2;
|
var numKinesin = 2;
|
||||||
var percentOnMainMT = 100;
|
var percentOnMainMT = 100;
|
||||||
//print('RUNNING AC!!');
|
|
||||||
var baseLocation;
|
var baseLocation;
|
||||||
if (USE_LOCAL_HOST === true) {
|
if (USE_LOCAL_HOST === true) {
|
||||||
baseLocation = "http://localhost:8080/";
|
baseLocation = "http://localhost:8080/";
|
||||||
|
@ -16,13 +16,32 @@ if (USE_LOCAL_HOST === true) {
|
||||||
baseLocation = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/"
|
baseLocation = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var WORLD_OFFSET = {
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
z: 0
|
||||||
|
}
|
||||||
|
|
||||||
|
var WORLD_SCALE_AMOUNT = 1.0;
|
||||||
|
|
||||||
|
function offsetVectorToWorld(vector) {
|
||||||
|
var newVector;
|
||||||
|
|
||||||
|
newVector = Vec3.sum(vector, WORLD_OFFSET);
|
||||||
|
|
||||||
|
print('JBP NEW VECTOR IS:: ' + JSON.stringify(newVector))
|
||||||
|
return newVector
|
||||||
|
}
|
||||||
|
|
||||||
var USE_LOCAL_HOST = false;
|
var USE_LOCAL_HOST = false;
|
||||||
|
|
||||||
EntityViewer.setPosition({
|
var basePosition = offsetVectorToWorld({
|
||||||
x: 3000,
|
x: 3000,
|
||||||
y: 13500,
|
y: 13500,
|
||||||
z: 3000
|
z: 3000
|
||||||
});
|
});
|
||||||
|
|
||||||
|
EntityViewer.setPosition(basePosition);
|
||||||
EntityViewer.setKeyholeRadius(60000);
|
EntityViewer.setKeyholeRadius(60000);
|
||||||
var octreeQueryInterval = Script.setInterval(function() {
|
var octreeQueryInterval = Script.setInterval(function() {
|
||||||
EntityViewer.queryOctree();
|
EntityViewer.queryOctree();
|
||||||
|
@ -44,11 +63,12 @@ var scriptURL = this.baseLocation + "Scripts/clickToRideAndLook.js?" + Math.rand
|
||||||
|
|
||||||
var t = 0;
|
var t = 0;
|
||||||
var tInc = 0.001;
|
var tInc = 0.001;
|
||||||
var sceneOffset = {
|
var sceneOffset = offsetVectorToWorld({
|
||||||
x: 3000,
|
x: 3000,
|
||||||
y: 13500,
|
y: 13500,
|
||||||
z: 3000
|
z: 3000
|
||||||
};
|
});
|
||||||
|
|
||||||
var yOffset = {
|
var yOffset = {
|
||||||
dynein: 16,
|
dynein: 16,
|
||||||
kinesin: -28
|
kinesin: -28
|
||||||
|
@ -60,11 +80,11 @@ var terms;
|
||||||
var secondaryInit = false;
|
var secondaryInit = false;
|
||||||
|
|
||||||
function deleteAllMotorProteins() {
|
function deleteAllMotorProteins() {
|
||||||
var position = {
|
var position = offsetVectorToWorld({
|
||||||
x: 3280,
|
x: 3280,
|
||||||
y: 13703,
|
y: 13703,
|
||||||
z: 4405
|
z: 4405
|
||||||
};
|
});
|
||||||
|
|
||||||
if (secondaryInit === true) {
|
if (secondaryInit === true) {
|
||||||
return;
|
return;
|
||||||
|
@ -83,7 +103,7 @@ function deleteAllMotorProteins() {
|
||||||
results.forEach(function(r) {
|
results.forEach(function(r) {
|
||||||
var name = Entities.getEntityProperties(r, 'name').name;
|
var name = Entities.getEntityProperties(r, 'name').name;
|
||||||
if (name.indexOf('Hifi-Motor-Protein-Anchor') > -1) {
|
if (name.indexOf('Hifi-Motor-Protein-Anchor') > -1) {
|
||||||
// print('Script.clearTimeout DELETING A MOTOR PROTEIN::' + r)
|
// print('Script.clearTimeout DELETING A MOTOR PROTEIN::' + r)
|
||||||
Entities.deleteEntity(r);
|
Entities.deleteEntity(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,7 +115,7 @@ function deleteAllMotorProteins() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function makeAll() {
|
function makeAll() {
|
||||||
// print('CREATING MOTOR PROTEINS')
|
// print('CREATING MOTOR PROTEINS')
|
||||||
var segment;
|
var segment;
|
||||||
var segments = shuffleSegments();
|
var segments = shuffleSegments();
|
||||||
var lastSegment = [];
|
var lastSegment = [];
|
||||||
|
@ -195,11 +215,11 @@ function update(deltaTime) {
|
||||||
print("servers exist -- makeAll...");
|
print("servers exist -- makeAll...");
|
||||||
Entities.setPacketsPerSecond(6000);
|
Entities.setPacketsPerSecond(6000);
|
||||||
print("PPS:" + Entities.getPacketsPerSecond());
|
print("PPS:" + Entities.getPacketsPerSecond());
|
||||||
Script.setTimeout(function(){
|
Script.setTimeout(function() {
|
||||||
//print('SETTING TIMEOUT')
|
//print('SETTING TIMEOUT')
|
||||||
deleteAllMotorProteins()
|
deleteAllMotorProteins()
|
||||||
},10000)
|
}, 10000)
|
||||||
|
|
||||||
initialized = true;
|
initialized = true;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -4,12 +4,29 @@
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
|
var WORLD_OFFSET = {
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
z: 0
|
||||||
|
}
|
||||||
|
|
||||||
var basePosition = {
|
var WORLD_SCALE_AMOUNT = 1.0;
|
||||||
|
|
||||||
|
|
||||||
|
function offsetVectorToWorld(vector) {
|
||||||
|
var newVector;
|
||||||
|
|
||||||
|
newVector = Vec3.sum(vector, WORLD_OFFSET);
|
||||||
|
|
||||||
|
print('JBP NEW VECTOR IS:: ' + JSON.stringify(newVector))
|
||||||
|
return newVector
|
||||||
|
}
|
||||||
|
|
||||||
|
var basePosition = offsetVectorToWorld({
|
||||||
x: 3000,
|
x: 3000,
|
||||||
y: 13500,
|
y: 13500,
|
||||||
z: 3000
|
z: 3000
|
||||||
};
|
}, WORLD_OFFSET);
|
||||||
|
|
||||||
var initialized = false;
|
var initialized = false;
|
||||||
|
|
||||||
|
|
|
@ -4,12 +4,29 @@
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
//
|
//
|
||||||
|
var WORLD_OFFSET = {
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
z: 0
|
||||||
|
}
|
||||||
|
|
||||||
var basePosition = {
|
var WORLD_SCALE_AMOUNT = 1.0;
|
||||||
|
|
||||||
|
function offsetVectorToWorld(vector) {
|
||||||
|
var newVector;
|
||||||
|
|
||||||
|
newVector = Vec3.sum(vector, WORLD_OFFSET);
|
||||||
|
|
||||||
|
print('JBP NEW VECTOR IS:: ' + JSON.stringify(newVector))
|
||||||
|
return newVector
|
||||||
|
}
|
||||||
|
|
||||||
|
var basePosition = offsetVectorToWorld({
|
||||||
x: 3000,
|
x: 3000,
|
||||||
y: 13500,
|
y: 13500,
|
||||||
z: 3000
|
z: 3000
|
||||||
};
|
}, WORLD_OFFSET);
|
||||||
|
|
||||||
|
|
||||||
var initialized = false;
|
var initialized = false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue