diff --git a/unpublishedScripts/DomainContent/Home/dressingRoom/wrapper.js b/unpublishedScripts/DomainContent/Home/dressingRoom/wrapper.js index cc52674ef5..f5c3097105 100644 --- a/unpublishedScripts/DomainContent/Home/dressingRoom/wrapper.js +++ b/unpublishedScripts/DomainContent/Home/dressingRoom/wrapper.js @@ -1,28 +1,39 @@ -function TransformerDoll(modelURL, spawnPosition, spawnRotation) { - var transformerProps = { - name: 'hifi-home-dressing-room-little-transformer', - type: 'model', - position: spawnPosition, - rotation: spawnRotation, - modelURL: modelURL, - dynamic: true, - gravity: { - x: 0, - y: -5, - z: 0 - }, - userData: JSON.stringify({ - 'grabbableKey': { - 'grabbable:', true - }, - 'hifiHomeTransformerKey': { - 'basePosition': spawnPosition - }, - 'hifiHomeKey': { - 'reset': true - } - }), - } - Entities.addEntity(transformerProps); - return this; -} \ No newline at end of file + TransformerDoll = function(modelURL, spawnPosition, spawnRotation) { + + var TRANSFORMER_SCRIPT = Script.resolvePath('transformer.js?' + Math.random()); + var transformerProps = { + name: 'hifi-home-dressing-room-little-transformer', + type: 'model', + position: spawnPosition, + rotation: spawnRotation, + modelURL: modelURL, + dynamic: true, + gravity: { + x: 0, + y: -5, + z: 0 + }, + userData: JSON.stringify({ + 'grabbableKey': { + 'grabbable': true + }, + 'hifiHomeTransformerKey': { + 'basePosition': spawnPosition + }, + 'hifiHomeKey': { + 'reset': true + } + }), + script: TRANSFORMER_SCRIPT + } + var transformer = Entities.addEntity(transformerProps); + Script.setTimeout(function() { + var actualProps = Entities.getEntityProperties(transformer); + var quarterSize = Vec3.multiply(0.25, actualProps.naturalDimensions); + Entities.editEntity(transformer, { + dimensions: quarterSize + }); + }, 1500) + + return this; + } \ No newline at end of file diff --git a/unpublishedScripts/DomainContent/Home/reset.js b/unpublishedScripts/DomainContent/Home/reset.js index 083df8d176..26841063f6 100644 --- a/unpublishedScripts/DomainContent/Home/reset.js +++ b/unpublishedScripts/DomainContent/Home/reset.js @@ -43,7 +43,7 @@ Script.include(fishTankPath); Script.include(tiltMazePath); Script.include(whiteboardPath); - Script.include(plantPath); + // Script.include(plantPath); Script.include(cuckooClockPath); Script.include(pingPongGunPath); Script.include(transformerPath); @@ -149,15 +149,15 @@ z: 0 }); - var myPlant = new Plant({ - x: 1099.8785, - y: 460.3115, - z: -84.7736 - }, { - x: 0, - y: 0, - z: 0 - }); + // var myPlant = new Plant({ + // x: 1099.8785, + // y: 460.3115, + // z: -84.7736 + // }, { + // x: 0, + // y: 0, + // z: 0 + // }); var pingPongGun = new HomePingPongGun({ x: 1101.2123, @@ -268,6 +268,7 @@ }, createTransformers: function() { + print('CREATING TRANSFORMERS!') var firstDollPosition= { x: 1108.2123, y: 460.7516, @@ -296,6 +297,7 @@ var howFarLeft = Vec3.multiply(separation, left); var distanceToLeft = Vec3.sum(firstDollPosition, howFarLeft); var transformer = new TransformerDoll(doll, distanceToLeft, dollRotation); + print('CREATE TRANSFORMER:: '+ doll) }); },