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:22:03 +01:00
|
|
|
this.animationSystem.start();
|
|
|
|
|
2018-01-16 14:45:11 +01:00
|
|
|
var currentRotation = this.cylinder.rotation.x;
|
2018-01-16 14:20:06 +01:00
|
|
|
|
2018-01-16 14:44:44 +01:00
|
|
|
var number = 0.897597901;
|
2018-01-16 14:40:47 +01:00
|
|
|
|
|
|
|
var remainder = currentRotation % number;
|
2018-01-16 14:16:32 +01:00
|
|
|
|
2018-01-16 14:35:48 +01:00
|
|
|
var integer = Math.floor(currentRotation);
|
|
|
|
|
2018-01-16 14:40:47 +01:00
|
|
|
var result = number - remainder;
|
2018-01-16 14:36:22 +01:00
|
|
|
|
|
|
|
console.log('current rotation: ' + currentRotation + ' remainder : ' + remainder + ' integer : ' + integer + ' result: ' + result);
|
2018-01-16 14:31:33 +01:00
|
|
|
|
2018-01-16 14:45:11 +01:00
|
|
|
this.cylinder.rotation.x += result;
|
2018-01-16 14:22:03 +01:00
|
|
|
|
2018-01-16 14:30:56 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//var offset = currentRotation / 0.4488;
|
|
|
|
|
|
|
|
//var integer = Math.floor(offset);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//if (remainder > 0.5) {
|
|
|
|
// this.cylinder.rotation.x = (integer + 1) * 0.4488 * 2 - 0.4488;
|
|
|
|
//} else {
|
|
|
|
// this.cylinder.rotation.x = (integer) * 0.4488 * 2 - 0.4488;
|
|
|
|
//}
|
|
|
|
|
|
|
|
//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
|