Kale
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Kale::Circle Struct Reference

#include <Circle.hpp>

+ Inheritance diagram for Kale::Circle:

Public Member Functions

 Circle ()
 
 Circle (const Vector2f &center, float radius)
 
Rect getBoundingBox () const override
 
bool pointCollision (Vector2f point) const override
 
bool rectCollision (RotatedRect rect) const override
 
bool rectCollision (Rect rect) const override
 
bool circleCollision (Circle circle) const override
 
bool rayCollision (Ray ray) const override
 
bool lineCollision (Line line) const override
 

Public Attributes

Vector2f center
 
float radius
 

Detailed Description

Represents a circle

Definition at line 26 of file Circle.hpp.

Constructor & Destructor Documentation

◆ Circle() [1/2]

Circle::Circle ( )

Creates a circle at 0, 0 with a radius of 1

Definition at line 31 of file Circle.cpp.

◆ Circle() [2/2]

Circle::Circle ( const Vector2f & center,
float radius )

Creates a circle given the center and radius

Parameters
centerThe center
radiusThe radius

Definition at line 40 of file Circle.cpp.

Member Function Documentation

◆ circleCollision()

bool Circle::circleCollision ( Circle circle) const
overridevirtual

Checks for collision with a circle

Parameters
circleThe circle to check collision for
Returns
True if there is a collision, false for no collision

Implements Kale::Geometry.

Definition at line 87 of file Circle.cpp.

◆ getBoundingBox()

Rect Circle::getBoundingBox ( ) const
overridevirtual

Gets a bounding box for this geometry to check for quick and inaccurate collisions

Returns
The bounding box

Implements Kale::Geometry.

Definition at line 48 of file Circle.cpp.

◆ lineCollision()

bool Circle::lineCollision ( Line line) const
overridevirtual

Checks for collision with a line

Parameters
lineThe line to check collision for
Returns
True if there is a collision, false for no collision

Implements Kale::Geometry.

Definition at line 109 of file Circle.cpp.

◆ pointCollision()

bool Circle::pointCollision ( Vector2f point) const
overridevirtual

Checks for collision with a point

Parameters
pointThe point to check collision for
Returns
True if there is a collision, false for no collision

Implements Kale::Geometry.

Definition at line 57 of file Circle.cpp.

◆ rayCollision()

bool Circle::rayCollision ( Ray ray) const
overridevirtual

Checks for collision with a ray

Parameters
rayThe ray to check collision for
Returns
True if there is a collision, false for no collision

Implements Kale::Geometry.

Definition at line 97 of file Circle.cpp.

◆ rectCollision() [1/2]

bool Circle::rectCollision ( Rect rect) const
overridevirtual

Checks for collision with a rectangle

Parameters
rectThe rectangle to check collision for
Returns
True if there is a collision, false for no collision

Implements Kale::Geometry.

Definition at line 78 of file Circle.cpp.

◆ rectCollision() [2/2]

bool Circle::rectCollision ( RotatedRect rect) const
overridevirtual

Checks for collision with a rectangle

Parameters
rectThe rectangle to check collision for
Returns
True if there is a collision, false for no collision

Implements Kale::Geometry.

Definition at line 67 of file Circle.cpp.

Member Data Documentation

◆ center

Vector2f Kale::Circle::center

The center of the circle

Definition at line 31 of file Circle.hpp.

◆ radius

float Kale::Circle::radius

The radius of the circle

Definition at line 36 of file Circle.hpp.


The documentation for this struct was generated from the following files: