![]() |
Pool End Game
Chapter 3 of Ian Parberry's "Introduction to Game Physics with Box2D"
|
The game object. More...
#include <Object.h>
Public Member Functions | |
| CGameObject (GameObjectType objecttype) | |
| Constructor. | |
| virtual void | move () |
| Move yourself, raus raus raus! | |
Protected Attributes | |
| GameObjectType | m_nObjectType |
| Object type. | |
| D3DXVECTOR2 | m_vPosition |
| Current position. | |
| D3DXVECTOR2 | m_vVelocity |
| Current velocity. | |
| int | m_nLastMoveTime |
| Last time moved. | |
| BOOL | m_bAtRest |
| Whether object is at rest. | |
| int | m_nFrictionTime |
| Timer for applying friction. | |
Friends | |
| class | CObjectManager |
| class | CBallManager |
| class | CObjectWorld |
| class | CRenderWorld |
The game object.
Game objects are responsible for remembering information about themselves, in particular, their representations in Render World and Physics World.
| CGameObject::CGameObject | ( | GameObjectType | objecttype | ) |
Constructor.
Constructor for a game object.
| objecttype | Object type. |
|
virtual |
Move yourself, raus raus raus!
Move in proportion to velocity vector and time since last move, and apply a small amount of friction to reduce the velocity.
Reimplemented in CBallObject.
1.8.2