|
The Game Engine
1
|
This defines CollisionCircle boundaries and data for objects/levels. More...
#include <CollisionObject.h>
Inheritance diagram for CollisionCircle:
Collaboration diagram for CollisionCircle:Public Member Functions | |
| CollisionCircle (string n) | |
| CollisionCircle (string n, Point2D pt, double r) | |
| pair< WorldObject *, CollisionObject * > | collision (const CollisionRectangle *c, WorldObject *wo, WorldObject *mObj) const |
| This does collision between Rectangles and Circles. More... | |
| virtual pair< WorldObject *, CollisionObject * > | collision (const CollisionObject *c, WorldObject *wo, WorldObject *mObj) const |
| Check collision with objects implements circle on circle. More... | |
| virtual void | draw (const Point2D &pos) |
| Draws the collision data to the screen. More... | |
| virtual CollisionObjectType | getType () const |
| This provides a simple interface to determine types of objects. More... | |
Public Member Functions inherited from CollisionObject | |
| CollisionObject (string n) | |
| bool | checkCollisions (const vector< CollisionObject * > &c, const Point2D cPos, const Point2D pos, vector< string > names=vector< string >()) |
| Check collision with objects. More... | |
Public Attributes | |
| double | radius |
| The raidus of the circle. More... | |
Public Attributes inherited from CollisionObject | |
| Point2D | mPos |
| The position of the center of the collision data. More... | |
Additional Inherited Members | |
Public Types inherited from CollisionObject | |
| enum | CollisionObjectType { COLLISIONRECTANGLE, COLLISIONCIRCLE, COLLISIONSEGMENT } |
| This is to be used for Type checking so as to make no need for dynamic_cast and it's inefficiency. More... | |
Protected Attributes inherited from CollisionObject | |
| string | name |
| Name of the collision type. More... | |
| Uint32 | color |
| The collision box color. More... | |
This defines CollisionCircle boundaries and data for objects/levels.
This class is tasked with the following:
Definition at line 125 of file CollisionObject.h.
|
inline |
Definition at line 128 of file CollisionObject.h.
|
inline |
Definition at line 129 of file CollisionObject.h.
| pair< WorldObject *, CollisionObject * > CollisionCircle::collision | ( | const CollisionRectangle * | c, |
| WorldObject * | wo, | ||
| WorldObject * | mObj | ||
| ) | const |
This does collision between Rectangles and Circles.
| c | a single collision data for an object |
| wo | Pointer to Object with checking bound |
| mObj | the current collision's world object |
check rect vs circle
Definition at line 145 of file CollisionObject.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
virtual |
Check collision with objects implements circle on circle.
| c | a single collision data for an object |
| wo | Pointer to Object with checking bound |
| mObj | the current collision's world object |
call the circle rect fn
check circle vs circle
Implements CollisionObject.
Definition at line 119 of file CollisionObject.cpp.
Here is the call graph for this function:
|
virtual |
Draws the collision data to the screen.
<The relative x,y pos
<the midpt of the circle
Implements CollisionObject.
Definition at line 55 of file CollisionObject.cpp.
Here is the call graph for this function:
|
inlinevirtual |
This provides a simple interface to determine types of objects.
Returns the name of the Class and Descendants i.e. Something inheriting from Sprite would look like Sprite:Thing
Implements CollisionObject.
Definition at line 154 of file CollisionObject.h.
| double CollisionCircle::radius |
The raidus of the circle.
Definition at line 130 of file CollisionObject.h.