#include <qafCollisionStruct.h>
Inheritance diagram for qaf::CollisionStruct:
CollisionStruct
is an abstract class that represents generic boundaries. In your GameObj
s, you should return one of the available subclasses:
Public Member Functions | |
virtual bool | collidesWith (CollisionStruct *otherStruct)=0 |
| |
virtual bool | hasPoint (float x, float y)=0 |
| |
virtual bool | pointIntersection (float x1, float y1, float x2, float y2, Vector2D *pContact, Vector2D *pNormal)=0 |
Tests a "moving point" collision. | |
virtual void | move (float dx, float dy)=0 |
Moves the collision structure by the specified amount of pixels. | |
virtual void | render (float scrollX, float scrollY, unsigned long color)=0 |
For debug purposes, this will render the current collision boundaries as a set of lines. | |
Classes | |
class | Box |
Represents rectangular collision boundaries. More... | |
class | Circle |
Represents circular collision boundaries. More... | |
class | Composite |
Represents disjointed collision shapes. More... | |
class | Polygon |
Represents a polygonal collision boundary. More... |
virtual bool qaf::CollisionStruct::pointIntersection | ( | float | x1, | |
float | y1, | |||
float | x2, | |||
float | y2, | |||
Vector2D * | pContact, | |||
Vector2D * | pNormal | |||
) | [pure virtual] |
Tests a "moving point" collision.
The method returns true if the point moving from (x1, y1) to (x2, y2) will collide against the structure. The point of intersection will be stored in the pContact
parameter, and its normal will be stored in pNormal
. These pointers may be NULL.