Pool End Game
Chapter 3 of Ian Parberry's "Introduction to Game Physics with Box2D"
 All Classes Files Functions Variables Enumerations Pages
Public Member Functions | List of all members
CBallManager Class Reference

The ball manager. More...

#include <BallManager.h>

Inheritance diagram for CBallManager:
CObjectManager

Public Member Functions

 CBallManager (int size)
 Constructor.
 
CGameObjectcreate (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.
 
CGameObjectcreate (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.
 

Detailed Description

The ball manager.

The ball manager is responsible for managing the pool balls.

Member Function Documentation

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.

Parameters
objectThe type of the new ball.
positionInitial position.
void CBallManager::draw ( )
virtual

Draw all objects.

Ask the Render World to draw all of the game objects.

Reimplemented from CObjectManager.