![]() |
VR-Forces 4.2 Class Documentation
|

Classes | |
| struct | LuaExtension |
Public Member Functions | |
| virtual | ~DtLuaScriptInterfaceImpl () |
| virtual void | init () |
| Derived class inits may do things, so init should always be called. | |
| virtual DtString | type () const |
| Script engine type. | |
| virtual bool | invokeInit () |
| virtual void | invokeSuspend () |
| virtual bool | invokeResume () |
| virtual void | invokeTick () |
| This will be called by the parent to invoke the script tick. | |
| virtual bool | invokeCheck () |
| virtual void | invokeCheckInit () |
| virtual bool | loadScript (bool reload) |
| This will be called by the parent to let the interface know when to load the script. | |
| virtual void | setLuaState (lua_State *L) |
| virtual lua_State * | getLuaState () |
| virtual DtReaderWriter * | saveState () |
| Called when the scenario is saved. | |
| virtual bool | loadState (const DtReaderWriter *loadState) |
| Called when the scenario is loaded. | |
| virtual void | processClearForReuse () |
| This function should be overridden by the inheritor to clear out any task specific variables. | |
| virtual bool | initializeVRFLuaExtensions (lua_State *L) |
| virtual bool | importTaskParams (lua_State *L) |
| void | luaEndTask (bool success) |
| Admin functions called from Lua. | |
| int | luaSendTask (DtScriptVrfObject &object, const ::std::string taskName, luabind::object const ¶meters) |
| Send task to another entity. | |
| int | luaSendTaskActAsSubtask (DtScriptVrfObject &object, const ::std::string taskName, luabind::object const ¶meters, bool actAsSubtask) |
| void | luaStopAllTasks () |
| Stops all tasks started by this task. | |
| void | luaSendSetDataToSelf (const ::std::string setName, luabind::object const ¶meters) |
| Send a set-data message to self. | |
| void | luaSendSetData (DtScriptVrfObject &object, const ::std::string setName, luabind::object const ¶meters) |
| Send a set-data message to another entity. | |
| luabind::object | luaGetReactionStatus () |
| Provide current reaction status to lua scripts. | |
| std::string | luaGetScriptId () |
| Provide the current script ID to lua scripts. | |
| luabind::object | luaGetObjectsNear (const DtLocation3D &loc, double distance) |
| luabind::object | luaGetObjectsNearWithFilter (const DtLocation3D &loc, double distance, luabind::object const ¶meters) |
| luabind::object | luaGetVrfObjects () |
| Returns a list of all scripted objects. | |
| DtLuaFeatureSet | luaGetFeaturesWithinArea (luabind::object const &points, luabind::object const &attributes) |
| Routines to query and return feature sets Returns a feature set which contains all features within the specified geometry containing the specified attributes. | |
| DtLuaFeatureSet | luaGetFeaturesWithinAreaNoAttributes (luabind::object const &points) |
| DtLuaFeatureSet | luaGetFeaturesWithinRange (const DtLocation3D &, double range, luabind::object const &attributes) |
| Returns a feature set which contains all features within the specified point and box size containing the specified attributes. | |
| DtLuaFeatureSet | luaGetFeaturesWithinRangeNoAttributes (const DtLocation3D &, double range) |
| boost::shared_ptr< DtLuaAsyncJob > | luaNavigateThroughFeatures (const luabind::object ¶meters) |
| Returns an async job object which will produce a path (set of points) from the input points. | |
| void | luaSendMessage (const DtScriptVrfObject &receiver, const std::string &message) |
| void | luaDeleteObject (std::string const &receiver) |
| void | luaDeleteScriptObject (const DtScriptVrfObject &receiver) |
| virtual void | processTextReport (const DtVrfObjectMessage *m) |
| int | luaStartSubtask (const std::string taskName, luabind::object const ¶meters) |
| Global functions that have Lua-specific dependencies. | |
| void | luaStopSubtask (int subtaskId) |
| Global functions that have Lua-specific dependencies. | |
| void | luaStopAllSubtasks () |
| Stops all subtasks that were started by this task. | |
| bool | luaIsSubtaskRunning (int subtaskId) |
| bool | luaIsSubtaskComplete (int subtaskId) |
| bool | luaIsSubtaskCanceled (int subtaskId) |
| bool | luaSubtaskResult (int subtaskId) |
| DtScriptVrfObject | luaCreateEntity (luabind::object const ¶meters) |
| Create an entity. | |
| DtScriptVrfObject | luaCreateTacticalGraphic (luabind::object const ¶meters) |
| Create a tactical graphic. Must specify name or type. | |
| DtScriptVrfObject | luaCreateObstacle (luabind::object const ¶meters) |
| Create an obstacle. | |
| DtScriptVrfObject | luaCreateRoute (luabind::object const ¶meters) |
| Create a route. | |
| DtScriptVrfObject | luaCreateArea (luabind::object const ¶meters) |
| Create an area. | |
| DtScriptVrfObject | luaCreateWaypoint (luabind::object const ¶meters) |
| Create a waypoint. | |
| DtScriptVrfObject | luaCreatePhaseLine (luabind::object const ¶meters) |
| Creates a phase line. | |
| unsigned | luaBitwiseOr (unsigned val1, unsigned val2) |
| unsigned | luaBitwiseAnd (unsigned val1, unsigned val2) |
| unsigned | luaBitwiseXor (unsigned val1, unsigned val2) |
| unsigned | luaBitwiseNot (unsigned val) |
| unsigned | luaBitwiseLeftShift (unsigned val, unsigned shift) |
| unsigned | luaBitwiseRightShift (unsigned val, unsigned shift) |
Public Member Functions inherited from DtScriptInterface | |
| virtual | ~DtScriptInterface () |
| virtual void | setTaskId (int taskId) |
| virtual int | taskId () const |
| virtual void | setScriptId (const DtString &scriptId) |
| virtual const DtString & | scriptId () const |
| virtual void | setScriptPath (const DtFilename &scriptPath) |
| virtual const DtFilename & | scriptPath () const |
| virtual void | setEntity (DtVrfObject *entity) |
| virtual DtVrfObject * | entity () const |
| virtual void | setTaskVariables (const DtRwVariableBindings &variables) |
| virtual const DtRwVariableBindings & | taskVariables () const |
| virtual bool | updateTaskVariables () |
| virtual void | setTaskStarting (bool v) |
| virtual bool | taskStarting () const |
| virtual void | setController (DtScriptTaskControllerInterface *controller) |
| virtual DtScriptTaskControllerInterface * | controller () |
| virtual void | setTaskResuming (bool v) |
| Flag indicating if the task is resuming from a suspended state. | |
| virtual bool | taskResuming () const |
| Flag indicating if the task is resuming from a suspended state. | |
| double | scriptGetExerciseTime () |
| Methods that are available for any script to use. | |
| double | scriptGetTimeOfDay () |
| Methods that are available for any script to use. | |
| double | scriptGetWindSpeed () |
| Returns wind speed in meters/second. | |
| double | scriptGetWindDirection () |
| Returns wind direction in radians. | |
| DtScriptVrfObject | scriptGetVrfObjectByName (const std::string name) |
| Methods that are available for any script to use. | |
| void | printError (const std::string message) |
| Methods that are available for any script to use. | |
| void | printWarn (const std::string message) |
| Methods that are available for any script to use. | |
| void | printInfo (const std::string message) |
| Methods that are available for any script to use. | |
| void | printVerbose (const std::string message) |
| Methods that are available for any script to use. | |
| void | printDebug (const std::string message) |
| Methods that are available for any script to use. | |
| bool | entityTypeMatches (const std::string &, const std::string &) |
| Methods that are available for any script to use. | |
| void | setTickPeriod (double) |
| Tick management. Will store information in PSR of controller only. | |
| double | getTerrainAltitude (const double lat, const double lon, bool &dataAvailable, std::string &surface) const |
| Gets the terrain height at the given location. | |
| double | getGroundAltitude (const double lat, const double lon, bool &isWater, bool &dataAvailable) |
| Gets the height of the ground at the given location. | |
| void | chordIntersectionDebug (const DtLocation3D &startLoc, const DtLocation3D &endLoc) |
| Script function for debugging chord-terrain intersections. | |
| bool | doesChordHitTerrain (const DtLocation3D &pt1, const DtLocation3D &pt2, bool &dataAvailable) const |
| Determines if the chord formed by (point1, point2) intersects the terrain. | |
| DtLocation3D | findClosestPointToRoad (const DtLocation3D &point, double searchRadius, bool &dataAvailable, bool &success) const |
| Methods that are available for any script to use. | |
| std::string | getForceName (int forceType) |
| Methods that are available for any script to use. | |
| bool | forcesHostile (std::string force1, std::string force2) |
| Methods that are available for any script to use. | |
Static Public Member Functions | |
| static DtScriptInterface * | creator () |
| static void | addLuaScriptInterfaceExtension (DtLuaScriptInterfaceExtension::CreatorFcn extension, void *usr) |
| Add a new extension creator function. | |
| static void | addLuaScriptInterfaceExtension (DtLuaScriptInterfaceExtension::CreatorFcn extension, const DtVrfObject *onlyForEntity, void *usr) |
| Add a new extension creator function. | |
| static void | removeLuaScriptInterfaceExtension (DtLuaScriptInterfaceExtension::CreatorFcn extension, void *usr) |
| Remove an extension. | |
| static void | removeLuaScriptInterfaceExtension (DtLuaScriptInterfaceExtension::CreatorFcn extension, const DtVrfObject *onlyForEntity, void *usr) |
| Removes only for particular entity if registered for that entity. | |
| static void | addKeyToIgnore (const std::string &) |
| When serializing ignore any key found in this list. Uses instance of luaObjectSerializer. | |
| static void | removeKeyToIgnore (const std::string &) |
| Removes a key to ignore during serialization Uses instance of luaObjectSerializer. | |
| static void | textReportCallback (const DtVrfObjectMessage *m, void *usr) |
Protected Types | |
| typedef std::vector < DtLuaScriptInterfaceExtension * > | LocalInterfaceExtensions |
| typedef std::vector< LuaExtension > | GlobalInterfaceExtensions |
Protected Member Functions | |
| DtLuaScriptInterfaceImpl () | |
| DtLuaScriptInterfaceImpl (const DtLuaScriptInterfaceImpl &other) | |
| DtLuaScriptInterfaceImpl & | operator= (const DtLuaScriptInterfaceImpl &other) |
| virtual bool | callLuaNoArgFunction (const std::string &functionName) |
Protected Member Functions inherited from DtScriptInterface | |
| DtScriptInterface () | |
| Call the DtScriptInterfaceHandler::createScriptInterface() function to create one. | |
| DtScriptInterface (const DtScriptInterface &other) | |
| DtScriptInterface & | operator= (const DtScriptInterface &other) |
| virtual void | scriptTaskComplete (bool success) |
| This function is meant to be called by the script itself or the script object to tell the parent that the script task is complete. | |
| virtual void | scriptTaskError () |
| virtual bool | scriptText (DtString &text) |
| Returns the script text as a string and a bool on whether the text is valid or not. | |
| virtual const DtReaderWriter * | getTaskParam (const DtString ¶mName) |
| virtual bool | getParamMetaDataType (const DtString ¶mName, DtString &typeName) |
Protected Attributes | |
| lua_State * | myLState |
| bool | myLuaScriptWarningShown |
| LocalInterfaceExtensions | myInterfaceExtensions |
Protected Attributes inherited from DtScriptInterface | |
| int | myTaskId |
| DtString | myScriptId |
| DtFilename | myScriptPath |
| DtScriptTaskControllerInterface * | myControllerInterface |
| DtVrfObject * | myEntity |
| DtRwVariableBindings | myTaskVariables |
| bool | myTaskStarting |
| Indicates that a new task is starting, and should be initialized on the next tick. | |
| bool | myTaskResuming |
Static Protected Attributes | |
| static GlobalInterfaceExtensions | theLuaInterfaceExtensions |
|
protected |
|
protected |
|
protected |
|
protected |
|
virtual |
|
protected |
|
static |
|
virtual |
Derived class inits may do things, so init should always be called.
Reimplemented from DtScriptInterface.
|
virtual |
Script engine type.
Implements DtScriptInterface.
|
virtual |
Implements DtScriptInterface.
|
virtual |
Implements DtScriptInterface.
|
virtual |
Implements DtScriptInterface.
|
virtual |
This will be called by the parent to invoke the script tick.
Implements DtScriptInterface.
|
virtual |
Implements DtScriptInterface.
|
virtual |
Implements DtScriptInterface.
This will be called by the parent to let the interface know when to load the script.
Implements DtScriptInterface.
|
virtual |
|
virtual |
|
virtual |
Called when the scenario is saved.
The stateState pointer may not be valid, in which case something went wrong with saving
Implements DtScriptInterface.
|
virtual |
Called when the scenario is loaded.
The load state pointer may not be valid, which does not indicate that the scenario loaded incorrectly, but that the data for this particular script interface was either corrupt or did not exist.
Implements DtScriptInterface.
|
virtual |
This function should be overridden by the inheritor to clear out any task specific variables.
This version should probably be called last if you override it rather than first to take care of things before these things get cleared.
Reimplemented from DtScriptInterface.
|
static |
Add a new extension creator function.
This creator will be called every time a new lua environment is created. Will be applied to all entities
| usr | A pointer that will be passed to the creator function when called. |
|
static |
Add a new extension creator function.
This creator will be called every time a new lua environment is created.
| onlyForEntity | Only invoke the creator if the entity being tasked is the entity this is registered for |
| usr | A pointer that will be passed to the creator function when called. |
|
static |
Remove an extension.
|
static |
Removes only for particular entity if registered for that entity.
If there is one registered for all entities and none registered for this entity then no action is taken
|
virtual |
|
virtual |
|
static |
When serializing ignore any key found in this list. Uses instance of luaObjectSerializer.
|
static |
Removes a key to ignore during serialization Uses instance of luaObjectSerializer.
| void DtLuaScriptInterfaceImpl::luaEndTask | ( | bool | success | ) |
Admin functions called from Lua.
| int DtLuaScriptInterfaceImpl::luaStartSubtask | ( | const std::string | taskName, |
| luabind::object const & | parameters | ||
| ) |
Global functions that have Lua-specific dependencies.
Subtasking related functions called from Lua Starts a subtask and returns the subtask ID. ID of -1 indicates it failed to start.
| void DtLuaScriptInterfaceImpl::luaStopSubtask | ( | int | subtaskId | ) |
Global functions that have Lua-specific dependencies.
Subtasking related functions called from Lua Starts a subtask and returns the subtask ID. ID of -1 indicates it failed to start.
| void DtLuaScriptInterfaceImpl::luaStopAllSubtasks | ( | ) |
Stops all subtasks that were started by this task.
| bool DtLuaScriptInterfaceImpl::luaIsSubtaskRunning | ( | int | subtaskId | ) |
| bool DtLuaScriptInterfaceImpl::luaIsSubtaskComplete | ( | int | subtaskId | ) |
| bool DtLuaScriptInterfaceImpl::luaIsSubtaskCanceled | ( | int | subtaskId | ) |
| bool DtLuaScriptInterfaceImpl::luaSubtaskResult | ( | int | subtaskId | ) |
| int DtLuaScriptInterfaceImpl::luaSendTask | ( | DtScriptVrfObject & | object, |
| const ::std::string | taskName, | ||
| luabind::object const & | parameters | ||
| ) |
Send task to another entity.
| int DtLuaScriptInterfaceImpl::luaSendTaskActAsSubtask | ( | DtScriptVrfObject & | object, |
| const ::std::string | taskName, | ||
| luabind::object const & | parameters, | ||
| bool | actAsSubtask | ||
| ) |
| void DtLuaScriptInterfaceImpl::luaStopAllTasks | ( | ) |
Stops all tasks started by this task.
| void DtLuaScriptInterfaceImpl::luaSendSetDataToSelf | ( | const ::std::string | setName, |
| luabind::object const & | parameters | ||
| ) |
Send a set-data message to self.
| void DtLuaScriptInterfaceImpl::luaSendSetData | ( | DtScriptVrfObject & | object, |
| const ::std::string | setName, | ||
| luabind::object const & | parameters | ||
| ) |
Send a set-data message to another entity.
| luabind::object DtLuaScriptInterfaceImpl::luaGetReactionStatus | ( | ) |
Provide current reaction status to lua scripts.
| std::string DtLuaScriptInterfaceImpl::luaGetScriptId | ( | ) |
Provide the current script ID to lua scripts.
| luabind::object DtLuaScriptInterfaceImpl::luaGetObjectsNear | ( | const DtLocation3D & | loc, |
| double | distance | ||
| ) |
| luabind::object DtLuaScriptInterfaceImpl::luaGetObjectsNearWithFilter | ( | const DtLocation3D & | loc, |
| double | distance, | ||
| luabind::object const & | parameters | ||
| ) |
| luabind::object DtLuaScriptInterfaceImpl::luaGetVrfObjects | ( | ) |
Returns a list of all scripted objects.
| DtLuaFeatureSet DtLuaScriptInterfaceImpl::luaGetFeaturesWithinArea | ( | luabind::object const & | points, |
| luabind::object const & | attributes | ||
| ) |
Routines to query and return feature sets Returns a feature set which contains all features within the specified geometry containing the specified attributes.
| DtLuaFeatureSet DtLuaScriptInterfaceImpl::luaGetFeaturesWithinAreaNoAttributes | ( | luabind::object const & | points | ) |
| DtLuaFeatureSet DtLuaScriptInterfaceImpl::luaGetFeaturesWithinRange | ( | const DtLocation3D & | , |
| double | range, | ||
| luabind::object const & | attributes | ||
| ) |
Returns a feature set which contains all features within the specified point and box size containing the specified attributes.
The range is in meters. The range will create a bounding box with the point supplied at the center
| DtLuaFeatureSet DtLuaScriptInterfaceImpl::luaGetFeaturesWithinRangeNoAttributes | ( | const DtLocation3D & | , |
| double | range | ||
| ) |
| boost::shared_ptr<DtLuaAsyncJob> DtLuaScriptInterfaceImpl::luaNavigateThroughFeatures | ( | const luabind::object & | parameters | ) |
Returns an async job object which will produce a path (set of points) from the input points.
The output path object will be altered as to move around the features.
| void DtLuaScriptInterfaceImpl::luaSendMessage | ( | const DtScriptVrfObject & | receiver, |
| const std::string & | message | ||
| ) |
| void DtLuaScriptInterfaceImpl::luaDeleteObject | ( | std::string const & | receiver | ) |
| void DtLuaScriptInterfaceImpl::luaDeleteScriptObject | ( | const DtScriptVrfObject & | receiver | ) |
|
static |
|
virtual |
| DtScriptVrfObject DtLuaScriptInterfaceImpl::luaCreateEntity | ( | luabind::object const & | parameters | ) |
Create an entity.
Series of create commands that will use base DtCreateObjectBuilder to create the object and return the created object
| DtScriptVrfObject DtLuaScriptInterfaceImpl::luaCreateTacticalGraphic | ( | luabind::object const & | parameters | ) |
Create a tactical graphic. Must specify name or type.
| DtScriptVrfObject DtLuaScriptInterfaceImpl::luaCreateObstacle | ( | luabind::object const & | parameters | ) |
Create an obstacle.
| DtScriptVrfObject DtLuaScriptInterfaceImpl::luaCreateRoute | ( | luabind::object const & | parameters | ) |
Create a route.
| DtScriptVrfObject DtLuaScriptInterfaceImpl::luaCreateArea | ( | luabind::object const & | parameters | ) |
Create an area.
| DtScriptVrfObject DtLuaScriptInterfaceImpl::luaCreateWaypoint | ( | luabind::object const & | parameters | ) |
Create a waypoint.
| DtScriptVrfObject DtLuaScriptInterfaceImpl::luaCreatePhaseLine | ( | luabind::object const & | parameters | ) |
Creates a phase line.
| unsigned DtLuaScriptInterfaceImpl::luaBitwiseOr | ( | unsigned | val1, |
| unsigned | val2 | ||
| ) |
Series of bitwise operations
| unsigned DtLuaScriptInterfaceImpl::luaBitwiseAnd | ( | unsigned | val1, |
| unsigned | val2 | ||
| ) |
Series of bitwise operations
| unsigned DtLuaScriptInterfaceImpl::luaBitwiseXor | ( | unsigned | val1, |
| unsigned | val2 | ||
| ) |
Series of bitwise operations
| unsigned DtLuaScriptInterfaceImpl::luaBitwiseNot | ( | unsigned | val | ) |
Series of bitwise operations
| unsigned DtLuaScriptInterfaceImpl::luaBitwiseLeftShift | ( | unsigned | val, |
| unsigned | shift | ||
| ) |
Series of bitwise operations
| unsigned DtLuaScriptInterfaceImpl::luaBitwiseRightShift | ( | unsigned | val, |
| unsigned | shift | ||
| ) |
Series of bitwise operations
|
protectedvirtual |
|
protected |
|
protected |
|
protected |
|
staticprotected |