mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-10 01:06:25 +02:00
add kinetic objects
This commit is contained in:
parent
b6955ec77f
commit
8477b721a4
5 changed files with 119 additions and 9 deletions
|
@ -189,7 +189,7 @@ FishTank = function(spawnPosition, spawnRotation) {
|
||||||
bubbleProperties.position.x += -0.076;
|
bubbleProperties.position.x += -0.076;
|
||||||
thirdBubbleSystem = Entities.addEntity(bubbleProperties)
|
thirdBubbleSystem = Entities.addEntity(bubbleProperties)
|
||||||
|
|
||||||
createBubbleSound(finalOffset);
|
// createBubbleSound(finalOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getOffsetFromTankCenter(VERTICAL_OFFSET, FORWARD_OFFSET, LATERAL_OFFSET) {
|
function getOffsetFromTankCenter(VERTICAL_OFFSET, FORWARD_OFFSET, LATERAL_OFFSET) {
|
||||||
|
|
|
@ -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(){
|
||||||
|
|
||||||
|
}
|
|
@ -15,6 +15,7 @@
|
||||||
var _this;
|
var _this;
|
||||||
|
|
||||||
var dynamicEntities = [];
|
var dynamicEntities = [];
|
||||||
|
var kineticEntities = [];
|
||||||
|
|
||||||
function Reset() {
|
function Reset() {
|
||||||
_this = this;
|
_this = this;
|
||||||
|
@ -30,6 +31,8 @@
|
||||||
|
|
||||||
var plantPath = Script.resolvePath("growingPlant/wrapper.js?" + Math.random());
|
var plantPath = Script.resolvePath("growingPlant/wrapper.js?" + Math.random());
|
||||||
|
|
||||||
|
var kineticPath = Script.resolvePath("kineticObjects/wrapper.js?" + Math.random());
|
||||||
|
|
||||||
Reset.prototype = {
|
Reset.prototype = {
|
||||||
preload: function(entityID) {
|
preload: function(entityID) {
|
||||||
_this.entityID = entityID;
|
_this.entityID = entityID;
|
||||||
|
@ -98,21 +101,38 @@
|
||||||
Script.include(whiteboardPath);
|
Script.include(whiteboardPath);
|
||||||
Script.include(plantPath);
|
Script.include(plantPath);
|
||||||
|
|
||||||
// var fishTank = new FishTank(center);
|
// var fishTank = new FishTank({
|
||||||
// var tiltMaze = new TiltMaze(center);
|
// x: 1098.9254,
|
||||||
// var whiteboard = new Whiteboard(center);
|
// y: 460.5814,
|
||||||
var myPlant = new Plant(center);
|
// 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(fishTank);
|
||||||
// dynamicEntities.push(tiltMaze);
|
// dynamicEntities.push(tiltMaze);
|
||||||
// dynamicEntities.push(whiteboard);
|
// dynamicEntities.push(whiteboard);
|
||||||
dynamicEntities.push(myPlant);
|
//dynamicEntities.push(myPlant);
|
||||||
|
|
||||||
//v2.0
|
//v2.0
|
||||||
// var musicBox = new MusicBox();
|
// var musicBox = new MusicBox();
|
||||||
// var cuckooClock = new CuckooClock();
|
// var cuckooClock = new CuckooClock();
|
||||||
// var doppelganger = new Doppelganger();
|
// var doppelganger = new Doppelganger();
|
||||||
|
|
||||||
|
//var pingPongGun = new PingPongGun({
|
||||||
|
// x:1101.2123, y:460.2328, z:-65.8513
|
||||||
|
// });
|
||||||
|
//dynamicEntities.push(pingPongGun);
|
||||||
},
|
},
|
||||||
|
|
||||||
cleanupDynamicEntities: function() {
|
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();
|
return new Reset();
|
||||||
});
|
});
|
|
@ -68,7 +68,7 @@
|
||||||
var results = Entities.findEntities(this.position, SEARCH_RADIUS);
|
var results = Entities.findEntities(this.position, SEARCH_RADIUS);
|
||||||
results.forEach(function(result) {
|
results.forEach(function(result) {
|
||||||
var properties = Entities.getEntityProperties(result);
|
var properties = Entities.getEntityProperties(result);
|
||||||
if (properties.name === _this.prefix + "light-glow") {
|
if (properties.name === _this.prefix + "glow") {
|
||||||
found.push(result);
|
found.push(result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -80,7 +80,7 @@
|
||||||
var results = Entities.findEntities(this.position, SEARCH_RADIUS);
|
var results = Entities.findEntities(this.position, SEARCH_RADIUS);
|
||||||
results.forEach(function(result) {
|
results.forEach(function(result) {
|
||||||
var properties = Entities.getEntityProperties(result);
|
var properties = Entities.getEntityProperties(result);
|
||||||
if (properties.name === _this.prefix + "light-master") {
|
if (properties.name === _this.prefix + "master") {
|
||||||
found.push(result);
|
found.push(result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -92,7 +92,7 @@
|
||||||
var results = Entities.findEntities(this.position, SEARCH_RADIUS);
|
var results = Entities.findEntities(this.position, SEARCH_RADIUS);
|
||||||
results.forEach(function(result) {
|
results.forEach(function(result) {
|
||||||
var properties = Entities.getEntityProperties(result);
|
var properties = Entities.getEntityProperties(result);
|
||||||
if (properties.name === _this.prefix + "light-model") {
|
if (properties.name === _this.prefix + "model") {
|
||||||
found.push(result);
|
found.push(result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -82,6 +82,11 @@ TiltMaze = function(spawnPosition, spawnRotation) {
|
||||||
var MAZE_RESTITUTION = 0.1;
|
var MAZE_RESTITUTION = 0.1;
|
||||||
var MAZE_DAMPING = 0.6;
|
var MAZE_DAMPING = 0.6;
|
||||||
var MAZE_ANGULAR_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_VERTICAL_OFFSET = 0.0 * SCALE;
|
||||||
var DETECTOR_FORWARD_OFFSET = 0.35 * SCALE;
|
var DETECTOR_FORWARD_OFFSET = 0.35 * SCALE;
|
||||||
|
@ -200,6 +205,7 @@ TiltMaze = function(spawnPosition, spawnRotation) {
|
||||||
name: 'Hifi Tilt Maze',
|
name: 'Hifi Tilt Maze',
|
||||||
type: 'Model',
|
type: 'Model',
|
||||||
modelURL: MAZE_MODEL_URL,
|
modelURL: MAZE_MODEL_URL,
|
||||||
|
gravity:MAZE_GRAVITY,
|
||||||
compoundShapeURL: MAZE_COLLISION_HULL,
|
compoundShapeURL: MAZE_COLLISION_HULL,
|
||||||
dimensions: MAZE_DIMENSIONS,
|
dimensions: MAZE_DIMENSIONS,
|
||||||
position: position,
|
position: position,
|
||||||
|
|
Loading…
Reference in a new issue