|
|
| Collidable (sf::Shape *mask, sf::Vector2f offset) |
| |
|
| Collidable (Collidable const &other) |
| |
| | Collidable (tinyxml2::XMLElement *xml) |
| | Constructs a Collidable from an xml tag. Tag requires pointCoint and type attributes in addition to child tags depending on type specified. More...
|
| |
|
const sf::Shape * | getMask () const |
| |
|
void | setMask (sf::Shape *mask, sf::Vector2f offset) |
| |
|
virtual void | onCollide (std::shared_ptr< Collidable > &other, sf::Vector2f const &mtv) |
| | Called when we collide with something.
|
| |
|
void | setDebugColour (sf::Color const &c) |
| |
|
void | debug_draw (sf::RenderTarget &target) |
| |
| void | getAxies (std::vector< sf::Vector2f > &axiesVector) |
| | Gets all axies of the mask. Gets all axies of the mask. Currently inefficient due to the fact that it iterates over all points and returns all axies (a duplicate of each axis is included!). More...
|
| |
|
size_t | getPointCount () const |
| | Gets the number of points in the mask. Calls mask->getPoint() and returns the result.
|
| |
| sf::Vector2f | projectOntoAxis (sf::Vector2f &axis) const |
| | Projects the mask onto an axis. Projects each point of the mask onto an axis and returns the min and max points it covers on that axis. More...
|
| |
|
| void | updateCollidableMask (sf::Vector2f const &newPosition) |
| | Updates the position of the mask. Updates the position of the mask to equal newPosition plus the offset. More...
|
| |
|
| sf::Shape * | mMask |
| |
|
sf::Vector2f | mOffset |
| |
| collision::Collidable::Collidable |
( |
tinyxml2::XMLElement * |
xml | ) |
|
Constructs a Collidable from an xml tag. Tag requires pointCoint and type attributes in addition to child tags depending on type specified.
- Parameters
-
| xml | Tag in the form <Collidable pointcount="???" type="???"> |
| void collision::Collidable::getAxies |
( |
std::vector< sf::Vector2f > & |
axiesVector | ) |
|
Gets all axies of the mask. Gets all axies of the mask. Currently inefficient due to the fact that it iterates over all points and returns all axies (a duplicate of each axis is included!).
- Parameters
-
| axisVector[in,out] | The container of axies to add our axies to. |
| sf::Vector2f collision::Collidable::projectOntoAxis |
( |
sf::Vector2f & |
axis | ) |
const |
Projects the mask onto an axis. Projects each point of the mask onto an axis and returns the min and max points it covers on that axis.
- Parameters
-
| axis | The axis to project onto. |
- Returns
- The shadow of the mask along the axis. i.e. The min and max points it touches on the axis.
| void collision::Collidable::updateCollidableMask |
( |
sf::Vector2f const & |
newPosition | ) |
|
|
protected |
Updates the position of the mask. Updates the position of the mask to equal newPosition plus the offset.
- Parameters
-
| The | new position of the mask, before offset is taken into account. |
| sf::Shape* collision::Collidable::mMask |
|
private |
The shape that is used to test collision.
The documentation for this class was generated from the following file: