<commit_before>package be.howest.twentytwo.parametergame.model.system;

import com.badlogic.ashley.core.ComponentMapper;
import com.badlogic.ashley.core.Entity;
import com.badlogic.ashley.core.Family;
import com.badlogic.ashley.systems.IteratingSystem;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.physics.box2d.World;

import be.howest.twentytwo.parametergame.model.component.BodyComponent;
import be.howest.twentytwo.parametergame.model.component.TransformComponent;

/**
 * Drives the Box2D Physics simulation.
 * 
 * @author <NAME>
 */
public class PhysicsSystem extends IteratingSystem {
	
	public static final float PHYSICS_TIMESTEP = 1/30f;
	
	private ComponentMapper<TransformComponent> transformMapper = ComponentMapper.getFor(TransformComponent.class);
	private ComponentMapper<BodyComponent> bodyMapper = ComponentMapper.getFor(BodyComponent.class);
	
	private World world;
	private float elapsed;

	public PhysicsSystem(World world) {
		super(Family.all(TransformComponent.class, BodyComponent.class).get());
		this.world = world;
		this.elapsed = 0f;
	}

	@Override
	public void update(float deltaTime) {
		elapsed += deltaTime;
		if(elapsed >= PHYSICS_TIMESTEP){	// World timestep
			Gdx.app.log("Phsx", "World step");
			world.step(PHYSICS_TIMESTEP, 6, 3);
			elapsed -= PHYSICS_TIMESTEP;
			super.update(deltaTime);	// Foreach -> processEntity
		}
		
	}

	@Override
	protected void processEntity(Entity entity, float deltaTime) {
		TransformComponent transform = transformMapper.get(entity);
		BodyComponent body = bodyMapper.get(entity);
		
		transform.setPosition(body.getBody().getPosition());
		transform.setRotation(body.getBody().getAngle() * MathUtils.radiansToDegrees);
		
		Gdx.app.log("PhsxSys", body.getBody().getLinearVelocity().toString());
		Gdx.app.log("Phsx", "Entity pos: " + transform.getPosition());
	}

}
<commit_msg>Cleaned up log pollution.<commit_after>package be.howest.twentytwo.parametergame.model.system;

import com.badlogic.ashley.core.ComponentMapper;
import com.badlogic.ashley.core.Entity;
import com.badlogic.ashley.core.Family;
import com.badlogic.ashley.systems.IteratingSystem;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.physics.box2d.World;

import be.howest.twentytwo.parametergame.model.component.BodyComponent;
import be.howest.twentytwo.parametergame.model.component.TransformComponent;

/**
 * Drives the Box2D Physics simulation.
 * 
 * @author <NAME>
 */
public class PhysicsSystem extends IteratingSystem {
	
	public static final float PHYSICS_TIMESTEP = 1/30f;
	
	private ComponentMapper<TransformComponent> transformMapper = ComponentMapper.getFor(TransformComponent.class);
	private ComponentMapper<BodyComponent> bodyMapper = ComponentMapper.getFor(BodyComponent.class);
	
	private World world;
	private float elapsed;

	public PhysicsSystem(World world) {
		super(Family.all(TransformComponent.class, BodyComponent.class).get());
		this.world = world;
		this.elapsed = 0f;
	}

	@Override
	public void update(float deltaTime) {
		elapsed += deltaTime;
		if(elapsed >= PHYSICS_TIMESTEP){	// World timestep
			world.step(PHYSICS_TIMESTEP, 6, 3);
			elapsed -= PHYSICS_TIMESTEP;
			super.update(deltaTime);	// Foreach -> processEntity
		}
		
	}

	@Override
	protected void processEntity(Entity entity, float deltaTime) {
		TransformComponent transform = transformMapper.get(entity);
		BodyComponent body = bodyMapper.get(entity);
		
		transform.setPosition(body.getBody().getPosition());
		transform.setRotation(body.getBody().getAngle() * MathUtils.radiansToDegrees);
	}

}

{'fraction_non_alphanumeric': 0.11416781292984869, 'fraction_numerical': 0.004401650618982118, 'mean_word_length': 5.401408450704225, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1896320', 'n_tokens_mistral': 1241, 'n_tokens_neox': 1142, 'n_words': 204}