Added getter + setter for update interval
This commit is contained in:
		
							parent
							
								
									e71f603aeb
								
							
						
					
					
						commit
						915d17da80
					
				
							
								
								
									
										12
									
								
								src/lib.rs
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								src/lib.rs
									
									
									
									
									
								
							| @ -36,7 +36,12 @@ pub mod core { | |||||||
|             new_state |             new_state | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         /// Returns the current "delta time", the time elapsed since the last update tick in milliseconds
 |         /// Returns the "update interval", the minimum time (in ms) which will elapse between update ticks
 | ||||||
|  |         pub fn get_update_interval(self) -> u32 { | ||||||
|  |             self.update_interval | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         /// Returns the current "delta time", the time (in ms) elapsed since the last update tick
 | ||||||
|         pub fn get_delta_time(self) -> u32 { |         pub fn get_delta_time(self) -> u32 { | ||||||
|             self.delta_time |             self.delta_time | ||||||
|         } |         } | ||||||
| @ -71,6 +76,11 @@ pub mod core { | |||||||
|             self.simulate = true; |             self.simulate = true; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |         /// Changes the simulation update interval
 | ||||||
|  |         pub fn set_update_interval(&mut self, update_interval: u32) { | ||||||
|  |             self.update_interval = update_interval; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|         /// Changes the simulation timescale
 |         /// Changes the simulation timescale
 | ||||||
|         pub fn set_timescale(&mut self, timescale: f32) { |         pub fn set_timescale(&mut self, timescale: f32) { | ||||||
|             self.timescale = timescale; |             self.timescale = timescale; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user