RioEngine  0.1
My first attempt to create a 3D WYSIWYG Game Engine
CGameScene Class Reference

#include <cgamescene.h>

Inheritance diagram for CGameScene:
CObject CCustomScene

Public Member Functions

 CGameScene ()
 used to serialize the GameScene More...
 
 CGameScene (const CGameScene &game_scene)
 
CGameSceneoperator= (const CGameScene &game_scene)
 
virtual void copyValuesFromObject (const CGameScene &game_scene)
 
CGameObjectcreateGameObjectWithNode (const std::string &node_id, bool add_to_scene=true, const char *object_type=NULL)
 Creates a GameObject based upon the specified Node id. More...
 
void addGameObject (CGameObject *game_object)
 
const CGameObjectgetGameObject (const std::string &name) const
 
const CGameObjectgetGameObject (uint uid) const
 
std::vector< CGameObject * > * getGameObjects () const
 
CGameObjectgetGameObjectHavingTag (int tag) const
 
bool existsGameObjectWithName (const std::string &name)
 
CGameObjectduplicateGameObject (const CGameObject *game_object)
 
bool removeGameObject (uint uid)
 
void removeGameObjectWhenAble (CGameObject *game_object)
 
virtual void clear ()
 
virtual void run ()
 
virtual void preUpdate ()
 
virtual void update ()
 
virtual void postUpdate ()
 
virtual void updateWorld ()
 
virtual void postUpdateWorld ()
 
virtual void deleteWorld ()
 
virtual void performCollisionCallbacks ()
 
QList< CGameObjectgameObjects ()
 
void setGameObjects (QList< CGameObject > game_objects)
 
btDiscreteDynamicsWorld * dynamicsWorld () const
 
virtual ~CGameScene ()
 
- Public Member Functions inherited from CObject
 CObject ()
 
 CObject (const CObject &object)
 
CObjectoperator= (const CObject &object)
 
CObjectretain ()
 
unsigned int release () const
 
CObjectautorelease ()
 
unsigned int retainCount () const
 
bool isValidCObject () const
 
virtual ~CObject ()
 

Protected Member Functions

std::string & createUniqueGameObjectName (std::string &original_name)
 
virtual void start ()
 
virtual void stopAllActions ()
 
- Protected Member Functions inherited from CObject
virtual void copyValuesFromObject (const CObject &object)
 

Protected Attributes

bool m_isRunningUpdateLoops
 
std::vector< CGameObject * > * m_gameObjects
 
std::vector< CGameObject * > * m_gameObjectsPendingToBeAdded
 stores GameObjects added during the update loop More...
 
std::vector< CGameObject * > * m_gameObjectsPendingToBeRemoved
 stores GameObjects removed during the update loop More...
 
btAlignedObjectArray< btCollisionShape * > m_collisionShapes
 
btDefaultCollisionConfiguration * m_collisionConfiguration
 
btCollisionDispatcher * m_dispatcher
 
btBroadphaseInterface * m_overlappingPairCache
 
btSequentialImpulseConstraintSolver * m_solver
 
btDiscreteDynamicsWorld * m_dynamicsWorld
 

Properties

QList< CGameObjectGameObjects
 

Additional Inherited Members

- Static Public Member Functions inherited from CObject
static void safeRetain (void *pointer)
 
template<class T >
static void safeRelease (T *pointer)
 
template<class T >
static void safeReleaseArray (T *array)
 
static void safeRelease (const char *pointer)
 

Detailed Description

Definition at line 38 of file cgamescene.h.

Constructor & Destructor Documentation

CGameScene::CGameScene ( )

used to serialize the GameScene

Definition at line 43 of file cgamescene.cpp.

CGameScene::CGameScene ( const CGameScene game_scene)

Definition at line 63 of file cgamescene.cpp.

CGameScene::~CGameScene ( )
virtual

Definition at line 572 of file cgamescene.cpp.

Member Function Documentation

void CGameScene::addGameObject ( CGameObject game_object)

Adds the GameObject to the GameScene

Definition at line 244 of file cgamescene.cpp.

void CGameScene::clear ( )
virtual

Clears the GameScene

Reimplemented in CCustomScene.

Definition at line 384 of file cgamescene.cpp.

void CGameScene::copyValuesFromObject ( const CGameScene game_scene)
virtual

Definition at line 80 of file cgamescene.cpp.

CGameObject * CGameScene::createGameObjectWithNode ( const std::string &  node_id,
bool  add_to_scene = true,
const char *  object_type = NULL 
)

Creates a GameObject based upon the specified Node id.

Parameters
node_idThe Node id
add_to_sceneWhether the GameObject must be immediately added to the GameScene
object_type(optional) A special type can be specified for the GameObject (it must inherit from CGameObject)

Definition at line 214 of file cgamescene.cpp.

std::string & CGameScene::createUniqueGameObjectName ( std::string &  original_name)
protected

Definition at line 330 of file cgamescene.cpp.

