VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
DtLuaVehicleFightingPositionQueryJob Class Reference

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.

Parameters
nPointsToReturnThe number of pairs to find. A pair is a shoot position and a hide position. Typically one pair per subordinate.
targetAreaCornersTable of Location3D vertices defining the area to target for engagement.
originPointA point representing the battle position from which to engage the enemy, i.e. the pivot point for the search.
hideVolumeNotional bounding volume (full dimensions) of a vehicle, perhaps the largest vehicle in a unit. Used to space out the pairs along searchWidthSide.
shootHeightIn meters, a height above the ground where presumably a shooter's gun is located. Used as an endpoint for line of sight checks.
targetHeightIn 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.
forwardBackSearchLimitIn meters, total distance forward and back of the originPoint, in which to find shoot/hide positions. E.g. 50m forward + 50m back = 100m.
sideSideSearchLimitIn meters, the total width left to right about origin point in which the position pairs should fit. E.g. 50m left + 50m right = 100m.
maxSlopeDegreesIn 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.
positionSpacingIn meters, how far apart should the position pairs be laterally across the width of a formation?
Returns
An asynchronous job.
Inheritance diagram for DtLuaVehicleFightingPositionQueryJob:
Inheritance graph
[legend]

Public Types

typedef std::list< DtLocation3DPoints
 

Public Member Functions

 DtLuaVehicleFightingPositionQueryJob ()
 
virtual ~DtLuaVehicleFightingPositionQueryJob ()
 
luabind::object getObject (lua_State *L, int &index, std::string &message)
 
luabind::object getDebugObject (lua_State *L)
 
virtual void cancel (lua_State *L)
 
DtString serialize ()
 
bool deserialize (const DtString &)
 
DtString objectType () const
 
boost::shared_ptr
< DtLuaVehicleFightingPositionQueryJob
shared_from_this ()
 
boost::shared_ptr< const
DtLuaVehicleFightingPositionQueryJob
shared_from_this () const
 
- Public Member Functions inherited from DtLuaAsyncJob
void init (void *userData)
 
- Public Member Functions inherited from DtAsciiSerializable
 DtAsciiSerializable ()
 
 DtAsciiSerializable (const DtAsciiSerializable &orig)
 
virtual ~DtAsciiSerializable ()
 
virtual std::string objectTypeC () const
 

Static Public Member Functions

static boost::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 DtAsciiSerializablecreator ()
 

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
 
boost::shared_ptr
< DtAsyncJobMapEntry
myJobEntry
 
bool bMyDebug
 
- Protected Attributes inherited from DtLuaAsyncJob
DtSimulationServicesmySimulationServices
 

Member Typedef Documentation

Constructor & Destructor Documentation

DtLuaVehicleFightingPositionQueryJob::DtLuaVehicleFightingPositionQueryJob ( )

For creating when deserializing.

virtual DtLuaVehicleFightingPositionQueryJob::~DtLuaVehicleFightingPositionQueryJob ( )
virtual

DTOR.

DtLuaVehicleFightingPositionQueryJob::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 
)
protected

For creating from lua call.

Member Function Documentation

static boost::shared_ptr<DtLuaVehicleFightingPositionQueryJob> 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
luabind::object DtLuaVehicleFightingPositionQueryJob::getObject ( lua_State *  L,
int index,
std::string &  message 
)
virtual

Retrieve value If job is done, index will be > 0 and returned table will be Location3D points found.

Implements DtLuaAsyncJob.

luabind::object DtLuaVehicleFightingPositionQueryJob::getDebugObject ( lua_State *  L)
inlinevirtual

Retrieve debug data, if available. Default return value is an empty table.

Implements DtLuaAsyncJob.

virtual void DtLuaVehicleFightingPositionQueryJob::cancel ( lua_State *  L)
inlinevirtual

Currently a no-op.

Implements DtLuaAsyncJob.

static DtAsciiSerializable* DtLuaVehicleFightingPositionQueryJob::creator ( )
static

DtAsciiSerializable functions.

DtString DtLuaVehicleFightingPositionQueryJob::serialize ( )
virtual

The following characters are reserved and cannot be used in serialization: '|', ':'.

Implements DtAsciiSerializable.

bool DtLuaVehicleFightingPositionQueryJob::deserialize ( const DtString )
virtual

This function should take the string that was serialized via serialize() and fill this object with the correct data.

Implements DtAsciiSerializable.

DtString DtLuaVehicleFightingPositionQueryJob::objectType ( ) const
virtual

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.

boost::shared_ptr<DtLuaVehicleFightingPositionQueryJob> DtLuaVehicleFightingPositionQueryJob::shared_from_this ( )
boost::shared_ptr<const DtLuaVehicleFightingPositionQueryJob> DtLuaVehicleFightingPositionQueryJob::shared_from_this ( ) const
void DtLuaVehicleFightingPositionQueryJob::start ( )
protected
void DtLuaVehicleFightingPositionQueryJob::run ( const DtAlgorithmManager mgr = DtAlgorithmManager())
protected
void DtLuaVehicleFightingPositionQueryJob::taskComplete ( )
protected

Called by task object whenever it is done.

Member Data Documentation

Points DtLuaVehicleFightingPositionQueryJob::myTargetAreaCorners
protected
unsigned int DtLuaVehicleFightingPositionQueryJob::nMyPointsToReturn
protected
DtLocation3D DtLuaVehicleFightingPositionQueryJob::myOriginPoint
protected
DtVectorOffset3D DtLuaVehicleFightingPositionQueryJob::myHideVolume
protected
double DtLuaVehicleFightingPositionQueryJob::myShootHeight
protected
double DtLuaVehicleFightingPositionQueryJob::myTargetHeight
protected
double DtLuaVehicleFightingPositionQueryJob::myForwardBackSearchLimit
protected
double DtLuaVehicleFightingPositionQueryJob::mySideSideSearchLimit
protected
double DtLuaVehicleFightingPositionQueryJob::myMaxSlopeDegrees
protected
double DtLuaVehicleFightingPositionQueryJob::myPositionSpacing
protected
DtAsyncJobStatus DtLuaVehicleFightingPositionQueryJob::myStatus
protected
std::vector<std::pair<DtLocation3D, DtLocation3D> > DtLuaVehicleFightingPositionQueryJob::myPositionPairs
protected
boost::shared_ptr<DtAsyncJobMapEntry> DtLuaVehicleFightingPositionQueryJob::myJobEntry
protected
bool DtLuaVehicleFightingPositionQueryJob::bMyDebug
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)