mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-15 21:08:46 +02:00
got rid of wasteful network calls
This commit is contained in:
parent
948b37d681
commit
2b34c5a917
2 changed files with 2520 additions and 2465 deletions
|
@ -52,6 +52,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MasterReset = function() {
|
MasterReset = function() {
|
||||||
var resetKey = "resetMe";
|
var resetKey = "resetMe";
|
||||||
var GRABBABLE_DATA_KEY = "grabbableKey";
|
var GRABBABLE_DATA_KEY = "grabbableKey";
|
||||||
|
@ -220,12 +221,12 @@
|
||||||
y: 0.01,
|
y: 0.01,
|
||||||
z: 0.1
|
z: 0.1
|
||||||
},
|
},
|
||||||
lifespan: 1
|
lifespan: 1,
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
|
||||||
setEntityCustomData(resetKey, fire, {
|
|
||||||
resetMe: true
|
resetMe: true
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -266,15 +267,16 @@
|
||||||
},
|
},
|
||||||
collisionsWillMove: true,
|
collisionsWillMove: true,
|
||||||
ignoreForCollisions: false,
|
ignoreForCollisions: false,
|
||||||
compoundShapeURL: rackCollisionHullURL
|
compoundShapeURL: rackCollisionHullURL,
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
setEntityCustomData(resetKey, rack, {
|
|
||||||
resetMe: true
|
resetMe: true
|
||||||
});
|
},
|
||||||
|
grabbableKey: {
|
||||||
|
grabbable: true
|
||||||
|
}
|
||||||
|
|
||||||
setEntityCustomData(GRABBABLE_DATA_KEY, rack, {
|
})
|
||||||
grabbable: false
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var collidingBalls = [];
|
var collidingBalls = [];
|
||||||
|
@ -315,14 +317,15 @@
|
||||||
collisionsWillMove: true,
|
collisionsWillMove: true,
|
||||||
ignoreForCollisions: false,
|
ignoreForCollisions: false,
|
||||||
modelURL: basketballURL,
|
modelURL: basketballURL,
|
||||||
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
resetMe: true
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
collidingBalls.push(collidingBall);
|
collidingBalls.push(collidingBall);
|
||||||
originalBallPositions.push(position);
|
originalBallPositions.push(position);
|
||||||
|
|
||||||
setEntityCustomData(resetKey, collidingBall, {
|
|
||||||
resetMe: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -413,11 +416,11 @@
|
||||||
visible: false,
|
visible: false,
|
||||||
collisionsWillMove: false,
|
collisionsWillMove: false,
|
||||||
ignoreForCollisions: true,
|
ignoreForCollisions: true,
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
|
||||||
setEntityCustomData(resetKey, targetIntervalClearer, {
|
|
||||||
resetMe: true
|
resetMe: true
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
var targets = [];
|
var targets = [];
|
||||||
|
@ -451,13 +454,15 @@
|
||||||
compoundShapeURL: COLLISION_HULL_URL,
|
compoundShapeURL: COLLISION_HULL_URL,
|
||||||
position: position,
|
position: position,
|
||||||
rotation: rotation,
|
rotation: rotation,
|
||||||
script: targetsScriptURL
|
script: targetsScriptURL,
|
||||||
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
resetMe: true
|
||||||
|
}
|
||||||
|
})
|
||||||
};
|
};
|
||||||
var target = Entities.addEntity(targetProperties);
|
var target = Entities.addEntity(targetProperties);
|
||||||
targets.push(target);
|
targets.push(target);
|
||||||
setEntityCustomData(resetKey, target, {
|
|
||||||
resetMe: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -483,13 +488,15 @@
|
||||||
compoundShapeURL: COLLISION_HULL_URL,
|
compoundShapeURL: COLLISION_HULL_URL,
|
||||||
position: originalPositions[index],
|
position: originalPositions[index],
|
||||||
rotation: rotation,
|
rotation: rotation,
|
||||||
script: targetsScriptURL
|
script: targetsScriptURL,
|
||||||
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
resetMe: true
|
||||||
|
}
|
||||||
|
})
|
||||||
};
|
};
|
||||||
var target = Entities.addEntity(targetProperties);
|
var target = Entities.addEntity(targetProperties);
|
||||||
targets[index] = target;
|
targets[index] = target;
|
||||||
setEntityCustomData(resetKey, target, {
|
|
||||||
resetMe: true
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -544,11 +551,13 @@
|
||||||
y: 0.50762706995010376,
|
y: 0.50762706995010376,
|
||||||
z: 0.90716040134429932
|
z: 0.90716040134429932
|
||||||
},
|
},
|
||||||
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
resetMe: true
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
setEntityCustomData(resetKey, cat, {
|
|
||||||
resetMe: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createFlashlight(position) {
|
function createFlashlight(position) {
|
||||||
|
@ -577,11 +586,13 @@
|
||||||
z: 0
|
z: 0
|
||||||
},
|
},
|
||||||
shapeType: 'box',
|
shapeType: 'box',
|
||||||
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
resetMe: true
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
setEntityCustomData(resetKey, flashlight, {
|
|
||||||
resetMe: true
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -618,12 +629,14 @@
|
||||||
x: 0.10546875,
|
x: 0.10546875,
|
||||||
y: 0.032372996211051941,
|
y: 0.032372996211051941,
|
||||||
z: 0.16242524981498718
|
z: 0.16242524981498718
|
||||||
}
|
},
|
||||||
});
|
userData: JSON.stringify({
|
||||||
setEntityCustomData(resetKey, lightSwitchHall, {
|
resetMe: {
|
||||||
resetMe: true,
|
resetMe: true,
|
||||||
on: true,
|
on: true,
|
||||||
type: "Hall Light"
|
type: "Hall Light"
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
var sconceLight1 = Entities.addEntity({
|
var sconceLight1 = Entities.addEntity({
|
||||||
|
@ -644,12 +657,13 @@
|
||||||
red: 217,
|
red: 217,
|
||||||
green: 146,
|
green: 146,
|
||||||
blue: 24
|
blue: 24
|
||||||
}
|
},
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
setEntityCustomData(resetKey, sconceLight1, {
|
|
||||||
resetMe: true,
|
resetMe: true,
|
||||||
type: "Hall Light",
|
type: "Hall Light"
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
var sconceLight2 = Entities.addEntity({
|
var sconceLight2 = Entities.addEntity({
|
||||||
|
@ -670,15 +684,15 @@
|
||||||
red: 217,
|
red: 217,
|
||||||
green: 146,
|
green: 146,
|
||||||
blue: 24
|
blue: 24
|
||||||
}
|
},
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
setEntityCustomData(resetKey, sconceLight2, {
|
|
||||||
resetMe: true,
|
resetMe: true,
|
||||||
type: "Hall Light",
|
type: "Hall Light"
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
rotation = {
|
rotation = {
|
||||||
w: 0.20082402229309082,
|
w: 0.20082402229309082,
|
||||||
x: 0.20082402229309082,
|
x: 0.20082402229309082,
|
||||||
|
@ -708,16 +722,19 @@
|
||||||
x: 0.10546875,
|
x: 0.10546875,
|
||||||
y: 0.032372996211051941,
|
y: 0.032372996211051941,
|
||||||
z: 0.16242524981498718
|
z: 0.16242524981498718
|
||||||
}
|
},
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
setEntityCustomData(resetKey, lightSwitchGarage, {
|
|
||||||
resetMe: true,
|
resetMe: true,
|
||||||
on: true,
|
on: true,
|
||||||
type: "Garage Light"
|
type: "Garage Light"
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var sconceLight3 = Entities.addEntity({
|
var sconceLight3 = Entities.addEntity({
|
||||||
type: "Light",
|
type: "Light",
|
||||||
position: {
|
position: {
|
||||||
|
@ -737,16 +754,16 @@
|
||||||
red: 217,
|
red: 217,
|
||||||
green: 146,
|
green: 146,
|
||||||
blue: 24
|
blue: 24
|
||||||
}
|
},
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
|
||||||
|
|
||||||
setEntityCustomData(resetKey, sconceLight3, {
|
|
||||||
resetMe: true,
|
resetMe: true,
|
||||||
type: "Garage Light",
|
type: "Garage Light"
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
var sconceLight4 = Entities.addEntity({
|
var sconceLight4 = Entities.addEntity({
|
||||||
type: "Light",
|
type: "Light",
|
||||||
position: {
|
position: {
|
||||||
|
@ -765,12 +782,13 @@
|
||||||
red: 217,
|
red: 217,
|
||||||
green: 146,
|
green: 146,
|
||||||
blue: 24
|
blue: 24
|
||||||
}
|
},
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
setEntityCustomData(resetKey, sconceLight4, {
|
|
||||||
resetMe: true,
|
resetMe: true,
|
||||||
type: "Garage Light",
|
type: "Garage Light"
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
var sconceLight5 = Entities.addEntity({
|
var sconceLight5 = Entities.addEntity({
|
||||||
|
@ -791,12 +809,13 @@
|
||||||
red: 217,
|
red: 217,
|
||||||
green: 146,
|
green: 146,
|
||||||
blue: 24
|
blue: 24
|
||||||
}
|
},
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
setEntityCustomData(resetKey, sconceLight5, {
|
|
||||||
resetMe: true,
|
resetMe: true,
|
||||||
type: "Garage Light",
|
type: "Garage Light"
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -830,7 +849,12 @@
|
||||||
z: 0
|
z: 0
|
||||||
},
|
},
|
||||||
shapeType: "box",
|
shapeType: "box",
|
||||||
collisionsWillMove: true
|
collisionsWillMove: true,
|
||||||
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
resetMe: true,
|
||||||
|
}
|
||||||
|
})
|
||||||
};
|
};
|
||||||
var dice1 = Entities.addEntity(diceProps);
|
var dice1 = Entities.addEntity(diceProps);
|
||||||
|
|
||||||
|
@ -842,13 +866,6 @@
|
||||||
|
|
||||||
var dice2 = Entities.addEntity(diceProps);
|
var dice2 = Entities.addEntity(diceProps);
|
||||||
|
|
||||||
setEntityCustomData(resetKey, dice1, {
|
|
||||||
resetMe: true
|
|
||||||
});
|
|
||||||
|
|
||||||
setEntityCustomData(resetKey, dice2, {
|
|
||||||
resetMe: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -882,17 +899,18 @@
|
||||||
linearDamping: 1,
|
linearDamping: 1,
|
||||||
angularDamping: 10,
|
angularDamping: 10,
|
||||||
mass: 10,
|
mass: 10,
|
||||||
|
userData: JSON.stringify({
|
||||||
});
|
resetMe: {
|
||||||
|
resetMe: true,
|
||||||
setEntityCustomData(resetKey, gate1, {
|
},
|
||||||
resetMe: true
|
grabbableKey: {
|
||||||
});
|
|
||||||
|
|
||||||
setEntityCustomData(GRABBABLE_DATA_KEY, gate1, {
|
|
||||||
grabbable: false
|
grabbable: false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
var rotation2 = Quat.fromPitchYawRollDegrees(0, -16, 0);
|
var rotation2 = Quat.fromPitchYawRollDegrees(0, -16, 0);
|
||||||
var gate2 = Entities.addEntity({
|
var gate2 = Entities.addEntity({
|
||||||
name: 'Front Door Fence',
|
name: 'Front Door Fence',
|
||||||
|
@ -919,14 +937,14 @@
|
||||||
linearDamping: 1,
|
linearDamping: 1,
|
||||||
angularDamping: 10,
|
angularDamping: 10,
|
||||||
mass: 10,
|
mass: 10,
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
setEntityCustomData(resetKey, gate2, {
|
resetMe: true,
|
||||||
resetMe: true
|
},
|
||||||
});
|
grabbableKey: {
|
||||||
|
grabbable: true
|
||||||
setEntityCustomData(GRABBABLE_DATA_KEY, gate2, {
|
}
|
||||||
grabbable: false
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -960,10 +978,11 @@
|
||||||
z: 0.47
|
z: 0.47
|
||||||
},
|
},
|
||||||
collisionsWillMove: true,
|
collisionsWillMove: true,
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
setEntityCustomData(resetKey, pingPongGun, {
|
resetMe: true,
|
||||||
resetMe: true
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -994,15 +1013,15 @@
|
||||||
y: 3.99,
|
y: 3.99,
|
||||||
z: 3.79
|
z: 3.79
|
||||||
},
|
},
|
||||||
compoundShapeURL: hoopCollisionHullURL
|
compoundShapeURL: hoopCollisionHullURL,
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
setEntityCustomData(resetKey, hoop, {
|
resetMe: true,
|
||||||
resetMe: true
|
},
|
||||||
});
|
grabbaleKey: {
|
||||||
|
|
||||||
setEntityCustomData(GRABBABLE_DATA_KEY, hoop, {
|
|
||||||
grabbable: false
|
grabbable: false
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1032,12 +1051,15 @@
|
||||||
//Look into why bubble wand is going through table when gravity is enabled
|
//Look into why bubble wand is going through table when gravity is enabled
|
||||||
// gravity: {x: 0, y: -3.5, z: 0},
|
// gravity: {x: 0, y: -3.5, z: 0},
|
||||||
// velocity: {x: 0, y: -0.01, z:0},
|
// velocity: {x: 0, y: -0.01, z:0},
|
||||||
script: wandScriptURL
|
script: wandScriptURL,
|
||||||
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
resetMe: true,
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
setEntityCustomData(resetKey, entity, {
|
|
||||||
resetMe: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createBasketBall(position) {
|
function createBasketBall(position) {
|
||||||
|
@ -1068,12 +1090,14 @@
|
||||||
y: -0.01,
|
y: -0.01,
|
||||||
z: 0
|
z: 0
|
||||||
},
|
},
|
||||||
collisionSoundURL: "http://s3.amazonaws.com/hifi-public/sounds/basketball/basketball.wav"
|
collisionSoundURL: "http://s3.amazonaws.com/hifi-public/sounds/basketball/basketball.wav",
|
||||||
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
resetMe: true,
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
setEntityCustomData(resetKey, entity, {
|
|
||||||
resetMe: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createDoll(position) {
|
function createDoll(position) {
|
||||||
|
@ -1103,12 +1127,14 @@
|
||||||
y: -0.1,
|
y: -0.1,
|
||||||
z: 0
|
z: 0
|
||||||
},
|
},
|
||||||
collisionsWillMove: true
|
collisionsWillMove: true,
|
||||||
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
resetMe: true,
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
setEntityCustomData(resetKey, entity, {
|
|
||||||
resetMe: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createSprayCan(position) {
|
function createSprayCan(position) {
|
||||||
|
@ -1137,11 +1163,12 @@
|
||||||
x: 0,
|
x: 0,
|
||||||
y: -1,
|
y: -1,
|
||||||
z: 0
|
z: 0
|
||||||
|
},
|
||||||
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
resetMe: true,
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
setEntityCustomData(resetKey, entity, {
|
|
||||||
resetMe: true
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1171,16 +1198,15 @@
|
||||||
y: 0,
|
y: 0,
|
||||||
z: 0
|
z: 0
|
||||||
},
|
},
|
||||||
linearDamping: 0.4
|
linearDamping: 0.4,
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
setEntityCustomData(resetKey, entity, {
|
resetMe: true,
|
||||||
resetMe: true
|
},
|
||||||
});
|
grabbableKey: {
|
||||||
|
grabbale: false
|
||||||
|
}
|
||||||
setEntityCustomData(GRABBABLE_DATA_KEY, entity, {
|
})
|
||||||
grabbable: false
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1215,16 +1241,17 @@
|
||||||
y: 0,
|
y: 0,
|
||||||
z: 0
|
z: 0
|
||||||
},
|
},
|
||||||
linearDamping: 0.2
|
linearDamping: 0.2,
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
setEntityCustomData(resetKey, entity, {
|
resetMe: true,
|
||||||
resetMe: true
|
},
|
||||||
});
|
grabbaleKey: {
|
||||||
|
|
||||||
setEntityCustomData(GRABBABLE_DATA_KEY, entity, {
|
|
||||||
grabbable: false
|
grabbable: false
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createBlocks(position) {
|
function createBlocks(position) {
|
||||||
|
@ -1296,13 +1323,14 @@
|
||||||
x: 0,
|
x: 0,
|
||||||
y: -0.01,
|
y: -0.01,
|
||||||
z: 0
|
z: 0
|
||||||
|
},
|
||||||
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
resetMe: true,
|
||||||
}
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
//customKey, id, data
|
|
||||||
setEntityCustomData(resetKey, entity, {
|
|
||||||
resetMe: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -193,12 +193,12 @@ MasterReset = function() {
|
||||||
y: 0.01,
|
y: 0.01,
|
||||||
z: 0.1
|
z: 0.1
|
||||||
},
|
},
|
||||||
lifespan: 1
|
lifespan: 1,
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
|
||||||
setEntityCustomData(resetKey, fire, {
|
|
||||||
resetMe: true
|
resetMe: true
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -239,15 +239,16 @@ MasterReset = function() {
|
||||||
},
|
},
|
||||||
collisionsWillMove: true,
|
collisionsWillMove: true,
|
||||||
ignoreForCollisions: false,
|
ignoreForCollisions: false,
|
||||||
compoundShapeURL: rackCollisionHullURL
|
compoundShapeURL: rackCollisionHullURL,
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
setEntityCustomData(resetKey, rack, {
|
|
||||||
resetMe: true
|
resetMe: true
|
||||||
});
|
},
|
||||||
|
grabbableKey: {
|
||||||
|
grabbable: true
|
||||||
|
}
|
||||||
|
|
||||||
setEntityCustomData(GRABBABLE_DATA_KEY, rack, {
|
})
|
||||||
grabbable: false
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var collidingBalls = [];
|
var collidingBalls = [];
|
||||||
|
@ -288,14 +289,15 @@ MasterReset = function() {
|
||||||
collisionsWillMove: true,
|
collisionsWillMove: true,
|
||||||
ignoreForCollisions: false,
|
ignoreForCollisions: false,
|
||||||
modelURL: basketballURL,
|
modelURL: basketballURL,
|
||||||
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
resetMe: true
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
collidingBalls.push(collidingBall);
|
collidingBalls.push(collidingBall);
|
||||||
originalBallPositions.push(position);
|
originalBallPositions.push(position);
|
||||||
|
|
||||||
setEntityCustomData(resetKey, collidingBall, {
|
|
||||||
resetMe: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -386,11 +388,11 @@ MasterReset = function() {
|
||||||
visible: false,
|
visible: false,
|
||||||
collisionsWillMove: false,
|
collisionsWillMove: false,
|
||||||
ignoreForCollisions: true,
|
ignoreForCollisions: true,
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
|
||||||
setEntityCustomData(resetKey, targetIntervalClearer, {
|
|
||||||
resetMe: true
|
resetMe: true
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
var targets = [];
|
var targets = [];
|
||||||
|
@ -424,13 +426,15 @@ MasterReset = function() {
|
||||||
compoundShapeURL: COLLISION_HULL_URL,
|
compoundShapeURL: COLLISION_HULL_URL,
|
||||||
position: position,
|
position: position,
|
||||||
rotation: rotation,
|
rotation: rotation,
|
||||||
script: targetsScriptURL
|
script: targetsScriptURL,
|
||||||
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
resetMe: true
|
||||||
|
}
|
||||||
|
})
|
||||||
};
|
};
|
||||||
var target = Entities.addEntity(targetProperties);
|
var target = Entities.addEntity(targetProperties);
|
||||||
targets.push(target);
|
targets.push(target);
|
||||||
setEntityCustomData(resetKey, target, {
|
|
||||||
resetMe: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -456,13 +460,15 @@ MasterReset = function() {
|
||||||
compoundShapeURL: COLLISION_HULL_URL,
|
compoundShapeURL: COLLISION_HULL_URL,
|
||||||
position: originalPositions[index],
|
position: originalPositions[index],
|
||||||
rotation: rotation,
|
rotation: rotation,
|
||||||
script: targetsScriptURL
|
script: targetsScriptURL,
|
||||||
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
resetMe: true
|
||||||
|
}
|
||||||
|
})
|
||||||
};
|
};
|
||||||
var target = Entities.addEntity(targetProperties);
|
var target = Entities.addEntity(targetProperties);
|
||||||
targets[index] = target;
|
targets[index] = target;
|
||||||
setEntityCustomData(resetKey, target, {
|
|
||||||
resetMe: true
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -517,11 +523,13 @@ MasterReset = function() {
|
||||||
y: 0.50762706995010376,
|
y: 0.50762706995010376,
|
||||||
z: 0.90716040134429932
|
z: 0.90716040134429932
|
||||||
},
|
},
|
||||||
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
resetMe: true
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
setEntityCustomData(resetKey, cat, {
|
|
||||||
resetMe: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createFlashlight(position) {
|
function createFlashlight(position) {
|
||||||
|
@ -550,11 +558,13 @@ MasterReset = function() {
|
||||||
z: 0
|
z: 0
|
||||||
},
|
},
|
||||||
shapeType: 'box',
|
shapeType: 'box',
|
||||||
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
resetMe: true
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
setEntityCustomData(resetKey, flashlight, {
|
|
||||||
resetMe: true
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -591,12 +601,14 @@ MasterReset = function() {
|
||||||
x: 0.10546875,
|
x: 0.10546875,
|
||||||
y: 0.032372996211051941,
|
y: 0.032372996211051941,
|
||||||
z: 0.16242524981498718
|
z: 0.16242524981498718
|
||||||
}
|
},
|
||||||
});
|
userData: JSON.stringify({
|
||||||
setEntityCustomData(resetKey, lightSwitchHall, {
|
resetMe: {
|
||||||
resetMe: true,
|
resetMe: true,
|
||||||
on: true,
|
on: true,
|
||||||
type: "Hall Light"
|
type: "Hall Light"
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
var sconceLight1 = Entities.addEntity({
|
var sconceLight1 = Entities.addEntity({
|
||||||
|
@ -617,12 +629,13 @@ MasterReset = function() {
|
||||||
red: 217,
|
red: 217,
|
||||||
green: 146,
|
green: 146,
|
||||||
blue: 24
|
blue: 24
|
||||||
}
|
},
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
setEntityCustomData(resetKey, sconceLight1, {
|
|
||||||
resetMe: true,
|
resetMe: true,
|
||||||
type: "Hall Light",
|
type: "Hall Light"
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
var sconceLight2 = Entities.addEntity({
|
var sconceLight2 = Entities.addEntity({
|
||||||
|
@ -643,15 +656,15 @@ MasterReset = function() {
|
||||||
red: 217,
|
red: 217,
|
||||||
green: 146,
|
green: 146,
|
||||||
blue: 24
|
blue: 24
|
||||||
}
|
},
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
setEntityCustomData(resetKey, sconceLight2, {
|
|
||||||
resetMe: true,
|
resetMe: true,
|
||||||
type: "Hall Light",
|
type: "Hall Light"
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
rotation = {
|
rotation = {
|
||||||
w: 0.20082402229309082,
|
w: 0.20082402229309082,
|
||||||
x: 0.20082402229309082,
|
x: 0.20082402229309082,
|
||||||
|
@ -681,16 +694,19 @@ MasterReset = function() {
|
||||||
x: 0.10546875,
|
x: 0.10546875,
|
||||||
y: 0.032372996211051941,
|
y: 0.032372996211051941,
|
||||||
z: 0.16242524981498718
|
z: 0.16242524981498718
|
||||||
}
|
},
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
setEntityCustomData(resetKey, lightSwitchGarage, {
|
|
||||||
resetMe: true,
|
resetMe: true,
|
||||||
on: true,
|
on: true,
|
||||||
type: "Garage Light"
|
type: "Garage Light"
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var sconceLight3 = Entities.addEntity({
|
var sconceLight3 = Entities.addEntity({
|
||||||
type: "Light",
|
type: "Light",
|
||||||
position: {
|
position: {
|
||||||
|
@ -710,16 +726,16 @@ MasterReset = function() {
|
||||||
red: 217,
|
red: 217,
|
||||||
green: 146,
|
green: 146,
|
||||||
blue: 24
|
blue: 24
|
||||||
}
|
},
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
|
||||||
|
|
||||||
setEntityCustomData(resetKey, sconceLight3, {
|
|
||||||
resetMe: true,
|
resetMe: true,
|
||||||
type: "Garage Light",
|
type: "Garage Light"
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
var sconceLight4 = Entities.addEntity({
|
var sconceLight4 = Entities.addEntity({
|
||||||
type: "Light",
|
type: "Light",
|
||||||
position: {
|
position: {
|
||||||
|
@ -738,12 +754,13 @@ MasterReset = function() {
|
||||||
red: 217,
|
red: 217,
|
||||||
green: 146,
|
green: 146,
|
||||||
blue: 24
|
blue: 24
|
||||||
}
|
},
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
setEntityCustomData(resetKey, sconceLight4, {
|
|
||||||
resetMe: true,
|
resetMe: true,
|
||||||
type: "Garage Light",
|
type: "Garage Light"
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
var sconceLight5 = Entities.addEntity({
|
var sconceLight5 = Entities.addEntity({
|
||||||
|
@ -764,12 +781,13 @@ MasterReset = function() {
|
||||||
red: 217,
|
red: 217,
|
||||||
green: 146,
|
green: 146,
|
||||||
blue: 24
|
blue: 24
|
||||||
}
|
},
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
setEntityCustomData(resetKey, sconceLight5, {
|
|
||||||
resetMe: true,
|
resetMe: true,
|
||||||
type: "Garage Light",
|
type: "Garage Light"
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -803,7 +821,12 @@ MasterReset = function() {
|
||||||
z: 0
|
z: 0
|
||||||
},
|
},
|
||||||
shapeType: "box",
|
shapeType: "box",
|
||||||
collisionsWillMove: true
|
collisionsWillMove: true,
|
||||||
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
resetMe: true,
|
||||||
|
}
|
||||||
|
})
|
||||||
};
|
};
|
||||||
var dice1 = Entities.addEntity(diceProps);
|
var dice1 = Entities.addEntity(diceProps);
|
||||||
|
|
||||||
|
@ -815,13 +838,6 @@ MasterReset = function() {
|
||||||
|
|
||||||
var dice2 = Entities.addEntity(diceProps);
|
var dice2 = Entities.addEntity(diceProps);
|
||||||
|
|
||||||
setEntityCustomData(resetKey, dice1, {
|
|
||||||
resetMe: true
|
|
||||||
});
|
|
||||||
|
|
||||||
setEntityCustomData(resetKey, dice2, {
|
|
||||||
resetMe: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -855,17 +871,18 @@ MasterReset = function() {
|
||||||
linearDamping: 1,
|
linearDamping: 1,
|
||||||
angularDamping: 10,
|
angularDamping: 10,
|
||||||
mass: 10,
|
mass: 10,
|
||||||
|
userData: JSON.stringify({
|
||||||
});
|
resetMe: {
|
||||||
|
resetMe: true,
|
||||||
setEntityCustomData(resetKey, gate1, {
|
},
|
||||||
resetMe: true
|
grabbableKey: {
|
||||||
});
|
|
||||||
|
|
||||||
setEntityCustomData(GRABBABLE_DATA_KEY, gate1, {
|
|
||||||
grabbable: false
|
grabbable: false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
var rotation2 = Quat.fromPitchYawRollDegrees(0, -16, 0);
|
var rotation2 = Quat.fromPitchYawRollDegrees(0, -16, 0);
|
||||||
var gate2 = Entities.addEntity({
|
var gate2 = Entities.addEntity({
|
||||||
name: 'Front Door Fence',
|
name: 'Front Door Fence',
|
||||||
|
@ -892,14 +909,14 @@ MasterReset = function() {
|
||||||
linearDamping: 1,
|
linearDamping: 1,
|
||||||
angularDamping: 10,
|
angularDamping: 10,
|
||||||
mass: 10,
|
mass: 10,
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
setEntityCustomData(resetKey, gate2, {
|
resetMe: true,
|
||||||
resetMe: true
|
},
|
||||||
});
|
grabbableKey: {
|
||||||
|
grabbable: true
|
||||||
setEntityCustomData(GRABBABLE_DATA_KEY, gate2, {
|
}
|
||||||
grabbable: false
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -933,10 +950,11 @@ MasterReset = function() {
|
||||||
z: 0.47
|
z: 0.47
|
||||||
},
|
},
|
||||||
collisionsWillMove: true,
|
collisionsWillMove: true,
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
setEntityCustomData(resetKey, pingPongGun, {
|
resetMe: true,
|
||||||
resetMe: true
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -967,15 +985,15 @@ MasterReset = function() {
|
||||||
y: 3.99,
|
y: 3.99,
|
||||||
z: 3.79
|
z: 3.79
|
||||||
},
|
},
|
||||||
compoundShapeURL: hoopCollisionHullURL
|
compoundShapeURL: hoopCollisionHullURL,
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
setEntityCustomData(resetKey, hoop, {
|
resetMe: true,
|
||||||
resetMe: true
|
},
|
||||||
});
|
grabbaleKey: {
|
||||||
|
|
||||||
setEntityCustomData(GRABBABLE_DATA_KEY, hoop, {
|
|
||||||
grabbable: false
|
grabbable: false
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1005,12 +1023,15 @@ MasterReset = function() {
|
||||||
//Look into why bubble wand is going through table when gravity is enabled
|
//Look into why bubble wand is going through table when gravity is enabled
|
||||||
// gravity: {x: 0, y: -3.5, z: 0},
|
// gravity: {x: 0, y: -3.5, z: 0},
|
||||||
// velocity: {x: 0, y: -0.01, z:0},
|
// velocity: {x: 0, y: -0.01, z:0},
|
||||||
script: wandScriptURL
|
script: wandScriptURL,
|
||||||
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
resetMe: true,
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
setEntityCustomData(resetKey, entity, {
|
|
||||||
resetMe: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createBasketBall(position) {
|
function createBasketBall(position) {
|
||||||
|
@ -1041,12 +1062,14 @@ MasterReset = function() {
|
||||||
y: -0.01,
|
y: -0.01,
|
||||||
z: 0
|
z: 0
|
||||||
},
|
},
|
||||||
collisionSoundURL: "http://s3.amazonaws.com/hifi-public/sounds/basketball/basketball.wav"
|
collisionSoundURL: "http://s3.amazonaws.com/hifi-public/sounds/basketball/basketball.wav",
|
||||||
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
resetMe: true,
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
setEntityCustomData(resetKey, entity, {
|
|
||||||
resetMe: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createDoll(position) {
|
function createDoll(position) {
|
||||||
|
@ -1076,12 +1099,14 @@ MasterReset = function() {
|
||||||
y: -0.1,
|
y: -0.1,
|
||||||
z: 0
|
z: 0
|
||||||
},
|
},
|
||||||
collisionsWillMove: true
|
collisionsWillMove: true,
|
||||||
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
resetMe: true,
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
setEntityCustomData(resetKey, entity, {
|
|
||||||
resetMe: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createSprayCan(position) {
|
function createSprayCan(position) {
|
||||||
|
@ -1110,11 +1135,12 @@ MasterReset = function() {
|
||||||
x: 0,
|
x: 0,
|
||||||
y: -1,
|
y: -1,
|
||||||
z: 0
|
z: 0
|
||||||
|
},
|
||||||
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
resetMe: true,
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
setEntityCustomData(resetKey, entity, {
|
|
||||||
resetMe: true
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1144,16 +1170,15 @@ MasterReset = function() {
|
||||||
y: 0,
|
y: 0,
|
||||||
z: 0
|
z: 0
|
||||||
},
|
},
|
||||||
linearDamping: 0.4
|
linearDamping: 0.4,
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
setEntityCustomData(resetKey, entity, {
|
resetMe: true,
|
||||||
resetMe: true
|
},
|
||||||
});
|
grabbableKey: {
|
||||||
|
grabbale: false
|
||||||
|
}
|
||||||
setEntityCustomData(GRABBABLE_DATA_KEY, entity, {
|
})
|
||||||
grabbable: false
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1188,16 +1213,17 @@ MasterReset = function() {
|
||||||
y: 0,
|
y: 0,
|
||||||
z: 0
|
z: 0
|
||||||
},
|
},
|
||||||
linearDamping: 0.2
|
linearDamping: 0.2,
|
||||||
});
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
setEntityCustomData(resetKey, entity, {
|
resetMe: true,
|
||||||
resetMe: true
|
},
|
||||||
});
|
grabbaleKey: {
|
||||||
|
|
||||||
setEntityCustomData(GRABBABLE_DATA_KEY, entity, {
|
|
||||||
grabbable: false
|
grabbable: false
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function createBlocks(position) {
|
function createBlocks(position) {
|
||||||
|
@ -1269,13 +1295,14 @@ MasterReset = function() {
|
||||||
x: 0,
|
x: 0,
|
||||||
y: -0.01,
|
y: -0.01,
|
||||||
z: 0
|
z: 0
|
||||||
|
},
|
||||||
|
userData: JSON.stringify({
|
||||||
|
resetMe: {
|
||||||
|
resetMe: true,
|
||||||
}
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
//customKey, id, data
|
|
||||||
setEntityCustomData(resetKey, entity, {
|
|
||||||
resetMe: true
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue