Adjust acceleration scale and clamp linear acceleration limits for improved physics simulation

This commit is contained in:
Sam 2025-06-16 15:33:57 -05:00
parent fedb4117b4
commit 3253bebe9c
2 changed files with 2 additions and 2 deletions

View File

@ -47,7 +47,7 @@ FOOD_SPAWNING = True
RANDOM_SEED = 0 RANDOM_SEED = 0
# Vector visualization settings # Vector visualization settings
ACCELERATION_SCALE = 1000 ACCELERATION_SCALE = 100
VELOCITY_SCALE = 50 VELOCITY_SCALE = 50
ANGULAR_ACCELERATION_SCALE = 50 ANGULAR_ACCELERATION_SCALE = 50
ARROW_TIP_SIZE = 5 ARROW_TIP_SIZE = 5

View File

@ -302,7 +302,7 @@ class DefaultCell(BaseEntity):
# 3. Combine all forces # 3. Combine all forces
total_linear_accel = output_data["linear_acceleration"] total_linear_accel = output_data["linear_acceleration"]
total_linear_accel = max(-0.1, min(0.02, total_linear_accel)) total_linear_accel = max(-0.1, min(0.1, total_linear_accel))
# 4. Convert to world coordinates # 4. Convert to world coordinates
x_component = total_linear_accel * math.cos(math.radians(self.rotation.get_rotation())) x_component = total_linear_accel * math.cos(math.radians(self.rotation.get_rotation()))