add kinetic objects

This commit is contained in:
James B. Pollack 2016-03-16 15:48:17 -07:00
parent b6955ec77f
commit 8477b721a4
5 changed files with 119 additions and 9 deletions

View file

@ -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) {

View file

@ -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(){
}

View file

@ -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();
});

View file

@ -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);
}
});

View file

@ -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,