*/
public void updateForces(Segment segment) {
Edge[] edges_ = segment.getEdges();
Particle[] particles_ = segment.getParticles();
Vector2d e0Force = edges_[0].getForce();
Vector2d e1Force = edges_[1].getForce();
Vector2d e2Force = edges_[2].getForce();
Vector2d e4Force = edges_[4].getForce();
Vector2d e5Force = edges_[5].getForce();
Vector2d e6Force = edges_[6].getForce();
Vector2d e7Force = edges_[7].getForce();
// update the front 3 particle forces
particles_[1].force.set( 0, 0 );
particles_[1].force.add( e0Force );
particles_[1].force.sub( e5Force );
particles_[1].force.sub( e1Force );
particles_[2].force.set( 0, 0 );
particles_[2].force.sub( e2Force );
particles_[2].force.sub( e6Force );
particles_[2].force.add( e1Force );
particles_[CENTER_INDEX].force.set( 0, 0 );
particles_[CENTER_INDEX].force.add( e4Force );
particles_[CENTER_INDEX].force.add( e7Force );
particles_[CENTER_INDEX].force.add( e5Force );
particles_[CENTER_INDEX].force.add( e6Force );
if ( !segment.isHead() ) {
Segment segmentInFront = segment.segmentInFront_;
particles_[1].force.sub(segmentInFront.getRightForce());
particles_[1].force.sub(segmentInFront.getRightBackDiagForce());
particles_[2].force.add( segmentInFront.getLeftForce() );
particles_[2].force.sub(segmentInFront.getLeftBackDiagForce());
}
if (segment.isTail()) {
Vector2d e3Force = edges_[3].getForce();
// update back 2 particle forces if at tail
particles_[0].force.set( 0, 0 );
particles_[0].force.sub( e3Force );
particles_[0].force.sub( e0Force );