void CGameScene::deleteWorld ( )
virtual

Definition at line 475 of file cgamescene.cpp.

CGameObject * CGameScene::duplicateGameObject ( const CGameObject game_object)

Returns a duplicate of the GameObject

Definition at line 339 of file cgamescene.cpp.

btDiscreteDynamicsWorld * CGameScene::dynamicsWorld ( ) const

Definition at line 86 of file cgamescene.cpp.

bool CGameScene::existsGameObjectWithName ( const std::string &  name)

Indicates whether a GameObject with the specified name already exists

Definition at line 294 of file cgamescene.cpp.

QList< CGameObject > CGameScene::gameObjects ( )

Definition at line 399 of file cgamescene.cpp.

const CGameObject * CGameScene::getGameObject ( const std::string &  name) const

Returns the GameObject with the specified name

Definition at line 260 of file cgamescene.cpp.

const CGameObject * CGameScene::getGameObject ( uint  uid) const

Returns the GameObject with the specified uid

Definition at line 274 of file cgamescene.cpp.

CGameObject * CGameScene::getGameObjectHavingTag ( int  tag) const

Returns the GameObject with the specified tag

Definition at line 558 of file cgamescene.cpp.

std::vector< CGameObject * > * CGameScene::getGameObjects ( ) const

Definition at line 288 of file cgamescene.cpp.

CGameScene & CGameScene::operator= ( const CGameScene game_scene)

Definition at line 69 of file cgamescene.cpp.

void CGameScene::performCollisionCallbacks ( )
virtual

Definition at line 529 of file cgamescene.cpp.

void CGameScene::postUpdate ( )
virtual

Calls postUpdate() on every CGameObject in the GameScene

Definition at line 184 of file cgamescene.cpp.

void CGameScene::postUpdateWorld ( )
virtual

Calls postUpdateWorld() on every CGameObject in the GameScene

Definition at line 465 of file cgamescene.cpp.

void CGameScene::preUpdate ( )
virtual

Calls preUpdate() on every CGameObject in the GameScene

Reimplemented in CCustomScene.

Definition at line 159 of file cgamescene.cpp.

bool CGameScene::removeGameObject ( uint  uid)

Immediately removes the GameObject with the specified uid Note: You should call this method only if the GameScene is NOT running (e.g. from the Editor).

Definition at line 350 of file cgamescene.cpp.

void CGameScene::removeGameObjectWhenAble ( CGameObject game_object)

Once the GameScene is running you should remove GameObjects by calling this method.

Definition at line 374 of file cgamescene.cpp.

void CGameScene::run ( )
virtual

Runs the GameScene

Definition at line 423 of file cgamescene.cpp.

void CGameScene::setGameObjects ( QList< CGameObject game_objects)

Definition at line 412 of file cgamescene.cpp.

void CGameScene::start ( )
protectedvirtual

Reimplemented in CCustomScene.

Definition at line 148 of file cgamescene.cpp.

void CGameScene::stopAllActions ( )
protectedvirtual

Stops all CActions

Definition at line 512 of file cgamescene.cpp.

void CGameScene::update ( )
virtual

Calls update() on every CGameObject in the GameScene

Definition at line 170 of file cgamescene.cpp.

void CGameScene::updateWorld ( )
virtual

Calls stepSimulation() on btDiscreteDynamicsWorld and then updates all CGameObject Transforms so they match their btRigidBody Transform.

Definition at line 446 of file cgamescene.cpp.

Member Data Documentation

btDefaultCollisionConfiguration* CGameScene::m_collisionConfiguration
protected

Definition at line 171 of file cgamescene.h.

btAlignedObjectArray<btCollisionShape*> CGameScene::m_collisionShapes
protected

Definition at line 170 of file cgamescene.h.

btCollisionDispatcher* CGameScene::m_dispatcher
protected

Definition at line 172 of file cgamescene.h.

btDiscreteDynamicsWorld* CGameScene::m_dynamicsWorld
protected

Definition at line 175 of file cgamescene.h.

std::vector<CGameObject*>* CGameScene::m_gameObjects
protected

Definition at line 161 of file cgamescene.h.

std::vector<CGameObject*>* CGameScene::m_gameObjectsPendingToBeAdded
protected

stores GameObjects added during the update loop

Definition at line 164 of file cgamescene.h.

std::vector<CGameObject*>* CGameScene::m_gameObjectsPendingToBeRemoved
protected

stores GameObjects removed during the update loop

Definition at line 167 of file cgamescene.h.

bool CGameScene::m_isRunningUpdateLoops
protected

Definition at line 159 of file cgamescene.h.

btBroadphaseInterface* CGameScene::m_overlappingPairCache
protected

Definition at line 173 of file cgamescene.h.

btSequentialImpulseConstraintSolver* CGameScene::m_solver
protected

Definition at line 174 of file cgamescene.h.

Property Documentation

QList<CGameObject> CGameScene::GameObjects
readwrite

Definition at line 40 of file cgamescene.h.


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