Elaztek Developer Hub
Blamite Game Engine - blam!  00398.09.22.23.2015.blamite
The core library for the Blamite Game Engine.
Demo::GameEntityManager Class Reference

#include <GameEntityManager.h>

Classes

struct  CreatedGameEntity
 

Public Types

typedef std::vector< GameEntityVecGameEntityVecVec
 

Public Member Functions

 GameEntityManager (Mq::MessageQueueSystem *graphicsSystem, LogicSystem *logicSystem)
 
 ~GameEntityManager ()
 
GameEntityaddGameEntity (Ogre::SceneMemoryMgrTypes type, const MovableObjectDefinition *moDefinition, const Ogre::Vector3 &initialPos, const Ogre::Quaternion &initialRot, const Ogre::Vector3 &initialScale)
 Creates a GameEntity, adding it to the world, and scheduling for the Graphics thread to create the appropiate SceneNode and Item pointers. More...
 
void removeGameEntity (GameEntity *toRemove)
 Removes the GameEntity from the world. More...
 
void _notifyGameEntitiesRemoved (size_t slot)
 Must be called by LogicSystem when Mq::GAME_ENTITY_SCHEDULED_FOR_REMOVAL_SLOT message arrives. More...
 
void finishFrameParallel (void)
 Must be called every frame from the LOGIC THREAD. More...
 

Member Typedef Documentation

◆ GameEntityVecVec

Constructor & Destructor Documentation

◆ GameEntityManager()

Demo::GameEntityManager::GameEntityManager ( Mq::MessageQueueSystem graphicsSystem,
LogicSystem logicSystem 
)
+ Here is the call graph for this function:

◆ ~GameEntityManager()

Demo::GameEntityManager::~GameEntityManager ( )
+ Here is the call graph for this function:

Member Function Documentation

◆ _notifyGameEntitiesRemoved()

void Demo::GameEntityManager::_notifyGameEntitiesRemoved ( size_t  slot)

Must be called by LogicSystem when Mq::GAME_ENTITY_SCHEDULED_FOR_REMOVAL_SLOT message arrives.

+ Here is the caller graph for this function:

◆ addGameEntity()

GameEntity * Demo::GameEntityManager::addGameEntity ( Ogre::SceneMemoryMgrTypes  type,
const MovableObjectDefinition moDefinition,
const Ogre::Vector3 &  initialPos,
const Ogre::Quaternion &  initialRot,
const Ogre::Vector3 &  initialScale 
)

Creates a GameEntity, adding it to the world, and scheduling for the Graphics thread to create the appropiate SceneNode and Item pointers.

MUST BE CALLED FROM LOGIC THREAD.

Parameters
typeWhether this GameEntity is dynamic (going to change transform frequently), or static (will move/rotate/scale very, very infrequently)
initialPosStarting position of the GameEntity
initialRotStarting orientation of the GameEntity
initialScaleStarting scale of the GameEntity
Returns
Pointer of GameEntity ready to be used by the Logic thread. Take in mind not all of its pointers may filled yet (the ones that are not meant to be used by the logic thread)
+ Here is the call graph for this function:

◆ finishFrameParallel()

void Demo::GameEntityManager::finishFrameParallel ( void  )

Must be called every frame from the LOGIC THREAD.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeGameEntity()

void Demo::GameEntityManager::removeGameEntity ( GameEntity toRemove)

Removes the GameEntity from the world.

The pointer is not immediately destroyed, we first need to release data in other threads (i.e. Graphics). It will be destroyed after the Render thread confirms it is done with it (via a Mq::GAME_ENTITY_SCHEDULED_FOR_REMOVAL_SLOT message)

+ Here is the call graph for this function:

The documentation for this class was generated from the following files: