This commit is contained in:
James B. Pollack 2016-03-28 14:32:30 -07:00
parent 774cf8f42f
commit 3f6b7c2f1c
5 changed files with 28 additions and 6 deletions

View file

@ -26,11 +26,10 @@
collisionWithEntity: function(myID, otherID, collisionInfo) {
var otherProps = Entities.getEntityProperties(otherID);
if (otherProps.name = "hifi-home-dressing-room-transformer-collider" && _this.locked === false) {
if (otherProps.name === "hifi-home-dressing-room-transformer-collider" && _this.locked === false) {
var myProps = Entities.getEntityProperties(myID);
var distance = Vec3.distance(myProps.position, otherProps.position);
print('transformer DISTANCE ' + distance)
if (distance < TRIGGER_DISTANCE) {
print('transformer should do magic!!!')
// this.playTransformationSound(collisionInfo.contactPoint);

View file

@ -1,6 +1,6 @@
var TRANSFORMER_SCRIPT = Script.resolvePath('transformer.js?' + Math.random());
var AVATAR_COLLISION_HULL='http://hifi-content.s3.amazonaws.com/DomainContent/Home/dressingRoom/Avatar-Hull.obj';
var AVATAR_COLLISION_HULL = 'http://hifi-content.s3.amazonaws.com/DomainContent/Home/dressingRoom/Avatar-Hull-3.obj';
// var SHRINK_AMOUNT = 1 / 2;
TransformerDoll = function(modelURL, spawnPosition, spawnRotation, dimensions) {
print('SCRIPT REF AT TRANSFORMER CREATE::' + TRANSFORMER_SCRIPT);
@ -8,7 +8,7 @@
name: 'hifi-home-dressing-room-little-transformer',
type: 'Model',
shapeType: 'compound',
compoundShapeURL:AVATAR_COLLISION_HULL,
compoundShapeURL: AVATAR_COLLISION_HULL,
position: spawnPosition,
rotation: Quat.fromPitchYawRollDegrees(spawnRotation.x, spawnRotation.y, spawnRotation.z),
modelURL: modelURL,

View file

@ -9,4 +9,8 @@
x: 0,
y: 123,
z: 0
});
});
Script.scriptEnding.connect(function(){
fishtank.cleanup()
})

View file

@ -497,4 +497,6 @@ FishTank = function(spawnPosition, spawnRotation) {
return defaultValue;
}
}
this.cleanup = cleanup;
}

View file

@ -47,6 +47,10 @@
blue: 0
};
var THROTTLE = false;
var THROTTLE_RATE = 1000;
var sinceLastUpdate = 0;
var _this;
function Maze() {
@ -213,6 +217,19 @@
Audio.playSound(VICTORY_SOUND, audioProperties);
},
update:function(){
if (THROTTLE === true) {
sinceLastUpdate = sinceLastUpdate + deltaTime * 100;
if (sinceLastUpdate > THROTTLE_RATE) {
sinceLastUpdate = 0;
} else {
return;
}
}
this.testBallDistance()
}
};
return new Maze();