浏览代码

Merge pull request #14268 from Mugen87/dev7

Global: Clean up deprecated WebGLRenderer.animate()
Michael Herzog 7 年之前
父节点
当前提交
2b5952a1e3
共有 2 个文件被更改,包括 6 次插入6 次删除
  1. 4 4
      docs/api/renderers/WebGLRenderer.html
  2. 2 2
      editor/js/libs/app.js

+ 4 - 4
docs/api/renderers/WebGLRenderer.html

@@ -286,10 +286,6 @@
 		See [page:WebGLRenderer.capabilities capabilities.maxTextures].
 		</p>
 
-		<h3>[method:null animate]( [param:Function callback] )</h3>
-		<p>[page:Function callback] — The function will be called every available frame. If `null` is passed it will stop any already ongoing animation.</p>
-		<p>A build in function that can be used instead of [link:https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame requestAnimationFrame]. For WebVR projects this function must be used.</p>
-
 		<h3>[method:null clear]( [param:Boolean color], [param:Boolean depth], [param:Boolean stencil] )</h3>
 		<p>
 		Tells the renderer to clear its color, depth or stencil drawing buffer(s).
@@ -407,6 +403,10 @@
 		Render an immediate buffer. Gets called by renderImmediateObject.
 		</p>
 
+		<h3>[method:null setAnimationLoop]( [param:Function callback] )</h3>
+		<p>[page:Function callback] — The function will be called every available frame. If `null` is passed it will stop any already ongoing animation.</p>
+		<p>A build in function that can be used instead of [link:https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame requestAnimationFrame]. For WebVR projects this function must be used.</p>
+
 		<h3>[method:null setClearAlpha]( [param:Float alpha] )</h3>
 		<p>Sets the clear alpha. Valid input is a float between *0.0* and *1.0*.</p>
 

+ 2 - 2
editor/js/libs/app.js

@@ -190,7 +190,7 @@ var APP = {
 
 			dispatch( events.start, arguments );
 
-			renderer.animate( animate );
+			renderer.setAnimationLoop( animate );
 
 		};
 
@@ -207,7 +207,7 @@ var APP = {
 
 			dispatch( events.stop, arguments );
 
-			renderer.animate( null );
+			renderer.setAnimationLoop( null );
 
 		};