From 8477b721a45e521ac6e101248177ef68389e9f3d Mon Sep 17 00:00:00 2001 From: "James B. Pollack" Date: Wed, 16 Mar 2016 15:48:17 -0700 Subject: [PATCH] add kinetic objects --- .../DomainContent/Home/fishTank/wrapper.js | 2 +- .../Home/kineticObjects/wrapper.js | 35 ++++++++ .../DomainContent/Home/reset.js | 79 +++++++++++++++++-- .../Home/switches/livingRoomDiscLights.js | 6 +- .../DomainContent/Home/tiltMaze/wrapper.js | 6 ++ 5 files changed, 119 insertions(+), 9 deletions(-) create mode 100644 unpublishedScripts/DomainContent/Home/kineticObjects/wrapper.js diff --git a/unpublishedScripts/DomainContent/Home/fishTank/wrapper.js b/unpublishedScripts/DomainContent/Home/fishTank/wrapper.js index f687d41fe6..31de973852 100644 --- a/unpublishedScripts/DomainContent/Home/fishTank/wrapper.js +++ b/unpublishedScripts/DomainContent/Home/fishTank/wrapper.js @@ -189,7 +189,7 @@ FishTank = function(spawnPosition, spawnRotation) { bubbleProperties.position.x += -0.076; thirdBubbleSystem = Entities.addEntity(bubbleProperties) - createBubbleSound(finalOffset); + // createBubbleSound(finalOffset); } function getOffsetFromTankCenter(VERTICAL_OFFSET, FORWARD_OFFSET, LATERAL_OFFSET) { diff --git a/unpublishedScripts/DomainContent/Home/kineticObjects/wrapper.js b/unpublishedScripts/DomainContent/Home/kineticObjects/wrapper.js new file mode 100644 index 0000000000..a6da7b3877 --- /dev/null +++ b/unpublishedScripts/DomainContent/Home/kineticObjects/wrapper.js @@ -0,0 +1,35 @@ +var fruitBowl, livingRoomLamp, labLamp, upperBookshelf, lowerBookshelf, chair, trash can, book; + + +FruitBowl = function(spawnLocation, spawnRotation) { + +} + +LabLamp = function(spawnLocation, spawnRotation) { + +} + +LivingRoomLamp = function(spawnLocation, spawnRotation) { + +} + +UpperBookshelf = function(spawnLocation, spawnRotation) { + +} + +LowerBookshelf = function(spawnLocation, spawnRotation) { + +} + +Chair = function(spawnLocation, spawnRotation){ + +} + +Trashcan = function(){ + + +} + +Books = function(){ + +} \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/reset.js b/unpublishedScripts/DomainContent/Home/reset.js index ac65cbc560..ead62c3370 100644 --- a/unpublishedScripts/DomainContent/Home/reset.js +++ b/unpublishedScripts/DomainContent/Home/reset.js @@ -15,6 +15,7 @@ var _this; var dynamicEntities = []; + var kineticEntities = []; function Reset() { _this = this; @@ -30,6 +31,8 @@ var plantPath = Script.resolvePath("growingPlant/wrapper.js?" + Math.random()); + var kineticPath = Script.resolvePath("kineticObjects/wrapper.js?" + Math.random()); + Reset.prototype = { preload: function(entityID) { _this.entityID = entityID; @@ -98,21 +101,38 @@ Script.include(whiteboardPath); Script.include(plantPath); - // var fishTank = new FishTank(center); - // var tiltMaze = new TiltMaze(center); - // var whiteboard = new Whiteboard(center); - var myPlant = new Plant(center); + // var fishTank = new FishTank({ + // x: 1098.9254, + // y: 460.5814, + // z: -79.1103 + // }); + // var tiltMaze = new TiltMaze({ + // x: 1105.5768, + // y: 460.3298, + // z: -80.4891 + // }); + // var whiteboard = new Whiteboard({ + // x: 1104, + // y: 450, + // z: -77 + // }); + // var myPlant = new Plant(center); // dynamicEntities.push(fishTank); // dynamicEntities.push(tiltMaze); // dynamicEntities.push(whiteboard); - dynamicEntities.push(myPlant); + //dynamicEntities.push(myPlant); //v2.0 // var musicBox = new MusicBox(); // var cuckooClock = new CuckooClock(); // var doppelganger = new Doppelganger(); + + //var pingPongGun = new PingPongGun({ + // x:1101.2123, y:460.2328, z:-65.8513 + // }); + //dynamicEntities.push(pingPongGun); }, cleanupDynamicEntities: function() { @@ -124,6 +144,55 @@ }) }, + createKineticEntities: function() { + var fruitBowl = new FruitBowl({ + x: 1105.3185, + y: 460.3221, + z: 81.1803 + }); + //var labLamp = new LabLamp(); + var livingRoomLamp = new LivingRoomLamp({ + x: 1104.6732, + y: 460.3326, + z: 81.9710 + }); + var upperBookShelf = new UpperBookshelf({ + x: 1106.2649, + y: 461.5352, + z: -80.3018 + }); + var lowerBookShelf = new LowerBookShelf({ + x: 1106.2725, + y: 460.9600, + z: 80.2837 + }); + var chair = new Chair({ + x: 1105.2716, + y: 459.7251, + z: 79.8097 + }); + var trashcan = new Trashcan({ + x: 1104.0031, + y: 459.4355, + z: -82.7294 + }); + var books = new Books({ + x: 1101.2123, + y: 460.2328, + z: -65.8513 + }); + + kineticEntities.push(fruitBowl); + kineticEntities.push(livingRoomLamp); + kineticEntities.push(upperBookShelf); + kineticEntities.push(chair); + kineticEntities.push(trashcan); + kineticEntities.push(books); + }, + cleanupKineticEntities: function() { + + } + } return new Reset(); }); \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/switches/livingRoomDiscLights.js b/unpublishedScripts/DomainContent/Home/switches/livingRoomDiscLights.js index eda568eeb6..c342e9d16a 100644 --- a/unpublishedScripts/DomainContent/Home/switches/livingRoomDiscLights.js +++ b/unpublishedScripts/DomainContent/Home/switches/livingRoomDiscLights.js @@ -68,7 +68,7 @@ var results = Entities.findEntities(this.position, SEARCH_RADIUS); results.forEach(function(result) { var properties = Entities.getEntityProperties(result); - if (properties.name === _this.prefix + "light-glow") { + if (properties.name === _this.prefix + "glow") { found.push(result); } }); @@ -80,7 +80,7 @@ var results = Entities.findEntities(this.position, SEARCH_RADIUS); results.forEach(function(result) { var properties = Entities.getEntityProperties(result); - if (properties.name === _this.prefix + "light-master") { + if (properties.name === _this.prefix + "master") { found.push(result); } }); @@ -92,7 +92,7 @@ var results = Entities.findEntities(this.position, SEARCH_RADIUS); results.forEach(function(result) { var properties = Entities.getEntityProperties(result); - if (properties.name === _this.prefix + "light-model") { + if (properties.name === _this.prefix + "model") { found.push(result); } }); diff --git a/unpublishedScripts/DomainContent/Home/tiltMaze/wrapper.js b/unpublishedScripts/DomainContent/Home/tiltMaze/wrapper.js index d3189cddcc..ceb43ca1ac 100644 --- a/unpublishedScripts/DomainContent/Home/tiltMaze/wrapper.js +++ b/unpublishedScripts/DomainContent/Home/tiltMaze/wrapper.js @@ -82,6 +82,11 @@ TiltMaze = function(spawnPosition, spawnRotation) { var MAZE_RESTITUTION = 0.1; var MAZE_DAMPING = 0.6; var MAZE_ANGULAR_DAMPING = 0.6; + var MAZE_GRAVITY = { + x:0, + y:-3, + z:0 + }; var DETECTOR_VERTICAL_OFFSET = 0.0 * SCALE; var DETECTOR_FORWARD_OFFSET = 0.35 * SCALE; @@ -200,6 +205,7 @@ TiltMaze = function(spawnPosition, spawnRotation) { name: 'Hifi Tilt Maze', type: 'Model', modelURL: MAZE_MODEL_URL, + gravity:MAZE_GRAVITY, compoundShapeURL: MAZE_COLLISION_HULL, dimensions: MAZE_DIMENSIONS, position: position,