Class PolygonConstraint

java.lang.Object
toxi.physics2d.constraints.PolygonConstraint
All Implemented Interfaces:
ParticleConstraint2D

public class PolygonConstraint extends Object implements ParticleConstraint2D
  • Constructor Details

    • PolygonConstraint

      public PolygonConstraint(Polygon2D poly, boolean isContainer)
  • Method Details

    • apply

      public void apply(VerletParticle2D p)
      Description copied from interface: ParticleConstraint2D
      Applies the constraint to the passed in particle. The method is assumed to manipulate the given instance directly.
      Specified by:
      apply in interface ParticleConstraint2D
      Parameters:
      p - particle
    • getPolygon

      public Polygon2D getPolygon()
    • isContainer

      public boolean isContainer()
    • setIsContainer

      public void setIsContainer(boolean isContainer)
    • setPolygon

      public void setPolygon(Polygon2D poly)