r3-custom-code/abw1ga2etc.js

50 lines
913 B
JavaScript
Raw Normal View History

if (!this.entityLoaded) {
return;
}
if (!this.initialized) {
this.animationSystem = this.entityLoaded.animationSystem;
this.cylinder = this.entityLoaded.cylinder;
this.initialized = true;
}
this.animationSystem.start();
var currentRotation = this.cylinder.rotation.x;
console.log('current rotation: ' + currentRotation);
var remainder = currentRotation % 0.4488;
if (remainder > (0.4488 / 2)) {
this.cylinder.rotation.x += remainder;
} else {
this.cylinder.rotation.x -= 0.4488 - remainder;
}
//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);
console.log('started');
//console.log(data);
//@ sourceURL=SpoonLibMouseUp.js