Back to project page Verlet.
The source code is released under:
Copyright 2013 Devicement http://devicement.com/ Copyright 2013 Sub Protocol and other contributors http://subprotocol.com/ Permission is hereby granted, free of charge, to any person obtaining a co...
If you think the Android project Verlet listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.verletandroid.VerletCore.Objects; //from ww w.j a v a2 s. co m import org.verletandroid.VerletCore.Composite; import org.verletandroid.VerletCore.Contraints.DistanceConstraint; import org.verletandroid.VerletCore.Particle; import org.verletandroid.VerletCore.Vec2; import java.util.ArrayList; /** * Created with IntelliJ IDEA. * User: George * Date: 28.04.13 * Time: 23:44 * To change this template use File | Settings | File Templates. */ public class LineSegments extends Composite { public LineSegments(ArrayList<Vec2> vertices, float stiffness) { int i = 0; for(Vec2 v:vertices) { particles.add(new Particle(v)); if(i > 0) constraints.add(new DistanceConstraint(particles.get(i), particles.get(i-1), stiffness)); i++; } } }