dressing room updates

This commit is contained in:
James B. Pollack 2016-05-02 16:26:05 -07:00
parent 2ef87557fc
commit 0b867713cb
3 changed files with 43 additions and 19 deletions

View file

@ -39,6 +39,20 @@
z: 0.2606
};
var PRISCILLA_DIMENSIONS = {
//priscilla
x: 1.6448,
y: 1.6657,
z: 0.3078
};
var MATTHEW_DIMENSIONS = {
//matthew
x: 1.8722,
y: 1.8197,
z: 0.3666
}
var _this;
function Transformer() {
@ -54,7 +68,6 @@
print('PRELOAD TRANSFORMER SCRIPT')
this.entityID = entityID;
this.initialProperties = Entities.getEntityProperties(entityID);
// this.transformationSound = SoundCache.getSound(TRANSFORMATION_SOUND_URL);
},
collisionWithEntity: function(myID, otherID, collisionInfo) {
@ -69,14 +82,6 @@
}
},
// playTransformationSound: function(position) {
// print('transformer should play a sound')
// Audio.playSound(_this.transformationSound, {
// position: position,
// volume: 0.5
// });
// },
findRotatorBlock: function() {
print('transformer should find rotator block')
var myProps = Entities.getEntityProperties(_this.entityID);
@ -89,7 +94,6 @@
return;
}
});
},
removeCurrentBigVersion: function(rotatorBlock) {
@ -125,7 +129,6 @@
dimensions = WILL_DIMENSIONS;
} else if (smallProps.modelURL.indexOf('being_of_light') > -1) {
print('TRANSFORMER IS BEING OF LIGHT')
dimensions = BEING_OF_LIGHT_DIMENSIONS;
} else if (smallProps.modelURL.indexOf('stylized_female') > -1) {
print('TRANSFORMER IS ARTEMIS')
@ -133,6 +136,12 @@
} else if (smallProps.modelURL.indexOf('simple_robot') > -1) {
print('TRANSFORMER IS A ROBOT')
dimensions = ROBOT_DIMENSIONS;
} else if (smallProps.modelURL.indexOf('priscilla') > -1) {
print('TRANSFORMER IS PRISCILLA')
dimensions = PRISCILLA_DIMENSIONS;
} else if (smallProps.modelURL.indexOf('matthew') > -1) {
print('TRANSFORMER IS MATTHEW')
dimensions = MATTHEW_DIMENSIONS;
} else {
print('TRANSFORMER IS SOME OTHER');
dimensions = smallProps.naturalDimensions;
@ -156,8 +165,8 @@
}),
}
if(bigVersionProps.modelURL.indexOf('simple_robot') > -1){
bigVersionProps.position.y+=0.5;
if (bigVersionProps.modelURL.indexOf('simple_robot') > -1) {
bigVersionProps.position.y += 0.5;
}
var bigVersion = Entities.addEntity(bigVersionProps);

View file

@ -11,7 +11,7 @@
var TRANSFORMER_SCRIPT = Script.resolvePath('transformer.js');
var AVATAR_COLLISION_HULL = 'atp:/dressingRoom/Avatar-Hull-4.obj';
var AVATAR_COLLISION_HULL = 'atp:/dressingRoom/Avatar-Hull-5.obj';
TransformerDoll = function(modelURL, spawnPosition, spawnRotation, dimensions) {
print('SCRIPT REF AT TRANSFORMER CREATE::' + TRANSFORMER_SCRIPT);

View file

@ -68,9 +68,9 @@
var TRANSFORMER_URL_STYLIZED_FEMALE = 'atp:/dressingRoom/stylized_female.fbx';
var TRANSFORMER_URL_REALISTIC_MALE = '';
var TRANSFORMER_URL_PRISCILLA = 'atp:/dressingRoom/priscilla.fbx';
var TRANSFORMER_URL_REALISTIC_FEMALE = '';
var TRANSFORMER_URL_MATTHEW = 'atp:/dressingRoom/matthew.fbx';
Reset.prototype = {
tidying: false,
@ -414,7 +414,6 @@
};
var dais = Entities.addEntity(daisProperties);
print('HOME created dais : ' + dais)
},
createTransformers: function() {
@ -436,7 +435,9 @@
TRANSFORMER_URL_STYLIZED_FEMALE,
TRANSFORMER_URL_ROBOT,
TRANSFORMER_URL_BEING_OF_LIGHT,
TRANSFORMER_URL_WILL
TRANSFORMER_URL_WILL,
TRANSFORMER_URL_PRISCILLA,
TRANSFORMER_URL_MATTHEW
];
var dollDimensions = [{
@ -459,6 +460,16 @@
x: 1.6326,
y: 1.6764,
z: 0.2606
}, {
//priscilla
x: 1.6448,
y: 1.6657,
z: 0.3078
}, {
//matthew
x: 1.8722,
y: 1.8197,
z: 0.3666
}];
var TRANSFORMER_SCALE = 0.25;
@ -474,7 +485,11 @@
var separation = index * dollLateralSeparation;
var left = Quat.getRight(rotationAsQuat);
var distanceToLeft = Vec3.multiply(separation, left);
var dollPosition = Vec3.sum(firstDollPosition, distanceToLeft)
var dollPosition = Vec3.sum(firstDollPosition, distanceToLeft);
if (index === 1) {
//special case for robot
dollPosition.y += 0.15;
}
var transformer = new TransformerDoll(doll, dollPosition, dollRotation,
dollDimensions[index]);
});