Merge remote-tracking branch 'upstream/master'

This commit is contained in:
James B. Pollack 2015-10-09 10:56:06 -07:00
commit 9141ba9335
3 changed files with 2441 additions and 2307 deletions

View file

@ -24,7 +24,7 @@
var RELOAD_THRESHOLD = 0.95;
var GUN_TIP_FWD_OFFSET =-0.35;
var GUN_TIP_UP_OFFSET = 0.040;
var GUN_FORCE = 5;
var GUN_FORCE = 9;
var BALL_RESTITUTION = 0.6;
var BALL_LINEAR_DAMPING = 0.4;
var BALL_GRAVITY = {

View file

@ -21,6 +21,7 @@
var wandScriptURL = Script.resolvePath("../examples/toys/bubblewand/wand.js");
var dollScriptURL = Script.resolvePath("../examples/toys/doll/doll.js");
var lightsScriptURL = Script.resolvePath("../examples/toys/lightSwitch.js");
var targetsScriptURL = Script.resolvePath('../examples/toys/ping_pong_gun/wallTarget.js');
ResetSwitch = function() {
_this = this;
@ -51,6 +52,7 @@
};
MasterReset = function() {
var resetKey = "resetMe";
var GRABBABLE_DATA_KEY = "grabbableKey";
@ -136,6 +138,8 @@
z: 503.91
});
createTargets();
}
function deleteAllToys() {
@ -217,12 +221,12 @@
y: 0.01,
z: 0.1
},
lifespan: 1
});
setEntityCustomData(resetKey, fire, {
lifespan: 1,
userData: JSON.stringify({
resetMe: {
resetMe: true
}
})
});
}
@ -263,15 +267,16 @@
},
collisionsWillMove: true,
ignoreForCollisions: false,
compoundShapeURL: rackCollisionHullURL
});
setEntityCustomData(resetKey, rack, {
compoundShapeURL: rackCollisionHullURL,
userData: JSON.stringify({
resetMe: {
resetMe: true
});
setEntityCustomData(GRABBABLE_DATA_KEY, rack, {
},
grabbableKey: {
grabbable: false
}
})
});
var collidingBalls = [];
@ -312,14 +317,15 @@
collisionsWillMove: true,
ignoreForCollisions: false,
modelURL: basketballURL,
userData: JSON.stringify({
resetMe: {
resetMe: true
}
})
});
collidingBalls.push(collidingBall);
originalBallPositions.push(position);
setEntityCustomData(resetKey, collidingBall, {
resetMe: true
});
}
}
@ -368,6 +374,157 @@
var distanceCheckInterval = Script.setInterval(testBallDistanceFromStart, 1000);
}
function createTargets() {
var MODEL_URL = 'http://hifi-public.s3.amazonaws.com/models/ping_pong_gun/target.fbx';
var COLLISION_HULL_URL = 'http://hifi-public.s3.amazonaws.com/models/ping_pong_gun/target_collision_hull.obj';
var RESET_DISTANCE = 1;
var TARGET_USER_DATA_KEY = 'hifi-ping_pong_target';
var NUMBER_OF_TARGETS = 6;
var TARGETS_PER_ROW = 3;
var TARGET_DIMENSIONS = {
x: 0.06,
y: 0.42,
z: 0.42
};
var VERTICAL_SPACING = TARGET_DIMENSIONS.y + 0.5;
var HORIZONTAL_SPACING = TARGET_DIMENSIONS.z + 0.5;
var startPosition = {
x: 548.68,
y: 497.30,
z: 509.74
};
var rotation = Quat.fromPitchYawRollDegrees(0, -55.25, 0);
var targetIntervalClearer = Entities.addEntity({
name: 'Target Interval Clearer - delete me to clear',
type: 'Box',
position: startPosition,
dimensions: TARGET_DIMENSIONS,
color: {
red: 0,
green: 255,
blue: 0
},
rotation: rotation,
visible: false,
collisionsWillMove: false,
ignoreForCollisions: true,
userData: JSON.stringify({
resetMe: {
resetMe: true
}
})
});
var targets = [];
var originalPositions = [];
function addTargets() {
var i;
var row = -1;
for (i = 0; i < NUMBER_OF_TARGETS; i++) {
if (i % TARGETS_PER_ROW === 0) {
row++;
}
var vHat = Quat.getFront(rotation);
var spacer = HORIZONTAL_SPACING * (i % TARGETS_PER_ROW) + (row * HORIZONTAL_SPACING / 2);
var multiplier = Vec3.multiply(spacer, vHat);
var position = Vec3.sum(startPosition, multiplier);
position.y = startPosition.y - (row * VERTICAL_SPACING);
originalPositions.push(position);
var targetProperties = {
name: 'Target',
type: 'Model',
modelURL: MODEL_URL,
shapeType: 'compound',
collisionsWillMove: true,
dimensions: TARGET_DIMENSIONS,
compoundShapeURL: COLLISION_HULL_URL,
position: position,
rotation: rotation,
script: targetsScriptURL,
userData: JSON.stringify({
resetMe: {
resetMe: true
}
})
};
var target = Entities.addEntity(targetProperties);
targets.push(target);
}
}
function testTargetDistanceFromStart() {
targets.forEach(function(target, index) {
var currentPosition = Entities.getEntityProperties(target, "position").position;
var originalPosition = originalPositions[index];
var distance = Vec3.subtract(originalPosition, currentPosition);
var length = Vec3.length(distance);
if (length > RESET_DISTANCE) {
Entities.deleteEntity(target);
var targetProperties = {
name: 'Target',
type: 'Model',
modelURL: MODEL_URL,
shapeType: 'compound',
collisionsWillMove: true,
dimensions: TARGET_DIMENSIONS,
compoundShapeURL: COLLISION_HULL_URL,
position: originalPositions[index],
rotation: rotation,
script: targetsScriptURL,
userData: JSON.stringify({
resetMe: {
resetMe: true
}
})
};
var target = Entities.addEntity(targetProperties);
targets[index] = target;
}
});
}
function deleteEntity(entityID) {
if (entityID === targetIntervalClearer) {
deleteTargets();
Script.clearInterval(distanceCheckInterval);
Entities.deletingEntity.disconnect(deleteEntity);
}
}
function deleteTargets() {
while (targets.length > 0) {
Entities.deleteEntity(targets.pop());
}
Entities.deleteEntity(targetIntervalClearer);
}
Entities.deletingEntity.connect(deleteEntity);
var distanceCheckInterval = Script.setInterval(testTargetDistanceFromStart, 1000);
addTargets();
}
function createCat(position) {
var modelURL = "http://hifi-public.s3.amazonaws.com/ryan/Dark_Cat.fbx";
@ -394,11 +551,13 @@
y: 0.50762706995010376,
z: 0.90716040134429932
},
userData: JSON.stringify({
resetMe: {
resetMe: true
}
})
});
setEntityCustomData(resetKey, cat, {
resetMe: true
});
}
function createFlashlight(position) {
@ -427,11 +586,13 @@
z: 0
},
shapeType: 'box',
userData: JSON.stringify({
resetMe: {
resetMe: true
}
})
});
setEntityCustomData(resetKey, flashlight, {
resetMe: true
});
}
@ -468,12 +629,14 @@
x: 0.10546875,
y: 0.032372996211051941,
z: 0.16242524981498718
}
});
setEntityCustomData(resetKey, lightSwitchHall, {
},
userData: JSON.stringify({
resetMe: {
resetMe: true,
on: true,
type: "Hall Light"
}
})
});
var sconceLight1 = Entities.addEntity({
@ -494,12 +657,13 @@
red: 217,
green: 146,
blue: 24
}
});
setEntityCustomData(resetKey, sconceLight1, {
},
userData: JSON.stringify({
resetMe: {
resetMe: true,
type: "Hall Light",
type: "Hall Light"
}
})
});
var sconceLight2 = Entities.addEntity({
@ -520,15 +684,15 @@
red: 217,
green: 146,
blue: 24
}
});
setEntityCustomData(resetKey, sconceLight2, {
},
userData: JSON.stringify({
resetMe: {
resetMe: true,
type: "Hall Light",
type: "Hall Light"
}
})
});
rotation = {
w: 0.20082402229309082,
x: 0.20082402229309082,
@ -558,16 +722,19 @@
x: 0.10546875,
y: 0.032372996211051941,
z: 0.16242524981498718
}
});
setEntityCustomData(resetKey, lightSwitchGarage, {
},
userData: JSON.stringify({
resetMe: {
resetMe: true,
on: true,
type: "Garage Light"
}
})
});
var sconceLight3 = Entities.addEntity({
type: "Light",
position: {
@ -587,16 +754,16 @@
red: 217,
green: 146,
blue: 24
}
});
setEntityCustomData(resetKey, sconceLight3, {
},
userData: JSON.stringify({
resetMe: {
resetMe: true,
type: "Garage Light",
type: "Garage Light"
}
})
});
var sconceLight4 = Entities.addEntity({
type: "Light",
position: {
@ -615,12 +782,13 @@
red: 217,
green: 146,
blue: 24
}
});
setEntityCustomData(resetKey, sconceLight4, {
},
userData: JSON.stringify({
resetMe: {
resetMe: true,
type: "Garage Light",
type: "Garage Light"
}
})
});
var sconceLight5 = Entities.addEntity({
@ -641,12 +809,13 @@
red: 217,
green: 146,
blue: 24
}
});
setEntityCustomData(resetKey, sconceLight5, {
},
userData: JSON.stringify({
resetMe: {
resetMe: true,
type: "Garage Light",
type: "Garage Light"
}
})
});
}
@ -680,7 +849,12 @@
z: 0
},
shapeType: "box",
collisionsWillMove: true
collisionsWillMove: true,
userData: JSON.stringify({
resetMe: {
resetMe: true,
}
})
};
var dice1 = Entities.addEntity(diceProps);
@ -692,59 +866,14 @@
var dice2 = Entities.addEntity(diceProps);
setEntityCustomData(resetKey, dice1, {
resetMe: true
});
setEntityCustomData(resetKey, dice2, {
resetMe: true
});
}
function createGates() {
var MODEL_URL = 'http://hifi-public.s3.amazonaws.com/ryan/fence.fbx';
var rotation1 = Quat.fromPitchYawRollDegrees(0, 36, 0);
var gate1 = Entities.addEntity({
name: 'Back Door Gate',
type: 'Model',
shapeType: 'box',
modelURL: MODEL_URL,
position: {
x: 546.52,
y: 494.76,
z: 498.87
},
dimensions: {
x: 1.42,
y: 1.13,
z: 0.25
},
rotation: rotation1,
collisionsWillMove: true,
gravity: {
x: 0,
y: -50,
z: 0
},
linearDamping: 1,
angularDamping: 10,
mass: 10,
});
setEntityCustomData(resetKey, gate1, {
resetMe: true
});
setEntityCustomData(GRABBABLE_DATA_KEY, gate1, {
grabbable: false
});
var rotation2 = Quat.fromPitchYawRollDegrees(0, -16, 0);
var gate2 = Entities.addEntity({
var rotation = Quat.fromPitchYawRollDegrees(0, -16, 0);
var gate = Entities.addEntity({
name: 'Front Door Fence',
type: 'Model',
modelURL: MODEL_URL,
@ -769,14 +898,14 @@
linearDamping: 1,
angularDamping: 10,
mass: 10,
});
setEntityCustomData(resetKey, gate2, {
resetMe: true
});
setEntityCustomData(GRABBABLE_DATA_KEY, gate2, {
userData: JSON.stringify({
resetMe: {
resetMe: true,
},
grabbableKey: {
grabbable: false
}
})
});
}
@ -810,10 +939,11 @@
z: 0.47
},
collisionsWillMove: true,
});
setEntityCustomData(resetKey, pingPongGun, {
resetMe: true
userData: JSON.stringify({
resetMe: {
resetMe: true,
}
})
});
}
@ -844,15 +974,15 @@
y: 3.99,
z: 3.79
},
compoundShapeURL: hoopCollisionHullURL
});
setEntityCustomData(resetKey, hoop, {
resetMe: true
});
setEntityCustomData(GRABBABLE_DATA_KEY, hoop, {
compoundShapeURL: hoopCollisionHullURL,
userData: JSON.stringify({
resetMe: {
resetMe: true,
},
grabbaleKey: {
grabbable: false
}
})
});
}
@ -882,12 +1012,15 @@
//Look into why bubble wand is going through table when gravity is enabled
// gravity: {x: 0, y: -3.5, 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) {
@ -918,12 +1051,14 @@
y: -0.01,
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) {
@ -953,12 +1088,14 @@
y: -0.1,
z: 0
},
collisionsWillMove: true
collisionsWillMove: true,
userData: JSON.stringify({
resetMe: {
resetMe: true,
}
})
});
setEntityCustomData(resetKey, entity, {
resetMe: true
});
}
function createSprayCan(position) {
@ -987,11 +1124,12 @@
x: 0,
y: -1,
z: 0
},
userData: JSON.stringify({
resetMe: {
resetMe: true,
}
});
setEntityCustomData(resetKey, entity, {
resetMe: true
})
});
}
@ -1021,16 +1159,15 @@
y: 0,
z: 0
},
linearDamping: 0.4
});
setEntityCustomData(resetKey, entity, {
resetMe: true
});
setEntityCustomData(GRABBABLE_DATA_KEY, entity, {
grabbable: false
linearDamping: 0.4,
userData: JSON.stringify({
resetMe: {
resetMe: true,
},
grabbableKey: {
grabbale: false
}
})
});
}
@ -1065,16 +1202,17 @@
y: 0,
z: 0
},
linearDamping: 0.2
});
setEntityCustomData(resetKey, entity, {
resetMe: true
});
setEntityCustomData(GRABBABLE_DATA_KEY, entity, {
linearDamping: 0.2,
userData: JSON.stringify({
resetMe: {
resetMe: true,
},
grabbaleKey: {
grabbable: false
}
})
});
}
function createBlocks(position) {
@ -1146,13 +1284,14 @@
x: 0,
y: -0.01,
z: 0
},
userData: JSON.stringify({
resetMe: {
resetMe: true,
}
})
});
//customKey, id, data
setEntityCustomData(resetKey, entity, {
resetMe: true
});
}
}
}

View file

@ -193,12 +193,12 @@ MasterReset = function() {
y: 0.01,
z: 0.1
},
lifespan: 1
});
setEntityCustomData(resetKey, fire, {
lifespan: 1,
userData: JSON.stringify({
resetMe: {
resetMe: true
}
})
});
}
@ -239,15 +239,16 @@ MasterReset = function() {
},
collisionsWillMove: true,
ignoreForCollisions: false,
compoundShapeURL: rackCollisionHullURL
});
setEntityCustomData(resetKey, rack, {
compoundShapeURL: rackCollisionHullURL,
userData: JSON.stringify({
resetMe: {
resetMe: true
});
setEntityCustomData(GRABBABLE_DATA_KEY, rack, {
},
grabbableKey: {
grabbable: false
}
})
});
var collidingBalls = [];
@ -288,14 +289,15 @@ MasterReset = function() {
collisionsWillMove: true,
ignoreForCollisions: false,
modelURL: basketballURL,
userData: JSON.stringify({
resetMe: {
resetMe: true
}
})
});
collidingBalls.push(collidingBall);
originalBallPositions.push(position);
setEntityCustomData(resetKey, collidingBall, {
resetMe: true
});
}
}
@ -377,15 +379,15 @@ MasterReset = function() {
type: 'Box',
position: startPosition,
dimensions: TARGET_DIMENSIONS,
color: {
red: 0,
green: 255,
blue: 0
},
rotation: rotation,
visible: false,
collisionsWillMove: false,
ignoreForCollisions: true,
userData: JSON.stringify({
resetMe: {
resetMe: true
}
})
});
var targets = [];
@ -419,10 +421,15 @@ MasterReset = function() {
compoundShapeURL: COLLISION_HULL_URL,
position: position,
rotation: rotation,
script: targetsScriptURL
script: targetsScriptURL,
userData: JSON.stringify({
resetMe: {
resetMe: true
}
})
};
targets.push(Entities.addEntity(targetProperties));
var target = Entities.addEntity(targetProperties);
targets.push(target);
}
}
@ -448,10 +455,16 @@ MasterReset = function() {
compoundShapeURL: COLLISION_HULL_URL,
position: originalPositions[index],
rotation: rotation,
script: targetsScriptURL
script: targetsScriptURL,
userData: JSON.stringify({
resetMe: {
resetMe: true
}
})
};
var target = Entities.addEntity(targetProperties);
targets[index] = target;
targets[index] = Entities.addEntity(targetProperties);
}
});
}
@ -505,11 +518,13 @@ MasterReset = function() {
y: 0.50762706995010376,
z: 0.90716040134429932
},
userData: JSON.stringify({
resetMe: {
resetMe: true
}
})
});
setEntityCustomData(resetKey, cat, {
resetMe: true
});
}
function createFlashlight(position) {
@ -538,11 +553,13 @@ MasterReset = function() {
z: 0
},
shapeType: 'box',
userData: JSON.stringify({
resetMe: {
resetMe: true
}
})
});
setEntityCustomData(resetKey, flashlight, {
resetMe: true
});
}
@ -579,12 +596,14 @@ MasterReset = function() {
x: 0.10546875,
y: 0.032372996211051941,
z: 0.16242524981498718
}
});
setEntityCustomData(resetKey, lightSwitchHall, {
},
userData: JSON.stringify({
resetMe: {
resetMe: true,
on: true,
type: "Hall Light"
}
})
});
var sconceLight1 = Entities.addEntity({
@ -605,12 +624,13 @@ MasterReset = function() {
red: 217,
green: 146,
blue: 24
}
});
setEntityCustomData(resetKey, sconceLight1, {
},
userData: JSON.stringify({
resetMe: {
resetMe: true,
type: "Hall Light",
type: "Hall Light"
}
})
});
var sconceLight2 = Entities.addEntity({
@ -631,15 +651,15 @@ MasterReset = function() {
red: 217,
green: 146,
blue: 24
}
});
setEntityCustomData(resetKey, sconceLight2, {
},
userData: JSON.stringify({
resetMe: {
resetMe: true,
type: "Hall Light",
type: "Hall Light"
}
})
});
rotation = {
w: 0.20082402229309082,
x: 0.20082402229309082,
@ -669,16 +689,19 @@ MasterReset = function() {
x: 0.10546875,
y: 0.032372996211051941,
z: 0.16242524981498718
}
});
setEntityCustomData(resetKey, lightSwitchGarage, {
},
userData: JSON.stringify({
resetMe: {
resetMe: true,
on: true,
type: "Garage Light"
}
})
});
var sconceLight3 = Entities.addEntity({
type: "Light",
position: {
@ -698,16 +721,16 @@ MasterReset = function() {
red: 217,
green: 146,
blue: 24
}
});
setEntityCustomData(resetKey, sconceLight3, {
},
userData: JSON.stringify({
resetMe: {
resetMe: true,
type: "Garage Light",
type: "Garage Light"
}
})
});
var sconceLight4 = Entities.addEntity({
type: "Light",
position: {
@ -726,12 +749,13 @@ MasterReset = function() {
red: 217,
green: 146,
blue: 24
}
});
setEntityCustomData(resetKey, sconceLight4, {
},
userData: JSON.stringify({
resetMe: {
resetMe: true,
type: "Garage Light",
type: "Garage Light"
}
})
});
var sconceLight5 = Entities.addEntity({
@ -752,12 +776,13 @@ MasterReset = function() {
red: 217,
green: 146,
blue: 24
}
});
setEntityCustomData(resetKey, sconceLight5, {
},
userData: JSON.stringify({
resetMe: {
resetMe: true,
type: "Garage Light",
type: "Garage Light"
}
})
});
}
@ -791,7 +816,12 @@ MasterReset = function() {
z: 0
},
shapeType: "box",
collisionsWillMove: true
collisionsWillMove: true,
userData: JSON.stringify({
resetMe: {
resetMe: true,
}
})
};
var dice1 = Entities.addEntity(diceProps);
@ -803,59 +833,14 @@ MasterReset = function() {
var dice2 = Entities.addEntity(diceProps);
setEntityCustomData(resetKey, dice1, {
resetMe: true
});
setEntityCustomData(resetKey, dice2, {
resetMe: true
});
}
function createGates() {
var MODEL_URL = 'http://hifi-public.s3.amazonaws.com/ryan/fence.fbx';
var rotation1 = Quat.fromPitchYawRollDegrees(0, 36, 0);
var gate1 = Entities.addEntity({
name: 'Back Door Gate',
type: 'Model',
shapeType: 'box',
modelURL: MODEL_URL,
position: {
x: 546.52,
y: 494.76,
z: 498.87
},
dimensions: {
x: 1.42,
y: 1.13,
z: 0.25
},
rotation: rotation1,
collisionsWillMove: true,
gravity: {
x: 0,
y: -50,
z: 0
},
linearDamping: 1,
angularDamping: 10,
mass: 10,
});
setEntityCustomData(resetKey, gate1, {
resetMe: true
});
setEntityCustomData(GRABBABLE_DATA_KEY, gate1, {
grabbable: false
});
var rotation2 = Quat.fromPitchYawRollDegrees(0, -16, 0);
var gate2 = Entities.addEntity({
var rotation = Quat.fromPitchYawRollDegrees(0, -16, 0);
var gate = Entities.addEntity({
name: 'Front Door Fence',
type: 'Model',
modelURL: MODEL_URL,
@ -870,7 +855,7 @@ MasterReset = function() {
y: 1.13,
z: 0.2
},
rotation: rotation2,
rotation: rotation,
collisionsWillMove: true,
gravity: {
x: 0,
@ -880,14 +865,14 @@ MasterReset = function() {
linearDamping: 1,
angularDamping: 10,
mass: 10,
});
setEntityCustomData(resetKey, gate2, {
resetMe: true
});
setEntityCustomData(GRABBABLE_DATA_KEY, gate2, {
userData: JSON.stringify({
resetMe: {
resetMe: true,
},
grabbableKey: {
grabbable: false
}
})
});
}
@ -921,10 +906,11 @@ MasterReset = function() {
z: 0.47
},
collisionsWillMove: true,
});
setEntityCustomData(resetKey, pingPongGun, {
resetMe: true
userData: JSON.stringify({
resetMe: {
resetMe: true,
}
})
});
}
@ -955,15 +941,15 @@ MasterReset = function() {
y: 3.99,
z: 3.79
},
compoundShapeURL: hoopCollisionHullURL
});
setEntityCustomData(resetKey, hoop, {
resetMe: true
});
setEntityCustomData(GRABBABLE_DATA_KEY, hoop, {
compoundShapeURL: hoopCollisionHullURL,
userData: JSON.stringify({
resetMe: {
resetMe: true,
},
grabbaleKey: {
grabbable: false
}
})
});
}
@ -993,12 +979,15 @@ MasterReset = function() {
//Look into why bubble wand is going through table when gravity is enabled
// gravity: {x: 0, y: -3.5, 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) {
@ -1029,12 +1018,14 @@ MasterReset = function() {
y: -0.01,
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) {
@ -1064,12 +1055,14 @@ MasterReset = function() {
y: -0.1,
z: 0
},
collisionsWillMove: true
collisionsWillMove: true,
userData: JSON.stringify({
resetMe: {
resetMe: true,
}
})
});
setEntityCustomData(resetKey, entity, {
resetMe: true
});
}
function createSprayCan(position) {
@ -1098,11 +1091,12 @@ MasterReset = function() {
x: 0,
y: -1,
z: 0
},
userData: JSON.stringify({
resetMe: {
resetMe: true,
}
});
setEntityCustomData(resetKey, entity, {
resetMe: true
})
});
}
@ -1132,16 +1126,15 @@ MasterReset = function() {
y: 0,
z: 0
},
linearDamping: 0.4
});
setEntityCustomData(resetKey, entity, {
resetMe: true
});
setEntityCustomData(GRABBABLE_DATA_KEY, entity, {
grabbable: false
linearDamping: 0.4,
userData: JSON.stringify({
resetMe: {
resetMe: true,
},
grabbableKey: {
grabbale: false
}
})
});
}
@ -1176,16 +1169,17 @@ MasterReset = function() {
y: 0,
z: 0
},
linearDamping: 0.2
});
setEntityCustomData(resetKey, entity, {
resetMe: true
});
setEntityCustomData(GRABBABLE_DATA_KEY, entity, {
linearDamping: 0.2,
userData: JSON.stringify({
resetMe: {
resetMe: true,
},
grabbaleKey: {
grabbable: false
}
})
});
}
function createBlocks(position) {
@ -1257,13 +1251,14 @@ MasterReset = function() {
x: 0,
y: -0.01,
z: 0
},
userData: JSON.stringify({
resetMe: {
resetMe: true,
}
})
});
//customKey, id, data
setEntityCustomData(resetKey, entity, {
resetMe: true
});
}
}
}