VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
luaScriptInterfaceImpl.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 #pragma once
6 
7 #include <vrfLua/vrfLuaDefines.h>
8 #include <vrfLua/luaFeatureSet.h>
9 #include <vrfLua/luaPathJob.h>
10 
13 #include "vrfutil/scriptGeometry.h"
15 #include <luabind/luabind.hpp>
18 #include <vrfutil/objectCounter.h>
19 
20 #include <lua.hpp>
21 #include <lauxlib.h>
22 #include <lualib.h>
23 
24 #include <boost/signals2.hpp>
25 
26 namespace makVrfEvents
27 {
28  class DtEvent;
29 }
30 
32 
37 typedef luabind::object (*ReaderWriterToLuaTableFcn)(lua_State* LS, const DtReaderWriter* rwString,
38  const DtSimulationServices* mgr, const DtString& parameterType);
39 
40 const char ContactObservedOnly[] = "observedOnly";
41 const char ContactAliveOnly[] = "aliveOnly";
42 const char ContactHostileOnly[] = "hostileOnly";
43 const char ContactCurrentlyDetectedOnly[] = "currentlyDetectedOnly";
44 
49  : public DtScriptInterface
50 #ifdef DtObjectDebugger_Enable
51  , public DtObjectDebugger<DtLuaScriptInterfaceImpl>
52 #endif
53 {
54 protected:
56 
59 
60 public:
61  virtual ~DtLuaScriptInterfaceImpl();
62 
63  static DtScriptInterface* creator(DtSimulationServices*);
64 
65  virtual void init();
66 
67  virtual DtString type() const;
68 
69  virtual bool invokeInit();
70  virtual void invokeSuspend();
71  virtual bool invokeResume();
72  virtual void invokeTick();
73  virtual bool invokeCheck();
74  virtual void invokeCheckInit();
75  virtual void invokeShutdown();
76  virtual void invokeUpdateDisplayGraph();
77 
80  virtual void invokeDisable();
81 
82  virtual bool loadScript(bool reload);
83 
84  virtual void setLuaState(lua_State* L);
85  virtual lua_State* getLuaState();
86 
87  virtual std::string dumpLuaStack() const;
88  virtual int luaStackSize() const;
89  virtual void collectGarbage();
90 
91  virtual DtReaderWriter* saveState();
92  virtual bool loadState(const DtReaderWriter* loadState);
93  virtual void processClearForReuse();
94 
99  static void addLuaScriptInterfaceExtension(DtLuaScriptInterfaceExtension::CreatorFcn extension, void* usr);
100 
105  static void addLuaScriptInterfaceExtension(DtLuaScriptInterfaceExtension::CreatorFcn extension,
106  const DtLocalObject* onlyForEntity, void* usr);
107 
109  static void removeLuaScriptInterfaceExtension(DtLuaScriptInterfaceExtension::CreatorFcn extension, void* usr);
110 
113  static void removeLuaScriptInterfaceExtension(DtLuaScriptInterfaceExtension::CreatorFcn extension,
114  const DtLocalObject* onlyForEntity, void* usr);
115 
116  virtual bool initializeVRFLuaExtensions(lua_State* L);
117  virtual bool importTaskParams(lua_State* L);
118 
120  virtual bool importSetParams(lua_State* L);
121 
123  virtual luabind::object createLuaTableFromRegistry(lua_State* L, const DtReaderWriterRegistry& rwRegistry, bool requireMetadata = true, bool hasParamMetaData = true);
124 
126  static void addKeyToIgnore(const std::string&);
127 
129  static void removeKeyToIgnore(const std::string&);
130 
132  void luaEndTask(bool success);
133  void luaEndSet();
134 
136 
138 
139  virtual void luaPlayScenarioEvent(DtScriptVrfObject eventName);
140  virtual void luaStopScenarioEvent(DtScriptVrfObject eventName);
141  virtual void luaStopScenarioEventWithRewind(DtScriptVrfObject eventName, bool rewind);
142  virtual bool luaIsScenarioEventPlaying(DtScriptVrfObject eventName);
143  virtual void luaSetScenarioEventEnabled(DtScriptVrfObject eventName, bool);
144  virtual bool luaIsScenarioEventEnabled(DtScriptVrfObject eventName);
146 
148 
149  virtual int luaSendEmbeddedEntityTask(std::string eeName, std::string taskName, luabind::object const& parms);
151  virtual int luaSendEmbeddedEntityTaskActAsSubtask(std::string eeName, std::string taskName,
152  luabind::object const& parms, bool actAsSubtask);
154  virtual int luaSendEmbeddedEntitySet(std::string eeName, std::string setName, luabind::object const& parms);
156 
158 
159  int luaStartSubtask(const std::string taskName, luabind::object const& parameters);
161  void luaStopSubtask(int subtaskId);
163  void luaStopAllSubtasks();
165  bool luaIsSubtaskRunning(int subtaskId);
167  bool luaIsSubtaskComplete(int subtaskId);
169  bool luaIsSubtaskCanceled(int subtaskId);
171  bool luaSubtaskResult(int subtaskId);
175  void luaCleanupInactiveSubtaskStatus();
177 
179  void luaSendReportWithoutRecipients(const::std::string reportType,
180  luabind::object const& parameters);
181  void luaSendReport(const::std::string reportType,
182  luabind::object const& reciptients,
183  luabind::object const& parameters);
184 
186  int luaSendTask(DtScriptVrfObject& object, const::std::string taskName,
187  luabind::object const& parameters);
188  int luaSendTaskActAsSubtask(DtScriptVrfObject& object, const::std::string taskName,
189  luabind::object const& parameters, bool actAsSubtask);
190  int luaSendRadioTask(DtScriptVrfObject& object, const::std::string taskName,
191  luabind::object const& parameters);
192  int luaSendRadioTaskActAsSubtask(DtScriptVrfObject& object, const::std::string taskName,
193  luabind::object const& parameters, bool actAsSubtask);
194  int luaSendTaskActAsSubtaskWithRadio(DtScriptVrfObject& object, const::std::string taskName,
195  luabind::object const& parameters, bool actAsSubtask, bool sendWithRadio);
196 
198  void luaStopAllTasks();
199 
201  void luaSendSetDataToSelf(const::std::string setName,
202  luabind::object const& parameters);
203 
205  void luaSendSetData(DtScriptVrfObject& object, const::std::string setName,
206  luabind::object const& parameters);
207  void luaSendRadioSetData(DtScriptVrfObject& object, const::std::string setName,
208  luabind::object const& parameters);
209  void sendSetDataWithRadio(DtScriptVrfObject& object, const::std::string setName,
210  luabind::object const& parameters, bool useRadio);
211 
212  bool luaIsTaskAvailable(const::std::string taskName);
213  bool luaIsSetAvailable(const::std::string setName);
214 
216  luabind::object luaGetReactionStatus();
217 
226  luabind::object luaGetOrbatList();
227 
229  std::string luaGetScriptId();
230 
232  std::string luaGetSystemName();
233 
234  luabind::object luaGetObjectsNear(const DtLocation3D& loc, double distance);
235  luabind::object luaGetObjectsNearWithFilter(const DtLocation3D& loc, double distance, luabind::object const& parameters);
236 
237  luabind::object luaGetScriptAttribute(const std::string& attributeName, bool& error);
238 
240  luabind::object luaGetVrfObjects();
241 
243 
244  luabind::object luaGetDesignatorsNearWithFilter(const DtLocation3D& loc, double distance,
245  const luabind::object& params);
246 
247  luabind::object luaGetDesignatorsNear(const DtLocation3D& loc, double distance);
249 
251 
252  DtLuaFeatureSet luaGetFeaturesWithinArea(luabind::object const& points, luabind::object const& attributes);
255  DtLuaFeatureSet luaGetFeaturesWithinAreaNoAttributes(luabind::object const& points);
256 
259  DtLuaFeatureSet luaGetFeaturesWithinRange(const DtLocation3D&, double range, luabind::object const& attributes);
261  DtLuaFeatureSet luaGetFeaturesWithinRangeNoAttributes(const DtLocation3D&, double range);
262 
264  DtLuaFeatureSet luaGetFeaturesType(const std::string& type);
266  DtLuaFeatureSet luaGetFeatures();
268 
270 
271  DtLuaFeatureGeometry luaMakePointGeometry(const DtLocation3D&);
274  DtLuaFeatureGeometry luaMakePathGeometry(luabind::object const& table);
276  DtLuaFeatureGeometry luaMakeAreaGeometry(luabind::object const& table);
278 
280  boost::shared_ptr<DtLuaAsyncJob> generateRandomPoints(const luabind::object& parameters);
281 
283  boost::shared_ptr<DtLuaAsyncJob> findNearbyPointOfInterest(const int type);
284 
286  boost::shared_ptr<DtLuaAsyncJob> findCoverPoint(
287  const DtLocation3D& startLocation, const DtLocation3D& threatLocation,
288  double threatRadius, double distanceFromThreat, double range, unsigned numberOfPoints);
289 
291  luabind::object findLadders(lua_State* L, const DtLocation3D& startLocation, double range);
293  luabind::object findLaddersWithId(lua_State* L, const DtLocation3D& startLocation, double range, const unsigned int id);
294 
296  boost::shared_ptr<DtLuaAsyncJob> findPathToLocation(
297  const DtLocation3D& startLocation, const DtLocation3D& destinationLocation,
298  bool useAbstractGraphs, const DtLocation3D& avoidLocation, double avoidanceRadius);
299 
301  DtTranslatableStream translateStringFromScript(const std::string& format);
302 
305  boost::shared_ptr<DtLuaAsyncJob> luaNavigateThroughFeatures(const luabind::object& parameters);
306 
309  virtual boost::shared_ptr<DtLuaAsyncJob> luaFindHighPoints(const luabind::object& corners, unsigned int nPoints);
310  virtual boost::shared_ptr<DtLuaAsyncJob> luaFindHighPointsDebug(const luabind::object& corners, unsigned int nPoints, bool bDebug);
312 
314  /*
315  job = vrf:luaFindSinglePosition(taskParameters.targetArea:getLocations3D(),
316  taskParameters.battlePosition,
317  targetHeightMeters, -- 2/3 vehicle height, for example.
318  double viewHeightMeters, -- 2/3 vehicle height, for example.
319  double hideHeightMeters, -- 1.1x vehicle height, for example.
320  double forwardBackSearchLimitMeters, -- 50m forward + 50m backward = 100m
321  double forwardBackSearchIntervalMeters, -- half vehicle length, for example.
322  double maxSlopeDegrees, -- *todo add comments*
323  )
324  )
325 
326  */
327  virtual boost::shared_ptr<DtLuaAsyncJob> luaFindSinglePosition(const luabind::object& targetAreaCorners,
328  const DtLocation3D& pivotPoint,
329  double targetHeightMeters,
330  double viewHeightMeters,
331  double hideHeightMeters,
332  double forwardBackSearchLimitMeters,
333  double forwardBackSearchIntervalMeters,
334  double maxSlopeDegrees);
335 
337  /*
338  job = vrf:luaFindSinglePosition(taskParameters.targetArea:getLocations3D(),
339  taskParameters.battlePosition,
340  targetHeightMeters, -- 2/3 vehicle height, for example.
341  double viewHeightMeters, -- 2/3 vehicle height, for example.
342  double hideHeightMeters, -- 1.1x vehicle height, for example.
343  double forwardBackSearchLimitMeters, -- 50m forward + 50m backward = 100m
344  double forwardBackSearchIntervalMeters, -- half vehicle length, for example.
345  double maxSlopeDegrees, -- *todo add comments*
346  bool bDebug -- Log additional information)
347  )
348  */
349  virtual boost::shared_ptr<DtLuaAsyncJob> luaFindSinglePositionDebug(const luabind::object& targetAreaCorners,
350  const DtLocation3D& pivotPoint,
351  double targetHeightMeters,
352  double viewHeightMeters,
353  double hideHeightMeters,
354  double forwardBackSearchLimitMeters,
355  double forwardBackSearchIntervalMeters,
356  double maxSlopeDegrees,
357  bool bDebug);
358 
359 
361  /*
362  job = vrf:findVehicleFightingPositions(taskParameters.numberOfPoints,
363  taskParameters.targetArea:getLocations3D(),
364  taskParameters.battlePosition,
365  maxVolume, -- half dimensions of hide position
366  maxVolume:getUp() * 0.67, --67% of total height for shooting height
367  maxVolume:getUp() * 0.50, -- half height for target height
368  searchWidthForward, -- how much forward and back to search forward and back
369  searchWidthSide -- how much side to side to search
370  positionSpacing -- how many meters between postions, side to side
371  )
372  */
373  virtual boost::shared_ptr<DtLuaAsyncJob> luaFindVehicleFightingPositions(unsigned int nPositionPairs,
374  const luabind::object& targetAreaCorners,
375  const DtLocation3D& originPoint,
376  const DtVectorOffset3D& hideVolume,
377  double shootHeight,
378  double targetHeight,
379  double forwardBackSearchLimit,
380  double sideSideSearchLimit,
381  double maxSlopeDegrees,
382  double positionSpacing);
383 
385  virtual boost::shared_ptr<DtLuaAsyncJob> luaFindVehicleFightingPositionsDebug(unsigned int nPositionPairs,
386  const luabind::object& targetAreaCorners,
387  const DtLocation3D& originPoint,
388  const DtVectorOffset3D& hideVolume,
389  double shootHeight,
390  double targetHeight,
391  double forwardBackSearchLimit,
392  double sideSideSearchLimit,
393  double maxSlopeDegrees,
394  double positionSpacing,
395  bool useDebug);
396 
397  virtual boost::shared_ptr<DtLuaAsyncJob> luaFindPositionGroupsInAreaHilltop(unsigned int nPositionPairsPerGroup,
398  const luabind::object& searchAreaVertices,
399  const luabind::object& targetsAreaVertices,
400  double viewHeightMeters,
401  double coverHeightMeters,
402  unsigned int forwardBackRangeMeters,
403  unsigned int sideSideRangeMeters,
404  unsigned int searchIntervalMeters,
405  double maxSlopeDegrees,
406  unsigned int positionsLateralSpacingMeters);
407 
408  virtual boost::shared_ptr<DtLuaAsyncJob> luaFindPositionGroupsInAreaHilltopDebug(unsigned int nPositionPairsPerGroup,
409  const luabind::object& searchAreaVertices,
410  const luabind::object& targetsAreaVertices,
411  double viewHeightMeters,
412  double coverHeightMeters,
413  unsigned int forwardBackRangeMeters,
414  unsigned int sideSideRangeMeters,
415  unsigned int searchIntervalMeters,
416  double maxSlopeDegrees,
417  unsigned int positionsLateralSpacingMeters,
418  bool useDebug);
419 
420  virtual boost::shared_ptr<DtLuaAsyncJob> luaFindPositionGroupsInAreaRidge(unsigned int nPositionPairsPerGroup,
421  const luabind::object& searchAreaVertices,
422  const luabind::object& targetsAreaVertices,
423  unsigned int targetsAreaSampleRate,
424  const luabind::object& tableOfDoubles
425  );
426 
427  virtual boost::shared_ptr<DtLuaAsyncJob> luaFindPositionGroupsInAreaRidgeDebug(unsigned int nPositionPairsPerGroup,
428  const luabind::object& searchAreaVertices,
429  const luabind::object& targetsAreaVertices,
430  unsigned int targetsAreaSampleRate,
431  const luabind::object& tableOfDoubles
432  , bool useDebug);
433 
436  boost::shared_ptr<DtLuaAsyncJob> getAllEmbarkationSlots(DtScriptVrfObject& object);
437 
440  boost::shared_ptr<DtLuaAsyncJob> getEmbarkationSlots(DtScriptVrfObject& object);
441 
443  boost::shared_ptr<DtLuaAsyncJob> getEmbarkationSlotsFiltered(DtScriptVrfObject& object,
444  bool bAllSlots);
445 
447  boost::shared_ptr<DtLuaAsyncJob> reserveEmbarkationSlot(DtScriptVrfObject& object, int slotNumber);
448 
450  boost::shared_ptr<DtLuaAsyncJob> getEmbarkationEgressPoints(DtScriptVrfObject& object);
451 
452  void luaSendMessage(const DtScriptVrfObject& receiver, const std::string& message);
453  void luaSendRadioMessage(const DtScriptVrfObject& receiver, const std::string& message);
454  void luaSendRadioMessageToUuid(const std::string& uuid, const std::string& message);
455  void luaDeleteObject(std::string const& receiver);
456  void luaDeleteScriptObject(const DtScriptVrfObject& receiver);
457  void luaSetInterest(const DtLocation3D& location, double range);
458 
459  void luaSendObjectMessage(const DtScriptVrfObject& receiver, const std::string& messageType, const luabind::object& messageContents);
460  void luaSendRadioObjectMessage(const DtScriptVrfObject& receiver, const std::string& messageType, const luabind::object& messageContents);
461  void luaRegisterForObjectMessage(const std::string& messageType);
462  void luaUnregisterForObjectMessage(const std::string& messageType);
463  void processObjectMessage(const DtVrfObjectMessage* msg);
464 
465  static void textReportCallback(const DtVrfObjectMessage* m, void* usr);
466  virtual void queueTextReport(const DtVrfObjectMessage* m);
467  virtual void processTextReport(const DtVrfObjectMessage* m);
468 
469  void luaSendInfluence(const DtScriptVrfObject& target,
470  const std::string& influenceName, luabind::object const& influenceParams);
471 
473  static void addReaderWriterToLuaTableFunction(const DtString&, ReaderWriterToLuaTableFcn);
474 
475  virtual void queueInfluence(const makVrfEvents::DtEvent& m);
476  virtual void processInfluence(const makVrfEvents::DtEvent& m);
477 
479  virtual void processEntityDestroyed();
480 
482  luabind::object luaGetCloudLayerDescriptionsAt(lua_State *L, const DtLocation3D& location);
485 
488 
489  virtual double luaGetIllumination(DtScriptVrfObject& object);
490  virtual double luaGetExpectedIllumination(DtScriptVrfObject& object, double dateAndTimeOfDay);
491  virtual double luaGetSnowAccumulationByLocation(const DtLocation3D& object);
492  virtual double luaGetSnowRoadAccumulationByLocation(const DtLocation3D& object);
493  virtual double luaGetRainAccumulationByLocation(const DtLocation3D& object);
494 
495  virtual double luaGetAirTemperatureByLocation(const DtLocation3D& object);
496  virtual double luaGetAirPressureByLocation(const DtLocation3D& object);
497  virtual unsigned int luaGetPrecipitationByLocation(const DtLocation3D& location, double*);
498  virtual double luaGetPrecipitationIntensityByLocation(const DtLocation3D& object);
499  virtual unsigned int luaGetPrecipitationTypeByLocation(const DtLocation3D& object);
500  virtual double luaGetVisibilityDistanceByLocation(const DtLocation3D& object);
501  virtual int luaGetVisibilityObscurantByLocation(const DtLocation3D& object);
502  virtual double luaGetWindDirectionByLocation(const DtLocation3D& object);
503  virtual double luaGetWindSpeedByLocation(const DtLocation3D& object);
504  virtual double luaGetUnderwaterVisibilityByLocation(const DtLocation3D& object);
505  virtual unsigned int luaGetSwellStateByLocation(const DtLocation3D& object);
506  virtual double luaGetSwellStateDirectionByLocation(const DtLocation3D& object);
507  virtual unsigned int luaGetSeaStateByLocation(const DtLocation3D& object);
508  virtual double luaGetSeaStateDirectionByLocation(const DtLocation3D& object);
509  virtual double luaGetSurgeDepthByLocation(const DtLocation3D& object);
510  virtual double luaGetIlluminationByLocation(const DtLocation3D& object);
511  virtual double luaGetExpectedIlluminationByLocation(const DtLocation3D& object, double dateAndTimeOfDay);
513 
516  virtual double luaRunDurationTime();
517  virtual void luaRunForDuration(double);
518  virtual void luaStopSimulationDurationTimer();
520 
523  virtual void luaSetCheckpointMode(bool);
524  virtual void initializeCheckpointStateTable(lua_State* L);
525 
534  virtual int luaAskUserQuestion(const DtTranslatableStream& title, const DtTranslatableStream& message,
535  luabind::object const& options, int displayFlags);
536  virtual int luaAskUserQuestionST(const std::string& title, const DtTranslatableStream& message,
537  luabind::object const& options, int displayFlags);
538  virtual int luaAskUserQuestionTS(const DtTranslatableStream& title, const std::string& message,
539  luabind::object const& options, int displayFlags);
540  virtual int luaAskUserQuestionSS(const std::string& title, const std::string& message,
541  luabind::object const& options, int displayFlags);
542 
546  virtual int luaStatusOfUserQuestion(int questionId);
547 
549  virtual void luaCancelUserQuestion(int questionId);
550 
554 
556  DtScriptVrfObject luaCreateEntity(luabind::object const& parameters);
557  void luaCreateEntityParallel(luabind::object const& parameters);
558 
560  DtScriptVrfObject luaCreateFromOrbat(std::string orbatItem, const DtLocation3D& loc);
561 
563  DtScriptVrfObject luaCreateTacticalGraphic(luabind::object const& parameters);
564 
566  DtScriptVrfObject luaCreateObstacle(luabind::object const& parameters);
567 
569  DtScriptVrfObject luaCreateRoute(luabind::object const& parameters);
570 
572  DtScriptVrfObject luaCreateArea(luabind::object const& parameters);
573 
575  DtScriptVrfObject luaCreateWaypoint(luabind::object const& parameters);
576 
578  DtScriptVrfObject luaCreatePhaseLine(luabind::object const& parameters);
580 
582  virtual std::vector<DtLocation3D> luaMakeOffsetPoints(luabind::object const& fromPoints,
583  const DtVectorOffset3D& offset);
584 
586  void luaCreateSelectionGroup(const std::string& name, luabind::object const& parameters);
587 
591  void luaFinishTest(const int status, const std::string message);
592 
594  bool luaUpdateTaskVisualization(const std::string& visualizationName,
595  const std::string& visualizationType, luabind::object const& parameters);
596 
598  void luaDeleteTaskVisualization(const std::string& visualizationName);
599 
601  void luaRequire(lua_State* L, const std::string& filename);
602 
605  unsigned luaBitwiseOr(unsigned val1, unsigned val2);
606  unsigned luaBitwiseAnd(unsigned val1, unsigned val2);
607  unsigned luaBitwiseXor(unsigned val1, unsigned val2);
608  unsigned luaBitwiseNot(unsigned val);
609  unsigned luaBitwiseLeftShift(unsigned val, unsigned shift);
610  unsigned luaBitwiseRightShift(unsigned val, unsigned shift);
612 
613  bool luaIntersectSegments2D(const DtLocation3D& p1, const DtLocation3D& p2, const DtLocation3D& p3, const DtLocation3D& p4,
614  DtLocation3D& intersectPoint);
615 
620  {
621  public:
622  DtLuaScriptFunctionReference(const std::string& functionName)
624  , myFunctionName(functionName)
625  {
626 
627  }
628 
630  {
631 
632  }
633 
634  std::string functionName() const
635  {
636  return myFunctionName;
637  }
638 
639  virtual bool operator<(const DtScriptFunctionReference& other) const
640  {
641  try
642  {
643  const DtLuaScriptFunctionReference& rhs =
644  dynamic_cast<const DtLuaScriptFunctionReference&>(other);
645  return myFunctionName.compare(rhs.myFunctionName) < 0;
646  }
647  catch(...)
648  {
649  DtInfo << "DtLuaScriptFunctionReference::operator< attempt to compare with wrong type.\n";
650  return false;
651  }
652  }
653 
654  protected:
655  std::string myFunctionName;
656  };
657 
660  virtual void addPostSetDataCallback(const std::string& setDataType,
661  const std::string& functionName);
664  virtual void removePostSetDataCallback(const std::string& setDataType,
665  const std::string& functionName);
666 
669  virtual void invokePostSetDataCallback(
670  DtScriptFunctionReferencePtr functionReference,
671  DtSetDataRequestMessage* setDatRequest);
672 
678  virtual luabind::object luaGetParamPropertyFromType(
679  const std::string typeString, std::string const& paramName);
680 
682  virtual void putObjectsFromTableIntoGlobalTable(lua_State* state, luabind::object& table);
683  virtual void putObjectsFromGlobalTableIntoTable(lua_State* state, luabind::object& table);
684 
686  virtual luabind::object luaGetSubordinateFunctionNames();
687 
689  virtual luabind::object luaGetParameterSubordinateFunctionsFromType(
690  const std::string typeString);
691 
692 
693  virtual void connectForCallbacks();
694  virtual void processEvents();
695 
697  boost::shared_ptr<DtLuaAsyncJob> luaGetWeaponSystemsInfo(DtScriptVrfObject& object);
698 
699 protected:
703  virtual bool callLuaNoArgFunction(const std::string& functionName, bool* functionExists = 0);
704 
705  virtual void updateFuncCallCount();
706 
707  lua_State* myLState;
708  unsigned myFuncCallCount;
710 
711  typedef std::vector<DtLuaScriptInterfaceExtension*> LocalInterfaceExtensions;
713 
715  {
716  LuaExtension() : creator(0), onlyForEntity(0), usr(0) {};
717  LuaExtension(const LuaExtension& orig) : creator(orig.creator), onlyForEntity(orig.onlyForEntity),
718  usr(orig.usr) {};
719 
722  void* usr;
723  };
724 
725  typedef std::vector<LuaExtension> GlobalInterfaceExtensions;
726 
728 
729  luabind::object* myCheckpointStateTable;
730 
731  typedef std::map<DtString, ReaderWriterToLuaTableFcn> ReaderWriterToLuaTableMap;
734  boost::signals2::scoped_connection myInfluenceEventConnection;
735 
736  std::vector<DtVrfObjectMessage*> myTextReportCallbacks;
737  std::vector<makVrfEvents::DtEvent*> myInfluenceEvents;
738 };
739 
741 
749 namespace luaScriptInterface
750 {
751  typedef luabind::object (*rwToLuaBindObjectFcn)(
752  const DtReaderWriter* rw, lua_State* L);
753 
754  luabind::object luaGetEntityParam(lua_State* L,
755  const DtScriptVrfObject& entity, std::string const& paramName);
756 
757  luabind::object luaGetSystemAttribute(
758  const DtScriptComponentSystem& system, const std::string& attributeName
759  , bool *error
760  , lua_State *L
761  );
762 
764  luabind::object luaGetContactInfo(lua_State* L, const DtScriptOwnshipObject& thisEntity,
765  const DtScriptVrfObject& otherEntity);
766 
770  luabind::object luaGetSubordinateFormation(lua_State* L,
771  const DtScriptOwnshipObject& entity,
772  DtScriptVrfObject& leadSubordinate);
773 
781  std::list<DtVectorOffset3D> luaGetOptionFormationPositions(lua_State* L,
782  const DtScriptVrfObject& unit,
783  const std::string& formationName, luabind::object const& options,
784  int* leaderIndex);
785 
787  std::list<DtVectorOffset3D> luaGetFormationPositions(lua_State* L,
788  const DtScriptVrfObject& unit,
789  const std::string& formationName,
790  int* leaderIndex);
791 
794  luabind::object luaGetParameterSubordinateFunctions(lua_State* L, const DtScriptVrfObject& entity);
795 
797  luabind::object luaGetSubordinateFunctions(lua_State* L, const DtScriptVrfObject& entity);
798 
802  bool luaSetSubordinateFunctions(lua_State* L, const DtScriptVrfObject& entity, luabind::object const& subsAndFunctions);
803 
805  std::string luaGetSubordinateFunction(lua_State* L, const DtScriptVrfObject& entity, const DtScriptVrfObject& subEntity);
806 
810  bool luaSetSubordinateFunction(lua_State* L, const DtScriptVrfObject& entity, const DtScriptVrfObject& subEntity, const std::string& subFunction);
811 
813  luabind::object luaGetTargetPriorityList(lua_State* L, const DtScriptOwnshipObject& thisEntity);
814 
822  std::list<DtScriptVrfObject> luaGetContactsWithFilter(
823  lua_State* L, const DtScriptOwnshipObject& entity,
824  luabind::object const& typeFilters, bool observedOnly);
827  std::list<DtScriptVrfObject> luaGetContactsWithFilterAliveOnly(
828  lua_State* L, const DtScriptOwnshipObject& entity,
829  luabind::object const& typeFilters, bool observedOnly,
830  bool aliveOnly);
831 
834  std::list<DtScriptVrfObject> luaGetHostileContactsWithFilterAliveOnly(
835  lua_State* L, const DtScriptOwnshipObject& entity,
836  luabind::object const& typeFilters, bool observedOnly,
837  bool aliveOnly);
838 
843  std::list<DtScriptVrfObject> luaGetContacts(
844  lua_State* L, const DtScriptOwnshipObject& entity,
845  luabind::object const& typeFilters,
846  luabind::object const& flags);
847 
850  bool luaSetStateProperty(lua_State* L, DtScriptOwnshipObject& entity,
851  const std::string& propertyName, luabind::object const& prop);
852 
856  bool luaSetOrAddStateProperty(lua_State* L, DtScriptOwnshipObject& entity,
857  const std::string& propertyName, luabind::object const& prop, bool addIfNotFound);
858 
865  bool luaSetStatePropertyListItem(lua_State* L,
866  DtScriptOwnshipObject& entity, const std::string& propertyName,
867  luabind::object const& keyValues, luabind::object const& itemValue);
868 
875  lua_State* L, DtScriptOwnshipObject& entity, const std::string& propertyName,
876  int index, luabind::object const& itemValue);
877 
884  bool luaSetStatePropertyMapItem(lua_State* L,
885  DtScriptOwnshipObject& entity, const std::string& propertyName,
886  luabind::object const& keyValue, luabind::object const& itemValue);
887 
892  luabind::object luaGetStateProperty(lua_State* L,
893  const DtScriptVrfObject& entity, const std::string& propertyName);
894  luabind::object luaGetStateOwnshipProperty(lua_State* L,
895  const DtScriptOwnshipObject& entity, const std::string& propertyName);
896 
905  luabind::object luaGetStatePropertyListItem(lua_State* L,
906  const DtScriptVrfObject& entity, const std::string& propertyName,
907  luabind::object const& keyValues, int& index);
908  luabind::object luaGetStateOwnshipPropertyListItem(lua_State* L,
909  const DtScriptOwnshipObject& entity, const std::string& propertyName,
910  luabind::object const& keyValues, int& index);
911 
919  luabind::object luaGetStatePropertyListItemByIndex(lua_State* L,
920  const DtScriptVrfObject& entity, const std::string& propertyName,
921  int index);
922  luabind::object luaGetStateOwnshipPropertyListItemByIndex(lua_State* L,
923  const DtScriptOwnshipObject& entity, const std::string& propertyName,
924  int index);
925 
933  luabind::object luaGetStatePropertyMapItem(lua_State* L,
934  const DtScriptVrfObject& entity, const std::string& propertyName,
935  luabind::object const& keyValue);
936  luabind::object luaGetStateOwnshipPropertyMapItem(lua_State* L,
937  const DtScriptOwnshipObject& entity, const std::string& propertyName,
938  luabind::object const& keyValue);
939 
944  luabind::object luaGetParamProperty(lua_State* L,
945  const DtScriptVrfObject& entity, std::string const& paramName);
946  luabind::object luaGetOwnshipParamProperty(lua_State* L,
947  const DtScriptOwnshipObject& entity, std::string const& paramName);
948 
957  luabind::object luaGetParameterPropertyListItem(lua_State* L,
958  const DtScriptVrfObject& entity, const std::string& propertyName,
959  luabind::object const& keyValues, int& index);
960  luabind::object luaGetOwnshipParameterPropertyListItem(lua_State* L,
961  const DtScriptOwnshipObject& entity, const std::string& propertyName,
962  luabind::object const& keyValues, int& index);
963 
971  luabind::object luaGetParameterPropertyListItemByIndex(lua_State* L,
972  const DtScriptVrfObject& entity, const std::string& propertyName,
973  int index);
974  luabind::object luaGetOwnshipParameterPropertyListItemByIndex(lua_State* L,
975  const DtScriptOwnshipObject& entity, const std::string& propertyName,
976  int index);
977 
985  luabind::object luaGetParameterPropertyMapItem(lua_State* L,
986  const DtScriptVrfObject& entity, const std::string& propertyName,
987  luabind::object const& keyValue);
988  luabind::object luaGetOwnshipParameterPropertyMapItem(lua_State* L,
989  const DtScriptOwnshipObject& entity, const std::string& propertyName,
990  luabind::object const& keyValue);
991 
993  DtScriptComponentSystem& system, const std::string& attributeName,
994  const luabind::object & value,
995  lua_State *L);
996 
997  static const std::map<DtString, rwToLuaBindObjectFcn>& rwToLuaBindObjectMap();
998 };
virtual void invokePostSetDataCallback(DtScriptFunctionReferencePtr functionReference, DtSetDataRequestMessage *setDatRequest)=0
Implement to invoke the function referenced by functionReference. setDatRequest contains the informat...
virtual bool operator<(const DtScriptFunctionReference &other) const
Required for std::set.
Definition: luaScriptInterfaceImpl.h:639
virtual void processEntityDestroyed()
Can be overridden to perform some processing when the entity is destroyed.
Definition: scriptInterface.h:199
std::vector< DtVrfObjectMessage * > myTextReportCallbacks
Definition: luaScriptInterfaceImpl.h:736
virtual void addPostSetDataCallback(const DtSetMessageType &setDataType, DtScriptFunctionReferencePtr functionReference)
Adds a callback to be invoked after the specified type of set data request is executed.
virtual bool invokeInit()=0
luabind::object luaGetParameterPropertyListItemByIndex(lua_State *L, const DtScriptVrfObject &entity, const std::string &propertyName, int index)
Returns an object containing the value of the of an item in the given parameter property. The property must be a list. Returns the item at the given index, using the Lua convention that the first item is at index 1. The result may be a table containing a number of fields that make up the item, or a single value, depending on the data type of the list items. If the property or list item could not be found, the returned table will be empty.
std::list< DtScriptVrfObject > luaGetContactsWithFilterAliveOnly(lua_State *L, const DtScriptOwnshipObject &entity, luabind::object const &typeFilters, bool observedOnly, bool aliveOnly)
Same as luaGetContactsWithFiler but adds a boolean flag to indicate that only non-destroyed entities ...
luabind::object luaGetParamProperty(lua_State *L, const DtScriptVrfObject &entity, std::string const &paramName)
Returns an object containing the value of the requested parameter property. May be a table containing...
const char ContactObservedOnly[]
Definition: luaScriptInterfaceImpl.h:40
luabind::object * myCheckpointStateTable
Definition: luaScriptInterfaceImpl.h:729
luabind::object luaGetSubordinateFunctions(lua_State *L, const DtScriptVrfObject &entity)
Return a table of {{&quot;subordinate&quot; = DtScriptVrfObject, &quot;function&quot; = string}}.
static GlobalInterfaceExtensions theLuaInterfaceExtensions
Definition: luaScriptInterfaceImpl.h:727
std::vector< LuaExtension > GlobalInterfaceExtensions
Definition: luaScriptInterfaceImpl.h:725
lua_State * myLState
Definition: luaScriptInterfaceImpl.h:707
virtual bool invokeResume()=0
luabind::object luaGetStateOwnshipPropertyListItemByIndex(lua_State *L, const DtScriptOwnshipObject &entity, const std::string &propertyName, int index)
virtual bool loadState(const DtReaderWriter *savedState)=0
Called when the scenario is loaded. The load state pointer may not be valid, which does not indicate ...
bool luaSetSubordinateFunctions(lua_State *L, const DtScriptVrfObject &entity, luabind::object const &subsAndFunctions)
Given a table of {{&quot;subordinate&quot; = DtScriptVrfObject, &quot;function&quot; = string}} Set the state propert...
luabind::object luaGetStateOwnshipPropertyMapItem(lua_State *L, const DtScriptOwnshipObject &entity, const std::string &propertyName, luabind::object const &keyValue)
unsigned myFuncCallCount
Definition: luaScriptInterfaceImpl.h:708
luabind::object luaGetSubordinateFormation(lua_State *L, const DtScriptOwnshipObject &entity, DtScriptVrfObject &leadSubordinate)
Gets a table indexed by simObject (subordinates) of position offset relative to the formation leader...
virtual void invokeCheckInit()=0
luabind::object luaGetParameterPropertyListItem(lua_State *L, const DtScriptVrfObject &entity, const std::string &propertyName, luabind::object const &keyValues, int &index)
Returns an object containing the value of the of an item in the given parameter property. The property must be a list. The item returned will have values matching the specified key values in the key fields. The result may be a table containing a number of fields that make up the item, or a single value, depending on the data type of the list items. If the property or list item could not be found, the returned table will be empty. Sets index to be the index of the item, using the Lua convention that the first item is at index 1.
Definition: readerWriter.h:85
#define DT_DEFINE_OBJECT_DEBUGGER_NAME(type)
Definition: objectCounter.h:265
Default on in debug, off in release.
Definition: objectCounter.h:31
luabind::object(* ReaderWriterToLuaTableFcn)(lua_State *LS, const DtReaderWriter *rwString, const DtSimulationServices *mgr, const DtString &parameterType)
When adding decoder functions to turn reader/writer into lua tables, the format must be of the follow...
Definition: luaScriptInterfaceImpl.h:37
bool luaSetStatePropertyListItemByIndex(lua_State *L, DtScriptOwnshipObject &entity, const std::string &propertyName, int index, luabind::object const &itemValue)
Finds the item in the list at the specified index and updates it to the new value. If the list is not long enough, new entries are added. Any items added in this way will be given the same value as the new entry. If the property does not exist or the format of the data is incorrect, returns false.
virtual void removePostSetDataCallback(const DtSetMessageType &setDataType, DtScriptFunctionReferencePtr functionReference)
Remove a callback invoked after the specified type of set data request is executed.
Definition: readerWriterRegistry.h:39
virtual DtReaderWriter * saveState()=0
Called when the scenario is saved. The stateState pointer may not be valid, in which case something w...
luabind::object luaGetStatePropertyListItemByIndex(lua_State *L, const DtScriptVrfObject &entity, const std::string &propertyName, int index)
Returns an object containing the value of the of an item in the given state property. The state property must be a list. Returns the item at the given index, using the Lua convention that the first item is at index 1. The result may be a table containing a number of fields that make up the item, or a single value, depending on the data type of the list items. If the property or list item could not be found, the returned table will be empty.
LocalInterfaceExtensions myInterfaceExtensions
Definition: luaScriptInterfaceImpl.h:712
virtual bool loadScript(bool reload=false)=0
This will be called by the parent to let the interface know when to load the script.
bool myLuaScriptWarningShown
Definition: luaScriptInterfaceImpl.h:709
static ReaderWriterToLuaTableMap theReaderWriterToLuaTableMap
Definition: luaScriptInterfaceImpl.h:732
luabind::object luaGetParameterSubordinateFunctions(lua_State *L, const DtScriptVrfObject &entity)
Gets a table of entity type and subordinate function handle pairs {{ENTITY_TYPE_STRING, FUNCTION_HANDLE_STRING}}.
std::list< DtScriptVrfObject > luaGetContactsWithFilter(lua_State *L, const DtScriptOwnshipObject &entity, luabind::object const &typeFilters, bool observedOnly)
This function supports the script API. It gets the list of contacts matching the given filter and ret...
std::string functionName() const
Definition: luaScriptInterfaceImpl.h:634
DtLuaScriptFunctionReference(const std::string &functionName)
Definition: luaScriptInterfaceImpl.h:622
luabind::object luaGetStatePropertyMapItem(lua_State *L, const DtScriptVrfObject &entity, const std::string &propertyName, luabind::object const &keyValue)
Returns an object containing the value of the of an item in the given state property. The state property must be a map. The item returned will have values matching the specified key value. The result may be a table containing a number of fields that make up the item, or a single value, depending on the data type of the list items. If the property or map item could not be found, the returned table will be empty.
VectorOffset3D is a direction vector that is relative to some direction specified by a Vector3D...
Definition: scriptGeometry.h:424
Handles translation of messages from C++ structures into Lua tables and the reverse translation as we...
Definition: luaMessageInterface.h:23
luabind::object luaGetOwnshipParamProperty(lua_State *L, const DtScriptOwnshipObject &entity, std::string const &paramName)
std::string luaGetSubordinateFunction(lua_State *L, const DtScriptVrfObject &entity, const DtScriptVrfObject &subEntity)
Return a string representing subordinate function for indicated subordinate.
LuaExtension(const LuaExtension &orig)
Definition: luaScriptInterfaceImpl.h:717
bool luaSetStatePropertyMapItem(lua_State *L, DtScriptOwnshipObject &entity, const std::string &propertyName, luabind::object const &keyValue, luabind::object const &itemValue)
Sets a single item in a map state property to the given value. First looks in the map to see if any e...
Definition: event.h:13
virtual DtString type() const =0
Script engine type.
DT_DLL_VRVCORE double distance(const makVrv::DtCoordinateSystem &, const DtVector &from, const DtVector &to)
Returns the distance from the two points. Coordinates are in local database coordinates The coordinat...
Represents a feature geometry.
Definition: luaFeatureGeometry.h:25
luabind::object luaGetStateOwnshipPropertyListItem(lua_State *L, const DtScriptOwnshipObject &entity, const std::string &propertyName, luabind::object const &keyValues, int &index)
static const std::map< DtString, rwToLuaBindObjectFcn > & rwToLuaBindObjectMap()
const DtLocalObject * onlyForEntity
Definition: luaScriptInterfaceImpl.h:721
Definition: luaScriptInterfaceImpl.h:48
luabind::object luaGetOwnshipParameterPropertyListItem(lua_State *L, const DtScriptOwnshipObject &entity, const std::string &propertyName, luabind::object const &keyValues, int &index)
std::vector< makVrfEvents::DtEvent * > myInfluenceEvents
Definition: luaScriptInterfaceImpl.h:737
bool luaSetStateProperty(lua_State *L, DtScriptOwnshipObject &entity, const std::string &propertyName, luabind::object const &prop)
Sets the specified state property with the given value. If the property does not exist or the format ...
luabind::object luaGetSystemAttribute(const DtScriptComponentSystem &system, const std::string &attributeName, bool *error, lua_State *L)
luabind::object(* rwToLuaBindObjectFcn)(const DtReaderWriter *rw, lua_State *L)
Definition: luaScriptInterfaceImpl.h:751
virtual void invokeDisable()=0
Only called for reactive tasks which can be enabled but not active. When the task is completely disab...
virtual void invokeTick()=0
This will be called by the parent to invoke the script tick.
std::list< DtVectorOffset3D > luaGetFormationPositions(lua_State *L, const DtScriptVrfObject &unit, const std::string &formationName, int *leaderIndex)
Calls luaGetOptionFormationPositions with empty options.
#define DT_DLL_vrfLua
This file is used to determine how to build.
Definition: vrfLuaDefines.h:25
bool luaSetStatePropertyListItem(lua_State *L, DtScriptOwnshipObject &entity, const std::string &propertyName, luabind::object const &keyValues, luabind::object const &itemValue)
Sets a single item in a list state property to the given value. First looks in the list to see if any...
const char ContactAliveOnly[]
Definition: luaScriptInterfaceImpl.h:41
boost::shared_ptr< DtScriptFunctionReference > DtScriptFunctionReferencePtr
Shared ptr to DtScriptFunctionReference.
Definition: scriptInterface.h:53
luabind::object luaGetStatePropertyListItem(lua_State *L, const DtScriptVrfObject &entity, const std::string &propertyName, luabind::object const &keyValues, int &index)
Returns an object containing the value of the of an item in the given state property. The state property must be a list. The item returned will have values matching the specified key values in the key fields. The result may be a table containing a number of fields that make up the item, or a single value, depending on the data type of the list items. If the property or list item could not be found, the returned table will be empty. Sets index to be the index of the item, using the Lua convention that the first item is at index 1.
This stream is used by the scripting classes to be able to send out translatable messages from script...
Definition: translatableStream.h:22
luabind::object luaGetContactInfo(lua_State *L, const DtScriptOwnshipObject &thisEntity, const DtScriptVrfObject &otherEntity)
Gets the perceived contact info that this entity has for another entity.
The base class for all messages to/from a specific DtVrfObject. Various subclasses of this class will...
Definition: vrfObjectMessage.h:30
Override of DtScriptInterface::DtScriptFunctionReference that holds a function reference by function ...
Definition: luaScriptInterfaceImpl.h:619
std::vector< DtLuaScriptInterfaceExtension * > LocalInterfaceExtensions
Definition: luaScriptInterfaceImpl.h:711
Abstract object used to hold a reference to a function defined in the script language, to be used later to invoke that function. Used for registering callbacks to be invoked after specified types of set data requests are executed. For this functionality to be used in a derived script interface implementation, a derived class must be implemented to represent a reference to a function in the script language.
Definition: scriptInterface.h:42
luabind::object luaGetEntityParam(lua_State *L, const DtScriptVrfObject &entity, std::string const &paramName)
luabind::object luaGetStateProperty(lua_State *L, const DtScriptVrfObject &entity, const std::string &propertyName)
Returns an object containing the value of the requested state property. May be a table containing a n...
virtual void processClearForReuse()
This function should be overridden by the inheritor to clear out any task specific variables...
Definition: asyncJobServer.h:39
bool luaSetSubordinateFunction(lua_State *L, const DtScriptVrfObject &entity, const DtScriptVrfObject &subEntity, const std::string &subFunction)
Given a table of {{&quot;subordinate&quot; = DtScriptVrfObject, &quot;function&quot; = string}} Set the state propert...
Contains the DtTranslatableStream class declaration.
const char ContactCurrentlyDetectedOnly[]
Definition: luaScriptInterfaceImpl.h:43
DtLuaScriptInterfaceExtension *(* CreatorFcn)(void *usr)
Prototype for DtLuaScriptInterfaceExtension creator function.
Definition: luaScriptInterfaceExtension.h:37
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:89
luabind::object luaGetOwnshipParameterPropertyMapItem(lua_State *L, const DtScriptOwnshipObject &entity, const std::string &propertyName, luabind::object const &keyValue)
DtScriptInterface & operator=(const DtScriptInterface &other)
virtual bool invokeCheck()=0
The DtLuaFeatureSet class is a wrapper around a DtFeatureSet that will provide feature information fo...
Definition: luaFeatureSet.h:28
LuaExtension()
Definition: luaScriptInterfaceImpl.h:716
std::map< DtString, ReaderWriterToLuaTableFcn > ReaderWriterToLuaTableMap
Definition: luaScriptInterfaceImpl.h:731
DtLuaScriptInterfaceExtension.
DT_DLL_DEBUGDRAWRENDERER void init(makVrv::DtDe &de)
Work function for the plugin initialization.
bool luaSetSystemAttribute(DtScriptComponentSystem &system, const std::string &attributeName, const luabind::object &value, lua_State *L)
boost::signals2::scoped_connection myInfluenceEventConnection
Definition: luaScriptInterfaceImpl.h:734
Contains Extended DI-Guy Object net types.
luabind::object luaGetTargetPriorityList(lua_State *L, const DtScriptOwnshipObject &thisEntity)
Gets the target priority list that this entity has.
void * usr
Definition: luaScriptInterfaceImpl.h:722
const char ContactHostileOnly[]
Definition: luaScriptInterfaceImpl.h:42
Definition: luaScriptInterfaceImpl.h:714
The &quot;this&quot; version is the own-ship object. It is separated to allow special functions for the ownshi...
Definition: scriptVrfObject.h:385
DtLuaMessageInterface * myMessageInterface
Definition: luaScriptInterfaceImpl.h:733
std::list< DtVectorOffset3D > luaGetOptionFormationPositions(lua_State *L, const DtScriptVrfObject &unit, const std::string &formationName, luabind::object const &options, int *leaderIndex)
Gets a list of offset vectors defining the positions in the formation. Returns the index of the leade...
This class is a wrapper for a DtCompSystem for use by scripts. It derives from DtAsciiSerializable so...
Definition: scriptComponentSystem.h:18
This class is a two-way interface between the script language and its parent controller. There are functions that either the parent controller will call on the script interface (such as tick() ) and there will be functions the script interface will call on the parent controller to inform the parent of status updates and for data access.
Definition: scriptInterface.h:31
std::string myFunctionName
Definition: luaScriptInterfaceImpl.h:655
luabind::object luaGetOwnshipParameterPropertyListItemByIndex(lua_State *L, const DtScriptOwnshipObject &entity, const std::string &propertyName, int index)
virtual void invokeSuspend()=0
voidpf uLong offset
Definition: ioapi.h:42
A DtSetDataRequestMessage is a DtRadioMsg with a pointer to a setDataRequest. The type of the DtSetDa...
Definition: setDataRequestMessage.h:29
luabind::object luaGetStateOwnshipProperty(lua_State *L, const DtScriptOwnshipObject &entity, const std::string &propertyName)
bool luaSetOrAddStateProperty(lua_State *L, DtScriptOwnshipObject &entity, const std::string &propertyName, luabind::object const &prop, bool addIfNotFound)
Sets the specified state property with the given value. If not found and addIfNotFound is true...
std::list< DtScriptVrfObject > luaGetContacts(lua_State *L, const DtScriptOwnshipObject &entity, luabind::object const &typeFilters, luabind::object const &flags)
Lua &quot;getContacts()&quot; Return a list of contacts matching the given table of entity type filters...
luabind::object luaGetParameterPropertyMapItem(lua_State *L, const DtScriptVrfObject &entity, const std::string &propertyName, luabind::object const &keyValue)
Returns an object containing the value of the of an item in the given parameter property. The property must be a map. The item returned will have values matching the specified key value. The result may be a table containing a number of fields that make up the item, or a single value, depending on the data type of the list items. If the property or map item could not be found, the returned table will be empty.
std::list< DtScriptVrfObject > luaGetHostileContactsWithFilterAliveOnly(lua_State *L, const DtScriptOwnshipObject &entity, luabind::object const &typeFilters, bool observedOnly, bool aliveOnly)
This function is the same as luaGetContactsWithFilterAliveOnly, but it returns only hostile contacts...
virtual void invokeShutdown()=0
virtual void invokeUpdateDisplayGraph()=0
Called when graphs are enabled to get an immediate graph output.
virtual ~DtLuaScriptFunctionReference()
Definition: luaScriptInterfaceImpl.h:629
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86
Definition: scriptVrfObject.h:29
A location3D is a point in space, i.e. a geocentric coordinate.
Definition: scriptGeometry.h:22

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)