Buckets:
ktongue/docker_container / simsite /frontend /node_modules /three /src /renderers /webgl /WebGLAnimation.js
| function WebGLAnimation() { | |
| let context = null; | |
| let isAnimating = false; | |
| let animationLoop = null; | |
| let requestId = null; | |
| function onAnimationFrame( time, frame ) { | |
| animationLoop( time, frame ); | |
| requestId = context.requestAnimationFrame( onAnimationFrame ); | |
| } | |
| return { | |
| start: function () { | |
| if ( isAnimating === true ) return; | |
| if ( animationLoop === null ) return; | |
| requestId = context.requestAnimationFrame( onAnimationFrame ); | |
| isAnimating = true; | |
| }, | |
| stop: function () { | |
| context.cancelAnimationFrame( requestId ); | |
| isAnimating = false; | |
| }, | |
| setAnimationLoop: function ( callback ) { | |
| animationLoop = callback; | |
| }, | |
| setContext: function ( value ) { | |
| context = value; | |
| } | |
| }; | |
| } | |
| export { WebGLAnimation }; | |
Xet Storage Details
- Size:
- 767 Bytes
- Xet hash:
- 04c49bfb318e0ee566c5a5434de6f361e18e596534d402f5d2c1101bdd59bae1
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.