From 6c6ea3f0a76ce9bdc433216f3e3bcb6ad5d678e0 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Fri, 26 Feb 2016 10:42:45 -0800 Subject: [PATCH] code cleanup --- .../DomainContent/CellScience/moveCellsAC.js | 14 +++++++------- .../DomainContent/CellScience/moveVesiclesAC.js | 10 +++------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/unpublishedScripts/DomainContent/CellScience/moveCellsAC.js b/unpublishedScripts/DomainContent/CellScience/moveCellsAC.js index 881f8e981c..cf35e081e0 100644 --- a/unpublishedScripts/DomainContent/CellScience/moveCellsAC.js +++ b/unpublishedScripts/DomainContent/CellScience/moveCellsAC.js @@ -30,18 +30,18 @@ function findCells() { var results = Entities.findEntities(basePosition, 60000); if (results.length === 0) { - // print('no entities found') + // print('no entities found') return; } results.forEach(function(v) { var name = Entities.getEntityProperties(v, 'name').name; - // print('name is:: ' + name) + // print('name is:: ' + name) if (name === 'Cell') { - // print('found a cell!!' + v) + // print('found a cell!!' + v) Script.setTimeout(function() { moveCell(v); - }, Math.random() * THROTTLE_RATE) + }, Math.random() * THROTTLE_RATE); } }); } @@ -51,7 +51,7 @@ var minAngularVelocity = 0.01; var maxAngularVelocity = 0.03; function moveCell(entityId) { - // print('moving a cell! ' + entityId) + // print('moving a cell! ' + entityId) var magnitudeAV = maxAngularVelocity; @@ -60,7 +60,7 @@ function moveCell(entityId) { y: Math.random() - 0.5, z: Math.random() - 0.5 }; - // print("ROT magnitude is " + magnitudeAV + " and direction is " + directionAV.x); + // print("ROT magnitude is " + magnitudeAV + " and direction is " + directionAV.x); Entities.editEntity(entityId, { angularVelocity: Vec3.multiply(magnitudeAV, Vec3.normalize(directionAV)) }); @@ -84,7 +84,7 @@ function update(deltaTime) { if (THROTTLE === true) { sinceLastUpdate = sinceLastUpdate + deltaTime * 1000; if (sinceLastUpdate > THROTTLE_RATE) { - // print('SHOULD FIND CELLS!!!') + // print('SHOULD FIND CELLS!!!') sinceLastUpdate = 0; findCells(); } else { diff --git a/unpublishedScripts/DomainContent/CellScience/moveVesiclesAC.js b/unpublishedScripts/DomainContent/CellScience/moveVesiclesAC.js index 3e70934cba..922f0d94cf 100644 --- a/unpublishedScripts/DomainContent/CellScience/moveVesiclesAC.js +++ b/unpublishedScripts/DomainContent/CellScience/moveVesiclesAC.js @@ -30,18 +30,17 @@ function findVesicles() { var results = Entities.findEntities(basePosition, 60000); if (results.length === 0) { - print('no entities found') + // print('no entities found'); return; } results.forEach(function(v) { var name = Entities.getEntityProperties(v, 'name').name; - print('name is:: ' + name) if (name === 'vesicle') { - // print('found a vesicle!!' + v) + //print('found a vesicle!!' + v) Script.setTimeout(function() { moveVesicle(v); - }, Math.random() * THROTTLE_RATE) + }, Math.random() * THROTTLE_RATE); } }); } @@ -78,7 +77,6 @@ function moveVesicle(entityId) { } function update(deltaTime) { - // print('deltaTime',deltaTime) if (!initialized) { print("checking for servers..."); if (Entities.serversExist() && Entities.canRez()) { @@ -93,11 +91,9 @@ function update(deltaTime) { if (THROTTLE === true) { sinceLastUpdate = sinceLastUpdate + deltaTime * 1000; if (sinceLastUpdate > THROTTLE_RATE) { - // print('SHOULD FIND VESICLES!!!') sinceLastUpdate = 0; findVesicles(); } else { - // print('returning in update ' + sinceLastUpdate) return; } }