try hard coding doll sizesw

This commit is contained in:
James B. Pollack 2016-03-28 10:42:17 -07:00
parent ca4931e6ce
commit 054b910e20
2 changed files with 47 additions and 19 deletions

View file

@ -1,6 +1,6 @@
var TRANSFORMER_SCRIPT = Script.resolvePath('transformer.js?' + Math.random());
var SHRINK_AMOUNT = 1 / 2;
TransformerDoll = function(modelURL, spawnPosition, spawnRotation) {
// var SHRINK_AMOUNT = 1 / 2;
TransformerDoll = function(modelURL, spawnPosition, spawnRotation, dimensions) {
print('SCRIPT REF AT TRANSFORMER CREATE::' + TRANSFORMER_SCRIPT);
var transformerProps = {
name: 'hifi-home-dressing-room-little-transformer',
@ -15,36 +15,37 @@
y: -5,
z: 0
},
visible:false,
damping:0.8,
visible: false,
damping: 0.8,
userData: JSON.stringify({
'grabbableKey': {
'grabbable': true
},
'hifiHomeTransformerKey': {
'basePosition': spawnPosition,
'baseRotation':Quat.fromPitchYawRollDegrees(spawnRotation.x, spawnRotation.y, spawnRotation.z),
'baseRotation': Quat.fromPitchYawRollDegrees(spawnRotation.x, spawnRotation.y, spawnRotation.z),
},
'hifiHomeKey': {
'reset': true
}
}),
dimensions: dimensions,
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)
// 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))

View file

@ -289,6 +289,32 @@
TRANSFORMER_URL_WILL
];
var dollDimensions = [{
//artemis
x: 0.8120,
y: 0.8824,
z: 0.1358
}, {
//albert
x: 0.9283,
y: 0.9178,
z: 0.2097
}, {
//being of light
x: 0.9419,
y: 0.8932,
z: 0.1383
}, {
//kate
x: 0.8387,
y: 0.9009,
z: 0.1731
}, {
//will
x: 0.8163,
y: 0.8382,
z: 0.1303
}];
var dollLateralSeparation = 1.0;
dolls.forEach(function(doll, index) {
@ -297,7 +323,8 @@
var left = Quat.getRight(rotationAsQuat);
var distanceToLeft = Vec3.multiply(separation, left);
var dollPosition = Vec3.sum(firstDollPosition, distanceToLeft)
var transformer = new TransformerDoll(doll, dollPosition, dollRotation);
var transformer = new TransformerDoll(doll, dollPosition, dollRotation,
dollDimensions[index]);
});