fans, avatars, desk lamp, reset script

This commit is contained in:
James B. Pollack 2016-04-08 17:22:35 -07:00
parent 4961b38aef
commit ce670fbd21
4 changed files with 59 additions and 81 deletions

View file

@ -5,34 +5,30 @@
(function() { (function() {
//full size dimensions //full size dimensions
var ARTEMIS_DIMENSIONS = { var STYLIZED_FEMALE_DIMENSIONS = {
x: 1.6241, x: 1.6323,
y: 1.7649, y: 1.7705,
z: 0.2715 z: 0.2851
};
var ALBERT_DIMENSIONS = {
x: 1.8567,
y: 1.8356,
z: 0.4193
}; };
var BEING_OF_LIGHT_DIMENSIONS = { var BEING_OF_LIGHT_DIMENSIONS = {
x: 1.8838, x: 1.8838,
y: 1.7865, y: 1.7865,
z: 0.2766 z: 0.2955
}
var ROBOT_DIMENSIONS = {
//robot
x: 1.4439,
y: 0.6224,
z: 0.4998
} }
var KATE_DIMENSIONS = {
x: 1.6775,
y: 1.8018,
z: 0.3461
};
var WILL_DIMENSIONS = { var WILL_DIMENSIONS = {
x: 1.6326, x: 1.6326,
y: 1.6764, y: 1.6764,
z: 0.2606 z: 0.2606
}; };
// var TRANSFORMATION_SOUND_URL = '';
var _this; var _this;
function Transformer() { function Transformer() {
@ -114,25 +110,19 @@
var rotatorProps = Entities.getEntityProperties(_this.rotatorBlock); var rotatorProps = Entities.getEntityProperties(_this.rotatorBlock);
var dimensions; var dimensions;
if (smallProps.modelURL.indexOf('Will') > -1) { if (smallProps.modelURL.indexOf('will') > -1) {
print('TRANSFORMER IS WILL') print('TRANSFORMER IS WILL')
dimensions = WILL_DIMENSIONS; dimensions = WILL_DIMENSIONS;
} else if (smallProps.modelURL.indexOf('albert') > -1) { } else if (smallProps.modelURL.indexOf('being_of_light') > -1) {
print('TRANSFORMER IS ALBERT')
dimensions = ALBERT_DIMENSIONS;
} else if (smallProps.modelURL.indexOf('kate') > -1) {
print('TRANSFORMER IS KATE')
dimensions = KATE_DIMENSIONS;
} else if (smallProps.modelURL.indexOf('BoL') > -1) {
print('TRANSFORMER IS BEING OF LIGHT') print('TRANSFORMER IS BEING OF LIGHT')
dimensions = BEING_OF_LIGHT_DIMENSIONS; dimensions = BEING_OF_LIGHT_DIMENSIONS;
} else if (smallProps.modelURL.indexOf('FemAvi') > -1) { } else if (smallProps.modelURL.indexOf('stylized_female') > -1) {
print('TRANSFORMER IS ARTMIS') print('TRANSFORMER IS ARTEMIS')
dimensions = STYLIZED_FEMALE_DIMENSIONS;
dimensions = ARTEMIS_DIMENSIONS; } else if (smallProps.modelURL.indexOf('simple_robot') > -1) {
print('TRANSFORMER IS A ROBOT')
dimensions = ROBOT_DIMENSIONS;
} else { } else {
print('TRANSFORMER IS SOME OTHER'); print('TRANSFORMER IS SOME OTHER');
dimensions = smallProps.naturalDimensions; dimensions = smallProps.naturalDimensions;

View file

@ -1,26 +1,26 @@
{ {
"Entities": [{ "Entities": [{
"color": { "color": {
"blue": 68, "blue": 83,
"green": 252, "green": 199,
"red": 243 "red": 252
}, },
"created": "2016-03-24T22:21:38Z", "created": "2016-03-24T22:21:38Z",
"cutoff": 90, "cutoff": 90,
"dimensions": { "dimensions": {
"x": 4, "x": 11,
"y": 4, "y": 11,
"z": 4 "z": 11
}, },
"falloffRadius": 0.30000001192092896, "falloffRadius": 0.2,
"id": "{47e2c415-854c-4b6a-b71e-06c760675afd}", "id": "{47e2c415-854c-4b6a-b71e-06c760675afd}",
"intensity": 20, "intensity": 33,
"isSpotlight": 0, "isSpotlight": 0,
"name": "home_light_livingRoomLight", "name": "home_light_livingRoomLight",
"parentID": "{f59b50d8-13fb-4ceb-b80a-62cd03428a7c}", "parentID": "{f59b50d8-13fb-4ceb-b80a-62cd03428a7c}",
"position": { "position": {
"x": 0, "x": 0,
"y": -0.14917388558387756, "y": -0.075,
"z": 0 "z": 0
}, },
"queryAACube": { "queryAACube": {

View file

@ -51,12 +51,16 @@
// Script.include(musicBoxPath); // Script.include(musicBoxPath);
Script.include(transformerPath); Script.include(transformerPath);
var TRANSFORMER_URL_ARTEMIS = 'atp:/dressingRoom/0314HiFiFemAviHeightChange.fbx'; var TRANSFORMER_URL_ROBOT = 'atp:/dressingRoom/simple_robot.fbx';
var TRANSFORMER_URL_ALBERT = 'atp:/dressingRoom/albert.fbx';
var TRANSFORMER_URL_BEING_OF_LIGHT = 'atp:/dressingRoom/0318HiFiBoL.fbx';
var TRANSFORMER_URL_KATE = 'atp:/dressingRoom/kate.fbx';
var TRANSFORMER_URL_WILL = 'atp:/dressingRoom/Will.fbx';
var TRANSFORMER_URL_BEING_OF_LIGHT = 'atp:/dressingRoom/being_of_light.fbx';
var TRANSFORMER_URL_WILL = 'atp:/dressingRoom/will_T.fbx';
var TRANSFORMER_URL_STYLIZED_FEMALE = 'atp:/dressingRoom/stylized_female.fbx';
var TRANSFORMER_URL_REALISTIC_MALE = '';
var TRANSFORMER_URL_REALISTIC_FEMALE = '';
Reset.prototype = { Reset.prototype = {
tidying: false, tidying: false,
@ -387,41 +391,35 @@
var rotationAsQuat = Quat.fromPitchYawRollDegrees(dollRotation.x, dollRotation.y, dollRotation.z); var rotationAsQuat = Quat.fromPitchYawRollDegrees(dollRotation.x, dollRotation.y, dollRotation.z);
var dolls = [ var dolls = [
TRANSFORMER_URL_ARTEMIS, TRANSFORMER_URL_STYLIZED_FEMALE,
TRANSFORMER_URL_ALBERT, TRANSFORMER_URL_ROBOT,
TRANSFORMER_URL_BEING_OF_LIGHT, TRANSFORMER_URL_BEING_OF_LIGHT,
TRANSFORMER_URL_KATE,
TRANSFORMER_URL_WILL TRANSFORMER_URL_WILL
]; ];
var dollDimensions = [{ var dollDimensions = [{
//artemis //stylized female artemis
x: 0.8120, x: 1.6323,
y: 0.8824, y: 1.7705,
z: 0.1358 z: 0.2851
}, { }, {
//albert //robot
x: 0.9283, x: 1.4439,
y: 0.9178, y: 0.6224,
z: 0.2097 z: 0.4998
}, { }, {
//being of light //being of light
x: 0.9419, x: 1.8838,
y: 0.8932, y: 1.7865,
z: 0.1383 z: 0.2955
}, {
//kate
x: 0.8387,
y: 0.9009,
z: 0.1731
}, { }, {
//will //will
x: 0.8163, x: 1.6326,
y: 0.8382, y: 1.6764,
z: 0.1303 z: 0.2606
}]; }];
var TRANSFORMER_SCALE = 0.5; var TRANSFORMER_SCALE = 0.25;
dollDimensions.forEach(function(vector, index) { dollDimensions.forEach(function(vector, index) {
var scaled = Vec3.multiply(vector, TRANSFORMER_SCALE); var scaled = Vec3.multiply(vector, TRANSFORMER_SCALE);

View file

@ -7,11 +7,11 @@
_this = this; _this = this;
this.switchSound = SoundCache.getSound("atp:/switches/lamp_switch_2.wav"); this.switchSound = SoundCache.getSound("atp:/switches/lamp_switch_2.wav");
_this.FAN_VOLUME = 0.1; _this.FAN_VOLUME = 0.1;
_this.FAN_SOUND_ENTITY_NAME = "home_sfx _ceiling_fan"; _this.FAN_SOUND_ENTITY_NAME = "home_sfx_ceiling_fan";
}; };
Switch.prototype = { Switch.prototype = {
prefix: 'hifi-home-living-room-', prefix: 'home_living_room',
clickReleaseOnEntity: function(entityID, mouseEvent) { clickReleaseOnEntity: function(entityID, mouseEvent) {
if (!mouseEvent.isLeftButton) { if (!mouseEvent.isLeftButton) {
return; return;
@ -69,20 +69,12 @@
setEntityCustomData("soundKey", _this.fanSoundEntity, soundUserData); setEntityCustomData("soundKey", _this.fanSoundEntity, soundUserData);
}, },
ventSoundOn: function() {
},
ventSoundOff: function() {
},
findFan: function() { findFan: function() {
var found = []; var found = [];
var results = Entities.findEntities(this.position, SEARCH_RADIUS); var results = Entities.findEntities(this.position, SEARCH_RADIUS);
results.forEach(function(result) { results.forEach(function(result) {
var properties = Entities.getEntityProperties(result); var properties = Entities.getEntityProperties(result);
if (properties.name === _this.prefix + "ceiling-fan") { if (properties.name === _this.prefix + "_model_ceiling_fan_blades") {
found.push(result); found.push(result);
} }
}); });
@ -112,7 +104,6 @@
if (this._switch.state === 'off') { if (this._switch.state === 'off') {
this.fanRotationOn(); this.fanRotationOn();
this.fanSoundOn(); this.fanSoundOn();
this.ventSoundOn();
setEntityCustomData('home-switch', this.entityID, { setEntityCustomData('home-switch', this.entityID, {
state: 'on' state: 'on'
}); });
@ -120,7 +111,6 @@
} else { } else {
this.fanRotationOff(); this.fanRotationOff();
this.fanSoundOff(); this.fanSoundOff();
this.ventSoundOff();
setEntityCustomData('home-switch', this.entityID, { setEntityCustomData('home-switch', this.entityID, {
state: 'off' state: 'off'