![]() |
Pool End Game
Chapter 3 of Ian Parberry's "Introduction to Game Physics with Box2D"
|
The ball manager. More...
#include <BallManager.h>
Public Member Functions | |
| CBallManager (int size) | |
| Constructor. | |
| CGameObject * | create (GameObjectType object, D3DXVECTOR2 position) |
| Create a ball object. | |
| void | draw () |
| Draw all objects. | |
| void | CollisionResponse () |
| Collision detection and response. | |
| BOOL | CollisionPoint (CBallObject *b1, CBallObject *b2, D3DXVECTOR2 &v, D3DXVECTOR2 &point) |
Public Member Functions inherited from CObjectManager | |
| CObjectManager (int size) | |
| Constructor. | |
| ~CObjectManager () | |
| Destructor. | |
| CGameObject * | create (GameObjectType objecttype) |
| Create new object. | |
| void | move () |
| Move all objects. | |
| void | clear () |
| Clear the object list. | |
Additional Inherited Members | |
Protected Attributes inherited from CObjectManager | |
| CGameObject ** | m_pObjectList |
| List of game objects. | |
| int | m_nCount |
| How many objects in list. | |
| int | m_nSize |
| Maximum size of list. | |
The ball manager.
The ball manager is responsible for managing the pool balls.
| void CBallManager::CollisionResponse | ( | ) |
Collision detection and response.
Perform collision response for all objects. This function basically consists of a for-loop on i calling CollisionResponse(i)
| CGameObject * CBallManager::create | ( | GameObjectType | object, |
| D3DXVECTOR2 | position | ||
| ) |
Create a ball object.
Create a new instance of a ball object.
| object | The type of the new ball. |
| position | Initial position. |
|
virtual |
Draw all objects.
Ask the Render World to draw all of the game objects.
Reimplemented from CObjectManager.
1.8.2