mirror of
				https://github.com/luanti-org/luanti.git
				synced 2025-11-04 01:05:48 +01:00 
			
		
		
		
	Avert collision static detection rounding error (#12822)
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							6eb7d57ed3
						
					
				
				
					commit
					e832cee1e6
				
			@@ -250,11 +250,12 @@ collisionMoveResult collisionMoveSimple(Environment *env, IGameDef *gamedef,
 | 
			
		||||
		time_notification_done = false;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	v3f newpos_f = *pos_f + (*speed_f + accel_f * 0.5f * dtime) * dtime;
 | 
			
		||||
	v3f dpos_f = (*speed_f + accel_f * 0.5f * dtime) * dtime;
 | 
			
		||||
	v3f newpos_f = *pos_f + dpos_f;
 | 
			
		||||
	*speed_f += accel_f * dtime;
 | 
			
		||||
 | 
			
		||||
	// If the object is static, there are no collisions
 | 
			
		||||
	if (newpos_f == *pos_f)
 | 
			
		||||
	if (dpos_f == v3f())
 | 
			
		||||
		return result;
 | 
			
		||||
 | 
			
		||||
	// Limit speed for avoiding hangs
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user