Box2D Cannon Game with Stars
Chapter 8 of Ian Parberry's "Introduction to Game Physics with Box2D"
|
The game object. More...
#include <Object.h>
Public Member Functions | |
CGameObject (GameObjectType objecttype) | |
Constructor. | |
~CGameObject () | |
Destructor. | |
void | SetPhysicsBody (b2Body *b) |
Set pointer to physics world body. | |
Protected Attributes | |
GameObjectType | m_nObjectType |
Object type. | |
b2Body * | m_pBody |
Physics World body. | |
Friends | |
class | CObjectManager |
class | CHeadsUpDisplay |
class | CObjectWorld |
class | CRenderWorld |
class | CMyContactListener |
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. |
CGameObject::~CGameObject | ( | ) |
Destructor.
Destructor for a game object. It takes care of destroying the object's body in Physics World.
void CGameObject::SetPhysicsBody | ( | b2Body * | b | ) |
Set pointer to physics world body.
Set the physics body pointer (from Physics World) of the game object.
b | Pointer to the physics body. |