|
Box2D Bouncy Things Toy
Ian Parberry's "Introduction to Game Physics"
|
The game object. More...
#include <Object.h>
Public Member Functions | |
| CObject (eSprite, b2Body *) | |
| Constructor. More... | |
| ~CObject () | |
| Destructor. More... | |
| void | draw () |
| Draw object. More... | |
Private Attributes | |
| eSprite | m_eSpriteType = eSprite::Size |
| Sprite type. | |
| b2Body * | m_pBody = nullptr |
| Physics World body. | |
Additional Inherited Members | |
Static Protected Attributes inherited from CCommon | |
| static b2World * | m_pPhysicsWorld = nullptr |
| Pointer to Box2D Physics World. | |
| static CRenderer * | m_pRenderer = nullptr |
| Pointer to the renderer. | |
| static CObjectManager * | m_pObjectManager = nullptr |
| Pointer to the object manager. | |
The game object.
Game objects are responsible for remembering information about themselves.
| CObject::CObject | ( | eSprite | t, |
| b2Body * | b | ||
| ) |
Constructor.
This constructor assumes that a Physics World body has already been created for this object. It then has responsibility for deleting it in its destructor.
| t | Sprite type. |
| b | Pointer to Physics World body. |
| CObject::~CObject | ( | ) |
Destructor.
This destructor assumes that Box2D hasn't been shut down yet.
| void CObject::draw | ( | ) |
Draw object.
Draw the object using its position and orientation in Physics World.