mirror of
				https://github.com/godotengine/godot.git
				synced 2025-11-03 23:21:15 +00:00 
			
		
		
		
	Use Math_TAU and deg2rad/rad2deg in more places and optimize code
This commit is contained in:
		
							parent
							
								
									98ccaa1bad
								
							
						
					
					
						commit
						1d5042c9e2
					
				
					 34 changed files with 149 additions and 130 deletions
				
			
		| 
						 | 
				
			
			@ -721,8 +721,10 @@ void RendererCanvasCull::canvas_item_add_circle(RID p_item, const Point2 &p_pos,
 | 
			
		|||
	static const int circle_points = 64;
 | 
			
		||||
 | 
			
		||||
	points.resize(circle_points);
 | 
			
		||||
	const real_t circle_point_step = Math_TAU / circle_points;
 | 
			
		||||
 | 
			
		||||
	for (int i = 0; i < circle_points; i++) {
 | 
			
		||||
		float angle = (i / float(circle_points)) * 2 * Math_PI;
 | 
			
		||||
		float angle = i * circle_point_step;
 | 
			
		||||
		points.write[i].x = Math::cos(angle) * p_radius;
 | 
			
		||||
		points.write[i].y = Math::sin(angle) * p_radius;
 | 
			
		||||
		points.write[i] += p_pos;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue