2018-01-16 14:00:11 +01:00
|
|
|
if (!this.entityLoaded) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!this.initialized) {
|
2018-01-16 14:03:37 +01:00
|
|
|
|
2018-01-16 14:04:40 +01:00
|
|
|
this.animationSystem = this.entityLoaded.animationSystem;
|
2018-01-16 14:03:37 +01:00
|
|
|
|
2018-01-16 14:16:32 +01:00
|
|
|
this.cylinder = this.entityLoaded.cylinder;
|
|
|
|
|
2018-01-16 14:00:11 +01:00
|
|
|
this.initialized = true;
|
|
|
|
}
|
|
|
|
|
2018-01-16 14:16:32 +01:00
|
|
|
var currentRotation = this.cylinder.rotation.x;
|
|
|
|
|
2018-01-16 14:22:03 +01:00
|
|
|
this.animationSystem.start();
|
|
|
|
|
2018-01-16 14:16:32 +01:00
|
|
|
var offset = currentRotation / 0.4488;
|
2018-01-16 14:20:06 +01:00
|
|
|
|
|
|
|
var integer = Math.floor(offset);
|
|
|
|
|
|
|
|
var remainder = offset - integer;
|
2018-01-16 14:16:32 +01:00
|
|
|
|
2018-01-16 14:22:03 +01:00
|
|
|
if (remainder > 0.5) {
|
2018-01-16 14:23:02 +01:00
|
|
|
this.cylinder.rotation.x = (integer + 1) * 0.4488 * 2;
|
2018-01-16 14:22:03 +01:00
|
|
|
} else {
|
2018-01-16 14:23:02 +01:00
|
|
|
this.cylinder.rotation.x = (integer) * 0.4488 * 2;
|
2018-01-16 14:22:03 +01:00
|
|
|
}
|
|
|
|
|
2018-01-16 14:18:19 +01:00
|
|
|
console.log('offset:' + offset + ', remainder: ' + remainder);
|
2018-01-16 14:16:32 +01:00
|
|
|
|
2018-01-16 14:22:03 +01:00
|
|
|
|
2018-01-16 14:04:40 +01:00
|
|
|
|
2018-01-16 14:05:27 +01:00
|
|
|
console.log('started');
|
|
|
|
|
2018-01-16 14:04:40 +01:00
|
|
|
//console.log(data);
|
2018-01-16 14:00:11 +01:00
|
|
|
//@ sourceURL=SpoonLibMouseUp.js
|