mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 19:55:07 +02:00
refactor for names
This commit is contained in:
parent
333abddeee
commit
bf30102534
2 changed files with 11 additions and 16 deletions
|
@ -1,21 +1,23 @@
|
|||
(function() {
|
||||
|
||||
Script.include('../utils.js');
|
||||
var _this;
|
||||
|
||||
var d = new Date();
|
||||
var h = d.getHours();
|
||||
h = h % 12;
|
||||
|
||||
CuckooClock = function() {
|
||||
CuckooClockMinuteHand = function() {
|
||||
_this = this;
|
||||
|
||||
};
|
||||
|
||||
CuckooClock.prototype = {
|
||||
CuckooClockMinuteHand.prototype = {
|
||||
|
||||
|
||||
preload: function(entityID) {
|
||||
_this.entityID = entityID; // this.animation.isRunning = true;
|
||||
var userData = getEntityUserData(entityID);
|
||||
var clockBody = userData.clockBody;
|
||||
// print("ANIMATION!!! " + JSON.stringify(_this.animationURL));
|
||||
Entities.editEntity(_this.entityID, {animation: {running: true}})
|
||||
|
||||
|
@ -25,5 +27,5 @@
|
|||
};
|
||||
|
||||
// entity scripts always need to return a newly constructed object of our type
|
||||
return new CuckooClock();
|
||||
return new CuckooClockMinuteHand();
|
||||
});
|
|
@ -9,7 +9,7 @@
|
|||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
|
||||
var SCRIPT_URL = Script.resolvePath("cuckooClockEntityScript.js?v1" + Math.random())
|
||||
var MINUTE_HAND_CLOCK_SCRIPT_URL = Script.resolvePath("cuckooClockMinuteHandEntityScript.js?v1" + Math.random())
|
||||
var CLOCK_BODY_URL = "http://hifi-content.s3.amazonaws.com/DomainContent/Home/cuckooClock/cuckoo2_BODY.fbx";
|
||||
var CLOCK_FACE_URL = "https://s3-us-west-1.amazonaws.com/hifi-content/eric/models/cuckooClock2_FACE.fbx";
|
||||
var CLOCK_HOUR_HAND_URL = "https://s3-us-west-1.amazonaws.com/hifi-content/eric/models/cuckooClock2_HOUR_HAND.fbx";
|
||||
|
@ -36,7 +36,6 @@ MyCuckooClock = function(spawnPosition, spawnRotation) {
|
|||
y: 1.3662,
|
||||
z: 0.8181
|
||||
},
|
||||
script: SCRIPT_URL
|
||||
})
|
||||
|
||||
var clockFaceOffset = {
|
||||
|
@ -49,20 +48,13 @@ MyCuckooClock = function(spawnPosition, spawnRotation) {
|
|||
type: "Model",
|
||||
name: "home_model_clockface",
|
||||
modelURL: CLOCK_FACE_URL,
|
||||
animation: {
|
||||
url: CLOCK_FACE_URL,
|
||||
running: true,
|
||||
currentFrame: 0,
|
||||
loop: true
|
||||
},
|
||||
position: clockFacePosition,
|
||||
dimensions: {
|
||||
x: 0.2397,
|
||||
y: 0.2402,
|
||||
z: 0.0212
|
||||
},
|
||||
// script: SCRIPT_URL
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
// CLOCK HANDS
|
||||
// __________
|
||||
|
@ -135,7 +127,8 @@ MyCuckooClock = function(spawnPosition, spawnRotation) {
|
|||
y: 0.1179,
|
||||
z: 0.0032
|
||||
},
|
||||
// script: SCRIPT_URL
|
||||
script: MINUTE_HAND_CLOCK_SCRIPT_URL,
|
||||
userData: JSON.stringify({clockBody: clockBody})
|
||||
});
|
||||
// *******************************************
|
||||
|
||||
|
|
Loading…
Reference in a new issue