From baa030b7b07a24612953807d5a116398e8354f17 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Wed, 24 Feb 2016 13:18:01 -0800 Subject: [PATCH] cleanup and submit --- .../CellScience/importCellScience.js | 2 +- .../DomainContent/CellScience/moveCellsAC.js | 21 ++++++++++++------- .../CellScience/moveVesiclesAC.js | 20 +++++++++++------- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/unpublishedScripts/DomainContent/CellScience/importCellScience.js b/unpublishedScripts/DomainContent/CellScience/importCellScience.js index 55b09cd4a7..6a6de23f4e 100644 --- a/unpublishedScripts/DomainContent/CellScience/importCellScience.js +++ b/unpublishedScripts/DomainContent/CellScience/importCellScience.js @@ -5,7 +5,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -var version = 1057; +var version = 1100; var cellLayout; var baseLocation = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/"; diff --git a/unpublishedScripts/DomainContent/CellScience/moveCellsAC.js b/unpublishedScripts/DomainContent/CellScience/moveCellsAC.js index 30e83108d6..881f8e981c 100644 --- a/unpublishedScripts/DomainContent/CellScience/moveCellsAC.js +++ b/unpublishedScripts/DomainContent/CellScience/moveCellsAC.js @@ -1,3 +1,10 @@ +// 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 +// + var basePosition = { x: 3000, y: 13500, @@ -17,21 +24,21 @@ var THROTTLE_RATE = 5000; var sinceLastUpdate = 0; -print('cells script') +//print('cells script') 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) @@ -44,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; @@ -53,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)) }); @@ -77,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 ce8da54eb2..3e70934cba 100644 --- a/unpublishedScripts/DomainContent/CellScience/moveVesiclesAC.js +++ b/unpublishedScripts/DomainContent/CellScience/moveVesiclesAC.js @@ -1,3 +1,10 @@ +// 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 +// + var basePosition = { x: 3000, y: 13500, @@ -17,7 +24,7 @@ var THROTTLE_RATE = 5000; var sinceLastUpdate = 0; -print('vesicle script') +//print('vesicle script') function findVesicles() { var results = Entities.findEntities(basePosition, 60000); @@ -31,7 +38,7 @@ function findVesicles() { 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) @@ -45,7 +52,7 @@ var minAngularVelocity = 0.01; var maxAngularVelocity = 0.03; function moveVesicle(entityId) { - print('moving a vesicle! ' + entityId) + // print('moving a vesicle! ' + entityId) var magnitudeV = maxVelocity; var directionV = { x: Math.random() - 0.5, @@ -53,7 +60,7 @@ function moveVesicle(entityId) { z: Math.random() - 0.5 }; - print("POS magnitude is " + magnitudeV + " and direction is " + directionV.x); + // print("POS magnitude is " + magnitudeV + " and direction is " + directionV.x); var magnitudeAV = maxAngularVelocity; @@ -62,7 +69,7 @@ function moveVesicle(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, { velocity: Vec3.multiply(magnitudeV, Vec3.normalize(directionV)), angularVelocity: Vec3.multiply(magnitudeAV, Vec3.normalize(directionAV)) @@ -71,7 +78,6 @@ function moveVesicle(entityId) { } function update(deltaTime) { - // print('deltaTime',deltaTime) if (!initialized) { print("checking for servers..."); @@ -87,7 +93,7 @@ function update(deltaTime) { if (THROTTLE === true) { sinceLastUpdate = sinceLastUpdate + deltaTime * 1000; if (sinceLastUpdate > THROTTLE_RATE) { - print('SHOULD FIND VESICLES!!!') + // print('SHOULD FIND VESICLES!!!') sinceLastUpdate = 0; findVesicles(); } else {