toxi.physics2d
Class VerletConstrainedSpring2D

java.lang.Object
  extended by toxi.physics2d.VerletSpring2D
      extended by toxi.physics2d.VerletConstrainedSpring2D

public class VerletConstrainedSpring2D
extends VerletSpring2D

Implements a spring whose maximum relaxation distance at every time step can be limited to achieve better (if physically incorrect) stability of the whole spring system.


Field Summary
 float limit
          Maximum relaxation distance for either end of the spring in world units (by default unlimited until set by user)
 
Fields inherited from class toxi.physics2d.VerletSpring2D
a, b
 
Constructor Summary
VerletConstrainedSpring2D(VerletParticle2D a, VerletParticle2D b, float len, float str)
           
VerletConstrainedSpring2D(VerletParticle2D a, VerletParticle2D b, float len, float str, float limit)
           
 
Method Summary
 
Methods inherited from class toxi.physics2d.VerletSpring2D
getRestLength, getStrength, lockA, lockB, setRestLength, setStrength
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

limit

public float limit
Maximum relaxation distance for either end of the spring in world units (by default unlimited until set by user)

Constructor Detail

VerletConstrainedSpring2D

public VerletConstrainedSpring2D(VerletParticle2D a,
                                 VerletParticle2D b,
                                 float len,
                                 float str)
Parameters:
a -
b -
len -
str -

VerletConstrainedSpring2D

public VerletConstrainedSpring2D(VerletParticle2D a,
                                 VerletParticle2D b,
                                 float len,
                                 float str,
                                 float limit)
Parameters:
a -
b -
len -
str -
limit -