Pool End Game
Chapter 3 of Ian Parberry's "Introduction to Game Physics with Box2D"
|
The ball object. More...
#include <BallObject.h>
Public Member Functions | |
CBallObject (GameObjectType object, D3DXVECTOR2 position) | |
Constructor. | |
void | move () |
Change position depending on time and velocity. | |
void | DeliverImpulse (float angle, float magnitude) |
Deliver an impulse. | |
Public Member Functions inherited from CGameObject | |
CGameObject (GameObjectType objecttype) | |
Constructor. | |
Friends | |
class | CBallManager |
class | CObjectWorld |
class | CObjectManager |
Additional Inherited Members | |
Protected Attributes inherited from CGameObject | |
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. | |
The ball object.
void CBallObject::DeliverImpulse | ( | float | angle, |
float | magnitude | ||
) |
Deliver an impulse.
Deliver an impulse to the object, given the angle and magnitude.
angle | Angle at which the impulse is to be applied. |
magnitude | Magnitude of the impulse to apply. |
|
virtual |
Change position depending on time and velocity.
Move ball. Move the ball, apply collision and response with pockets and rails, playing the appropriate sound if necessary.
Reimplemented from CGameObject.