package prefuse.util.force;
/**
* Represents a point particle in a force simulation, maintaining values for
* mass, forces, velocity, and position.
*
* @author jeffrey heer
*/
public class ForceItem implements Cloneable {
/**
* Create a new ForceItem.
*/
public ForceItem() {
mass = 1.0f;
force = new float[] { 0.f, 0.f };
velocity = new float[] { 0.f, 0.f };
location = new float[] { 0.f, 0.f };
plocation = new float[] { 0.f, 0.f };
k = new float[4][2];
l = new float[4][2];
}
/**
* Clone a ForceItem.
* @see java.lang.Object#clone()
*/
public Object clone() {
ForceItem item = new ForceItem();
item.mass = this.mass;
System.arraycopy(force,0,item.force,0,2);
System.arraycopy(velocity,0,item.velocity,0,2);
System.arraycopy(location,0,item.location,0,2);
System.arraycopy(plocation,0,item.plocation,0,2);
for ( int i=0; i