Class SphereConstraint

java.lang.Object
toxi.physics3d.constraints.SphereConstraint
All Implemented Interfaces:
ParticleConstraint3D

public class SphereConstraint extends Object implements ParticleConstraint3D
This class implements a spherical constraint for 3D VerletParticle3Ds. The constraint can be configured in two ways: A bounding sphere not allowing particles to escape or alternatively does not allow particles to enter the space occupied by the sphere.
  • Field Details

  • Constructor Details

    • SphereConstraint

      public SphereConstraint(Sphere sphere, boolean isBoundary)
      Creates a new instance using the sphere definition and constraint mode given.
      Parameters:
      sphere - sphere instance
      isBoundary - constraint mode. Use INSIDE or OUTSIDE to specify constraint behaviour.
    • SphereConstraint

      public SphereConstraint(Vec3D origin, float radius, boolean isBoundary)
      Creates a new instance using the sphere definition and constraint mode given.
      Parameters:
      origin - sphere origin
      radius - sphere radius
      isBoundary - constraint mode. Use INSIDE or OUTSIDE to specify constraint behaviour.
  • Method Details