From e4bc0ce69103ccdd950793255384f9a6b3719a66 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Mon, 22 Feb 2016 13:08:58 -0800 Subject: [PATCH] tests --- .../DomainContent/CellScience/Scripts/zoom.js | 12 ---------- .../Scripts/zoomAndMoveRandomly.js | 23 +++++++------------ .../CellScience/importCellScience.js | 2 +- 3 files changed, 9 insertions(+), 28 deletions(-) diff --git a/unpublishedScripts/DomainContent/CellScience/Scripts/zoom.js b/unpublishedScripts/DomainContent/CellScience/Scripts/zoom.js index da41ec64ba..3fc5acae2a 100644 --- a/unpublishedScripts/DomainContent/CellScience/Scripts/zoom.js +++ b/unpublishedScripts/DomainContent/CellScience/Scripts/zoom.js @@ -52,13 +52,7 @@ print("Teleporting to (" + data.location.x + ", " + data.location.y + ", " + data.location.z + ")"); MyAvatar.position = data.location; - - // if (data.hasOwnProperty('entryPoint') && data.hasOwnProperty('target')) { - // this.lookAtTarget(data.entryPoint, data.target); - // } - // else{ - // } } } @@ -103,10 +97,4 @@ } } - this.hoverEnterEntity = function(entityID) { - Entities.editEntity(entityID, { - animationURL: animationURL, - animationSettings: '{ "fps": 24, "firstFrame": 1, "lastFrame": 25, "frameIndex": 1, "running": true, "hold": true }' - }); - } }) \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/CellScience/Scripts/zoomAndMoveRandomly.js b/unpublishedScripts/DomainContent/CellScience/Scripts/zoomAndMoveRandomly.js index bf249a4644..703c4ead33 100644 --- a/unpublishedScripts/DomainContent/CellScience/Scripts/zoomAndMoveRandomly.js +++ b/unpublishedScripts/DomainContent/CellScience/Scripts/zoomAndMoveRandomly.js @@ -15,18 +15,19 @@ var self = this; var baton; - var iOwn = false; + + this.iOwn = false; var currentInterval; var _entityId; function startUpdate() { - iOwn = true; + self.iOwn = true; print('i am the owner ' + _entityId) } function stopUpdateAndReclaim() { print('i released the object ' + _entityId) - iOwn = false; + self.iOwn = false; baton.claim(startUpdate, stopUpdateAndReclaim); } @@ -40,7 +41,7 @@ this.minAngularVelocity = 0.01; this.maxAngularVelocity = 0.03; baton = virtualBaton({ - batonName: 'io.highfidelity.vesicles:' + entityID, // One winner for each entity + batonName: 'io.highfidelity.cells:' + entityID, // One winner for each entity }); stopUpdateAndReclaim(); currentInterval = Script.setInterval(self.move, self.getTotalWait()) @@ -146,19 +147,11 @@ } this.move = function() { - if (!iOwn) { + if (self.iOwn===false) { + print('cell is not owned by me...') return; } - // var magnitudeV = self.maxVelocity; - // var directionV = { - // x: Math.random() - 0.5, - // y: Math.random() - 0.5, - // z: Math.random() - 0.5 - // }; - - //print("POS magnitude is " + magnitudeV + " and direction is " + directionV.x); - var magnitudeAV = self.maxAngularVelocity; var directionAV = { @@ -166,7 +159,7 @@ 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(self.entityId, { // velocity: Vec3.multiply(magnitudeV, Vec3.normalize(directionV)), angularVelocity: Vec3.multiply(magnitudeAV, Vec3.normalize(directionAV)) diff --git a/unpublishedScripts/DomainContent/CellScience/importCellScience.js b/unpublishedScripts/DomainContent/CellScience/importCellScience.js index b061dc6931..4ae5e5de36 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 = 1052; +var version = 1055; var cellLayout; var baseLocation = "https://hifi-content.s3.amazonaws.com/DomainContent/CellScience/";