Class VerletParticle2D

java.lang.Object
toxi.geom.Vec2D
toxi.physics2d.VerletParticle2D
All Implemented Interfaces:
Comparable<ReadonlyVec2D>, ReadonlyVec2D

public class VerletParticle2D extends Vec2D
An individual 3D particle for use by the VerletPhysics and VerletSpring classes. A particle has weight, can be locked in space and its position constrained inside an (optional) axis-aligned bounding box.
  • Field Details

    • bounds

      public Rect bounds
      Bounding box, by default set to null to disable
    • constraints

      public List<ParticleConstraint2D> constraints
      An optional particle constraints, called immediately after a particle is updated (and only used if particle is unlocked (default)
    • behaviors

      public List<ParticleBehavior2D> behaviors
  • Constructor Details

    • VerletParticle2D

      public VerletParticle2D(float x, float y)
      Creates particle at position xyz
      Parameters:
      x -
      y -
    • VerletParticle2D

      public VerletParticle2D(float x, float y, float w)
      Creates particle at position xyz with weight w
      Parameters:
      x -
      y -
      w -
    • VerletParticle2D

      public VerletParticle2D(ReadonlyVec2D v)
      Creates particle at the position of the passed in vector
      Parameters:
      v - position
    • VerletParticle2D

      public VerletParticle2D(ReadonlyVec2D v, float w)
      Creates particle with weight w at the position of the passed in vector
      Parameters:
      v - position
      w - weight
    • VerletParticle2D

      public VerletParticle2D(VerletParticle2D p)
      Creates a copy of the passed in particle
      Parameters:
      p -
  • Method Details