![]() |
VR-Forces Developer's Guide
|
Lua object class which represents a terrain reasoning job. Given an origin point, which is assumed to be near a hilltop or ridge, find "positions" (described in findSinglePosition) where the shoot and hide locations in each position are lined up with the target area. The positions are returned in left to right order as viewed from the originPoint looking toward the targetArea. This function is intended to compute the shoot and hide positions more accurately than the findPositionGroups functions. This function starts an async job to find the positions. The getObject function for this job returns a list of lists. Each list (table) has two Location3Ds in it; the first is the shoot position and the second is the hide position. Ideally there will be nPositionPairs pairs of locations, but there may not be.
| nPointsToReturn | The number of pairs to find. A pair is a shoot position and a hide position. Typically one pair per subordinate. |
| targetAreaCorners | Table of Location3D vertices defining the area to target for engagement. |
| originPoint | A point representing the battle position from which to engage the enemy, i.e. the pivot point for the search. |
| hideVolume | Notional bounding volume (full dimensions) of a vehicle, perhaps the largest vehicle in a unit. Used to space out the pairs along searchWidthSide. |
| shootHeight | In meters, a height above the ground where presumably a shooter's gun is located. Used as an endpoint for line of sight checks. |
| targetHeight | In meters, a height above the ground to use for line of sight checks, notionally some portion of an enemy's vehicle height, used for detection, e.g. 2/3 vehicle height. |
| forwardBackSearchLimit | In meters, total distance forward and back of the originPoint, in which to find shoot/hide positions. E.g. 50m forward + 50m back = 100m. |
| sideSideSearchLimit | In meters, the total width left to right about origin point in which the position pairs should fit. E.g. 50m left + 50m right = 100m. |
| maxSlopeDegrees | In degrees, the absolute value of the maximum slope along the line between view point and cover point. Must be from 0.0 to 90.0. |
| positionSpacing | In meters, how far apart should the position pairs be laterally across the width of a formation? |

Public Types | |
| typedef std::list< DtLocation3D > | Points |
Public Member Functions | |
| DtLuaVehicleFightingPositionQueryJob () | |
| virtual | ~DtLuaVehicleFightingPositionQueryJob () override |
| virtual luabind::object | getObject (lua_State *L, int &index, std::string &message) override |
| virtual luabind::object | getDebugObject (lua_State *L) override |
| virtual void | cancel (lua_State *L) override |
| virtual DtString | serialize () override |
| virtual bool | deserialize (const DtString &) override |
| virtual DtString | objectType () const override |
| std::shared_ptr < DtLuaVehicleFightingPositionQueryJob > | shared_from_this () |
| std::shared_ptr< const DtLuaVehicleFightingPositionQueryJob > | shared_from_this () const |
Public Member Functions inherited from DtLuaAsyncJob | |
| virtual void | init (void *userData) override |
Public Member Functions inherited from DtAsciiSerializable | |
| DtAsciiSerializable () | |
| DtAsciiSerializable (const DtAsciiSerializable &orig) | |
| virtual | ~DtAsciiSerializable () |
| virtual std::string | objectTypeC () const |
Static Public Member Functions | |
| static std::shared_ptr < DtLuaVehicleFightingPositionQueryJob > | Make (DtSimulationServices *, unsigned int nPointsToReturn, const std::list< DtLocation3D > &targetAreaCorners, const DtLocation3D &originPoint, const DtVectorOffset3D &hideVolume, double shootHeight, double targetHeight, double forwardBackSearchLimit, double sideSideSearchLimit, double maxSlopeDegrees, double positionSpacing, bool bDebug=false) |
| static DtAsciiSerializable * | creator () |
Protected Member Functions | |
| DtLuaVehicleFightingPositionQueryJob (DtSimulationServices *, unsigned int nPointsToReturn, const std::list< DtLocation3D > &targetAreaCorners, const DtLocation3D &originPoint, const DtVectorOffset3D &hideVolume, double shootHeight, double targetHeight, double forwardBackSearchLimit, double sideSideSearchLimit, double maxSlopeDegrees, double positionSpacing, bool bDebug=false) | |
| void | start () |
| void | run (const DtAlgorithmManager &mgr=DtAlgorithmManager()) |
| void | taskComplete () |
Protected Member Functions inherited from DtLuaAsyncJob | |
| DtLuaAsyncJob () | |
| DtLuaAsyncJob (DtSimulationServices *) | |
Protected Attributes | |
| Points | myTargetAreaCorners |
| unsigned int | nMyPointsToReturn |
| DtLocation3D | myOriginPoint |
| DtVectorOffset3D | myHideVolume |
| double | myShootHeight |
| double | myTargetHeight |
| double | myForwardBackSearchLimit |
| double | mySideSideSearchLimit |
| double | myMaxSlopeDegrees |
| double | myPositionSpacing |
| DtAsyncJobStatus | myStatus |
| std::vector< std::pair < DtLocation3D, DtLocation3D > > | myPositionPairs |
| std::shared_ptr < DtAsyncJobMapEntry > | myJobEntry |
| bool | bMyDebug |
Protected Attributes inherited from DtLuaAsyncJob | |
| DtSimulationServices * | mySimulationServices |
| typedef std::list<DtLocation3D> DtLuaVehicleFightingPositionQueryJob::Points |
| DtLuaVehicleFightingPositionQueryJob::DtLuaVehicleFightingPositionQueryJob | ( | ) |
For creating when deserializing.
|
overridevirtual |
DTOR.
|
protected |
For creating from lua call.
|
static |
|
overridevirtual |
Retrieve value If job is done, index will be > 0 and returned table will be Location3D points found.
Implements DtLuaAsyncJob.
|
inlineoverridevirtual |
Retrieve debug data, if available. Default return value is an empty table.
Implements DtLuaAsyncJob.
|
inlineoverridevirtual |
Currently a no-op.
Implements DtLuaAsyncJob.
|
static |
DtAsciiSerializable functions.
|
overridevirtual |
The following characters are reserved and cannot be used in serialization: '|', ':'.
Implements DtAsciiSerializable.
This function should take the string that was serialized via serialize() and fill this object with the correct data.
Implements DtAsciiSerializable.
|
overridevirtual |
Should return the string name of this object. The object name should not be part of the serialization unless you want it to be, but you should take it into account when implementing both functions.
Implements DtAsciiSerializable.
| std::shared_ptr<DtLuaVehicleFightingPositionQueryJob> DtLuaVehicleFightingPositionQueryJob::shared_from_this | ( | ) |
| std::shared_ptr<const DtLuaVehicleFightingPositionQueryJob> DtLuaVehicleFightingPositionQueryJob::shared_from_this | ( | ) | const |
|
protected |
|
protected |
|
protected |
Called by task object whenever it is done.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |