Download node_modules/three/src/renderers/webgl/WebGLAnimation.js from SimWorld-AI/industrial-harbor-viewer: direct link, hf CLI and curl.
- Browser
- Download file 767 Bytes
-
https://huggingface.co/spaces/SimWorld-AI/industrial-harbor-viewer/resolve/main/node_modules/three/src/renderers/webgl/WebGLAnimation.js
- Command line
-
hf download hf://spaces/SimWorld-AI/industrial-harbor-viewer/node_modules/three/src/renderers/webgl/WebGLAnimation.js
-
curl -L -o WebGLAnimation.js https://huggingface.co/spaces/SimWorld-AI/industrial-harbor-viewer/resolve/main/node_modules/three/src/renderers/webgl/WebGLAnimation.js
767 Bytes
| 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 }; | |