Merge branch 'homereset' of github.com:imgntn/hifi into homereset

This commit is contained in:
James B. Pollack 2016-04-05 18:23:46 -07:00
commit cb8adf6c2f
8 changed files with 59 additions and 88 deletions

View file

@ -21,7 +21,7 @@
},
"id": "{5371218c-e05b-49da-ac70-81f1f76c55ea}",
"modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx",
"name": "hifi-home-model-block",
"name": "home_model_block",
"position": {
"x": 0.69732666015625,
"y": 0.1600341796875,
@ -64,7 +64,7 @@
},
"id": "{ccc1198a-a501-48b8-959a-68297258aea7}",
"modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx",
"name": "hifi-home-model-block",
"name": "home_model_block",
"position": {
"x": 0.47344970703125,
"y": 0.06005859375,
@ -107,7 +107,7 @@
},
"id": "{3aaf5dd5-16d8-4852-880d-8256de68de19}",
"modelURL": "atp:/kineticObjects/blocks/planky_red.fbx",
"name": "hifi-home-model-block",
"name": "home_model_block",
"position": {
"x": 0.2613525390625,
"y": 0.01007080078125,
@ -150,7 +150,7 @@
},
"id": "{0474a29f-c45b-4d42-ae95-0c0bd1e6c501}",
"modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx",
"name": "hifi-home-model-block",
"name": "home_model_block",
"position": {
"x": 0.30487060546875,
"y": 0.01007080078125,
@ -193,7 +193,7 @@
},
"id": "{53e06851-8346-45ac-bdb5-0a74c99b5bd5}",
"modelURL": "atp:/kineticObjects/blocks/planky_green.fbx",
"name": "hifi-home-model-block",
"name": "home_model_block",
"position": {
"x": 0.40277099609375,
"y": 0.035064697265625,
@ -236,7 +236,7 @@
},
"id": "{38bcb70d-e384-4b60-878a-e34d4830f045}",
"modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx",
"name": "hifi-home-model-block",
"name": "home_model_block",
"position": {
"x": 0.54962158203125,
"y": 0.010040283203125,
@ -279,7 +279,7 @@
},
"id": "{fa8f8bbc-5bd0-4121-985d-75ce2f68eba1}",
"modelURL": "atp:/kineticObjects/blocks/planky_red.fbx",
"name": "hifi-home-model-block",
"name": "home_model_block",
"position": {
"x": 0.52001953125,
"y": 0.01007080078125,
@ -322,7 +322,7 @@
},
"id": "{d4b8582b-b707-453c-89c6-65e358da5cd7}",
"modelURL": "atp:/kineticObjects/blocks/planky_yellow.fbx",
"name": "hifi-home-model-block",
"name": "home_model_block",
"position": {
"x": 0.66876220703125,
"y": 0,
@ -365,7 +365,7 @@
},
"id": "{3b5b53fb-7ee5-44eb-9b81-8de8a525c433}",
"modelURL": "atp:/kineticObjects/blocks/planky_red.fbx",
"name": "hifi-home-model-block",
"name": "home_model_block",
"position": {
"x": 0.83819580078125,
"y": 0.135040283203125,
@ -408,7 +408,7 @@
},
"id": "{0d1f27e9-7e74-4263-9428-8c8f7aac94a6}",
"modelURL": "atp:/kineticObjects/blocks/planky_green.fbx",
"name": "hifi-home-model-block",
"name": "home_model_block",
"position": {
"x": 0.61773681640625,
"y": 0.0350341796875,
@ -451,7 +451,7 @@
},
"id": "{79ea518f-aac3-45ff-b22d-6d295b3c9e87}",
"modelURL": "atp:/kineticObjects/blocks/planky_green.fbx",
"name": "hifi-home-model-block",
"name": "home_model_block",
"position": {
"x": 0.7188720703125,
"y": 0.08502197265625,
@ -494,7 +494,7 @@
},
"id": "{ff470ff9-c889-4893-a25f-80895bff0e9a}",
"modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx",
"name": "hifi-home-model-block",
"name": "home_model_block",
"position": {
"x": 0.74981689453125,
"y": 0.010040283203125,
@ -537,7 +537,7 @@
},
"id": "{b5319f85-603d-436b-8bbe-fc9f798ca738}",
"modelURL": "atp:/kineticObjects/blocks/planky_green.fbx",
"name": "hifi-home-model-block",
"name": "home_model_block",
"position": {
"x": 0.8824462890625,
"y": 0.0350341796875,
@ -580,7 +580,7 @@
},
"id": "{944a4616-8dac-4d6a-a92b-49fa98514416}",
"modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx",
"name": "hifi-home-model-block",
"name": "home_model_block",
"position": {
"x": 0.963623046875,
"y": 0.010009765625,
@ -623,7 +623,7 @@
},
"id": "{ea6a1038-7047-4a1e-bdbd-076d6e41508c}",
"modelURL": "atp:/kineticObjects/blocks/planky_blue.fbx",
"name": "hifi-home-model-block",
"name": "home_model_block",
"position": {
"x": 0.49188232421875,
"y": 0.010040283203125,
@ -666,7 +666,7 @@
},
"id": "{ff65f5dd-2d53-4127-86da-05156a42946d}",
"modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx",
"name": "hifi-home-model-block",
"name": "home_model_block",
"position": {
"x": 0,
"y": 0.010101318359375,
@ -709,7 +709,7 @@
},
"id": "{3a9acd14-f754-4c70-b294-9f622c000785}",
"modelURL": "atp:/kineticObjects/blocks/planky_red.fbx",
"name": "hifi-home-model-block",
"name": "home_model_block",
"position": {
"x": 0.88006591796875,
"y": 0.010040283203125,
@ -752,7 +752,7 @@
},
"id": "{bb014301-247b-44d0-8b09-b830fea4439e}",
"modelURL": "atp:/kineticObjects/blocks/planky_natural.fbx",
"name": "hifi-home-model-block",
"name": "home_model_block",
"position": {
"x": 0.80487060546875,
"y": 0.010040283203125,

View file

@ -1,46 +1,5 @@
{
"Entities": [{
"collisionless": 1,
"color": {
"blue": 0,
"green": 0,
"red": 255
},
"created": "2016-03-24T22:17:16Z",
"dimensions": {
"x": 0.2776367485523224,
"y": 0.27723021268844604,
"z": 0.2535492241382599
},
"id": "{c7c6108b-4c60-4735-b2bf-5559d7e30e7d}",
"collisionless": 1,
"dynamic": 1,
"shapeType": "box",
"name": "home_box_livingRoomDeskLampTrigger",
"parentID": "{f59b50d8-13fb-4ceb-b80a-62cd03428a7c}",
"position": {
"x": 0.0062166899442672729,
"y": -0.1577162891626358,
"z": -0.0018789069727063179
},
"queryAACube": {
"scale": 6.92822265625,
"x": 1101.2117919921875,
"y": 456.86856079101562,
"z": -84.708488464355469
},
"rotation": {
"w": 0.84585332870483398,
"x": 1.52587890625e-05,
"y": 0.53337907791137695,
"z": -0.0001373291015625
},
"script": "atp:/switches/livingRoomDeskLamp.js",
"scriptTimestamp": 1458860464095,
"type": "Box",
"userData": "{\"hifiHomeKey\":{\"reset\":true},\"home-switch\":{\"state\":\"off\"}}",
"visible": 0
}, {
"color": {
"blue": 68,
"green": 252,
@ -56,9 +15,9 @@
"falloffRadius": 0.30000001192092896,
"id": "{47e2c415-854c-4b6a-b71e-06c760675afd}",
"intensity": 20,
"isSpotlight": 1,
"isSpotlight": 0,
"name": "home_light_livingRoomLight",
"parentID": "{c7c6108b-4c60-4735-b2bf-5559d7e30e7d}",
"parentID": "{f59b50d8-13fb-4ceb-b80a-62cd03428a7c}",
"position": {
"x": 0,
"y": -0.14917388558387756,
@ -133,6 +92,7 @@
"z": 0.26436954736709595
},
"dynamic": 1,
"script": "atp:/switches/livingRoomDeskLamp.js",
"gravity": {
"x": 0,
"y": -10,
@ -160,7 +120,7 @@
},
"shapeType": "compound",
"type": "Model",
"userData": "{\"hifiHomeKey\":{\"reset\":true}}",
"userData": "{\"hifiHomeKey\":{\"reset\":true},\"home-switch\":{\"state\":\"off\"}}",
"velocity": {
"x": -0.0026286719366908073,
"y": 0.0016162246465682983,

View file

@ -17,6 +17,7 @@ var COLLISION_HULL_URL = 'atp:/pingPongGun/Pingpong-Gun-New.obj';
HomePingPongGun = function(spawnPosition, spawnRotation) {
var pingPongGun = Entities.addEntity({
type: "Model",
name: "home_model_pingPongGun"
modelURL: MODEL_URL,
shapeType: 'compound',
compoundShapeURL: COLLISION_HULL_URL,

View file

@ -19,7 +19,7 @@
this.toggleLights();
},
startNearTrigger: function() {
startNearGrab: function() {
this.toggleLights();
},
@ -67,8 +67,6 @@
if (properties.name === _this.lightName) {
print("EBL FOUND THE LIGHT!");
found.push(result);
} else {
print("EBL DID NOT FIND THE LIGHT!");
}
});
return found;
@ -132,10 +130,6 @@
preload: function(entityID) {
print("EBL PRELOAD LIGHT SWITCH SCRIPT");
this.entityID = entityID;
setEntityCustomData('grabbableKey', this.entityID, {
wantsTrigger: true
});
var properties = Entities.getEntityProperties(this.entityID);

View file

@ -84,15 +84,20 @@
var otherProps = Entities.getEntityProperties(otherID);
if (otherProps.name === 'home_model_homeset') {
var userData = getEntityUserData(_this.entityID);
Entities.editEntity(_this.entityID) {
Entities.editEntity(_this.entityID, {
position: userData.originalPosition,
rotation: userData.originalRotation,
velocity: {
x: 0,
y: -0.01,
z: 0
},
angularVelocity: {
x: 0,
y: 0,
z: 0
}
}
});
}
},

View file

@ -67,34 +67,22 @@
visible: false
});
// Once user releases marker, wait a bit then put marker back to its original position and rotation
// Script.setTimeout(function() {
// var userData = getEntityUserData(_this.entityID);
// Entities.editEntity(_this.entityID, {
// position: userData.originalPosition,
// rotation: userData.originalRotation,
// velocity: {
// x: 0,
// y: -0.01,
// z: 0
// }
// });
// }, _this.MARKER_RESET_WAIT_TIME);
},
collisionWithEntity: function(myID, otherID, collision) {
var otherProps = Entities.getEntityProperties(otherID);
if (otherProps.name === 'home_model_homeset') {
var userData = getEntityUserData(_this.entityID);
Entities.editEntity(_this.entityID) {
Entities.editEntity(_this.entityID, {
position: userData.originalPosition,
rotation: userData.originalRotation,
velocity: {
x: 0,
y: -0.01,
z: 0
}
}
},
angularVelocity: {x: 0, y: 0, z: 0}
})
}
},
continueEquip: function() {

View file

@ -0,0 +1,12 @@
var whiteboardPath = Script.resolvePath('wrapper.js');
Script.include(whiteboardPath);
var whiteboard = new Whiteboard({
x: 1104,
y: 460.5,
z: -77
}, {
x: 0,
y: -133,
z: 0
});

View file

@ -25,8 +25,10 @@ Whiteboard = function(spawnPosition, spawnRotation) {
});
var whiteboardPosition = spawnPosition;
var whiteboardRotation = orientation;
var WHITEBOARD_MODEL_URL = "atp:/whiteboard/Whiteboard-4.fbx";
var WHITEBOARD_COLLISION_HULL_URL = "atp:/whiteboard/whiteboardCollisionHull.obj";
var whiteboard = Entities.addEntity({
type: "Model",
name: "home_model_whiteboard",
@ -92,8 +94,13 @@ Whiteboard = function(spawnPosition, spawnRotation) {
var WHITEBOARD_RACK_DEPTH = 1.9;
// ************ ERASER ************************************************
var ERASER_MODEL_URL = "atp:/whiteboard/eraser-2.fbx";
var eraserPosition = Vec3.sum(spawnPosition, Vec3.multiply(Quat.getFront(whiteboardRotation), -0.1));
eraserPosition = Vec3.sum(eraserPosition, Vec3.multiply(-0.5, Quat.getRight(whiteboardRotation)));
var eraserRotation = markerRotation;
@ -156,12 +163,16 @@ Whiteboard = function(spawnPosition, spawnRotation) {
}
// *************************************************************************************************
function createMarkers() {
var modelURLS = [
"atp:/whiteboard/marker-blue.fbx",
"atp:/whiteboard/marker-red.fbx",
"atp:/whiteboard/marker-black.fbx",
];
var markerPosition = Vec3.sum(spawnPosition, Vec3.multiply(Quat.getFront(whiteboardRotation), -0.1));
createMarker(modelURLS[0], markerPosition, {
@ -196,7 +207,7 @@ Whiteboard = function(spawnPosition, spawnRotation) {
dynamic: true,
gravity: {
x: 0,
y: -10,
y: -5,
z: 0
},
velocity: {