From 5cb792183e23442047557d9a9809ded0daef5e36 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Tue, 1 Mar 2016 17:51:05 -0800 Subject: [PATCH] start inner tank --- .../Home/fishTank/createFishTank.js | 2 ++ .../DomainContent/Home/fishTank/tank.js | 32 +++++++------------ 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/unpublishedScripts/DomainContent/Home/fishTank/createFishTank.js b/unpublishedScripts/DomainContent/Home/fishTank/createFishTank.js index 3671030948..7d9f2cf977 100644 --- a/unpublishedScripts/DomainContent/Home/fishTank/createFishTank.js +++ b/unpublishedScripts/DomainContent/Home/fishTank/createFishTank.js @@ -7,6 +7,8 @@ var TANK_DIMENSIONS = { z: 3.5914 }; +var INNER_TANK_SCALE = 0.8; +var INNER_TANK_DIMENSIONS = Vec3.multiply(INNER_TANK_SCALE,TANK_DIMENSIONS); var TANK_WIDTH = TANK_DIMENSIONS.z; var TANK_HEIGHT = TANK_DIMENSIONS.y; diff --git a/unpublishedScripts/DomainContent/Home/fishTank/tank.js b/unpublishedScripts/DomainContent/Home/fishTank/tank.js index bc56229ad8..cc845ea63e 100644 --- a/unpublishedScripts/DomainContent/Home/fishTank/tank.js +++ b/unpublishedScripts/DomainContent/Home/fishTank/tank.js @@ -156,7 +156,7 @@ updateDebugSphere: function(position) { Entities.editEntity(_this.debugSphere, { - visible:true, + visible: true, position: position }) }, @@ -164,9 +164,9 @@ debugSphereOff: function() { // Entities.deleteEntity(_this.debugSphere); Entities.editEntity(_this.debugSphere, { - visible: false - }) - //_this.debugSphere = null; + visible: false + }) + //_this.debugSphere = null; }, @@ -232,12 +232,10 @@ _this.updateDebugSphere(intersection.intersection); } } - print('INT DIST: ' + intersection.distance); if (intersection.distance > 1.5) { - print('NOT CLOSE ENOUGH TO THE TANK') - if (WANT_LOOK_DEBUG_SPHERE === true) { - _this.debugSphereOff(); - } + if (WANT_LOOK_DEBUG_SPHERE === true) { + _this.debugSphereOff(); + } return } // print('intersection:: ' + JSON.stringify(intersection)); @@ -454,18 +452,10 @@ z: 0 }; - var center = _this.currentProperties.position; - - lowerCorner = { - x: center.x - (TANK_WIDTH / 2), - y: center.y, - z: center.z - (TANK_WIDTH / 2) - }; - upperCorner = { - x: center.x + (TANK_WIDTH / 2), - y: center.y + TANK_HEIGHT, - z: center.z + (TANK_WIDTH / 2) - }; + //var center = _this.currentProperties.position; + var bounds = Entities.getEntityProperties(_this.entityID, "boundingBox").boundingBox; + lowerCorner = bounds.brn; + upperCorner = bounds.tfl; //createEntitiesAtCorners(lowerCorner,upperCorner);