The object manager.
More...
#include <ObjectManager.h>
|
|
UINT | m_nCrowCount = 0 |
| | Number of live or dead crows.
|
| |
|
Sage::CSpriteDesc3D | m_cSkyDesc |
| | Sky descriptor.
|
| |
|
Sage::CSpriteDesc3D | m_cLinedSkyDesc |
| | Lined sky descriptor.
|
| |
|
Sage::CSpriteDesc3D | m_cGrndDesc |
| | Ground descriptor.
|
| |
|
Sage::CParticleEngine3D * | m_pParticleEngine = nullptr |
| | Pointer to a particle engine.
|
| |
|
|
static CRenderer * | m_pRenderer = nullptr |
| | Pointer to the renderer.
|
| |
|
static CObjectManager * | m_pObjectManager = nullptr |
| | Pointer to the object manager.
|
| |
|
static CPlaneObject * | m_pPlayer = nullptr |
| | Pointer to player character.
|
| |
|
static float | m_fWorldScale = 2.0f |
| | World scale.
|
| |
|
static Vector3 | m_vCellSize = Vector3::Zero |
| | Cell size.
|
| |
|
static UINT | m_nNumCells = 3 |
| | Number of cells.
|
| |
|
static float | m_fWorldWidth = 0.0f |
| | World width.
|
| |
|
static eDrawMode | m_eDrawMode = eDrawMode::Playing |
| | Draw mode.
|
| |
|
static eGameState | m_eGameState = eGameState::Loading |
| | Game state.
|
| |
The object manager manages game objects.
◆ ~CObjectManager()
| CObjectManager::~CObjectManager |
( |
| ) |
|
The destructor clears the object list, which destructs all of the objects in it.
◆ Clear()
| void CObjectManager::Clear |
( |
| ) |
|
Clear the object list and initialize the sky and ground descriptors.
◆ Create() [1/2]
Create an object at the same position and moving at the same velocity as another object, and append it to the object list.
- Parameters
-
| t | Sprite type. |
| pObj | Pointer to an existing object. |
- Returns
- Pointer to the object created.
◆ Create() [2/2]
Create an object and append it to the object list.
- Parameters
-
| t | Sprite type. |
| pos | Initial position. |
- Returns
- Pointer to the object created.
◆ CreateStatic()
| CObject * CObjectManager::CreateStatic |
( |
eSprite | t, |
|
|
const Vector3 & | v ) |
Create a static object, that is, one whose position is fixed.
- Parameters
-
| t | Sprite type. |
| v | Initial position. |
- Returns
- Pointer to the object created.
◆ CrowDeathFx()
| void CObjectManager::CrowDeathFx |
( |
CObject * | p | ) |
|
|
private |
Particle effects for the crow death. An explosion. Feathers and body parts flying everywhere. Also sounds.
- Parameters
-
| p | Pointer to the crow. We need its position and velocity. |
◆ DrawBackground() [1/2]
| void CObjectManager::DrawBackground |
( |
| ) |
|
Draw the sky and the ground.
◆ DrawBackground() [2/2]
| void CObjectManager::DrawBackground |
( |
Sage::CSpriteDesc3D & | sd | ) |
|
|
private |
Draw part of the background.
- Parameters
-
◆ GetNumCrows()
| const UINT CObjectManager::GetNumCrows |
( |
| ) |
const |
Reader function for the number of crows.
- Returns
- Number of crows.
◆ GetRenderList()
| void CObjectManager::GetRenderList |
( |
std::vector< Sage::CSpriteDesc3D > & | renderlist | ) |
|
Get the render list, which is an unordered vector of sprite descriptors. This function also handles world wrapping, which ensures that whan the camera switches from its leftmost extent to the rightmost extent, then a copy of the objects in its view frustum will also be drawn in the rightmost view frustum. This temporarily draws two copies of the objects in question, but this will be invisible during game play because one of the copies will always be out of the view frustum. You will, however, see them when the camera is pulled back and I apologize in advance for any confusion that this causes. Object positions are also changed at the point of world wrap, which may also cause confusion because this function primarily creates a render list.
- Parameters
-
| renderlist | [IN, OUT] Render list. |
◆ Move()
| void CObjectManager::Move |
( |
| ) |
|
Move all of the objects in the object list and perform broad phase collision detection and response.
◆ NarrowPhase()
Perform collision detection and response for a pair of objects.
- Parameters
-
| p0 | Pointer to the first object. |
| p1 | Pointer to the second object. |