From d75db853c2b2fbd3d63cd4bcba02fcad5f1db9b7 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Wed, 23 Mar 2016 13:56:39 -0700 Subject: [PATCH] add posters and such --- .../DomainContent/Home/fishTank/tank.js | 170 ++++++++++-------- .../Home/kineticObjects/deskLamp.json | 89 +++++++++ .../Home/kineticObjects/labLamp.json | 35 ---- .../Home/kineticObjects/livingRoomLamp.json | 35 ---- .../Home/kineticObjects/postersCell.json | 74 ++++++++ .../Home/kineticObjects/postersPlaya.json | 75 ++++++++ .../Home/kineticObjects/wrapper.js | 52 +++++- .../DomainContent/Home/reset.js | 2 +- .../DomainContent/Home/tiltMaze/maze.js | 1 - 9 files changed, 383 insertions(+), 150 deletions(-) create mode 100644 unpublishedScripts/DomainContent/Home/kineticObjects/deskLamp.json delete mode 100644 unpublishedScripts/DomainContent/Home/kineticObjects/labLamp.json delete mode 100644 unpublishedScripts/DomainContent/Home/kineticObjects/livingRoomLamp.json create mode 100644 unpublishedScripts/DomainContent/Home/kineticObjects/postersCell.json create mode 100644 unpublishedScripts/DomainContent/Home/kineticObjects/postersPlaya.json diff --git a/unpublishedScripts/DomainContent/Home/fishTank/tank.js b/unpublishedScripts/DomainContent/Home/fishTank/tank.js index c0778a4413..baeeb2076e 100644 --- a/unpublishedScripts/DomainContent/Home/fishTank/tank.js +++ b/unpublishedScripts/DomainContent/Home/fishTank/tank.js @@ -24,7 +24,7 @@ var TANK_SEARCH_RADIUS = 5; var WANT_LOOK_DEBUG_LINE = false; - var WANT_LOOK_DEBUG_SPHERE = false; + var WANT_LOOK_DEBUG_SPHERE = true; var INTERSECT_COLOR = { red: 255, @@ -108,12 +108,12 @@ if (properties.hasOwnProperty('userData') === false || properties.userData.length === 0) { _this.initTimeout = Script.setTimeout(function() { if (properties.hasOwnProperty('userData')) { - print('JBP has user data property') + print('JBP has user data property') } if (properties.userData.length === 0) { - print('JBP user data length is zero') + print('JBP user data length is zero') } - if(properties.userData===""){ + if (properties.userData === "") { print('JBP user data is empty') } @@ -128,8 +128,8 @@ _this.userData = JSON.parse(properties.userData); print('JBP set userdata to parsed json') } catch (err) { - print('JBP error parsing json'); - print('JBP properties are:' + properties.userData); + print('JBP error parsing json'); + print('JBP properties are:' + properties.userData); return; } // print('after parse') @@ -176,7 +176,7 @@ // print('i am the owner!') //do stuff updateFish(deltaTime); - // _this.seeIfOwnerIsLookingAtTheTank(); + // _this.seeIfOwnerIsLookingAtTheTank(); }, debugSphereOn: function(position) { @@ -344,7 +344,7 @@ var FISHTANK_USERDATA_KEY = 'hifi-home-fishtank' var LIFETIME = 300; // Fish live for 5 minutes - var NUM_FISH = 2; + var NUM_FISH = 8; var TANK_DIMENSIONS = { x: 0.8212, y: 0.8116, @@ -421,7 +421,7 @@ } } - print('jbp has userdata fish??' + JSON.stringify(_this.userData)) + // print('jbp has userdata fish??' + JSON.stringify(_this.userData)) if (_this.userData['hifi-home-fishtank'].fishLoaded === false) { //no fish in the user data @@ -431,11 +431,6 @@ var data = { fishLoaded: true, bubbleSystem: _this.userData['hifi-home-fishtank'].bubbleSystem, - // bubbleSound: _this.userData['hifi-home-fishtank'].bubbleSound, - // corners: { - // brn: _this.userData['hifi-home-fishtank'].lowerCorner, - // tfl: _this.userData['hifi-home-fishtank'].upperCorner - // }, innerContainer: _this.userData['hifi-home-fishtank'].innerContainer, } @@ -480,15 +475,28 @@ var innerContainer = userData['hifi-home-fishtank']['innerContainer']; // var bounds = Entities.getEntityProperties(innerContainer, "boundingBox").boundingBox; - lowerCorner = getOffsetFromTankCenter(LOWER_CORNER_VERTICAL_OFFSET, LOWER_CORNER_FORWARD_OFFSET, LOWER_CORNER_LATERAL_OFFSET); - upperCorner = getOffsetFromTankCenter(UPPER_CORNER_VERTICAL_OFFSET, UPPER_CORNER_FORWARD_OFFSET, UPPER_CORNER_LATERAL_OFFSET); + // print('LOADFISH LOWER' + JSON.stringify(lowerCorner)); // print('LOADFISH UPPER' + JSON.stringify(upperCorner)); // First pre-load an array with properties on all the other fish so our per-fish loop // isn't doing it. var flockProperties = []; + var tankProps = Entities.getEntityProperties(_this.entityID); + var tankXForm = new Xform(tankProps.rotation, tankProps.position); + var inverseTankXForm = tankXForm.inv(); + + var lowerCorner = getOffsetFromTankCenter(LOWER_CORNER_VERTICAL_OFFSET, LOWER_CORNER_FORWARD_OFFSET, LOWER_CORNER_LATERAL_OFFSET); + var upperCorner = getOffsetFromTankCenter(UPPER_CORNER_VERTICAL_OFFSET, UPPER_CORNER_FORWARD_OFFSET, UPPER_CORNER_LATERAL_OFFSET); + + + lowerCorner = inverseTankXForm.xFormPoint(lowerCorner); + upperCorner = inverseTankXForm.xFormPoint(upperCorner); + for (var i = 0; i < fish.length; i++) { var otherProps = Entities.getEntityProperties(fish[i], ["position", "velocity", "rotation"]); + otherProps.position = inverseTankXForm.xFormPoint(otherProps.position); + otherProps.velocity = inverseTankXForm.xFormVector(otherProps.velocity) + print('TRANSFORMED POSITION::' + JSON.stringify(otherProps.position)); flockProperties.push(otherProps); } @@ -554,16 +562,13 @@ //attractors //[position, radius, force] - - } - if (_this.hasLookAttractor === true) { - //print('has a look attractor, so use it') - var attractorPosition = _this.lookAttractor.position; - var towardAttractor = Vec3.subtract(attractorPosition, position); - velocity = Vec3.mix(velocity, Vec3.multiply(Vec3.normalize(towardAttractor), Vec3.length(velocity)), LOOK_ATTRACTOR_FORCE); - } + // if (_this.hasLookAttractor === true) { + // var attractorPosition = _this.lookAttractor.position; + // var towardAttractor = Vec3.subtract(attractorPosition, position); + // velocity = Vec3.mix(velocity, Vec3.multiply(Vec3.normalize(towardAttractor), Vec3.length(velocity)), LOOK_ATTRACTOR_FORCE); + // } // Try to swim at a constant speed velocity = Vec3.mix(velocity, Vec3.multiply(Vec3.normalize(velocity), SWIMMING_SPEED), SWIMMING_FORCE); @@ -610,18 +615,30 @@ // Only update properties if they have changed, to save bandwidth var MIN_POSITION_CHANGE_FOR_UPDATE = 0.001; - if (Vec3.distance(properties.position, position) < MIN_POSITION_CHANGE_FOR_UPDATE) { - Entities.editEntity(fish[i], { - velocity: velocity, - rotation: finalQuat - }); - } else { - Entities.editEntity(fish[i], { - position: position, - velocity: velocity, - rotation: finalQuat - }); - } + + + var primePosition = tankXForm.xFormPoint(position); + var primeVector = tankXForm.xFormVector(velocity); + + // if (Vec3.distance(properties.position, position) < MIN_POSITION_CHANGE_FOR_UPDATE) { + // print('under min position change') + // Entities.editEntity(fish[i], { + // velocity: primeVector, + // // rotation: finalQuat + // }); + // } else { + // Entities.editEntity(fish[i], { + // position: primePosition, + // velocity: primeVector, + // // rotation: finalQuat + // }); + // } + + Entities.editEntity(fish[i], { + position: primePosition, + velocity: primeVector, + //rotation: finalQuat + }); } } } @@ -633,12 +650,12 @@ _this.currentProperties = Entities.getEntityProperties(_this.entityID); var center = _this.currentProperties.position; - lowerCorner = { + var lowerCorner = { x: center.x - (_this.currentProperties.dimensions.z / 2), y: center.y, z: center.z - (_this.currentProperties.dimensions.z / 2) }; - upperCorner = { + var upperCorner = { x: center.x + (_this.currentProperties.dimensions.z / 2), y: center.y + _this.currentProperties.dimensions.y, z: center.z + (_this.currentProperties.dimensions.z / 2) @@ -703,32 +720,6 @@ Script.update.disconnect(_this.update); }) - function keepFishInTank(fish,position,rotation){ - - // cast a ray from the fish - // see if it hits the tank wall - // see how far it is from the tank wall - // if less than a certain distance, then apply opposite vector - var keepAwayDistance = 0.15; - - - var pickRay = { - origin: position, - direction: rotation - }; - - var innerContainer = _this.userData['hifi-home-fishtank'].innerContainer; - - var intersection = Entities.findRayIntersection(pickRay, true, [innerContainer], [_this.entityID]); - - if (intersection.intersects && intersection.entityID === innerContainer) { - - } - - return newVector - } - - function setEntityUserData(id, data) { var json = JSON.stringify(data) Entities.editEntity(id, { @@ -772,21 +763,48 @@ } } - function transformFishFromTankToWorldSpace(position, velocity) { + function Xform(rot, pos) { + this.rot = rot; + this.pos = pos; + }; + Xform.ident = function() { + return new Xform({ + x: 0, + y: 0, + z: 0, + w: 1 + }, { + x: 0, + y: 0, + z: 0 + }); + }; - var Q = Entities.getEntityProperties(_this.entityID).rotation; - var tPosition = Vec3.multiplyQbyV(Q, position); - var tVelocity = Vec3.multiplyQbyV(Q, velocity); + Xform.mul = function(lhs, rhs) { + var rot = Quat.multiply(lhs.rot, rhs.rot); + var pos = Vec3.sum(lhs.pos, Vec3.multiplyQbyV(lhs.rot, rhs.pos)); + return new Xform(rot, pos); + }; - var inverseQ = Quat.inverse(Q); - var finalPosition = Vec3.multiplyQbyV(inverseQ, tPosition); - var finalVelocity = Vec3.multiplyQbyV(inverseQ, tVelocity); + Xform.prototype.inv = function() { + var invRot = Quat.inverse(this.rot); + var invPos = Vec3.multiply(-1, this.pos); + return new Xform(invRot, Vec3.multiplyQbyV(invRot, invPos)); + }; - return { - position: finalPosition, - velocity: finalVelocity - }; - } + Xform.prototype.xFormPoint = function(point) { + return Vec3.sum(Vec3.multiplyQbyV(this.rot, point), this.pos); + }; + + Xform.prototype.xFormVector = function(vector) { + return Vec3.multiplyQbyV(this.rot, vector); + }; + + Xform.prototype.toString = function() { + var rot = this.rot; + var pos = this.pos; + return "Xform rot = (" + rot.x + ", " + rot.y + ", " + rot.z + ", " + rot.w + "), pos = (" + pos.x + ", " + pos.y + ", " + pos.z + ")"; + }; return new FishTank(); }); \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/deskLamp.json b/unpublishedScripts/DomainContent/Home/kineticObjects/deskLamp.json new file mode 100644 index 0000000000..bf05afae8f --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/kineticObjects/deskLamp.json @@ -0,0 +1,89 @@ +{ + "Entities": [{ + "angularVelocity": { + "x": -0.00071254139766097069, + "y": 0.0045778844505548477, + "z": -0.0034651262685656548 + }, + "collisionsWillMove": 1, + "compoundShapeURL": "http://hifi-content.s3.amazonaws.com/alan/dev/Lamp-Bulldog-Shade.obj", + "created": "2016-03-22T22:55:11Z", + "dimensions": { + "x": 0.35158795118331909, + "y": 0.27823561429977417, + "z": 0.35158795118331909 + }, + "dynamic": 1, + "gravity": { + "x": 0, + "y": -2, + "z": 0 + }, + "id": "{638e562d-77cc-45ee-b2c7-f5c678cf83eb}", + "modelURL": "http://hifi-content.s3.amazonaws.com/alan/dev/Lamp-Bulldog-Shade.fbx", + "position": { + "x": 1104.558349609375, + "y": 460.93505859375, + "z": 0 + }, + "queryAACube": { + "scale": 0.56977474689483643, + "x": 1104.2734375, + "y": 460.65017700195312, + "z": -0.28488737344741821 + }, + "restitution": 0.20000000298023224, + "rotation": { + "w": 0.80972349643707275, + "x": 8.0799843999557197e-05, + "y": -0.58680325746536255, + "z": 0.0031326396856456995 + }, + "shapeType": "compound", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }, { + "angularVelocity": { + "x": -0.0025625245179980993, + "y": -0.00052156101446598768, + "z": 0.000514673360157758 + }, + "collisionsWillMove": 1, + "compoundShapeURL": "http://hifi-content.s3.amazonaws.com/alan/dev/Lamp-Bulldog-Base.obj", + "created": "2016-03-22T22:50:49Z", + "dimensions": { + "x": 0.26436957716941833, + "y": 0.73171323537826538, + "z": 0.26436954736709595 + }, + "dynamic": 1, + "gravity": { + "x": 0, + "y": -9, + "z": 0 + }, + "id": "{1fdc3a04-fbee-4f23-bdf8-c44c58258388}", + "modelURL": "http://hifi-content.s3.amazonaws.com/alan/dev/Lamp-Bulldog-Base.fbx", + "position": { + "x": 1104.5577392578125, + "y": 460.7225341796875, + "z": 0.0018768310546875 + }, + "queryAACube": { + "scale": 0.82169753313064575, + "x": 1104.1468505859375, + "y": 460.31167602539062, + "z": -0.40897193551063538 + }, + "rotation": { + "w": 0.98707658052444458, + "x": -5.647468424285762e-05, + "y": -0.16024939715862274, + "z": 2.5912273486028425e-05 + }, + "shapeType": "compound", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }], + "Version": 57 +} \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/labLamp.json b/unpublishedScripts/DomainContent/Home/kineticObjects/labLamp.json deleted file mode 100644 index fb2fb929cc..0000000000 --- a/unpublishedScripts/DomainContent/Home/kineticObjects/labLamp.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "Entities": [{ - "userData": "{\"hifiHomeKey\":{\"reset\":true}}", - "compoundShapeURL": "http://hifi-content.s3.amazonaws.com/alan/dev/Little-Lamp.obj", - "created": "2016-03-16T01:00:16Z", - "dimensions": { - "x": 0.63867169618606567, - "y": 0.75600343942642212, - "z": 0.22696791589260101 - }, - "id": "{533c2da8-ea8c-4ae8-9c1c-3a18c7d91f46}", - "modelURL": "http://hifi-content.s3.amazonaws.com/alan/dev/Little-Lamp-White-4.fbx", - "position": { - "x": 1103.28564453125, - "y": 460.89242553710938, - "z": 0 - }, - "dynamic": 1, - "queryAACube": { - "scale": 1.0153605937957764, - "x": 1102.7779541015625, - "y": 460.38473510742188, - "z": -0.50768029689788818 - }, - "rotation": { - "w": -0.36089110374450684, - "x": -0.014938592910766602, - "y": -0.93249410390853882, - "z": -0.0007476806640625 - }, - "shapeType": "compound", - "type": "Model", - }], - "Version": 57 -} \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/livingRoomLamp.json b/unpublishedScripts/DomainContent/Home/kineticObjects/livingRoomLamp.json deleted file mode 100644 index c0317c510f..0000000000 --- a/unpublishedScripts/DomainContent/Home/kineticObjects/livingRoomLamp.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "Entities": [{ - "compoundShapeURL": "http://hifi-content.s3.amazonaws.com/alan/dev/Little-Lamp.obj", - "created": "2016-03-16T01:04:38Z", - "dimensions": { - "x": 0.63867169618606567, - "y": 0.75600343942642212, - "z": 0.22696791589260101 - }, - "id": "{ee167d6d-3901-469a-86df-baf787691997}", - "modelURL": "http://hifi-content.s3.amazonaws.com/alan/dev/Little-Lamp-White-4.fbx", - "position": { - "x": 1104.701171875, - "y": 460.98452758789062, - "z": 0 - }, - "dynamic": 1, - "queryAACube": { - "scale": 1.0153605937957764, - "x": 1104.1934814453125, - "y": 460.47683715820312, - "z": -0.50768029689788818 - }, - "rotation": { - "w": 0.69259178638458252, - "x": -0.0070344209671020508, - "y": -0.72118711471557617, - "z": 0.013168573379516602 - }, - "shapeType": "compound", - "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}" - }], - "Version": 57 -} \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/postersCell.json b/unpublishedScripts/DomainContent/Home/kineticObjects/postersCell.json new file mode 100644 index 0000000000..c4dfd507b6 --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/kineticObjects/postersCell.json @@ -0,0 +1,74 @@ +{ + "Entities": [{ + "color": { + "blue": 117, + "green": 117, + "red": 117 + }, + "created": "2016-03-23T17:14:01Z", + "dimensions": { + "x": 0.20582196116447449, + "y": 0.032061770558357239, + "z": 0.14119282364845276 + }, + "id": "{fb17c832-d450-4293-a9b5-5b2d0425e8fc}", + "name": "Poster-Nail", + "position": { + "x": 1103.8148193359375, + "y": 461.78707885742188, + "z": 3.0988998413085938 + }, + "queryAACube": { + "scale": 0.25164666771888733, + "x": 1103.68896484375, + "y": 461.6612548828125, + "z": 2.9730765819549561 + }, + "rotation": { + "w": 0.96362245082855225, + "x": -1.52587890625e-05, + "y": 0.26723122596740723, + "z": -1.52587890625e-05 + }, + "type": "Box", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }, { + "collisionsWillMove": 1, + "compoundShapeURL": "http://hifi-content.s3.amazonaws.com/alan/dev/Poster2.obj", + "created": "2016-03-23T19:05:25Z", + "dimensions": { + "x": 0.057196967303752899, + "y": 1.1607639789581299, + "z": 0.87844705581665039 + }, + "dynamic": 1, + "gravity": { + "x": 0, + "y": -5, + "z": 0 + }, + "id": "{9eec1faa-9e1a-4d76-abeb-a1b1175a44d5}", + "modelURL": "http://hifi-content.s3.amazonaws.com/alan/dev/Cellscience-Poster-2.fbx", + "position": { + "x": 1103.866943359375, + "y": 461.2822265625, + "z": 3.0254440307617188 + }, + "queryAACube": { + "scale": 1.4568163156509399, + "x": 1103.1385498046875, + "y": 460.5538330078125, + "z": 2.2970359325408936 + }, + "rotation": { + "w": -0.28834974765777588, + "x": 0.023819327354431152, + "y": 0.95718324184417725, + "z": -0.0075837373733520508 + }, + "shapeType": "compound", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }], + "Version": 57 +} \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/postersPlaya.json b/unpublishedScripts/DomainContent/Home/kineticObjects/postersPlaya.json new file mode 100644 index 0000000000..3ac26b236f --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/kineticObjects/postersPlaya.json @@ -0,0 +1,75 @@ +{ + "Entities": [{ + "collisionsWillMove": 1, + "compoundShapeURL": "http://hifi-content.s3.amazonaws.com/alan/dev/Poster2.obj", + "created": "2016-03-23T17:16:12Z", + "dimensions": { + "x": 0.047816216945648193, + "y": 1.2243480682373047, + "z": 0.92656642198562622 + }, + "dynamic": 1, + "gravity": { + "x": 0, + "y": -2, + "z": 0 + }, + "id": "{2b5ca0a0-9115-4916-bee6-63f88d3909b1}", + "modelURL": "http://hifi-content.s3.amazonaws.com/alan/dev/Playa-Poster.fbx", + "position": { + "x": 1101.8731689453125, + "y": 461.19500732421875, + "z": 0 + }, + "queryAACube": { + "scale": 1.5361770391464233, + "x": 1101.1051025390625, + "y": 460.42691040039062, + "z": -0.76808851957321167 + }, + "restitution": 0.10000000149011612, + "rotation": { + "w": -0.29161518812179565, + "x": 0.0086823701858520508, + "y": 0.9564812183380127, + "z": -0.0002593994140625 + }, + "shapeType": "compound", + "type": "Model", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }, { + "color": { + "blue": 117, + "green": 117, + "red": 117 + }, + "created": "2016-03-23T17:14:01Z", + "dimensions": { + "x": 0.20582196116447449, + "y": 0.032061770558357239, + "z": 0.14119282364845276 + }, + "id": "{7f060027-2927-4513-bd92-13a98e6fc06c}", + "name": "Poster-Nail", + "position": { + "x": 1101.77685546875, + "y": 461.72821044921875, + "z": 0.0442657470703125 + }, + "queryAACube": { + "scale": 0.25164666771888733, + "x": 1101.6510009765625, + "y": 461.60238647460938, + "z": -0.081557586789131165 + }, + "rotation": { + "w": 0.96362245082855225, + "x": -1.52587890625e-05, + "y": 0.26723122596740723, + "z": -1.52587890625e-05 + }, + "type": "Box", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" + }], + "Version": 57 +} \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/wrapper.js b/unpublishedScripts/DomainContent/Home/kineticObjects/wrapper.js index 0ea61f76d4..40f015820c 100644 --- a/unpublishedScripts/DomainContent/Home/kineticObjects/wrapper.js +++ b/unpublishedScripts/DomainContent/Home/kineticObjects/wrapper.js @@ -8,9 +8,11 @@ var LEFT_DESK_DRAWER_URL = 'http://hifi-content.s3.amazonaws.com/DomainContent/H var CHAIR_URL = 'http://hifi-content.s3.amazonaws.com/DomainContent/Home/kineticObjects/chair.json' + "?" + Math.random(); var DESK_DRAWERS_URL = 'http://hifi-content.s3.amazonaws.com/DomainContent/Home/kineticObjects/deskDrawers.json' + "?" + Math.random(); var FRUIT_BOWL_URL = 'http://hifi-content.s3.amazonaws.com/DomainContent/Home/kineticObjects/fruit.json' + "?" + Math.random() -var LAB_LAMP_URL = 'http://hifi-content.s3.amazonaws.com/DomainContent/Home/kineticObjects/labLamp.json' + "?" + Math.random(); -var LIVING_ROOM_LAMP_URL = 'http://hifi-content.s3.amazonaws.com/DomainContent/Home/kineticObjects/livingRoomLamp.json' + "?" + Math.random(); +var LAB_LAMP_URL = 'http://hifi-content.s3.amazonaws.com/DomainContent/Home/kineticObjects/deskLamp.json' + "?" + Math.random(); +var LIVING_ROOM_LAMP_URL = 'http://hifi-content.s3.amazonaws.com/DomainContent/Home/kineticObjects/deskLamp.json' + "?" + Math.random(); var TRASHCAN_URL = 'http://hifi-content.s3.amazonaws.com/DomainContent/Home/kineticObjects/trashcan.json' + "?" + Math.random(); +var PLAYA_POSTER_URL = 'http://hifi-content.s3.amazonaws.com/DomainContent/Home/kineticObjects/postersPlaya.json' + "?" + Math.random(); +var CELL_POSTER_URL = 'http://hifi-content.s3.amazonaws.com/DomainContent/Home/kineticObjects/trashcan.json' + "?" + Math.random(); FruitBowl = function(spawnLocation, spawnRotation) { print('CREATE FRUIT BOWL') @@ -248,5 +250,51 @@ Books = function(spawnLocation, spawnRotation) { create(); + this.cleanup = cleanup; +} + +PosterCell = function(spawnLocation, spawnRotation) { + print('CREATE CELL POSTER') + var created = []; + + function create() { + var success = Clipboard.importEntities(CELL_POSTER_URL); + if (success === true) { + created = Clipboard.pasteEntities(spawnLocation) + print('created ' + created); + } + }; + + function cleanup() { + created.forEach(function(obj) { + Entities.deleteEntity(obj); + }) + }; + + create(); + + this.cleanup = cleanup; +} + +PosterPlaya = function(spawnLocation, spawnRotation) { + print('CREATE PLAYA POSTER') + var created = []; + + function create() { + var success = Clipboard.importEntities(PLAYA_POSTER_URL); + if (success === true) { + created = Clipboard.pasteEntities(spawnLocation) + print('created ' + created); + } + }; + + function cleanup() { + created.forEach(function(obj) { + Entities.deleteEntity(obj); + }) + }; + + create(); + this.cleanup = cleanup; } \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/reset.js b/unpublishedScripts/DomainContent/Home/reset.js index 4721555dad..e5e231308a 100644 --- a/unpublishedScripts/DomainContent/Home/reset.js +++ b/unpublishedScripts/DomainContent/Home/reset.js @@ -124,7 +124,7 @@ z: -79.1103 }, { x: 0, - y: 0, + y: 152, z: 0 }); diff --git a/unpublishedScripts/DomainContent/Home/tiltMaze/maze.js b/unpublishedScripts/DomainContent/Home/tiltMaze/maze.js index 4c64619177..77b6c98782 100644 --- a/unpublishedScripts/DomainContent/Home/tiltMaze/maze.js +++ b/unpublishedScripts/DomainContent/Home/tiltMaze/maze.js @@ -24,7 +24,6 @@ var BALL_RIGHT_OFFSET = -0.4 * SCALE; var BALL_VERTICAL_OFFSET = 0.02 * SCALE; - var BALL_FRICTION = 0.7; var BALL_RESTITUTION = 0.1; var BALL_DAMPING = 0.6;