public abstract class CollisionEntity extends Entity implements ICollisionEntity
ANY_MESSAGE
Modifier | Constructor and Description |
---|---|
protected |
CollisionEntity() |
Modifier and Type | Method and Description |
---|---|
boolean |
canCollideWith(ICollisionEntity otherEntity) |
java.awt.geom.Rectangle2D |
getCollisionBox()
Gets the collision box.
|
java.awt.geom.Rectangle2D |
getCollisionBox(java.awt.geom.Point2D location)
Gets the collision box.
|
static java.awt.geom.Rectangle2D |
getCollisionBox(java.awt.geom.Point2D location,
double entityWidth,
double entityHeight,
double collisionBoxWidth,
double collisionBoxHeight,
Align align,
Valign valign) |
Align |
getCollisionBoxAlign() |
java.awt.geom.Point2D |
getCollisionBoxCenter()
Gets the center
Point2D of the entities collision box. |
float |
getCollisionBoxHeight() |
Valign |
getCollisionBoxValign() |
float |
getCollisionBoxWidth() |
boolean |
hasCollision()
Checks for collision.
|
void |
setCollision(boolean collision)
Sets the collision.
|
void |
setCollisionBoxAlign(Align align) |
void |
setCollisionBoxHeight(float collisionBoxHeight) |
void |
setCollisionBoxValign(Valign valign) |
void |
setCollisionBoxWidth(float collisionBoxWidth) |
void |
setHeight(float height) |
void |
setLocation(java.awt.geom.Point2D location)
Sets the map location.
|
void |
setSize(float width,
float height) |
void |
setWidth(float width) |
addController, addListener, addMessageListener, addMessageListener, addTag, addTransformListener, attachControllers, detachControllers, getAngle, getAnimationController, getBehaviorController, getBoundingBox, getCenter, getController, getControllers, getHeight, getLocation, getMapId, getName, getProperties, getRenderType, getTags, getWidth, getX, getY, hasTag, loaded, removed, removeListener, removeMessageListener, removeTag, removeTransformListener, sendMessage, setAngle, setController, setLocation, setMapId, setName, setProperties, setRenderType, setX, setY, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addController, addListener, addMessageListener, addMessageListener, addTag, addTransformListener, attachControllers, detachControllers, getAngle, getAnimationController, getBehaviorController, getBoundingBox, getCenter, getController, getHeight, getLocation, getMapId, getName, getProperties, getRenderType, getTags, getWidth, getX, getY, hasTag, loaded, removed, removeListener, removeMessageListener, removeTag, removeTransformListener, sendMessage, setController, setLocation, setMapId, setName, setRenderType, setX, setY
public static java.awt.geom.Rectangle2D getCollisionBox(java.awt.geom.Point2D location, double entityWidth, double entityHeight, double collisionBoxWidth, double collisionBoxHeight, Align align, Valign valign)
public boolean canCollideWith(ICollisionEntity otherEntity)
canCollideWith
in interface ICollisionEntity
public Align getCollisionBoxAlign()
getCollisionBoxAlign
in interface ICollisionEntity
public java.awt.geom.Rectangle2D getCollisionBox()
getCollisionBox
in interface ICollisionEntity
public java.awt.geom.Rectangle2D getCollisionBox(java.awt.geom.Point2D location)
getCollisionBox
in interface ICollisionEntity
location
- the locationpublic float getCollisionBoxHeight()
getCollisionBoxHeight
in interface ICollisionEntity
public float getCollisionBoxWidth()
getCollisionBoxWidth
in interface ICollisionEntity
public java.awt.geom.Point2D getCollisionBoxCenter()
ICollisionEntity
Point2D
of the entities collision box.getCollisionBoxCenter
in interface ICollisionEntity
Point2D
of the entities collision boxpublic Valign getCollisionBoxValign()
getCollisionBoxValign
in interface ICollisionEntity
public boolean hasCollision()
hasCollision
in interface ICollisionEntity
public void setCollision(boolean collision)
setCollision
in interface ICollisionEntity
collision
- the new collisionpublic void setCollisionBoxAlign(Align align)
setCollisionBoxAlign
in interface ICollisionEntity
public void setCollisionBoxHeight(float collisionBoxHeight)
setCollisionBoxHeight
in interface ICollisionEntity
public void setCollisionBoxValign(Valign valign)
setCollisionBoxValign
in interface ICollisionEntity
public void setCollisionBoxWidth(float collisionBoxWidth)
setCollisionBoxWidth
in interface ICollisionEntity
public void setLocation(java.awt.geom.Point2D location)
Entity
setLocation
in interface IEntity
setLocation
in class Entity
location
- the new map locationpublic void setSize(float width, float height)
public void setHeight(float height)