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

Public Member Functions | |
| virtual | ~DtLuaScriptInterfaceImpl () |
| virtual void | init () |
| virtual DtString | type () const |
| Script engine type. | |
| virtual bool | invokeInit () |
| virtual void | invokeTick () |
| This will be called by the parent to invoke the script tick. | |
| virtual bool | loadScript () |
| 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 void | processScenarioSave (DtRwVariableBindings *saveState) |
| Called when the scenario is saved. | |
| virtual bool | processScenarioLoad (const DtRwVariableBindings *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. | |
| 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 | luaGetObjectsNear (const DtLocation3D &loc, double distance) |
| 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) |
| 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. | |
| 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. | |
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 | setParent (DtScriptMultiTaskController *parent) |
| Sets the parent of this object. | |
| virtual DtScriptMultiTaskController * | parent () 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 |
| 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. | |
| bool | doesChordHitTerrain (const DtLocation3D &pt1, const DtLocation3D &pt2, bool &dataAvailableart) const |
| Determines if the chord formed by (point1, point2) intersects the terrain. | |
| virtual 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 | removeLuaScriptInterfaceExtension (DtLuaScriptInterfaceExtension::CreatorFcn extension, void *usr) |
| Remove an extension. | |
| static void | textReportCallback (const DtVrfObjectMessage *m, void *usr) |
Protected Types | |
| typedef std::vector < DtLuaScriptInterfaceExtension * > | LocalInterfaceExtensions |
| typedef std::list< std::pair < DtLuaScriptInterfaceExtension::CreatorFcn, void * > > | 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 () | |
| 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 bool | scriptText (std::string &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 |
| DtVrfObject * | myEntity |
| DtRwVariableBindings | myTaskVariables |
| DtScriptMultiTaskController * | myParent |
| bool | myTaskStarting |
| Indicates that a new task is starting, and should be initialized on the next tick. | |
Static Protected Attributes | |
| static GlobalInterfaceExtensions | theLuaInterfaceExtensions |
|
protected |
|
protected |
|
protected |
|
protected |
|
virtual |
|
protected |
|
static |
|
virtual |
Reimplemented from DtScriptInterface.
|
virtual |
Script engine type.
Implements DtScriptInterface.
|
virtual |
Implements DtScriptInterface.
|
virtual |
This will be called by the parent to invoke the script tick.
Implements DtScriptInterface.
|
virtual |
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.
| usr | A pointer that will be passed to the creator function when called. |
|
static |
Remove an extension.
|
virtual |
|
virtual |
| 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.
| 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.
| 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::luaGetObjectsNear | ( | const DtLocation3D & | loc, |
| double | distance | ||
| ) |
| 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 | ||
| ) |
| 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.
|
protectedvirtual |
|
protected |
|
protected |
|
protected |
|
staticprotected |