![]() |
The LARC Game Engine
A Simple Game Engine from the Laboratory for Recreational Computing
|
The base object manager. More...
#include <BaseObjectManager.h>
Public Member Functions | |
LBaseObjectManager () | |
Constructor. More... | |
~LBaseObjectManager () | |
Destructor. More... | |
virtual void | clear () |
Reset to empty and delete all objects. More... | |
virtual void | move () |
Move all objects. More... | |
virtual void | draw () |
Draw all objects. More... | |
Protected Member Functions | |
virtual void | BroadPhase () |
Broad phase. More... | |
virtual void | NarrowPhase (obj *, obj *) |
Narrow phase. More... | |
virtual void | CullDeadObjects () |
Cull dead objects. More... | |
Protected Attributes | |
std::list< obj * > | m_stdObjectList |
The object list. | |
Additional Inherited Members | |
![]() | |
static LTimer * | m_pTimer = &cTimer |
Pointer to a timer. More... | |
static LRandom * | m_pRandom = &cRandom |
Pointer to a PRNG. More... | |
static LKeyboard * | m_pKeyboard = &cKeyboard |
Pointer to a keyboard handler. More... | |
static LXBoxController * | m_pController = &cController |
Pointer to a XBox controller. More... | |
static LSound * | m_pAudio = &cAudio |
Pointer to an audio player. More... | |
![]() | |
static char | m_szName [MAX_PATH] |
Name of this game. | |
static int | m_nWinWidth = 0 |
Window width in pixels. | |
static int | m_nWinHeight = 0 |
Window height in pixels. | |
static Vector2 | m_vWinCenter = Vector2::Zero |
Window center. | |
A list of game objects with some basic management functions and broad phase collision detection and response. This class is templated so that it can be used to manage game objects declared in individual games. Your game should instantiate it with your game object class, which must be derived from LBaseGameObject.
obj | Object class. |
LBaseObjectManager< obj >::LBaseObjectManager |
Default constructor, which does nothing.
obj | Object class. |
LBaseObjectManager< obj >::~LBaseObjectManager |
Destructor deletes all of the objects in the object list.
obj | Object class. |
|
protectedvirtual |
Perform collision detection and response for all objects with another object, making sure that each pair of objects is processed only once.
obj | Object class. |
|
virtual |
Delete all of the object instances pointed to by the object list, then clear the object list of all pointers so that the object list is empty.
obj | Object class. |
|
protectedvirtual |
Iterate through the objects and check whether each one is ready to delete. If so, then delete it and remove its pointer from the object list.
obj | Object class. |
|
virtual |
Move all objects by iterating through all objects in the object list and calling their draw functions.
obj | Object class. |
|
virtual |
Move all objects by iterating through all objects in the object list and calling their move functions. Perform broad phase collision detection and response, then delete any dead objects from the object list.
obj | Object class. |
|
protectedvirtual |
Perform collision detection and response for a pair of objects. This function is a stub.
p0 | Pointer to the first object. |
p1 | Pointer to the second object. |
obj | Object class. |