Circle

Circle defines a circle structure.

Constructors

this
this(int x, int y, uint radius)

CTor

Members

Functions

collapse
void collapse()

Collapse this Circle. Means that the radius is set to 0.

getCenter
Vector2i getCenter()

Returns the center position of this Circle

getPosition
Vector2i getPosition()

Returns the current position as Vector2

getRadius
uint getRadius()

Returns the current radius

increase
void increase(int radius)

Increase current size.

intersects
bool intersects(const Circle circle, Circle* overlap = null)

Checks whether this Circle intersects with an other. If, and the parameter 'overlap' isn't null, the colliding circle is stored there.

isEmpty
bool isEmpty()

Checks if this Circle is empty (if it's collapsed) with SDL_RectEmpty.

move
void move(const Vector2i vec)

Move the object.

move
void move(int x, int y)

Move the object.

opBinary
Circle opBinary(const Circle circle)

Supported operations: +, -, *, /, %

opEquals
bool opEquals(const Circle circle)

opEquals: compares two rectangles on their coordinates and their size (but not explicit type).

setPosition
void setPosition(int x, int y)

Set a new position with coordinates.

setPosition
void setPosition(const Vector2i position)

Set a new position with a vector.

setRadius
void setRadius(uint radius)

Replace the current size.

Variables

radius
uint radius;

The radius

x
int x;

The x coordinate

y
int y;

The y coordinates

Meta

Authors

Leonardo Tada