提交 f0e7bdc1 编写于 作者: B Brunner

Animation related function renaming.

Style compliance.
上级 eadda9a0
......@@ -530,7 +530,7 @@ function WebGLRenderer( parameters ) {
vr.dispose();
isAnimating = false;
stopAnimation();
};
......@@ -1046,55 +1046,52 @@ function WebGLRenderer( parameters ) {
var isAnimating = false;
var onAnimationFrame = null;
function start() {
function startAnimation() {
if ( isAnimating ) return;
requestLoopFrame();
requestAnimationLoopFrame();
isAnimating = true;
}
function stop()
{
function stopAnimation() {
isAnimating = false;
}
function requestLoopFrame()
{
function requestAnimationLoopFrame() {
var device = vr.getDevice();
if ( device && device.isPresenting ) {
device.requestAnimationFrame( loop );
device.requestAnimationFrame( animationLoop );
} else {
window.requestAnimationFrame( loop );
window.requestAnimationFrame( animationLoop );
}
}
function loop( time ) {
function animationLoop( time ) {
if ( isAnimating === false )
return;
if ( isAnimating === false ) return;
onAnimationFrame( time );
requestLoopFrame();
requestAnimationLoopFrame();
}
this.animate = function ( callback ) {
onAnimationFrame = callback;
onAnimationFrame !== null ? start() : stop();
onAnimationFrame !== null ? startAnimation() : stopAnimation();
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册