From 619a724eb85f58b83fd17ad1d851a609a2cd0834 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Fri, 1 Apr 2016 11:49:30 -0700 Subject: [PATCH 1/3] junk and shelf stuff --- .../Home/kineticObjects/blueChair.json | 2 +- .../Home/kineticObjects/junk.json | 186 ++++++++++++++++++ .../Home/kineticObjects/wrapper.js | 27 ++- .../DomainContent/Home/reset.js | 19 +- 4 files changed, 227 insertions(+), 7 deletions(-) create mode 100644 unpublishedScripts/DomainContent/Home/kineticObjects/junk.json diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/blueChair.json b/unpublishedScripts/DomainContent/Home/kineticObjects/blueChair.json index 09023f2722..54148f7f83 100644 --- a/unpublishedScripts/DomainContent/Home/kineticObjects/blueChair.json +++ b/unpublishedScripts/DomainContent/Home/kineticObjects/blueChair.json @@ -32,7 +32,7 @@ }, "shapeType": "compound", "type": "Model", - "userData": "{\"hifiHomeKey\":{\"reset\":true}}", + "userData": "{\"hifiHomeKey\":{\"reset\":true}}" } ], "Version": 57 diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/junk.json b/unpublishedScripts/DomainContent/Home/kineticObjects/junk.json new file mode 100644 index 0000000000..25af5ea8f3 --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/kineticObjects/junk.json @@ -0,0 +1,186 @@ +{ + "Entities": [{ + "collisionsWillMove": 1, + "created": "2016-04-01T18:13:50Z", + "dimensions": { + "x": 0.31800505518913269, + "y": 0.31800499558448792, + "z": 0.0033226886298507452 + }, + "dynamic": 1, + "gravity": { + "x": 0, + "y": -10, + "z": 0 + }, + "userData": "{\"hifiHomeKey\":{\"reset\":true}}", + "id": "{e9edc4d0-ecef-42de-88de-a652087f8a18}", + "modelURL": "atp:/tutorialContent/Junk-Album-3.fbx", + "name": "Junk-Album-3.fbx", + "queryAACube": { + "scale": 0.44973927736282349, + "x": -0.22486963868141174, + "y": -0.22486963868141174, + "z": -0.22486963868141174 + }, + "restitution": 0.10000000149011612, + "rotation": { + "w": 0.66469824314117432, + "x": -0.66491186618804932, + "y": 0.24086368083953857, + "z": 0.24098575115203857 + }, + "shapeType": "box", + "type": "Model" + }, { + "collisionsWillMove": 1, + "created": "2016-04-01T18:13:50Z", + "dimensions": { + "x": 0.2365347146987915, + "y": 0.32964301109313965, + "z": 0.34057953953742981 + }, + "dynamic": 1, + "gravity": { + "x": 0, + "y": -10, + "z": 0 + }, + "userData": "{\"hifiHomeKey\":{\"reset\":true}}", + "id": "{cc75df45-0caf-41ff-8c05-29c771cc63d9}", + "modelURL": "atp:/tutorialContent/Hideous-Knick-Knack1.fbx", + "name": "Junk-Doll", + "position": { + "x": 0.3363037109375, + "y": 0.1844482421875, + "z": 0.3884124755859375 + }, + "queryAACube": { + "scale": 0.52972406148910522, + "x": 0.071441680192947388, + "y": -0.080413788557052612, + "z": 0.12355044484138489 + }, + "rotation": { + "w": 0.24678421020507812, + "x": -7.62939453125e-05, + "y": 0.9690546989440918, + "z": -7.62939453125e-05 + }, + "shapeType": "box", + "type": "Model" + }, { + "collisionsWillMove": 1, + "created": "2016-04-01T18:11:39Z", + "dimensions": { + "x": 0.31800505518913269, + "y": 0.31800499558448792, + "z": 0.0033226886298507452 + }, + "dynamic": 1, + "friction": 0.75, + "gravity": { + "x": 0, + "y": -10, + "z": 0 + }, + "userData": "{\"hifiHomeKey\":{\"reset\":true}}", + "id": "{903543d7-4531-4532-997a-8176be9fc660}", + "modelURL": "atp:/tutorialContent/Junk-Album-1.fbx", + "name": "Junk-Album-1.fbx", + "position": { + "x": 0.10009765625, + "y": 0.087310791015625, + "z": 0.27129364013671875 + }, + "queryAACube": { + "scale": 0.44973927736282349, + "x": -0.12477198243141174, + "y": -0.13755884766578674, + "z": 0.046424001455307007 + }, + "rotation": { + "w": 0.31657898426055908, + "x": -0.024460196495056152, + "y": 0.63219654560089111, + "z": 0.70672154426574707 + }, + "shapeType": "box", + "type": "Model" + }, { + "collisionsWillMove": 1, + "created": "2016-04-01T18:13:50Z", + "dimensions": { + "x": 0.29665771126747131, + "y": 0.50835514068603516, + "z": 0.26848328113555908 + }, + "dynamic": 1, + "gravity": { + "x": 0, + "y": -10, + "z": 0 + }, + "userData": "{\"hifiHomeKey\":{\"reset\":true}}", + "id": "{d99aeed0-9d38-4b82-8ae0-630cdfcd32cb}", + "marketplaceID": "268b7d13-d3f6-4e03-a252-3e5bde1d145e", + "modelURL": "https://s3.amazonaws.com/hifi-public/marketplace/hificontent/ozan/Lamp.fbx", + "name": "Junk - lamp", + "position": { + "x": 0.61279296875, + "y": 0.2528076171875, + "z": 0.91259002685546875 + }, + "queryAACube": { + "scale": 0.64692658185958862, + "x": 0.28932967782020569, + "y": -0.070655673742294312, + "z": 0.58912670612335205 + }, + "rotation": { + "w": 0.999969482421875, + "x": -7.62939453125e-05, + "y": -0.0066376924514770508, + "z": 4.57763671875e-05 + }, + "shapeType": "box", + "type": "Model" + }, { + "compoundShapeURL": "atp:/static_objects/Junk-Crate.obj", + "created": "2016-04-01T18:13:50Z", + "dimensions": { + "x": 0.39995807409286499, + "y": 0.11108967661857605, + "z": 0.71549224853515625 + }, + "gravity": { + "x": 0, + "y": -10, + "z": 0 + }, + "userData": "{\"hifiHomeKey\":{\"reset\":true}}", + "id": "{51a01cc1-15cf-4265-9d33-261c96e0e1ed}", + "modelURL": "atp:/models/Junk-Crate.fbx", + "name": "home_model_junk_holder", + "position": { + "x": 0.369384765625, + "y": 0.0540771484375, + "z": 0.39377593994140625 + }, + "queryAACube": { + "scale": 0.82718592882156372, + "x": -0.04420819878578186, + "y": -0.35951581597328186, + "z": -0.01981702446937561 + }, + "rotation": { + "w": 0.85989165306091309, + "x": -0.0001373291015625, + "y": 0.5104600191116333, + "z": 4.57763671875e-05 + }, + "shapeType": "compound", + "type": "Model" + }], + "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 a4b91a5403..ef7ebdb044 100644 --- a/unpublishedScripts/DomainContent/Home/kineticObjects/wrapper.js +++ b/unpublishedScripts/DomainContent/Home/kineticObjects/wrapper.js @@ -14,7 +14,8 @@ var TRASHCAN_URL = "atp:/kineticObjects/trashcan.json" var BLOCKS_URL = "atp:/kineticObjects/blocks.json"; var PLAYA_POSTER_URL = "atp:/kineticObjects/postersPlaya.json" var CELL_POSTER_URL = "atp:/kineticObjects/postersCell.json" -var STUFF_ON_SHELVES_URL ="atp:/kineticObjects/stuff_on_shelves.json" +var STUFF_ON_SHELVES_URL = "atp:/kineticObjects/stuff_on_shelves.json" +var JUNK_URL = "atp:/kineticObjects/junk.json" FruitBowl = function(spawnLocation, spawnRotation) { print('CREATE FRUIT BOWL') @@ -139,6 +140,7 @@ BlueChair = function(spawnLocation, spawnRotation) { function create() { var success = Clipboard.importEntities(BLUE_CHAIR_URL); + if (success === true) { created = Clipboard.pasteEntities(spawnLocation) print('created ' + created); @@ -293,5 +295,28 @@ StuffOnShelves = function(spawnLocation, spawnRotation) { create(); + this.cleanup = cleanup; +} + +HomeJunk = function(spawnLocation, spawnRotation) { + print('HOME CREATE JUNK') + var created = []; + + function create() { + var success = Clipboard.importEntities(JUNK_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 783f07e66e..6f9a396ae5 100644 --- a/unpublishedScripts/DomainContent/Home/reset.js +++ b/unpublishedScripts/DomainContent/Home/reset.js @@ -241,15 +241,24 @@ z: -79.8097 }); - print('HOME CREATE BLUE CHAIR') - - var blueChair = new BlueChair({ + var blueChair = new BlueChair({ x: 1100.4821, y: 459.8161, - z:-75.9071 + z: -75.9071 }); - // var stuffOnShelf = new stuffOnShelf({}); + + var stuffOnShelves = new StuffOnShelves({ + x: 1105.9432, + y: 461.1020, + z: -80.7894 + }); + + var junk = new HomeJunk({ + x: 1102.8754, + y: 460.2932, + z: -69.0222 + }); var trashcan = new Trashcan({ x: 1103.9034, From e7f5ddf67a37cfa9c3156f03233152cd80cb65f5 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Fri, 1 Apr 2016 14:48:12 -0700 Subject: [PATCH 2/3] werk --- .../Home/dressingRoom/transformer.js | 2 +- .../Home/dressingRoom/wrapper.js | 2 +- .../Home/growingPlant/wrapper.js | 2 +- .../Home/kineticObjects/books.json | 2 +- .../DomainContent/Home/misc/avatarCatcher.js | 30 +++++++++++++++++++ .../Home/pingPongGun/pingPongGun.js | 2 +- .../DomainContent/Home/pingPongGun/wrapper.js | 2 +- .../DomainContent/Home/reset.js | 12 ++++---- .../DomainContent/Home/tiltMaze/wrapper.js | 2 +- .../DomainContent/Home/whiteboard/wrapper.js | 4 +-- 10 files changed, 45 insertions(+), 15 deletions(-) create mode 100644 unpublishedScripts/DomainContent/Home/misc/avatarCatcher.js diff --git a/unpublishedScripts/DomainContent/Home/dressingRoom/transformer.js b/unpublishedScripts/DomainContent/Home/dressingRoom/transformer.js index 4945c80fa6..0218f174a0 100644 --- a/unpublishedScripts/DomainContent/Home/dressingRoom/transformer.js +++ b/unpublishedScripts/DomainContent/Home/dressingRoom/transformer.js @@ -188,7 +188,7 @@ // delete littleVersionProps.script; littleVersionProps.gravity = { x: 0, - y: -5, + y: -10, z: 0 }; var userData = JSON.parse(littleVersionProps.userData); diff --git a/unpublishedScripts/DomainContent/Home/dressingRoom/wrapper.js b/unpublishedScripts/DomainContent/Home/dressingRoom/wrapper.js index 55435b0b3a..b3280ca8ef 100644 --- a/unpublishedScripts/DomainContent/Home/dressingRoom/wrapper.js +++ b/unpublishedScripts/DomainContent/Home/dressingRoom/wrapper.js @@ -15,7 +15,7 @@ dynamic: true, gravity: { x: 0, - y: -5, + y: -10, z: 0 }, visible: true, diff --git a/unpublishedScripts/DomainContent/Home/growingPlant/wrapper.js b/unpublishedScripts/DomainContent/Home/growingPlant/wrapper.js index 2799e8bf6f..cf51678c68 100644 --- a/unpublishedScripts/DomainContent/Home/growingPlant/wrapper.js +++ b/unpublishedScripts/DomainContent/Home/growingPlant/wrapper.js @@ -99,7 +99,7 @@ Plant = function(spawnPosition, spawnRotation) { dynamic: true, gravity: { x: 0.0, - y: -2.0, + y: -10.0, z: 0 }, velocity: { diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/books.json b/unpublishedScripts/DomainContent/Home/kineticObjects/books.json index ced3901eb1..d746b6293b 100644 --- a/unpublishedScripts/DomainContent/Home/kineticObjects/books.json +++ b/unpublishedScripts/DomainContent/Home/kineticObjects/books.json @@ -2,7 +2,7 @@ "Entities": [{ "gravity": { "x": 0, - "y": -7, + "y": -10, "z": 0 }, "userData": "{\"hifiHomeKey\":{\"reset\":true}}", diff --git a/unpublishedScripts/DomainContent/Home/misc/avatarCatcher.js b/unpublishedScripts/DomainContent/Home/misc/avatarCatcher.js new file mode 100644 index 0000000000..a15b667a8a --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/misc/avatarCatcher.js @@ -0,0 +1,30 @@ +(function() { + var _this; + + var LIVING_ROOM_POSITION = { + "x": 1101.7781982421875, + "y": 460.5820007324219, + "z": -77.89060974121094 + } + + var ROTATION = { + "x": -0.04497870057821274, + "y": -0.4520675241947174, + "z": -0.02283225581049919, + "w": 0.890556275844574 + } + + var AvatarCatcher = function() { + _this = this; + } + + AvatarCatcher.prototype = { + enterEntity: function() { + this.teleportToLivingRoom(); + }, + teleportToLivingRoom: function() { + MyAvatar.goToLocation(LIVING_ROOM_POSITION, true, ROTATION); + } + } + return new AvatarCatcher(); +}); \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/pingPongGun/pingPongGun.js b/unpublishedScripts/DomainContent/Home/pingPongGun/pingPongGun.js index e160b67a45..3ade768bfd 100644 --- a/unpublishedScripts/DomainContent/Home/pingPongGun/pingPongGun.js +++ b/unpublishedScripts/DomainContent/Home/pingPongGun/pingPongGun.js @@ -35,7 +35,7 @@ var PING_PONG_GUN_GRAVITY = { x: 0, - y: -5, + y: -10, z: 0 }; diff --git a/unpublishedScripts/DomainContent/Home/pingPongGun/wrapper.js b/unpublishedScripts/DomainContent/Home/pingPongGun/wrapper.js index 42f48615a0..93544e5113 100644 --- a/unpublishedScripts/DomainContent/Home/pingPongGun/wrapper.js +++ b/unpublishedScripts/DomainContent/Home/pingPongGun/wrapper.js @@ -29,7 +29,7 @@ HomePingPongGun = function(spawnPosition, spawnRotation) { }, gravity: { x: 0, - y: -3, + y: -10, z: 0 }, rotation: Quat.fromPitchYawRollDegrees(spawnRotation.x, spawnRotation.y, spawnRotation.z), diff --git a/unpublishedScripts/DomainContent/Home/reset.js b/unpublishedScripts/DomainContent/Home/reset.js index 6f9a396ae5..552b8da3a1 100644 --- a/unpublishedScripts/DomainContent/Home/reset.js +++ b/unpublishedScripts/DomainContent/Home/reset.js @@ -250,14 +250,14 @@ var stuffOnShelves = new StuffOnShelves({ x: 1105.9432, - y: 461.1020, + y: 461.095, z: -80.7894 }); var junk = new HomeJunk({ - x: 1102.8754, - y: 460.2932, - z: -69.0222 + x: 1102.5861, + y: 460.1812, + z: -69.5005 }); var trashcan = new Trashcan({ @@ -323,7 +323,7 @@ }), position: { x: 1106.9778, - y: 460.6075, + y: 460.3075, z: -74.5842 }, userData: JSON.stringify({ @@ -343,7 +343,7 @@ var DAIS_DIMENSIONS = { x: 1.0654, - y: 0.4679, + y: 0.1695, z: 1.0654 }; diff --git a/unpublishedScripts/DomainContent/Home/tiltMaze/wrapper.js b/unpublishedScripts/DomainContent/Home/tiltMaze/wrapper.js index 95a673a256..6f6d497bc7 100644 --- a/unpublishedScripts/DomainContent/Home/tiltMaze/wrapper.js +++ b/unpublishedScripts/DomainContent/Home/tiltMaze/wrapper.js @@ -83,7 +83,7 @@ TiltMaze = function(spawnPosition, spawnRotation) { var MAZE_ANGULAR_DAMPING = 0.6; var MAZE_GRAVITY = { x: 0, - y: -3, + y: -10, z: 0 }; diff --git a/unpublishedScripts/DomainContent/Home/whiteboard/wrapper.js b/unpublishedScripts/DomainContent/Home/whiteboard/wrapper.js index ede17c0760..c6f259e718 100644 --- a/unpublishedScripts/DomainContent/Home/whiteboard/wrapper.js +++ b/unpublishedScripts/DomainContent/Home/whiteboard/wrapper.js @@ -112,7 +112,7 @@ Whiteboard = function(spawnPosition, spawnRotation) { dynamic: true, gravity: { x: 0, - y: -1, + y: -10, z: 0 }, velocity: { @@ -195,7 +195,7 @@ Whiteboard = function(spawnPosition, spawnRotation) { dynamic: true, gravity: { x: 0, - y: -1, + y: -10, z: 0 }, velocity: { From 44fe56698e1652db010bb83ef50278b0ba503373 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Fri, 1 Apr 2016 14:53:54 -0700 Subject: [PATCH 3/3] catcher --- .../DomainContent/Home/misc/avatarCatcher.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/unpublishedScripts/DomainContent/Home/misc/avatarCatcher.js b/unpublishedScripts/DomainContent/Home/misc/avatarCatcher.js index a15b667a8a..eb5445cfdf 100644 --- a/unpublishedScripts/DomainContent/Home/misc/avatarCatcher.js +++ b/unpublishedScripts/DomainContent/Home/misc/avatarCatcher.js @@ -2,16 +2,16 @@ var _this; var LIVING_ROOM_POSITION = { - "x": 1101.7781982421875, - "y": 460.5820007324219, - "z": -77.89060974121094 + "x": 1102.35, + "y": 460.122, + "z": -78.924 } var ROTATION = { - "x": -0.04497870057821274, - "y": -0.4520675241947174, - "z": -0.02283225581049919, - "w": 0.890556275844574 + "x": 0, + "y": -0.447182, + "z": 0, + "w": 0.894443 } var AvatarCatcher = function() {