qaf::CollisionStruct Class Reference

#include <qafCollisionStruct.h>

Inheritance diagram for qaf::CollisionStruct:

qaf::CollisionStruct::Box qaf::CollisionStruct::Circle qaf::CollisionStruct::Composite qaf::CollisionStruct::Polygon List of all members.

Detailed Description

Represents a geometric boundary for use in collision tests.

CollisionStruct is an abstract class that represents generic boundaries. In your GameObjs, you should return one of the available subclasses:

Warning:
Do not derive from this class to implement your own collision tests.
See also:
GameObj::getCollisionStruct()


Public Member Functions

virtual bool collidesWith (CollisionStruct *otherStruct)=0
 
Returns:
true if this struct is colliding against the supplied pointer.

virtual bool hasPoint (float x, float y)=0
 
Returns:
true if the point lies inside the structure's boundaries.

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...


Member Function Documentation

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.

Returns:
true if the point's path intersects the collision structure.


The documentation for this class was generated from the following file:
Generated on Sun Mar 25 12:32:13 2007 for Qaf Framework by  doxygen 1.5.1-p1