From 60ad2688384170fb65a7f7079a87d2796e24fb47 Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Tue, 29 Mar 2016 10:48:34 -0700 Subject: [PATCH] various changes --- .../DomainContent/Home/musicBox/lid.js | 10 ++- .../DomainContent/Home/musicBox/wrapper.js | 14 ++++- .../DomainContent/Home/reset.js | 62 ++++++++++++++++++- .../DomainContent/Home/tiltMaze/maze.js | 1 + 4 files changed, 80 insertions(+), 7 deletions(-) diff --git a/unpublishedScripts/DomainContent/Home/musicBox/lid.js b/unpublishedScripts/DomainContent/Home/musicBox/lid.js index 78c4fd819c..6edf708340 100644 --- a/unpublishedScripts/DomainContent/Home/musicBox/lid.js +++ b/unpublishedScripts/DomainContent/Home/musicBox/lid.js @@ -28,10 +28,12 @@ isPlaying: false } }, + continueNearTrigger: function() { var properties = Entities.getEntityProperties(this.entityID); }, + playMusic: function() { if (this.musicIsPlaying !== true) { @@ -119,9 +121,15 @@ }, + playBaseOpeningAnimation: function() {}, + playHoldBaseOpenAnimation: function() {}, + playBaseClosingAnimation: function() {}, + stopBaseAnimation: function() {}, + playKeyTurnAnimation: function() {}, + stopKeyTurnAnimation: function() {}, + unload: function() { this.musicInjector.stop(); - }, } diff --git a/unpublishedScripts/DomainContent/Home/musicBox/wrapper.js b/unpublishedScripts/DomainContent/Home/musicBox/wrapper.js index f8204cc7db..904eeef293 100644 --- a/unpublishedScripts/DomainContent/Home/musicBox/wrapper.js +++ b/unpublishedScripts/DomainContent/Home/musicBox/wrapper.js @@ -1,6 +1,6 @@ var HomeMusicBox = function() { - var SHOULD_CLEANUP = true; + var SHOULD_CLEANUP = false; var WHITE = { red: 255, @@ -69,7 +69,12 @@ var HomeMusicBox = function() { type: 'Box', color: WHITE, position: BASE_POSITION, - dimensions: BASE_DIMENSIONS + dimensions: BASE_DIMENSIONS, + userData: JSON.stringify({ + 'hifiHomeKey': { + 'reset': true + } + }), } base = Entities.addEntity(baseProperties); @@ -91,6 +96,9 @@ var HomeMusicBox = function() { script: LID_SCRIPT_URL, collidesWith: 'myAvatar,otherAvatar', userData: JSON.stringify({ + 'hifiHomeKey': { + 'reset': true + }, grabConstraintsKey: { callback: 'rotateLid', positionLocked: true, @@ -144,6 +152,6 @@ var HomeMusicBox = function() { createBase(); createLid(); - + return this; } \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/reset.js b/unpublishedScripts/DomainContent/Home/reset.js index e67776e644..8d3ba02e37 100644 --- a/unpublishedScripts/DomainContent/Home/reset.js +++ b/unpublishedScripts/DomainContent/Home/reset.js @@ -103,6 +103,7 @@ Script.setTimeout(function() { _this.createKineticEntities(); _this.createDynamicEntities(); + _this.createTransformingDais(); _this.createTransformers(); }, 750) @@ -267,8 +268,64 @@ }, + setupDressingRoom: function() { + this.createRotatorBlock(); + this.createTransformingDais(); + this.createTransformers(); + }, + + createRotatorBlock: function() { + var rotatorBlockProps = { + name: 'hifi-home-dressing-room-rotator-block', + type: 'Box', + visible: false, + collisionless: true, + angularDamping: 0, + angularVelocity: { + x: 0, + y: 6, + z: 0 + }, + dynamic: false, + userData: JSON.stringify({ + 'hifiHomeKey': { + 'reset': true + } + }), + } + + var rotatorBlock = Entities.addEntity() + }, + + createTransformingDais: function() { + var DAIS_MODEL_URL = ''; + var COLLISION_HULL_URL = ''; + + var DAIS_DIMENSIONS = { + x: 1, + y: 1, + z: 1 + }; + + var daisProperties = { + name: 'hifi-home-dressing-room-transformer-collider', + type: 'Model', + modelURL: DAIS_MODEL_URL, + dimensions: DAIS_DIMENSIONS, + compoundShapeURL: COLLISION_HULL_URL, + position: DAIS_POSITION, + dynamic: false, + userData: JSON.stringify({ + 'hifiHomeKey': { + 'reset': true + } + }), + }; + + var dais = Entities.addEntity(daisProperties); + }, + createTransformers: function() { - print('CREATING TRANSFORMERS!') var firstDollPosition = { x: 1107.61, y: 460.8, @@ -326,10 +383,9 @@ }) var dollLateralSeparation = 1.0; - dolls.forEach(function(doll, index) { + dolls.forEach(function(doll, index) { var separation = index * dollLateralSeparation; - print('separation: ' + separation) var left = Quat.getRight(rotationAsQuat); var distanceToLeft = Vec3.multiply(separation, left); var dollPosition = Vec3.sum(firstDollPosition, distanceToLeft) diff --git a/unpublishedScripts/DomainContent/Home/tiltMaze/maze.js b/unpublishedScripts/DomainContent/Home/tiltMaze/maze.js index a2f45b6d83..484929e702 100644 --- a/unpublishedScripts/DomainContent/Home/tiltMaze/maze.js +++ b/unpublishedScripts/DomainContent/Home/tiltMaze/maze.js @@ -230,6 +230,7 @@ }, update: function(deltaTime) { + //anyone can clean up loose balls if (THROTTLE === true) { sinceLastUpdate = sinceLastUpdate + deltaTime * 100; if (sinceLastUpdate > THROTTLE_RATE) {