VR-Forces 4.1 Class Documentation
List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions
BHAVE::DtKynapseManager Class Reference

The main singleton class that connects Kynapse with VR-Forces. More...

Public Member Functions

virtual ~DtKynapseManager ()
 called in DtUnloadVrfPlugin()
virtual bool init (DtCgf *cgf)
 called after instantiation to make all the connections with VRF
virtual void closeKynapseWorld ()
 called after delete AND after a new terrain is loaded.
DtBhavePluginOptionspluginOptions ()
 Plugin options - Essentially the current configuration of B-HAVE.
virtual Kaim::World * getKynapseWorld ()
virtual DtCgfgetCgf ()
virtual DtBhaveFactoriesgetFactories ()
virtual double getPathDataHeight (const DtString &pathDataName) const
 Returns the height used when generating the pathdata that is in.

Static Public Member Functions

static DtKynapseManagerinstance ()
 Singleton class.

Protected Member Functions

virtual void registerKynapseActuators ()
 Register all actuators that Kynapse needs with VR-Forces.
virtual void registerKynapseControllers ()
 Register all controllers that Kynapse needs with VR-Forces.
virtual void processPreLoadTerrainCallback (const DtFilename &filename)
 before a new terrain is loaded, we need to clean up a bit
virtual void processPostLoadTerrainCallback (const DtFilename &filename)
 when a new terrain has been loaded (w/ new pathdata from metafile), we can create a new world
virtual void processSimTick (void *)
 updates and calls Kynapse::WorldUpdate
virtual void processPostTick (void *)
 Do anything that needs to be done at the end of a tick.
virtual void updateAllKynapsePositions ()
 Calls updatePosition to all kynapse entities. Necessarily done before the worldUpdate.
bool PrepareWorld ()
 Fills a partial WorldDefinition with graphs from the terrain, entities from the scenario editor.
void disableBHAVETasks (DtVrfObject *vrfObject)
 Forces this particular vrfObject to stop using B-HAVE. Cannot be undone.
Kaim::Bot * getKynBotByVrfObject (DtVrfObject *vrfObject)
 Allows access to the kynapse object from a known VR-Forces object.

Static Protected Member Functions

static void preLoadTerrainCallback (const DtFilename &filename, void *usr)
 used as a static adapter to processPreLoadTerrainCallback
static void postLoadTerrainCallback (const DtFilename &filename, void *usr)
 used as a static adapter to processPostLoadTerrainCallback
static void simTickCallback (void *)
 calls processSimTick thanks to the DtKynapseManager pointer which is in KynMgrSimTickArguments (DtSimTickArguments cast)
static void postTickCallback (void *)
 calls processPostTick thanks to the DtKynapseManager pointer which is in KynMgrSimTickArguments (DtSimTickArguments cast)

Protected Attributes

DtBhavePluginOptionsmyBhavePluginOptions
 Configuration options.
DtCgfmyCgf
 pointer to main VRF application
Kaim::World * myWorld
 Kynapse AI World.
DtVrlLogBridgemyLogBridge
 Extend kynapse logging to use DtWarn etc.
DtDrawingViewerBridgemyDrawingBridge
 Shared memory drawer.
DtVrfCollisionBridgemyCollisionBridge
 Forces Kynapse to use VR-Forces for collision checks.
DtKynapseObstacleManagermyObstacleManager
 Manages all area obstacles in your scene.
DtVrfBodyManagermyBodyManager
 Manages all objects thar are not directly controlled by Kynapse.
std::list< Kaim::PathData * > myPathDataList
 A list of all loaded pathdatas. Must match the database list.
std::list< Kaim::Database * > myPathDatabaseList
 A list of all loaded pathdata databases. Must match the pathdata list.
DtFilename myTerrainFilename
std::map< DtString, double > myPathDataHeights
 Path data types ("lifeform", "groundplatform") mapped to the height used when generating pathdata for that type.
int myTickCount

Static Protected Attributes

static DtKynapseManagertheKynapseManager
static Kaim::Engine * theKynapseEngine

Private Member Functions

 DtKynapseManager ()
 No public constructor for singletons.
bool BHAVELicenseCheck ()
 Enables B-HAVE, if it is valid to do so.

Detailed Description

The main singleton class that connects Kynapse with VR-Forces.

This class must be initialized on plugin loading or Kynapse will never load and B-HAVE won't do anything.

Constructor & Destructor Documentation

virtual BHAVE::DtKynapseManager::~DtKynapseManager ( )
virtual

called in DtUnloadVrfPlugin()

BHAVE::DtKynapseManager::DtKynapseManager ( )
private

No public constructor for singletons.

Member Function Documentation

static DtKynapseManager* BHAVE::DtKynapseManager::instance ( )
static

Singleton class.

This grabs the one kynapse manager or creates one if none exists. Note that it still needs to be initialized after creation.

virtual bool BHAVE::DtKynapseManager::init ( DtCgf cgf)
virtual

called after instantiation to make all the connections with VRF

virtual void BHAVE::DtKynapseManager::closeKynapseWorld ( )
virtual

called after delete AND after a new terrain is loaded.

Deletes the kynapse world and all pathdata.

DtBhavePluginOptions* BHAVE::DtKynapseManager::pluginOptions ( )

Plugin options - Essentially the current configuration of B-HAVE.

virtual Kaim::World* BHAVE::DtKynapseManager::getKynapseWorld ( )
inlinevirtual
virtual DtCgf* BHAVE::DtKynapseManager::getCgf ( )
inlinevirtual
virtual DtBhaveFactories* BHAVE::DtKynapseManager::getFactories ( )
inlinevirtual
virtual double BHAVE::DtKynapseManager::getPathDataHeight ( const DtString pathDataName) const
virtual

Returns the height used when generating the pathdata that is in.

virtual void BHAVE::DtKynapseManager::registerKynapseActuators ( )
protectedvirtual

Register all actuators that Kynapse needs with VR-Forces.

virtual void BHAVE::DtKynapseManager::registerKynapseControllers ( )
protectedvirtual

Register all controllers that Kynapse needs with VR-Forces.

static void BHAVE::DtKynapseManager::preLoadTerrainCallback ( const DtFilename &  filename,
void *  usr 
)
staticprotected

used as a static adapter to processPreLoadTerrainCallback

virtual void BHAVE::DtKynapseManager::processPreLoadTerrainCallback ( const DtFilename &  filename)
protectedvirtual

before a new terrain is loaded, we need to clean up a bit

static void BHAVE::DtKynapseManager::postLoadTerrainCallback ( const DtFilename &  filename,
void *  usr 
)
staticprotected

used as a static adapter to processPostLoadTerrainCallback

virtual void BHAVE::DtKynapseManager::processPostLoadTerrainCallback ( const DtFilename &  filename)
protectedvirtual

when a new terrain has been loaded (w/ new pathdata from metafile), we can create a new world

static void BHAVE::DtKynapseManager::simTickCallback ( void *  )
staticprotected

calls processSimTick thanks to the DtKynapseManager pointer which is in KynMgrSimTickArguments (DtSimTickArguments cast)

static void BHAVE::DtKynapseManager::postTickCallback ( void *  )
staticprotected

calls processPostTick thanks to the DtKynapseManager pointer which is in KynMgrSimTickArguments (DtSimTickArguments cast)

virtual void BHAVE::DtKynapseManager::processSimTick ( void *  )
protectedvirtual

updates and calls Kynapse::WorldUpdate

virtual void BHAVE::DtKynapseManager::processPostTick ( void *  )
protectedvirtual

Do anything that needs to be done at the end of a tick.

virtual void BHAVE::DtKynapseManager::updateAllKynapsePositions ( )
protectedvirtual

Calls updatePosition to all kynapse entities. Necessarily done before the worldUpdate.

bool BHAVE::DtKynapseManager::PrepareWorld ( )
protected

Fills a partial WorldDefinition with graphs from the terrain, entities from the scenario editor.

void BHAVE::DtKynapseManager::disableBHAVETasks ( DtVrfObject vrfObject)
protected

Forces this particular vrfObject to stop using B-HAVE. Cannot be undone.

Kaim::Bot* BHAVE::DtKynapseManager::getKynBotByVrfObject ( DtVrfObject vrfObject)
protected

Allows access to the kynapse object from a known VR-Forces object.

bool BHAVE::DtKynapseManager::BHAVELicenseCheck ( )
private

Enables B-HAVE, if it is valid to do so.

Messing with this function is certain to cause license errors.

Member Data Documentation

DtKynapseManager* BHAVE::DtKynapseManager::theKynapseManager
staticprotected
Kaim::Engine* BHAVE::DtKynapseManager::theKynapseEngine
staticprotected
DtBhavePluginOptions* BHAVE::DtKynapseManager::myBhavePluginOptions
protected

Configuration options.

DtCgf* BHAVE::DtKynapseManager::myCgf
protected

pointer to main VRF application

Kaim::World* BHAVE::DtKynapseManager::myWorld
protected

Kynapse AI World.

DtVrlLogBridge* BHAVE::DtKynapseManager::myLogBridge
protected

Extend kynapse logging to use DtWarn etc.

DtDrawingViewerBridge* BHAVE::DtKynapseManager::myDrawingBridge
protected

Shared memory drawer.

DtVrfCollisionBridge* BHAVE::DtKynapseManager::myCollisionBridge
protected

Forces Kynapse to use VR-Forces for collision checks.

DtKynapseObstacleManager* BHAVE::DtKynapseManager::myObstacleManager
protected

Manages all area obstacles in your scene.

DtVrfBodyManager* BHAVE::DtKynapseManager::myBodyManager
protected

Manages all objects thar are not directly controlled by Kynapse.

std::list<Kaim::PathData*> BHAVE::DtKynapseManager::myPathDataList
protected

A list of all loaded pathdatas. Must match the database list.

std::list<Kaim::Database*> BHAVE::DtKynapseManager::myPathDatabaseList
protected

A list of all loaded pathdata databases. Must match the pathdata list.

DtFilename BHAVE::DtKynapseManager::myTerrainFilename
protected
std::map<DtString, double> BHAVE::DtKynapseManager::myPathDataHeights
protected

Path data types ("lifeform", "groundplatform") mapped to the height used when generating pathdata for that type.

int BHAVE::DtKynapseManager::myTickCount
protected

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

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)