Package de.gurkenlabs.litiengine.physics
Class Force
java.lang.Object
de.gurkenlabs.litiengine.physics.Force
- Direct Known Subclasses:
GravityForce,StickyForce
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanCancel on collision.booleanvoidend()Gets the location.floatGets the strength in pixels per second.booleanhasEnded()Checks for ended.booleanhasReached(ICollisionEntity entity) voidsetCancelOnCollision(boolean cancelOnCollision) voidsetCancelOnReached(boolean cancelOnReached) voidsetIdentifier(String identifier) voidsetLocation(Point2D location) voidsetStrength(float strength) toString()
-
Constructor Details
-
Force
Instantiates a new force.- Parameters:
location- The location where the force is originating fromstrength- The strength/intensity of this force instancesize- 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
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
-
hasEnded
public boolean hasEnded()Checks for ended.- Returns:
- true, if successful
-
hasReached
-
setCancelOnCollision
public void setCancelOnCollision(boolean cancelOnCollision) -
setCancelOnReached
public void setCancelOnReached(boolean cancelOnReached) -
setLocation
-
setStrength
public void setStrength(float strength) -
setIdentifier
-
toString
-