mirror of
https://github.com/lubosz/overte.git
synced 2025-04-23 16:33:56 +02:00
various changes
This commit is contained in:
parent
f745a3f06d
commit
60ad268838
4 changed files with 80 additions and 7 deletions
|
@ -28,10 +28,12 @@
|
|||
isPlaying: false
|
||||
}
|
||||
},
|
||||
|
||||
continueNearTrigger: function() {
|
||||
var properties = Entities.getEntityProperties(this.entityID);
|
||||
|
||||
},
|
||||
|
||||
playMusic: function() {
|
||||
if (this.musicIsPlaying !== true) {
|
||||
|
||||
|
@ -119,9 +121,15 @@
|
|||
|
||||
},
|
||||
|
||||
playBaseOpeningAnimation: function() {},
|
||||
playHoldBaseOpenAnimation: function() {},
|
||||
playBaseClosingAnimation: function() {},
|
||||
stopBaseAnimation: function() {},
|
||||
playKeyTurnAnimation: function() {},
|
||||
stopKeyTurnAnimation: function() {},
|
||||
|
||||
unload: function() {
|
||||
this.musicInjector.stop();
|
||||
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var HomeMusicBox = function() {
|
||||
|
||||
var SHOULD_CLEANUP = true;
|
||||
var SHOULD_CLEANUP = false;
|
||||
|
||||
var WHITE = {
|
||||
red: 255,
|
||||
|
@ -69,7 +69,12 @@ var HomeMusicBox = function() {
|
|||
type: 'Box',
|
||||
color: WHITE,
|
||||
position: BASE_POSITION,
|
||||
dimensions: BASE_DIMENSIONS
|
||||
dimensions: BASE_DIMENSIONS,
|
||||
userData: JSON.stringify({
|
||||
'hifiHomeKey': {
|
||||
'reset': true
|
||||
}
|
||||
}),
|
||||
}
|
||||
|
||||
base = Entities.addEntity(baseProperties);
|
||||
|
@ -91,6 +96,9 @@ var HomeMusicBox = function() {
|
|||
script: LID_SCRIPT_URL,
|
||||
collidesWith: 'myAvatar,otherAvatar',
|
||||
userData: JSON.stringify({
|
||||
'hifiHomeKey': {
|
||||
'reset': true
|
||||
},
|
||||
grabConstraintsKey: {
|
||||
callback: 'rotateLid',
|
||||
positionLocked: true,
|
||||
|
@ -144,6 +152,6 @@ var HomeMusicBox = function() {
|
|||
|
||||
createBase();
|
||||
createLid();
|
||||
|
||||
|
||||
return this;
|
||||
}
|
|
@ -103,6 +103,7 @@
|
|||
Script.setTimeout(function() {
|
||||
_this.createKineticEntities();
|
||||
_this.createDynamicEntities();
|
||||
_this.createTransformingDais();
|
||||
_this.createTransformers();
|
||||
}, 750)
|
||||
|
||||
|
@ -267,8 +268,64 @@
|
|||
|
||||
},
|
||||
|
||||
setupDressingRoom: function() {
|
||||
this.createRotatorBlock();
|
||||
this.createTransformingDais();
|
||||
this.createTransformers();
|
||||
},
|
||||
|
||||
createRotatorBlock: function() {
|
||||
var rotatorBlockProps = {
|
||||
name: 'hifi-home-dressing-room-rotator-block',
|
||||
type: 'Box',
|
||||
visible: false,
|
||||
collisionless: true,
|
||||
angularDamping: 0,
|
||||
angularVelocity: {
|
||||
x: 0,
|
||||
y: 6,
|
||||
z: 0
|
||||
},
|
||||
dynamic: false,
|
||||
userData: JSON.stringify({
|
||||
'hifiHomeKey': {
|
||||
'reset': true
|
||||
}
|
||||
}),
|
||||
}
|
||||
|
||||
var rotatorBlock = Entities.addEntity()
|
||||
},
|
||||
|
||||
createTransformingDais: function() {
|
||||
var DAIS_MODEL_URL = '';
|
||||
var COLLISION_HULL_URL = '';
|
||||
|
||||
var DAIS_DIMENSIONS = {
|
||||
x: 1,
|
||||
y: 1,
|
||||
z: 1
|
||||
};
|
||||
|
||||
var daisProperties = {
|
||||
name: 'hifi-home-dressing-room-transformer-collider',
|
||||
type: 'Model',
|
||||
modelURL: DAIS_MODEL_URL,
|
||||
dimensions: DAIS_DIMENSIONS,
|
||||
compoundShapeURL: COLLISION_HULL_URL,
|
||||
position: DAIS_POSITION,
|
||||
dynamic: false,
|
||||
userData: JSON.stringify({
|
||||
'hifiHomeKey': {
|
||||
'reset': true
|
||||
}
|
||||
}),
|
||||
};
|
||||
|
||||
var dais = Entities.addEntity(daisProperties);
|
||||
},
|
||||
|
||||
createTransformers: function() {
|
||||
print('CREATING TRANSFORMERS!')
|
||||
var firstDollPosition = {
|
||||
x: 1107.61,
|
||||
y: 460.8,
|
||||
|
@ -326,10 +383,9 @@
|
|||
})
|
||||
|
||||
var dollLateralSeparation = 1.0;
|
||||
dolls.forEach(function(doll, index) {
|
||||
|
||||
dolls.forEach(function(doll, index) {
|
||||
var separation = index * dollLateralSeparation;
|
||||
print('separation: ' + separation)
|
||||
var left = Quat.getRight(rotationAsQuat);
|
||||
var distanceToLeft = Vec3.multiply(separation, left);
|
||||
var dollPosition = Vec3.sum(firstDollPosition, distanceToLeft)
|
||||
|
|
|
@ -230,6 +230,7 @@
|
|||
},
|
||||
|
||||
update: function(deltaTime) {
|
||||
//anyone can clean up loose balls
|
||||
if (THROTTLE === true) {
|
||||
sinceLastUpdate = sinceLastUpdate + deltaTime * 100;
|
||||
if (sinceLastUpdate > THROTTLE_RATE) {
|
||||
|
|
Loading…
Reference in a new issue