fixed merge conflicts

This commit is contained in:
ericrius1 2016-03-31 17:16:36 -07:00
commit 39f5ed443a
20 changed files with 239 additions and 495 deletions

BIN
cmake/installer/Thumbs.db Normal file

Binary file not shown.

BIN
interface/icon/Thumbs.db Normal file

Binary file not shown.

View file

@ -1,36 +0,0 @@
//v1.0
var center = Vec3.sum(Vec3.sum(MyAvatar.position, {
x: 0,
y: 0.5,
z: 0
}), Vec3.multiply(2, Quat.getFront(Camera.getOrientation())));
var SCRIPT_URL = Script.resolvePath('reset.js?' + Math.random());
function createTidyGuy() {
var properties = {
type: 'Model',
modelURL: 'http://hifi-content.s3.amazonaws.com/DomainContent/Home/tidyGuy/Tidyguy-6.fbx',
dimensions: {
x: 0.32,
y: 0.96,
z: 0.6844
},
position: center,
script: SCRIPT_URL,
dynamic:false,
userData:JSON.stringify({
grabbableKey:{
wantsTrigger:true
}
})
}
return Entities.addEntity(properties);
}
var tidyGuy = createTidyGuy();
Script.scriptEnding.connect(function() {
Entities.deleteEntity(tidyGuy);
})

View file

@ -3,7 +3,7 @@
(function() {
var TRIGGER_DISTANCE = 0.85;
var TRANSFORMATION_SOUND_URL = '';
var _this;
@ -28,9 +28,9 @@
var otherProps = Entities.getEntityProperties(otherID);
if (otherProps.name === "hifi-home-dressing-room-transformer-collider" && _this.locked === false) {
print('UNLOCKED TRANSFORMER COLLIDED WITH BASE!! THE AVATAR WHO SIMULATED THIS COLLISION IS:: ' + MyAvatar.sessionUUID);
_this.locked = true;
_this.findRotatorBlock();
this.locked = true;
} else {
return;
}
@ -44,12 +44,6 @@
});
},
createTransformationParticles: function() {
print('transformer should create particles')
var particleProps = {};
Entities.addEntity(particleProps);
},
findRotatorBlock: function() {
print('transformer should find rotator block')
var myProps = Entities.getEntityProperties(_this.entityID);
@ -59,6 +53,7 @@
if (resultProps.name === "hifi-home-dressing-room-rotator-block") {
_this.rotatorBlock = result;
_this.removeCurrentBigVersion(result);
return;
}
});
@ -67,8 +62,6 @@
removeCurrentBigVersion: function(rotatorBlock) {
print('transformer should remove big version')
var blacklistKey = 'Hifi-Hand-RayPick-Blacklist';
var myProps = Entities.getEntityProperties(_this.entityID);
var results = Entities.findEntities(myProps.position, 10);
results.forEach(function(result) {
@ -80,16 +73,16 @@
}));
Entities.deleteEntity(result);
return;
}
});
_this.createBigVersion(myProps);
_this.createBigVersion();
},
createBigVersion: function(smallProps) {
print('transformer should create big version!!')
createBigVersion: function() {
var smallProps = Entities.getEntityProperties(_this.entityID);
print('transformer should create big version!!' + smallProps.modelURL);
print('transformer has rotatorBlock??' + _this.rotatorBlock);
var rotatorProps = Entities.getEntityProperties(_this.rotatorBlock);
var bigVersionProps = {
@ -149,65 +142,16 @@
var baseRotation = userData["hifiHomeTransformerKey"].baseRotation;
littleVersionProps.position = basePosition;
littleVersionProps.rotation = baseRotation;
// print('transformer new version ' + JSON.stringify(littleVersionProps));
var littleTransformer = Entities.addEntity(littleVersionProps);
print('little transformer:: ' + littleTransformer);
_this.removeSelf();
},
removeSelf: function() {
print('transformer should remove itself')
var success = Entities.deleteEntity(_this.entityID);
print('transformer actually deleted self: ' + success);
},
};
function getJointData(avatar) {
//can you do this for an arbitrary model?
var allJointData = [];
var jointNames = MyAvatar.jointNames;
jointNames.forEach(function(joint, index) {
var translation = MyAvatar.getJointTranslation(index);
var rotation = MyAvatar.getJointRotation(index)
allJointData.push({
joint: joint,
index: index,
translation: translation,
rotation: rotation
});
});
return allJointData;
}
function getAvatarFootOffset() {
var data = getJointData();
var upperLeg, lowerLeg, foot, toe, toeTop;
data.forEach(function(d) {
var jointName = d.joint;
if (jointName === "RightUpLeg") {
upperLeg = d.translation.y;
}
if (jointName === "RightLeg") {
lowerLeg = d.translation.y;
}
if (jointName === "RightFoot") {
foot = d.translation.y;
}
if (jointName === "RightToeBase") {
toe = d.translation.y;
}
if (jointName === "RightToe_End") {
toeTop = d.translation.y
}
})
var myPosition = MyAvatar.position;
var offset = upperLeg + lowerLeg + foot + toe + toeTop;
offset = offset / 100;
return offset
}
return new Transformer();
})

