All setInterval
This commit is contained in:
		
							parent
							
								
									64b27b3e1f
								
							
						
					
					
						commit
						5259a8feea
					
				
							
								
								
									
										4
									
								
								js/prototype/replay.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								js/prototype/replay.js
									
									
									
									
										vendored
									
									
								
							| @ -77,6 +77,8 @@ function init() { | |||||||
| 
 | 
 | ||||||
|     // Add listeners
 |     // Add listeners
 | ||||||
|     initListeners(); |     initListeners(); | ||||||
|  | 
 | ||||||
|  |     setInterval(animate, 20); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function initListeners() { | function initListeners() { | ||||||
| @ -203,7 +205,7 @@ function render() { | |||||||
| 
 | 
 | ||||||
| function animate() { | function animate() { | ||||||
|     // Render each frame
 |     // Render each frame
 | ||||||
|     requestAnimationFrame(animate); |     // requestAnimationFrame(animate);
 | ||||||
| 
 | 
 | ||||||
|     // stats count the number of frames per second
 |     // stats count the number of frames per second
 | ||||||
|     stats.begin(); |     stats.begin(); | ||||||
|  | |||||||
							
								
								
									
										4
									
								
								js/prototype/tutorial.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								js/prototype/tutorial.js
									
									
									
									
										vendored
									
									
								
							| @ -97,6 +97,8 @@ function init() { | |||||||
|     initListeners(); |     initListeners(); | ||||||
| 
 | 
 | ||||||
|     tutorial.nextStep(); |     tutorial.nextStep(); | ||||||
|  | 
 | ||||||
|  |     setInterval(animate, 20); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function initListeners() { | function initListeners() { | ||||||
| @ -174,7 +176,7 @@ function render() { | |||||||
| 
 | 
 | ||||||
| function animate() { | function animate() { | ||||||
|     // Render each frame
 |     // Render each frame
 | ||||||
|     requestAnimationFrame(animate); |     // requestAnimationFrame(animate);
 | ||||||
| 
 | 
 | ||||||
|     // stats count the number of frames per second
 |     // stats count the number of frames per second
 | ||||||
|     stats.begin(); |     stats.begin(); | ||||||
|  | |||||||
| @ -53,10 +53,12 @@ function init() { | |||||||
|     plane.translate(0,0,-100); |     plane.translate(0,0,-100); | ||||||
|     plane.addToScene(scene); |     plane.addToScene(scene); | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|  |     setInterval(animate, 20); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| function animate() { | function animate() { | ||||||
|     requestAnimationFrame(animate); |     // requestAnimationFrame(animate);
 | ||||||
| 
 | 
 | ||||||
|     var currentTime = Date.now() - previousTime; |     var currentTime = Date.now() - previousTime; | ||||||
|     camera.update(isNaN(currentTime) ? 20 : currentTime); |     camera.update(isNaN(currentTime) ? 20 : currentTime); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user