Vom Anderen PC aus hoch gespielt

This commit is contained in:
ChK
2026-02-01 13:40:05 +01:00
commit 60b1b7591c
1088 changed files with 452896 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
class Animation {
constructor() {
this.nodes = null;
this.animationLoop = null;
this.requestId = null;
this.isAnimating = false;
this.context = self;
}
start() {
if ( this.isAnimating === true || this.animationLoop === null || this.nodes === null ) return;
this.isAnimating = true;
const update = ( time, frame ) => {
this.requestId = self.requestAnimationFrame( update );
this.nodes.nodeFrame.update();
this.animationLoop( time, frame );
};
this.requestId = self.requestAnimationFrame( update );
}
stop() {
self.cancelAnimationFrame( this.requestId );
this.isAnimating = false;
}
setAnimationLoop( callback ) {
this.animationLoop = callback;
}
setNodes( nodes ) {
this.nodes = nodes;
}
}
export default Animation;