src/core/engines/ogl/ogl.js
/**
     * Render loop.
     *
     * @param time  Number      Provided by WebXR
     * @param view  XRView      Provided by WebXR
     */
Render loop.
@param time  Number      Provided by WebXR
@param view  XRView      Provided by WebXR
Render loop . @param time Number Provided by WebXR @param view XRView Provided by WebXR
render(time, view) {
        checkGLError(gl, "OGL render() begin");
        const position = view.transform.position;
        const orientation = view.transform.orientation;
        camera.projectionMatrix.copy(view.projectionMatrix);
        camera.position.set(position.x, position.y, position.z);
        camera.quaternion.set(orientation.x, orientation.y, orientation.z, orientation.w);
        Object.values(updateHandlers).forEach(handler => handler());
        const relTime = time - lastTime;
        lastTime = time;
        uniforms.time.forEach(model => model.program.uniforms.uTime.value = time * 0.001);  
        renderer.render({scene, camera});
        checkGLError(gl, "OGL render() end");
    }
render ( time , view ) { checkGLError ( gl , "OGL render() begin" ) ; const position = view . transform . position ; const orientation = view . transform . orientation ; camera . projectionMatrix . copy ( view . projectionMatrix ) ; camera . position . set ( position . x , position . y , position . z ) ; camera . quaternion . set ( orientation . x , orientation . y , orientation . z , orientation . w ) ; Object . values ( updateHandlers ) . forEach ( handler => handler ( ) ) ; const relTime = time - lastTime ; lastTime = time ; uniforms . time . forEach ( model => model . program . uniforms . uTime . value = time * 0.001 ) ; renderer . render ( { scene , camera } ) ; checkGLError ( gl , "OGL render() end" ) ; }
Render loop.
Render loop .
// Time in seconds