![]() |
Ned's Turkey Farm
A Simple 2.5D Side Scroller
|
The game object. More...
#include <Object.h>


Public Member Functions | |
| CObject () | |
| Default constructor. | |
| CObject (eSprite, const Vector3 &) | |
| Constructor. | |
| virtual | ~CObject () |
| Destructor. | |
| virtual void | Move () |
| Move me. | |
| void | Kill () |
| Kill the object. | |
| bool | TooOld () |
| Kill me. | |
| void | GetRenderList (std::vector< Sage::CSpriteDesc3D > &) |
| Get render list. | |
| const Vector3 & | GetPos () const |
| Get position. | |
| const Vector3 & | GetVel () const |
| Get velocity. | |
| const float | GetRoll () const |
| Get roll angle. | |
| const eSprite | GetType () const |
| Get sprite type. | |
| virtual void | SetVel (const Vector3 &) |
| Set velocity. | |
| virtual void | SetRoll (float) |
| Set roll angle. | |
| void | SetRotSpeed (float) |
| Set roll speed. | |
| void | SetLifeTime (float) |
| Set lifetime. | |
Public Member Functions inherited from CCommon | |
| float | Wrap (float) |
| Wrap horizontal distance. | |
Friends | |
| class | CObjectManager |
Additional Inherited Members | |
Static Protected Attributes inherited from CCommon | |
| 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 abstract representation of an object. CObjectManager is a friend of this class so that it can access any private members as needed to manage the objects without the need for reader and set functions for each private or protected member variable.
| CObject::CObject | ( | eSprite | t, |
| const Vector3 & | p ) |
Constructor.
| t | Type of sprite. |
| p | Initial position of object. |
| const Vector3 & CObject::GetPos | ( | ) | const |
Reader function for position.

| void CObject::GetRenderList | ( | std::vector< Sage::CSpriteDesc3D > & | renderlist | ) |
Append the render list for the object and its particle engine.
| renderlist | [IN, OUT] Render list to append to. |
| const float CObject::GetRoll | ( | ) | const |
Reader function for roll.

| const eSprite CObject::GetType | ( | ) | const |
Reader function for the sprite type.

| const Vector3 & CObject::GetVel | ( | ) | const |
Reader function for velocity.

|
virtual |
Update the position of the object and the particles in its particle engine using velocity and time. Rotate it using its roll speed and time. Change the current frame using its frame interval and time.
Reimplemented in CCrowObject, CDeadCrowObject, CHouseObject, and CPlaneObject.


| void CObject::SetLifeTime | ( | float | t | ) |
Writer function for the lifetime. Objects die when this much time has elapsed since their birth time.
| t | New lifetime. |

|
virtual |
Writer function for roll.
| angle | New roll angle in radians. |
Reimplemented in CPlaneObject.

| void CObject::SetRotSpeed | ( | float | rps | ) |
Writer function for roll speed.
| rps | Revolutions per second. |

|
virtual |
Writer function for the velocity.
| v | New velocity. |
Reimplemented in CPlaneObject.

| bool CObject::TooOld | ( | ) |
Died of old age.
An object is too old if the time elapsed since it was born is greater than or equal to its lifetime.