View file

@ -38,22 +38,8 @@
script: TRANSFORMER_SCRIPT
}
var transformer = Entities.addEntity(transformerProps);
// Script.setTimeout(function() {
// var actualProps = Entities.getEntityProperties(transformer);
// var quarterSize = Vec3.multiply(SHRINK_AMOUNT, actualProps.naturalDimensions);
// Entities.editEntity(transformer, {
// dimensions: quarterSize,
// visible:true,
// // velocity: {
// // x: 0,
// // y: -0.1,
// // z: 0
// // }
// });
// }, 1000)
print('CREATED TRANSFORMER' + transformer);
// print('at location: ' + JSON.stringify(transformerProps.position))
return this;
}

View file

@ -1,16 +1,16 @@
var fishTankPath = Script.resolvePath('wrapper.js');
Script.include(fishTankPath);
var center = Vec3.sum(Vec3.sum(MyAvatar.position, {
x: 0,
y: 0.5,
z: 0
}), Vec3.multiply(1, Quat.getFront(Camera.getOrientation())));
var fishTank = new FishTank(center, {
x: 0,
y: 0,
z: 0
});
var fishTankPath = Script.resolvePath('wrapper.js');
Script.include(fishTankPath);
var center = Vec3.sum(Vec3.sum(MyAvatar.position, {
x: 0,
y: 0.5,
z: 0
}), Vec3.multiply(1, Quat.getFront(Camera.getOrientation())));
var fishTank = new FishTank(center, {
x: 0,
y: 0,
z: 0
});
Script.scriptEnding.connect(function() {
fishtank.cleanup()
})
Script.scriptEnding.connect(function() {
fishtank.cleanup()
})

View file

