Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
CircleBounds Class Reference
CicleBounds Class. More...
#include <collision_lib.h>
Public Member Functions | |
CircleBounds () | |
Default constructor. | |
CircleBounds (Point _center, float _radius) | |
Constructor with center and radius parameters. | |
bool | circleCollideTwoObjects (const Point &pos_a, const CircleBounds &bounds_a, const Point &pos_b, const CircleBounds &bounds_b) |
Determines whether the two circles collide. |
Detailed Description
CicleBounds Class.
Class to define object's bounds as a circle with center(e.g. offset).
- Date:
- 15/04/2019
Definition at line 49 of file collision_lib.h.
Constructor & Destructor Documentation
CircleBounds | ( | ) |
Default constructor.
Definition at line 52 of file collision_lib.h.
CircleBounds | ( | Point | _center, |
float | _radius | ||
) |
Constructor with center and radius parameters.
Definition at line 54 of file collision_lib.h.
Member Function Documentation
bool circleCollideTwoObjects | ( | const Point & | pos_a, |
const CircleBounds & | bounds_a, | ||
const Point & | pos_b, | ||
const CircleBounds & | bounds_b | ||
) |
Determines whether the two circles collide.
the function takes in position and circle bounds (center and radius) of two objects and returns wether they collided.
- Parameters:
-
pos_a positon of x and y of the first object. (const Point&). bounds_a center point and radius of the first object. (const CircleBounds&). pos_b positon of x and y of the second object. (const Point&). bounds_b center point and radius of the second object. (const CircleBounds&).
- Returns:
- true if the two circles overlap.
Definition at line 69 of file collision_lib.h.
Generated on Wed Dec 20 2023 20:30:17 by
