java.lang.Object
de.gurkenlabs.litiengine.physics.Force
Direct Known Subclasses:
GravityForce, StickyForce

public class Force
extends java.lang.Object
  • Constructor Details

    • Force

      public Force​(java.awt.geom.Point2D location, float strength, float size)
      Instantiates a new force.
      Parameters:
      location - The location where the force is originating from
      strength - The strength/intensity of this force instance
      size - The size of this force (used to determine if/when an entity has reached the force)
  • Method Details

    • cancelOnCollision

      public boolean cancelOnCollision()
      Cancel on collision.
      Returns:
      true, if successful
    • cancelOnReached

      public boolean cancelOnReached()
    • end

      public void end()
    • getLocation

      public java.awt.geom.Point2D getLocation()
      Gets the location.
      Returns:
      the location
    • getStrength

      public float getStrength()
      Gets the strength in pixels per second.
      Returns:
      the strength in pixels per seconds
    • getIdentifier

      public java.lang.String getIdentifier()
    • hasEnded

      public boolean hasEnded()
      Checks for ended.
      Returns:
      true, if successful
    • hasReached

      public boolean hasReached​(ICollisionEntity entity)
    • setCancelOnCollision

      public void setCancelOnCollision​(boolean cancelOnCollision)
    • setCancelOnReached

      public void setCancelOnReached​(boolean cancelOnReached)
    • setLocation

      public void setLocation​(java.awt.geom.Point2D location)
    • setStrength

      public void setStrength​(float strength)
    • setIdentifier

      public void setIdentifier​(java.lang.String identifier)
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object