# How can I avoid duplication of jBox2D physics attributes?

I'm using jBox2D for physics and collision detection in a game engine with an entity-component system. It works, but I'm unsure how to structure my code with respect to the values represented in the Physics World and in my Pixel world.

Initially, I had these vectors on my Entity class:

public Vector position;
public Vector acceleration;
public Vector velocity;

public Body body; //this is jBox2D's physics body object.


Duplication is bad. How can I reduce the duplication of entity values in jBox2d's physics body?

• and the what??? – eskimo Apr 22 '14 at 9:14
• Sorry, I'm a bit tired. I updated the question. – Petter Thowsen Apr 22 '14 at 9:15