torque Torque Game Engine Documentation
CVS Revision Label 1.3.x

simBase.h File Reference

#include "core/tVector.h"
#include "core/tAlgorithm.h"
#include "core/bitSet.h"
#include "console/consoleObject.h"
#include "console/simDictionary.h"

Namespaces

namespace  Sim

Defines

#define DeclareNamedSet(set)   extern SimSet *g##set;inline SimSet *get##set() { return g##set; }
#define DeclareNamedGroup(set)   extern SimGroup *g##set;inline SimGroup *get##set() { return g##set; }
#define ImplementNamedSet(set)   SimSet *g##set;
#define ImplementNamedGroup(set)   SimGroup *g##set;
#define IMPLEMENT_SETDATATYPE(T)
#define IMPLEMENT_GETDATATYPE(T)
#define REF_SETDATATYPE(T)   setDataTypeDataBlockPtr##T
#define REF_GETDATATYPE(T)   getDataTypeDataBlockPtr##T

Typedefs

typedef U32 SimTime
typedef U32 SimObjectId

Enumerations

enum  SimObjectsConstants {
  DataBlockObjectIdFirst = 3,
  DataBlockObjectIdBitSize = 10,
  DataBlockObjectIdLast = DataBlockObjectIdFirst + (1 << DataBlockObjectIdBitSize) - 1,
  DynamicObjectIdFirst = DataBlockObjectIdLast + 1,
  InvalidEventId = 0,
  RootGroupId = 0xFFFFFFFF
}
 Definition of some basic Sim system constants. More...

Functions

 DeclareNamedSet (ActiveActionMapSet) DeclareNamedSet(GhostAlwaysSet) DeclareNamedSet(LightSet) DeclareNamedSet(WayPointSet) DeclareNamedSet(fxReplicatorSet) DeclareNamedSet(fxFoliageSet) DeclareNamedGroup(ActionMapGroup) DeclareNamedGroup(ClientGroup) DeclareNamedGroup(GuiGroup) DeclareNamedGroup(GuiDataGroup) DeclareNamedGroup(TCPGroup) DeclareNamedGroup(ClientConnectionGroup) void init()
void shutdown ()
SimDataBlockGroupgetDataBlockGroup ()
SimGroupgetRootGroup ()
SimObjectfindObject (SimObjectId)
SimObjectfindObject (const char *name)
template<class T>
bool findObject (SimObjectId id, T *&t)
template<class T>
bool findObject (const char *objectName, T *&t)
void advanceToTime (SimTime time)
void advanceTime (SimTime delta)
SimTime getCurrentTime ()
SimTime getTargetTime ()
U32 postEvent (SimObject *, SimEvent *, U32 targetTime)
 a target time of 0 on an event means current event
U32 postEvent (SimObjectId id, SimEvent *evt, U32 targetTime)
U32 postEvent (const char *objectName, SimEvent *evt, U32 targetTime)
U32 postCurrentEvent (SimObject *obj, SimEvent *evt)
U32 postCurrentEvent (SimObjectId obj, SimEvent *evt)
U32 postCurrentEvent (const char *obj, SimEvent *evt)
void cancelEvent (U32 eventId)
bool isEventPending (U32 eventId)


Define Documentation

#define IMPLEMENT_SETDATATYPE  ) 
 

Value:

void setDataTypeDataBlockPtr##T(void *dptr, S32 argc, const char **argv, EnumTable *, BitSet32)   \
{                                                                                                 \
   volatile SimDataBlock* pConstraint = static_cast<SimDataBlock*>((T*)NULL);                     \
                                                                                                  \
   if (argc == 1) {                                                                               \
      *reinterpret_cast<T**>(dptr) = NULL;                                                        \
      if (argv[0] && argv[0][0] && !Sim::findObject(argv[0],*reinterpret_cast<T**>(dptr)))        \
         Con::printf("Object '%s' is not a member of the '%s' data block class", argv[0], #T);    \
   }                                                                                              \
   else                                                                                           \
      Con::printf("Cannot set multiple args to a single pointer.");                               \
}

#define IMPLEMENT_GETDATATYPE  ) 
 

Value:

const char* getDataTypeDataBlockPtr##T(void *dptr, EnumTable *, BitSet32)           \
{                                                                                   \
   volatile SimDataBlock* pConstraint = static_cast<SimDataBlock*>((T*)NULL);       \
                                                                                    \
   T** obj = reinterpret_cast<T**>(dptr);                                           \
   return *obj ? (*obj)->getName() : "";                                            \
}

#define REF_SETDATATYPE  )     setDataTypeDataBlockPtr##T
 

#define REF_GETDATATYPE  )     getDataTypeDataBlockPtr##T
 


Typedef Documentation

typedef U32 SimTime
 

typedef U32 SimObjectId
 


Enumeration Type Documentation

enum SimObjectsConstants
 

Definition of some basic Sim system constants.

These constants define the range of ids assigned to datablocks (DataBlockObjectIdFirst - DataBlockObjectIdLast), and the number of bits used to store datablock IDs.

Normal Sim objects are given the range of IDs starting at DynamicObjectIdFirst and going to infinity. Sim objects use a SimObjectId to represent their ID; this is currently a U32.

The RootGroupId is assigned to gRootGroup, in which most SimObjects are addded as child members. See simManager.cc for details, particularly Sim::initRoot() and following.

Enumeration values:
DataBlockObjectIdFirst 
DataBlockObjectIdBitSize 
DataBlockObjectIdLast 
DynamicObjectIdFirst 
InvalidEventId 
RootGroupId 


Function Documentation

Sim::DeclareNamedSet ActiveActionMapSet   ) 
 

void Sim::shutdown  ) 
 

SimDataBlockGroup* Sim::getDataBlockGroup  ) 
 

SimGroup* Sim::getRootGroup  ) 
 

SimObject* Sim::findObject SimObjectId   ) 
 

SimObject* Sim::findObject const char *  name  ) 
 

template<class T>
bool Sim::findObject SimObjectId  id,
T *&  t
[inline]
 

template<class T>
bool Sim::findObject const char *  objectName,
T *&  t
[inline]
 

void Sim::advanceToTime SimTime  time  ) 
 

void Sim::advanceTime SimTime  delta  ) 
 

SimTime Sim::getCurrentTime  ) 
 

SimTime Sim::getTargetTime  ) 
 

U32 Sim::postEvent SimObject ,
SimEvent ,
U32  targetTime
 

a target time of 0 on an event means current event

U32 Sim::postEvent SimObjectId  id,
SimEvent evt,
U32  targetTime
[inline]
 

U32 Sim::postEvent const char *  objectName,
SimEvent evt,
U32  targetTime
[inline]
 

U32 Sim::postCurrentEvent SimObject obj,
SimEvent evt
[inline]
 

U32 Sim::postCurrentEvent SimObjectId  obj,
SimEvent evt
[inline]
 

U32 Sim::postCurrentEvent const char *  obj,
SimEvent evt
[inline]
 

void Sim::cancelEvent U32  eventId  ) 
 

bool Sim::isEventPending U32  eventId  ) 
 




All Rights Reserved GarageGames.com, Inc. 1999-2005
Auto-magically Generated with Doxygen