public class CircleHitbox extends Hitbox
A CircleHitbox is a circular Hitbox with its origin at its center. A CircleHitbox's radius cannot be negative.
Constructor and Description |
---|
CircleHitbox(CellVector relPosition,
long radius)
Constructs a CircleHitbox with the specified relative position and
radius.
|
CircleHitbox(long relX,
long relY,
long radius)
Constructs a CircleHitbox with the specified relative position and
radius.
|
Modifier and Type | Method and Description |
---|---|
long |
getBottomEdge()
Returns the y-coordinate of this Hitbox's absolute bottom boundary.
|
CircleHitbox |
getCopy()
Returns a copy of this Hitbox with its relative position at the origin
that is not flipped or rotated.
|
long |
getLeftEdge()
Returns the x-coordinate of this Hitbox's absolute left boundary.
|
long |
getRadius()
Returns this CircleHitbox's radius.
|
long |
getRightEdge()
Returns the x-coordinate of this Hitbox's absolute right boundary.
|
long |
getTopEdge()
Returns the y-coordinate of this Hitbox's absolute top boundary.
|
boolean |
setRadius(long radius)
Sets this CircleHitbox's radius to the specified value.
|
angleTo, changeRelAngle, changeRelPosition, changeRelPosition, changeRelX, changeRelY, distanceTo, getAbsAngle, getAbsAngleX, getAbsAngleY, getAbsPosition, getAbsX, getAbsXFlip, getAbsXSign, getAbsY, getAbsYFlip, getAbsYSign, getComponentOf, getGameState, getHeight, getObject, getRelAngle, getRelAngleX, getRelAngleY, getRelPosition, getRelX, getRelXFlip, getRelXSign, getRelY, getRelYFlip, getRelYSign, getWidth, isSolid, overlap, overlaps, relFlipX, relFlipY, setRelAngle, setRelPosition, setRelPosition, setRelX, setRelXFlip, setRelY, setRelYFlip, setSolid, setSurfaceSolid, surfaceIsSolid
public CircleHitbox(CellVector relPosition, long radius)
relPosition
- This CircleHitbox's relative positionradius
- This CircleHitbox's radiuspublic CircleHitbox(long relX, long relY, long radius)
relX
- The x-coordinate of this CircleHitbox's relative positionrelY
- The y-coordinate of this CircleHitbox's relative positionradius
- This CircleHitbox's radiuspublic final CircleHitbox getCopy()
Hitbox
public final long getRadius()
public final boolean setRadius(long radius)
radius
- The new radiuspublic final long getLeftEdge()
Hitbox
getLeftEdge
in class Hitbox
public final long getRightEdge()
Hitbox
getRightEdge
in class Hitbox
public final long getTopEdge()
Hitbox
getTopEdge
in class Hitbox
public final long getBottomEdge()
Hitbox
getBottomEdge
in class Hitbox