@ -13,7 +13,7 @@
var TANK_SCRIPT = Script.resolvePath('entityLocalFish.js');
FishTank = function(spawnPosition, spawnRotation) {
var fishTank, tankBase, bubbleSystem, secondBubbleSystem, thirdBubbleSystem, anemone, treasure, rocks;
var fishTank, innerTank, tankBase, bubbleSystem, secondBubbleSystem, thirdBubbleSystem, anemone, treasure, rocks;
var CLEANUP = true;
var TANK_DIMENSIONS = {
@ -22,11 +22,11 @@ FishTank = function(spawnPosition, spawnRotation) {
z: 2.1404
};
// var INNER_TANK_SCALE = 0.7;
// var INNER_TANK_DIMENSIONS = Vec3.multiply(INNER_TANK_SCALE, TANK_DIMENSIONS);
// INNER_TANK_DIMENSIONS.y = INNER_TANK_DIMENSIONS.y - 0.4;
// var TANK_WIDTH = TANK_DIMENSIONS.z;
// var TANK_HEIGHT = TANK_DIMENSIONS.y;
var INNER_TANK_SCALE = 0.85;
var INNER_TANK_DIMENSIONS = Vec3.multiply(INNER_TANK_SCALE, TANK_DIMENSIONS);
INNER_TANK_DIMENSIONS.y = INNER_TANK_DIMENSIONS.y - 0.2;
var TANK_WIDTH = TANK_DIMENSIONS.z;
var TANK_HEIGHT = TANK_DIMENSIONS.y;
var DEBUG_COLOR = {
red: 255,
@ -64,10 +64,9 @@ FishTank = function(spawnPosition, spawnRotation) {
var bubbleSound = SoundCache.getSound(BUBBLE_SOUND_URL);
var ANEMONE_FORWARD_OFFSET = TANK_DIMENSIONS.x - 0.35;
var ANEMONE_LATERAL_OFFSET = -0.05;
var ANEMONE_VERTICAL_OFFSET = -0.12;
var ANEMONE_FORWARD_OFFSET = -TANK_DIMENSIONS.x+0.06;
var ANEMONE_LATERAL_OFFSET = 0.2;
var ANEMONE_VERTICAL_OFFSET = -0.16;
var ANEMONE_MODEL_URL = 'atp:/fishTank/anemone.fbx';
var ANEMONE_ANIMATION_URL = 'atp:/fishTank/anemone.fbx';
@ -89,9 +88,9 @@ FishTank = function(spawnPosition, spawnRotation) {
z: 1.64
}
var TREASURE_FORWARD_OFFSET = -TANK_DIMENSIONS.x;
var TREASURE_LATERAL_OFFSET = -0.15;
var TREASURE_VERTICAL_OFFSET = -0.23;
var TREASURE_FORWARD_OFFSET = TANK_DIMENSIONS.x - 0.075;
var TREASURE_LATERAL_OFFSET = 0.15;
var TREASURE_VERTICAL_OFFSET = -0.26;
var TREASURE_MODEL_URL = 'atp:/fishTank/Treasure-Chest2-SM.fbx';
@ -111,7 +110,6 @@ FishTank = function(spawnPosition, spawnRotation) {
rotation: Quat.fromPitchYawRollDegrees(spawnRotation.x, spawnRotation.y, spawnRotation.z),
color: DEBUG_COLOR,
collisionless: true,
script: TANK_SCRIPT,
visible: true,
userData: JSON.stringify({
'hifiHomeKey': {
@ -274,7 +272,7 @@ FishTank = function(spawnPosition, spawnRotation) {
modelURL: TREASURE_MODEL_URL,
position: finalPosition,
dimensions: TREASURE_DIMENSIONS,
rotation: Quat.fromPitchYawRollDegrees(10, 135, 10),
rotation: Quat.fromPitchYawRollDegrees(10, 35, 10),
userData: JSON.stringify({
'hifiHomeKey': {
'reset': true
@ -310,10 +308,38 @@ FishTank = function(spawnPosition, spawnRotation) {
tankBase = Entities.addEntity(properties);
}
function createInnerTank() {
var properties = {
dimensions: INNER_TANK_DIMENSIONS,
name: 'hifi-home-fishtank-inner-tank',
type: 'Box',
visible: true,
color: {
red: 255,
green: 0,
blue: 255
},
position: TANK_POSITION,
rotation: Quat.fromPitchYawRollDegrees(spawnRotation.x, spawnRotation.y, spawnRotation.z),
collisionless: true,
script: TANK_SCRIPT,
visible: false,
userData: JSON.stringify({
'hifiHomeKey': {
'reset': true
}
}),
}
print('INNER TANK PROPS ' + properties)
innerTank = Entities.addEntity(properties);
}
createFishTank();
createBubbleSystems();
createInnerTank();
createAnenome();
createRocks();
@ -330,6 +356,7 @@ FishTank = function(spawnPosition, spawnRotation) {
Entities.deleteEntity(thirdBubbleSystem);
Entities.deleteEntity(anemone);
Entities.deleteEntity(rocks);
Entities.deleteEntity(innerTank);
}
this.cleanup = cleanup;

View file

@ -13,18 +13,16 @@
//
var PLANT_SCRIPT_URL = Script.resolvePath("atp:/growingPlant/growingPlantEntityScript.js");
var WATER_CAN_SCRIPT_URL = Script.resolvePath("atp:/growingPlant/waterCanEntityScript.js");
Plant = function(spawnPosition, spawnRotation) {
print("EBL PLANT CONSTRUCTOR!")
var orientation;
if (spawnRotation !== undefined) {
orientation = Quat.fromPitchYawRollDegrees(spawnRotation.x, spawnRotation.y, spawnRotation.z);
} else {
orientation = Camera.getOrientation();
}
print("EBL ORIENTATION " + JSON.stringify(orientation));
var bowlPosition = spawnPosition;
var BOWL_MODEL_URL = "atp:/growingPlant/Flowers-Bowl.fbx";
var BOWL_COLLISION_HULL_URL = "atp:/growingPlant/bowl.obj";
var bowlDimensions = {
x: 0.518,
@ -38,7 +36,7 @@ Plant = function(spawnPosition, spawnRotation) {
dynamic: true,
shapeType: 'compound',
compoundShapeURL: BOWL_COLLISION_HULL_URL,
name: "home_model_plantNowl",
name: "home_model_plantBowl",
position: bowlPosition,
userData: JSON.stringify({
'hifiHomeKey': {
@ -60,6 +58,7 @@ Plant = function(spawnPosition, spawnRotation) {
y: plantDimensions.y / 2,
z: 0
});
var plant = Entities.addEntity({
type: "Model",
modelURL: PLANT_MODEL_URL,
@ -75,9 +74,9 @@ Plant = function(spawnPosition, spawnRotation) {
}),
});
var WATER_CAN_MODEL_URL = "atp:/growingPlant/waterCan.fbx";
var WATER_CAN_COLLIISION_HULL_URL = "atp:/growingPlant/can.obj";
var waterCanPosition = Vec3.sum(plantPosition, Vec3.multiply(0.6, Quat.getRight(orientation)));
var waterCanRotation = orientation;
var waterCan = Entities.addEntity({
@ -92,6 +91,8 @@ Plant = function(spawnPosition, spawnRotation) {
y: 0.2762,
z: 0.4115
},
shapeType: 'compound',
compoundShapeURL: WATER_CAN_COLLIISION_HULL_URL,
position: waterCanPosition,
collisionSoundURL: "atp:/growingPlant/watering_can_drop.L.wav",
angularDamping: 1,

View file

@ -0,0 +1,39 @@
{
"Entities": [
{
"collisionsWillMove": 1,
"compoundShapeURL": "atp:/kineticObjects/blueChair/Comfy_Chair_Blue_hull.obj",
"created": "2016-03-29T17:37:52Z",
"dimensions": {
"x": 0.99695134162902832,
"y": 1.23363196849823,
"z": 1.0726165771484375
},
"dynamic": 1,
"gravity": {
"x": 0,
"y": -10,
"z": 0
},
"id": "{51a44c3a-ec4a-4c79-8034-aeb5c45660b5}",
"modelURL": "atp:/kineticObjects/blueChair/Comfy_Chair_Blue.fbx",
"name": "home_model_comfyChair",
"queryAACube": {
"scale": 1.9147497415542603,
"x": -0.95737487077713013,
"y": -0.95737487077713013,
"z": -0.95737487077713013
},
"rotation": {
"w": 0.46746015548706055,
"x": -0.0017547607421875,
"y": 0.88400089740753174,
"z": 0.0024261474609375
},
"shapeType": "compound",
"type": "Model",
"userData": "{\"hifiHomeKey\":{\"reset\":true}}",
}
],
"Version": 57
}

View file

@ -2,7 +2,7 @@
"Entities": [{
"userData": "{\"hifiHomeKey\":{\"reset\":true}}",
"name": "hifi-home-model-chair",
"compoundShapeURL": "atp:/kineticObjects/simple-chair2.obj",
"compoundShapeURL": "atp:/kineticObjects/deskChair/simple-chair2.obj",
"created": "2016-03-07T21:07:29Z",
"dimensions": {
"x": 0.66077238321304321,
@ -16,7 +16,7 @@
"z": 0
},
"id": "{d97c8a4e-9b95-448c-a729-5da9e22b6adc}",
"modelURL": "atp:/models/simple-chair2.fbx",
"modelURL": "atp:/kineticObjects/deskChair/simple-chair2.fbx",
"queryAACube": {
"scale": 1.439794659614563,
"x": -0.71989732980728149,

View file

@ -1,36 +0,0 @@
{
"Entities": [{
"name":"hifi_home_model_desk_drawer_left",
"compoundShapeURL": "http://hifi-content.s3.amazonaws.com/alan/dev/desk-drawer-1.obj",
"created": "2016-03-15T21:26:11Z",
"dimensions": {
"x": 0.87835502624511719,
"y": 0.32454308867454529,
"z": 0.71838575601577759
},
"gravity": {
"x": 0,
"y": -1,
"z": 0
},
"dynamic": 1,
"id": "{a87cc972-aaf5-48a4-b720-d79ee7bd68d9}",
"modelURL": "http://hifi-content.s3.amazonaws.com/alan/dev/desk-drawer-1.fbx",
"queryAACube": {
"scale": 1.1802177429199219,
"x": -0.59010887145996094,
"y": -0.59010887145996094,
"z": -0.59010887145996094
},
"rotation": {
"w": 0.9542534351348877,
"x": -4.57763671875e-05,
"y": 0.29893946647644043,
"z": -1.52587890625e-05
},
"shapeType": "compound",
"type": "Model",
"userData": "{\"hifiHomeKey\":{\"reset\":true}}"
}],
"Version": 57
}

View file

@ -1,36 +0,0 @@
{
"Entities": [{
"name": "hifi_home_model_desk_drawer_right",
"compoundShapeURL": "http://hifi-content.s3.amazonaws.com/alan/dev/desk-drawer-2.obj",
"created": "2016-03-15T21:26:11Z",
"dimensions": {
"x": 0.8697468638420105,
"y": 0.31825172901153564,
"z": 1.1220188140869141
},
"gravity": {
"x": 0,
"y": -1,
"z": 0
},
"dynamic": 1,
"id": "{ae1fa8dd-1167-40c1-8fa7-aeb12ee7b12c}",
"modelURL": "http://hifi-content.s3.amazonaws.com/alan/dev/desk-drawer-2.fbx",
"queryAACube": {
"scale": 1.4548780918121338,
"x": -0.72743904590606689,
"y": -0.72743904590606689,
"z": -0.72743904590606689
},
"rotation": {
"w": 0.9539787769317627,
"x": -7.62939453125e-05,
"y": 0.29982447624206543,
"z": -1.52587890625e-05
},
"shapeType": "compound",
"type": "Model",
"userData": "{\"hifiHomeKey\":{\"reset\":true}}"
}],
"Version": 57
}

View file

@ -3,9 +3,9 @@ print('KINETIC INCLUDING WRAPPER')
var BOOKS_URL = "atp:/kineticObjects/books.json"
var UPPER_BOOKSHELF_URL = "atp:/kineticObjects/upperBookShelf.json"
var LOWER_BOOKSHELF_URL = "atp:/kineticObjects/lowerBookShelf.json"
var RIGHT_DESK_DRAWER_URL = "atp:/kineticObjects/rightDeskDrawer.json"
var LEFT_DESK_DRAWER_URL = "atp:/kineticObjects/leftDeskDrawer.json"
var CHAIR_URL = 'atp:/JSON/chair.json';
var CHAIR_URL = 'atp:/kineticObjects/deskChair.json';
var BLUE_CHAIR_URL = 'atp:/kineticObjects/blueChair.json';
var FRUIT_BOWL_URL = "atp:/kineticObjects/fruit.json"
@ -109,53 +109,6 @@ LowerBookShelf = function(spawnLocation, spawnRotation) {
this.cleanup = cleanup;
}
RightDeskDrawer = function(spawnLocation, spawnRotation) {
print('CREATE RIGHT DRAWER')
var created = [];
function create() {
var success = Clipboard.importEntities(RIGHT_DESK_DRAWER_URL);
if (success === true) {
created = Clipboard.pasteEntities(spawnLocation)
print('created ' + created);
}
};
function cleanup() {
created.forEach(function(obj) {
Entities.deleteEntity(obj);
})
};
create();
this.cleanup = cleanup;
}
LeftDeskDrawer = function(spawnLocation, spawnRotation) {
print('CREATE LEFT DRAWER')
var created = [];
function create() {
var success = Clipboard.importEntities(LEFT_DESK_DRAWER_URL);
if (success === true) {
created = Clipboard.pasteEntities(spawnLocation)
print('created ' + created);
}
};
function cleanup() {
created.forEach(function(obj) {
Entities.deleteEntity(obj);
})
};
create();
this.cleanup = cleanup;
}
Chair = function(spawnLocation, spawnRotation) {
print('CREATE CHAIR')
var created = [];
@ -179,6 +132,29 @@ Chair = function(spawnLocation, spawnRotation) {
this.cleanup = cleanup;
}
BlueChair = function(spawnLocation, spawnRotation) {
print('CREATE BLUE CHAIR')
var created = [];
function create() {
var success = Clipboard.importEntities(BLUE_CHAIR_URL);
if (success === true) {
created = Clipboard.pasteEntities(spawnLocation)
print('created ' + created);
}
};
function cleanup() {
created.forEach(function(obj) {
Entities.deleteEntity(obj);
})
};
create();
this.cleanup = cleanup;
}
Trashcan = function(spawnLocation, spawnRotation) {
print('CREATE TRASHCAN')
var created = [];

View file

@ -49,7 +49,6 @@ HomeMusicBox = function(spawnPosition, spawnRotation) {
var LID_OFFSET = {
x: 0,
y: BASE_DIMENSIONS.y / 2,
// y: BASE_DIMENSIONS.y / 2 + (LID_DIMENSIONS.y / 2),
z: 0
};
@ -103,8 +102,8 @@ HomeMusicBox = function(spawnPosition, spawnRotation) {
type: 'Model',
modelURL: LID_MODEL_URL,
dimensions: LID_DIMENSIONS,
position: backPosition,
registrationPoint: LID_REGISTRATION_POINT,
position: baseProps.position,
registrationPoint: LID_REGISTRATION_POINT,
dynamic: false,
script: LID_SCRIPT_URL,
collidesWith: 'myAvatar,otherAvatar',

View file

@ -62,41 +62,43 @@
Reset.prototype = {
tidying: false,
preload: function(entityID) {
_this.entityID = entityID;
},
showTidyingButton: function() {
var data = {
"Texture.001": "atp:/Tidyguy-7.fbx/Tidyguy-7.fbm/Head-Housing-Texture.png",
"button.tidy": "atp:/Tidyguy-7.fbx/Tidyguy-7.fbm/Tidy-Up-Button-Orange.png",
"button.tidy-active": "atp:/Tidyguy-7.fbx/Tidyguy-7.fbm/Tidy-Up-Button-Orange.png",
"button.tidy-active.emit": "atp:/Tidyguy-7.fbx/Tidyguy-7.fbm/Tidy-Up-Button-Orange-Emit.png",
"button.tidy.emit": "atp:/Tidyguy-7.fbx/Tidyguy-7.fbm/Tidy-Up-Button-Orange-Emit.png",
"tex.button.blanks": "atp:/Tidyguy-7.fbx/Tidyguy-7.fbm/Button-Blanks.png",
"tex.button.blanks.normal": "atp:/Tidyguy-7.fbx/Tidyguy-7.fbm/Button-Blanks-Normal.png",
"tex.face.sceen": "atp:/Tidyguy-7.fbx/Tidyguy-7.fbm/tidy-guy-face.png",
"tex.face.screen.emit": "atp:/Tidyguy-7.fbx/Tidyguy-7.fbm/tidy-guy-face-Emit.png"
}
Entities.editEntity(_this.entityID, {
textures: {
"Texture.001": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/Head-Housing-Texture.png",
"button.tidy": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/Tidy-Up-Button-Orange.png",
"button.tidy.emit": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/Tidy-Up-Button-Orange-Emit.png",
"tex.button.blanks": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/Button-Blanks.png",
"tex.button.blanks.normal": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/Button-Blanks-Normal.png",
"tex.face.sceen": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/tidy-guy-face.png",
"tex.face.screen.emit": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/tidy-guy-face-Emit.png"
}
textures: JSON.stringify(data)
});
},
showTidyButton: function() {
var data = {
"Texture.001": "atp:/Tidyguy-7.fbx/Tidyguy-7.fbm/Head-Housing-Texture.png",
"button.tidy": "atp:/Tidyguy-7.fbx/Tidyguy-7.fbm/Tidy-Up-Button-Green.png",
"button.tidy.emit": "atp:/Tidyguy-7.fbx/Tidyguy-7.fbm/Tidy-Up-Button-Green-Emit.png",
"tex.button.blanks": "atp:/Tidyguy-7.fbx/Tidyguy-7.fbm/Button-Blanks.png",
"tex.button.blanks.normal": "atp:/Tidyguy-7.fbx/Tidyguy-7.fbm/Button-Blanks-Normal.png",
"tex.face.sceen": "atp:/Tidyguy-7.fbx/Tidyguy-7.fbm/tidy-guy-face.png",
"tex.face.screen.emit": "atp:/Tidyguy-7.fbx/Tidyguy-7.fbm/tidy-guy-face-Emit.png"
}
Entities.editEntity(_this.entityID, {
textures: {
"Texture.001": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/Head-Housing-Texture.png",
"button.tidy": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/Tidy-Up-Button-Green.png",
"button.tidy.emit": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/Tidy-Up-Button-Green-Emit.png",
"tex.button.blanks": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/Button-Blanks.png",
"tex.button.blanks.normal": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/Button-Blanks-Normal.png",
"tex.face.sceen": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/tidy-guy-face.png",
"tex.face.screen.emit": "atp:/Tidyguy-6.fbx/Tidyguy-6.fbm/tidy-guy-face-Emit.png"
}
textures: JSON.stringify(data)
});
},
@ -235,24 +237,19 @@
z: -80.2837
});
var rightDeskDrawer = new RightDeskDrawer({
x: 1105.1735,
y: 460.0446,
z: -81.3612
});
var leftDeskDrawer = new LeftDeskDrawer({
x: 1104.6478,
y: 460.0463,
z: -82.1095
});
var chair = new Chair({
x: 1105.2716,
y: 459.7251,
z: -79.8097
});
// var comfyChair = new BlueChair({
// x: 1100.4821,
// y: 459.8161,
// z:-75.9071
// });
var trashcan = new Trashcan({
x: 1103.9034,
y: 459.4355,
@ -290,20 +287,24 @@
var rotatorBlockProps = {
name: 'hifi-home-dressing-room-rotator-block',
type: 'Box',
visible: true,
visible: false,
color: {
red: 0,
green: 255,
blue: 0
},
dimensions: {
x: 0.5,
y: 0.5,
z: 0.5
x: 1.0000,
y: 0.0367,
z: 1.0000
},
collisionless: true,
angularDamping: 0,
angularVelocity: Quat.fromPitchYawRollDegrees(0, 6, 0),
angularVelocity: {
x: 0,
y: 0.10472,
z: 0
},
dynamic: false,
userData: JSON.stringify({
'hifiHomeKey': {
@ -311,10 +312,15 @@
}
}),
position: {
x: 1107.0330,
y: 460.4326,
z: -74.5704
}
x: 1106.9778,
y: 460.6075,
z: -74.5842
},
userData: JSON.stringify({
'hifiHomeKey': {
'reset': true
}
})
}
var rotatorBlock = Entities.addEntity(rotatorBlockProps);

View file

@ -26,14 +26,29 @@
},
modelEmitOn: function(glowDisc) {
Entities.editEntity(glowDisc, {
textures: 'Metal-brushed-light.jpg:"https://s3-us-west-1.amazonaws.com/hifi-content/alan/dev/Lights-Dressing-Room-3.fbx/Lights-Dressing-Room-3.fbm/Metal-brushed-light.jpg",\nTex.CeilingLight-Emit:"http://hifi-content.s3.amazonaws.com/alan/dev/Lights-Dressing-Room-3.fbx/Lights-Dressing-Room-3.fbm/CielingLight-On-Diffuse.jpg",\nTexCeilingLight.Diffuse:"https://s3-us-west-1.amazonaws.com/hifi-content/alan/dev/Lights-Dressing-Room-3.fbx/Lights-Dressing-Room-3.fbm/CielingLight-Base.jpg"'
var data = {
"Metal-brushed-light.jpg": "atp:/models/Lights-Dressing-Room-3.fbx/Lights-Dressing-Room-3.fbm/Metal-brushed-light.jpg",
"Tex.CeilingLight-Diffuse": "atp:/models/Lights-Dressing-Room-3.fbx/Lights-Dressing-Room-3.fbm/CielingLight-Base.jpg",
"Tex.CeilingLight-Emit": "atp:/models/Lights-Dressing-Room-3.fbx/Lights-Dressing-Room-3.fbm/CielingLight-On-Diffuse.jpg"
}
Entities.editEntity(glowDisc, {
textures: JSON.stringify(data)
});
},
modelEmitOff: function(glowDisc) {
Entities.editEntity(glowDisc, {
textures: 'Metal-brushed-light.jpg:"https://s3-us-west-1.amazonaws.com/hifi-content/alan/dev/Lights-Dressing-Room-3.fbx/Lights-Dressing-Room-3.fbm/Metal-brushed-light.jpg",\nTex.CeilingLight-Emit:"",\nTexCeilingLight.Diffuse:"https://s3-us-west-1.amazonaws.com/hifi-content/alan/dev/Lights-Dressing-Room-3.fbx/Lights-Dressing-Room-3.fbm/CielingLight-Base.jpg"'
var data = {
"Metal-brushed-light.jpg": "atp:/models/Lights-Dressing-Room-3.fbx/Lights-Dressing-Room-3.fbm/Metal-brushed-light.jpg",
"Tex.CeilingLight-Diffuse": "atp:/models/Lights-Dressing-Room-3.fbx/Lights-Dressing-Room-3.fbm/CielingLight-Base.jpg",
"Tex.CeilingLight-Emit": ""
}
Entities.editEntity(glowDisc, {
textures: JSON.stringify(data)
});
},
@ -100,7 +115,9 @@
toggleLights: function() {
_this._switch = getEntityCustomData('home-switch', _this.entityID, {state: 'off'});
_this._switch = getEntityCustomData('home-switch', _this.entityID, {
state: 'off'
});
var glowLights = this.findGlowLights();
var masterLights = this.findMasterLights();

View file

@ -1,155 +0,0 @@
(function() {
var SEARCH_RADIUS = 10;
var _this;
var utilitiesScript = Script.resolvePath('../utils.js');
Script.include(utilitiesScript);
Switch = function() {
_this = this;
this.switchSound = SoundCache.getSound("atp:/switches/lamp_switch_2.wav");
};
Switch.prototype = {
prefix: 'hifi-home-lab-desk-lamp',
clickReleaseOnEntity: function(entityID, mouseEvent) {
if (!mouseEvent.isLeftButton) {
return;
}
this.toggleLights();
},
startNearTrigger: function() {
this.toggleLights();
},
modelEmitOn: function(discModel) {
Entities.editEntity(glowDisc, {
textures: {
"Tex.Lamp-Bulldog": "http://hifi-content.s3.amazonaws.com/alan/dev/Lamp-Bulldog-Base.fbx/Lamp-Bulldog-Base.fbm/dog_statue.jpg",
"Texture.001": "http://hifi-content.s3.amazonaws.com/alan/dev/Lamp-Bulldog-Base.fbx/Lamp-Bulldog-Base.fbm/Emissive-Map.png"
}
})
},
modelEmitOff: function(discModel) {
Entities.editEntity(glowDisc, {
textures: {
"Tex.Lamp-Bulldog": "http://hifi-content.s3.amazonaws.com/alan/dev/Lamp-Bulldog-Base.fbx/Lamp-Bulldog-Base.fbm/dog_statue.jpg",
"Texture.001": ""
}
})
},
masterLightOn: function(masterLight) {
Entities.editEntity(masterLight, {
visible: true
});
},
masterLightOff: function() {
Entities.editEntity(masterLight, {
visible: false
});
},
findMasterLights: function() {
var found = [];
var results = Entities.findEntities(this.position, SEARCH_RADIUS);
results.forEach(function(result) {
var properties = Entities.getEntityProperties(result);
if (properties.name === _this.prefix + "spotlight") {
found.push(result);
}
});
return found;
},
findEmitModels: function() {
var found = [];
var results = Entities.findEntities(this.position, SEARCH_RADIUS);
results.forEach(function(result) {
var properties = Entities.getEntityProperties(result);
if (properties.name === _this.prefix + "model") {
found.push(result);
}
});
return found;
},
toggleLights: function() {
this._switch = getEntityCustomData('home-switch', this.entityID, {
state: 'off'
});
var masterLights = this.findMasterLights();
var emitModels = this.findEmitModels();
if (this._switch.state === 'off') {
masterLights.forEach(function(masterLight) {
_this.masterLightOn(masterLight);
});
emitModels.forEach(function(emitModel) {
_this.modelEmitOn(emitModel);
});
setEntityCustomData('home-switch', this.entityID, {
state: 'on'
});
} else {
masterLights.forEach(function(masterLight) {
_this.masterLightOff(masterLight);
});
emitModels.forEach(function(emitModel) {
_this.modelEmitOff(emitModel);
});
setEntityCustomData('home-switch', this.entityID, {
state: 'off'
});
}
this.flipSwitch();
Audio.playSound(this.switchSound, {
volume: 0.5,
position: this.position
});
},
flipSwitch: function() {
var rotation = Entities.getEntityProperties(this.entityID, "rotation").rotation;
var axis = {
x: 0,
y: 1,
z: 0
};
var dQ = Quat.angleAxis(180, axis);
rotation = Quat.multiply(rotation, dQ);
Entities.editEntity(this.entityID, {
rotation: rotation
});
},
preload: function(entityID) {
this.entityID = entityID;
setEntityCustomData('grabbableKey', this.entityID, {
wantsTrigger: true
});
var properties = Entities.getEntityProperties(this.entityID);
//The light switch is static, so just cache its position once
this.position = Entities.getEntityProperties(this.entityID, "position").position;
}
};
// entity scripts always need to return a newly constructed object of our type
return new Switch();
});

View file

@ -23,21 +23,24 @@
},
modelEmitOn: function(discModel) {
var data = {
"Tex.Lamp-Bulldog": "atp:/kineticObjects/lamp/Lamp-Bulldog-Base.fbx/Lamp-Bulldog-Base.fbm/dog_statue.jpg",
"Texture.001": "atp:/kineticObjects/lamp/Lamp-Bulldog-Base.fbx/Lamp-Bulldog-Base.fbm/Emissive-Map.png"
}
Entities.editEntity(glowDisc, {
textures: {
"Tex.Lamp-Bulldog": "http://hifi-content.s3.amazonaws.com/alan/dev/Lamp-Bulldog-Base.fbx/Lamp-Bulldog-Base.fbm/dog_statue.jpg",
"Texture.001": "http://hifi-content.s3.amazonaws.com/alan/dev/Lamp-Bulldog-Base.fbx/Lamp-Bulldog-Base.fbm/Emissive-Map.png"
}
textures: JSON.stringify(data)
})
},
modelEmitOff: function(discModel) {
var data = {
"Tex.Lamp-Bulldog": "atp:/kineticObjects/lamp/Lamp-Bulldog-Base.fbx/Lamp-Bulldog-Base.fbm/dog_statue.jpg",
"Texture.001": ""
};
Entities.editEntity(glowDisc, {
textures: {
"Tex.Lamp-Bulldog": "http://hifi-content.s3.amazonaws.com/alan/dev/Lamp-Bulldog-Base.fbx/Lamp-Bulldog-Base.fbm/dog_statue.jpg",
"Texture.001": ""
}
textures: JSON.stringify(data)
})
},

View file

@ -24,14 +24,27 @@
},
modelEmitOn: function(glowDisc) {
var data = {
"Metal-brushed-light.jpg": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/Metal-brushed-light.jpg",
"Tex.CeilingLight.Emit": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/CielingLight-On-Diffuse.jpg",
"TexCeilingLight.Diffuse": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/CielingLight-Base.jpg"
}
Entities.editEntity(glowDisc, {
textures: 'Metal-brushed-light.jpg:"https://s3-us-west-1.amazonaws.com/hifi-content/alan/dev/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/Metal-brushed-light.jpg",\nTex.CeilingLight.Emit:"https://s3-us-west-1.amazonaws.com/hifi-content/alan/dev/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/CielingLight-On-Diffuse.jpg",\nTexCeilingLight.Diffuse:"https://s3-us-west-1.amazonaws.com/hifi-content/alan/dev/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/CielingLight-Base.jpg"'
textures: JSON.stringify(data)
})
},
modelEmitOff: function(glowDisc) {
var data = {
"Metal-brushed-light.jpg": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/Metal-brushed-light.jpg",
"Tex.CeilingLight.Emit": "",
"TexCeilingLight.Diffuse": "atp:/models/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/CielingLight-Base.jpg"
}
Entities.editEntity(glowDisc, {
textures: 'Metal-brushed-light.jpg:"https://s3-us-west-1.amazonaws.com/hifi-content/alan/dev/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/Metal-brushed-light.jpg",\nTex.CeilingLight.Emit:"",\nTexCeilingLight.Diffuse:"https://s3-us-west-1.amazonaws.com/hifi-content/alan/dev/Lights-Living-Room-2.fbx/Lights-Living-Room-2.fbm/CielingLight-Base.jpg"'
textures: JSON.stringify(data)
})
},

View file

@ -60,7 +60,6 @@
preload: function(entityID) {
this.entityID = entityID;
VICTORY_SOUND = SoundCache.getSound("atp:/tiltMaze/levelUp.wav");
Script.update.connect(this.update);
},
startNearGrab: function() {
@ -234,11 +233,8 @@
};
Audio.playSound(VICTORY_SOUND, audioProperties);
},
unload: function() {
Script.update.disconnect(_this.update);
}
};
return new Maze();