Kale
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Kale::Geometry Struct Referenceabstract

#include <Geometry.hpp>

+ Inheritance diagram for Kale::Geometry:

Public Member Functions

virtual Rect getBoundingBox () const =0
 
virtual bool pointCollision (Vector2f point) const =0
 
virtual bool rectCollision (RotatedRect rect) const =0
 
virtual bool rectCollision (Rect rect) const =0
 
virtual bool circleCollision (Circle circle) const =0
 
virtual bool rayCollision (Ray ray) const =0
 
virtual bool lineCollision (Line line) const =0
 

Detailed Description

All geometries (rect/path/line/etc) must inherit from this struct. This struct contains function pointers to all collision methods

Definition at line 32 of file Geometry.hpp.

Member Function Documentation

◆ circleCollision()

virtual bool Kale::Geometry::circleCollision ( Circle circle) const
pure virtual

Checks for collision with a circle

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

Implemented in Kale::Circle, Kale::Line, Kale::Ray, Kale::Rect, and Kale::RotatedRect.

◆ getBoundingBox()

virtual Rect Kale::Geometry::getBoundingBox ( ) const
pure virtual

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

Returns
The bounding box

Implemented in Kale::Circle, Kale::Line, Kale::Ray, Kale::Rect, and Kale::RotatedRect.

◆ lineCollision()

virtual bool Kale::Geometry::lineCollision ( Line line) const
pure virtual

Checks for collision with a line

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

Implemented in Kale::Circle, Kale::Line, Kale::Ray, Kale::Rect, and Kale::RotatedRect.

◆ pointCollision()

virtual bool Kale::Geometry::pointCollision ( Vector2f point) const
pure virtual

Checks for collision with a point

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

Implemented in Kale::Circle, Kale::Line, Kale::Ray, Kale::Rect, and Kale::RotatedRect.

◆ rayCollision()

virtual bool Kale::Geometry::rayCollision ( Ray ray) const
pure virtual

Checks for collision with a ray

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

Implemented in Kale::Circle, Kale::Line, Kale::Ray, Kale::Rect, and Kale::RotatedRect.

◆ rectCollision() [1/2]

virtual bool Kale::Geometry::rectCollision ( Rect rect) const
pure virtual

Checks for collision with a rectangle

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

Implemented in Kale::Circle, Kale::Line, Kale::Ray, Kale::Rect, and Kale::RotatedRect.

◆ rectCollision() [2/2]

virtual bool Kale::Geometry::rectCollision ( RotatedRect rect) const
pure virtual

Checks for collision with a rectangle

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

Implemented in Kale::Circle, Kale::Line, Kale::Ray, Kale::Rect, and Kale::RotatedRect.


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