![]() |
VR-Forces 4.0.4 Class Documentation
|
Controller for using Lua scripts. More...

Public Member Functions | |
| DtLuaScriptController (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=NULL, DtReaderWriterRegistry *parentRegistry=0) | |
| constructor | |
| virtual | ~DtLuaScriptController () |
| destructor | |
| DtLuaScriptController (const DtLuaScriptController &orig) | |
| copy constructor | |
| DtLuaScriptController & | operator= (const DtLuaScriptController &orig) |
| assignment operator | |
| virtual bool | init (DtLuaScriptManager *manager) |
| virtual bool | createScriptPSR () |
| virtual void | setLuaState (lua_State *L) |
| virtual lua_State * | getLuaState () |
| virtual DtString | type () const |
| Returns the string type for this component. | |
| virtual void | registerTaskMsgCallbacks () |
| Register a callback for notification of DtUserTask messages. | |
| virtual void | unregisterTaskMsgCallbacks () |
| Unregister a callback for notification of DtUserTask messages. | |
| const DtSensorContactInfoList & | getSensorContacts () |
| Gives a pointer to target detection list. | |
| virtual void | processSetViewTarget (DtSimMessage *msg) |
| Processes a Set View Target command, using BaseEntity::SetViewTarget() | |
| virtual void | processTextRadioMessage (DtTextReport *textReport) |
| Processes a Text Radio Message. | |
| virtual void | processLocationRequest (DtSetLocationRequest *textReport) |
| Processes a Location Request Message. | |
| virtual DtBoolean | checkTick () |
| virtual void | tick () |
| virtual void | firstTick () |
| virtual bool | tickWhileDestroyed () const |
| If the component returns true here, it will be ticked regardless of the destroyed state of the host entity. | |
| virtual void | NotifyTaskCompleted (bool success=true) |
| VR-Forces Task methods. | |
| virtual void | clearTask () |
Static Public Member Functions | |
| static DtSimComponent * | creator (const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc, DtReaderWriterRegistry *parentRegistry) |
| This is called by the factory. | |
| static void | setViewTargetCallback (DtSimMessage *msg, void *usr) |
| Callback for processing "Set View Target" messages. | |
Protected Member Functions | |
| virtual DtBoolean | createPortGroups () |
| methods | |
| virtual DtBoolean | createPorts () |
| virtual void | processRequestScriptName (const DtVrfObjectMessage *msg) |
| virtual DtBoolean | deactivateOutputControl () |
| virtual void | sendScriptName (const DtString &script, const DtString &origSender) |
| virtual void | processAboutToSaveCheckpoint () |
| Called just before the chechpoint file is written, so the controller has a chance to put things to the PSR. | |
| virtual void | processPostLoadCheckpoint () |
| Called after the scenario has been read, so the controller has a chance to restore data from the PSR. | |
Static Protected Member Functions | |
| static void | requestScriptNameCallback (const DtVrfObjectMessage *msg, void *usr) |
| static void | aboutToSaveCheckpointCallback (DtScenario &scn, void *usr) |
| static void | postLoadCheckpointCallback (const DtScenario &scn, void *usr) |
| static void | postRewindCallback (void *usr) |
Protected Attributes | |
| DtUserTask | myUserTask |
| attributes | |
| DtScriptPSR * | myScriptPSR |
| process state repository : records state info for this controller (movement mode, vrf debug route..) | |
| DtLuaScriptManager * | myScriptManager |
| bool | myFirstTick |
| DtString | myLUAScript |
| current lua script name | |
| lua_State * | myLState |
| current lua state | |
| bool | m_luaScriptWarningShown |
| virtual void | processSetScript (DtSimMessage *msg) |
| Manage Lua scripts. | |
| void | setScript (const DtString &name) |
| Manage Lua scripts. | |
| virtual DtString | getScriptName () |
| Manage Lua scripts. | |
| virtual void | setScriptNameAndLoad (const DtString &name) |
| Manage Lua scripts. | |
| virtual DtString | getScriptSerialization () |
| Manage Lua scripts. | |
| virtual void | setScriptFromSerialization (const DtString &buffer) |
| Manage Lua scripts. | |
| static void | setScriptCallback (DtSimMessage *msg, void *usr) |
| Manage Lua scripts. | |
Controller for using Lua scripts.
This controller provides the ability to use Lua scripts to create other behaviours.
| vrfLua::DtLuaScriptController::DtLuaScriptController | ( | const DtString & | name, |
| DtVrfObject * | owner, | ||
| DtSimManager * | simManager, | ||
| DtComponentDescriptor * | desc = NULL, |
||
| DtReaderWriterRegistry * | parentRegistry = 0 |
||
| ) |
constructor
| virtual vrfLua::DtLuaScriptController::~DtLuaScriptController | ( | ) | [virtual] |
destructor
copy constructor
| DtLuaScriptController& vrfLua::DtLuaScriptController::operator= | ( | const DtLuaScriptController & | orig | ) |
assignment operator
| virtual bool vrfLua::DtLuaScriptController::init | ( | DtLuaScriptManager * | manager | ) | [virtual] |
| virtual bool vrfLua::DtLuaScriptController::createScriptPSR | ( | ) | [virtual] |
| virtual void vrfLua::DtLuaScriptController::setLuaState | ( | lua_State * | L | ) | [virtual] |
| virtual lua_State* vrfLua::DtLuaScriptController::getLuaState | ( | ) | [virtual] |
| virtual DtString vrfLua::DtLuaScriptController::type | ( | ) | const [virtual] |
Returns the string type for this component.
Implements DtTaskControllerComponent.
| static DtSimComponent* vrfLua::DtLuaScriptController::creator | ( | const DtString & | name, |
| DtVrfObject * | owner, | ||
| DtSimManager * | simManager, | ||
| DtComponentDescriptor * | desc, | ||
| DtReaderWriterRegistry * | parentRegistry | ||
| ) | [static] |
This is called by the factory.
| virtual void vrfLua::DtLuaScriptController::registerTaskMsgCallbacks | ( | ) | [virtual] |
Register a callback for notification of DtUserTask messages.
Overrides this so it can register its interest in DtUserTask* commands
Reimplemented from DtTaskControllerComponent.
| virtual void vrfLua::DtLuaScriptController::unregisterTaskMsgCallbacks | ( | ) | [virtual] |
Unregister a callback for notification of DtUserTask messages.
This is used if the entity cannot process DtUserTasks
Gives a pointer to target detection list.
| static void vrfLua::DtLuaScriptController::setScriptCallback | ( | DtSimMessage * | msg, |
| void * | usr | ||
| ) | [static] |
Manage Lua scripts.
Callback for receiving the DtSetScript messages that contain the name of the script to be run. Calls processSetScript().
| virtual void vrfLua::DtLuaScriptController::processSetScript | ( | DtSimMessage * | msg | ) | [virtual] |
Manage Lua scripts.
Callback for receiving the DtSetScript messages that contain the name of the script to be run. Calls processSetScript().
| void vrfLua::DtLuaScriptController::setScript | ( | const DtString & | name | ) |
Manage Lua scripts.
Callback for receiving the DtSetScript messages that contain the name of the script to be run. Calls processSetScript().
| virtual DtString vrfLua::DtLuaScriptController::getScriptName | ( | ) | [virtual] |
Manage Lua scripts.
Callback for receiving the DtSetScript messages that contain the name of the script to be run. Calls processSetScript().
| virtual void vrfLua::DtLuaScriptController::setScriptNameAndLoad | ( | const DtString & | name | ) | [virtual] |
Manage Lua scripts.
Callback for receiving the DtSetScript messages that contain the name of the script to be run. Calls processSetScript().
| virtual DtString vrfLua::DtLuaScriptController::getScriptSerialization | ( | ) | [virtual] |
Manage Lua scripts.
Callback for receiving the DtSetScript messages that contain the name of the script to be run. Calls processSetScript().
| virtual void vrfLua::DtLuaScriptController::setScriptFromSerialization | ( | const DtString & | buffer | ) | [virtual] |
Manage Lua scripts.
Callback for receiving the DtSetScript messages that contain the name of the script to be run. Calls processSetScript().
| static void vrfLua::DtLuaScriptController::setViewTargetCallback | ( | DtSimMessage * | msg, |
| void * | usr | ||
| ) | [static] |
Callback for processing "Set View Target" messages.
Calls processSetViewTarget()
| virtual void vrfLua::DtLuaScriptController::processSetViewTarget | ( | DtSimMessage * | msg | ) | [virtual] |
Processes a Set View Target command, using BaseEntity::SetViewTarget()
| virtual void vrfLua::DtLuaScriptController::processTextRadioMessage | ( | DtTextReport * | textReport | ) | [virtual] |
Processes a Text Radio Message.
| virtual void vrfLua::DtLuaScriptController::processLocationRequest | ( | DtSetLocationRequest * | textReport | ) | [virtual] |
Processes a Location Request Message.
| virtual DtBoolean vrfLua::DtLuaScriptController::checkTick | ( | ) | [virtual] |
Returns true if tick() must be completed.
| virtual void vrfLua::DtLuaScriptController::NotifyTaskCompleted | ( | bool | success = true | ) | [virtual] |
VR-Forces Task methods.
Switch to next task if current one has completed
| virtual void vrfLua::DtLuaScriptController::clearTask | ( | ) | [virtual] |
Stops any currently executing task.
Reimplemented from DtSingleTaskControllerComponent.
| virtual void vrfLua::DtLuaScriptController::tick | ( | ) | [virtual] |
Transmit steering and throttle information from the action computed by the kynapse entity's brain, and provide them thanks to automotive output port group.
Reimplemented from DtSimComponent.
| virtual void vrfLua::DtLuaScriptController::firstTick | ( | ) | [virtual] |
| virtual bool vrfLua::DtLuaScriptController::tickWhileDestroyed | ( | ) | const [virtual] |
If the component returns true here, it will be ticked regardless of the destroyed state of the host entity.
Otherwise, tick will only be called when the entity is alive.
Reimplemented from DtSimComponent.
| virtual DtBoolean vrfLua::DtLuaScriptController::createPortGroups | ( | ) | [protected, virtual] |
methods
Reimplemented from DtSimComponent.
| virtual DtBoolean vrfLua::DtLuaScriptController::createPorts | ( | ) | [protected, virtual] |
Create input/output ports
Reimplemented from DtSimComponent.
| static void vrfLua::DtLuaScriptController::requestScriptNameCallback | ( | const DtVrfObjectMessage * | msg, |
| void * | usr | ||
| ) | [static, protected] |
| virtual void vrfLua::DtLuaScriptController::processRequestScriptName | ( | const DtVrfObjectMessage * | msg | ) | [protected, virtual] |
| virtual DtBoolean vrfLua::DtLuaScriptController::deactivateOutputControl | ( | ) | [inline, protected, virtual] |
| virtual void vrfLua::DtLuaScriptController::sendScriptName | ( | const DtString & | script, |
| const DtString & | origSender | ||
| ) | [protected, virtual] |
| static void vrfLua::DtLuaScriptController::aboutToSaveCheckpointCallback | ( | DtScenario & | scn, |
| void * | usr | ||
| ) | [static, protected] |
| virtual void vrfLua::DtLuaScriptController::processAboutToSaveCheckpoint | ( | ) | [protected, virtual] |
Called just before the chechpoint file is written, so the controller has a chance to put things to the PSR.
| static void vrfLua::DtLuaScriptController::postLoadCheckpointCallback | ( | const DtScenario & | scn, |
| void * | usr | ||
| ) | [static, protected] |
| static void vrfLua::DtLuaScriptController::postRewindCallback | ( | void * | usr | ) | [static, protected] |
| virtual void vrfLua::DtLuaScriptController::processPostLoadCheckpoint | ( | ) | [protected, virtual] |
Called after the scenario has been read, so the controller has a chance to restore data from the PSR.
DtUserTask vrfLua::DtLuaScriptController::myUserTask [protected] |
attributes
Current task
DtScriptPSR* vrfLua::DtLuaScriptController::myScriptPSR [protected] |
process state repository : records state info for this controller (movement mode, vrf debug route..)
bool vrfLua::DtLuaScriptController::myFirstTick [protected] |
DtString vrfLua::DtLuaScriptController::myLUAScript [protected] |
current lua script name
lua_State* vrfLua::DtLuaScriptController::myLState [protected] |
current lua state