VR-Forces 4.8 Class Documentation
 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 Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Friends
DtPhysicalWorld Class Reference

The DtPhysicalWorld is the primary interface to and manager of all of the "physical" aspects of the simulated world. More...

Public Types

typedef std::list
< DtVrfLineOfSightFunctorSP
DtLineOfSightTestContainer
 
typedef DtString DtLosTestKey
 The following typedefs, functions, and other code are all related to the Line Of Sight calculations. More...
 

Public Member Functions

 DtPhysicalWorld (DtSimManager *simManager)
 Constructor. More...
 
virtual ~DtPhysicalWorld ()
 Destructor. More...
 
virtual bool initialize ()
 Initializes the physical world for use. More...
 
virtual bool reinitialize ()
 Reinitializes the physical world, and all it contains, to an initial state. More...
 
virtual bool reset ()
 Resets system to initial state. Calls reinitialize() and deletes myParameters. More...
 
virtual bool loadParametersFromFile (const DtFilename &filename)
 Calls createParameters() to get a new instance of the parameter object, and calls getSelf() on the parameters to load them from the file. More...
 
virtual bool loadPhysicalWorldFile (const DtFilename &filename)
 Called from loadParametersFromFile, will create a parameters list and merge any contents from the supplied file into it. More...
 
virtual void processParameters ()
 Initializes managers with parameters loaded from files. More...
 
const DtFilename & physicalWorldFile () const
 Returns the value of the last file loaded. More...
 
virtual bool parametersLoaded () const
 
virtual bool isValidState () const
 This function returns whether or not the physical world instance is in a valid state to perform its operations or not. More...
 
virtual void tick ()
 The tick function is responsible for updating the state of the physical world to account for anything that changed in the last tick. More...
 
virtual Coordinate_SystemcoordinateSystem ()
 ! COORDINATE SYSTEM OPERATIONS More...
 
virtual const Coordinate_SystemcoordinateSystem () const
 
virtual void geocentricToDatabase (const DtVector &in, DtVector &out) const
 Converts the specified vector from geocentric to database coordinates. More...
 
virtual void geocentricToDatabase (const DtDcm &in, DtDcm &out) const
 Converts the specified rotation matrix from geocentric to database coordinates. More...
 
virtual void geocentricToDatabase (const DtVector &vIn, const DtDcm &dIn, DtVector &vOut, DtDcm &dOut) const
 Converts the specified vector and rotation matrix from geocentric to database coordinates. More...
 
virtual void geocentricToDatabase (const DtExtent &in, DtExtent &out) const
 Converts the specified extent from geocentric to database coordinates. More...
 
virtual void databaseToGeocentric (const DtVector &in, DtVector &out) const
 Converts the specified vector from database to geocentric coordinates. More...
 
virtual void databaseToGeocentric (const DtDcm &in, DtDcm &out) const
 Converts the specified rotation matrix from database to geocentric coordinates. More...
 
virtual void databaseToGeocentric (const DtVector &vIn, const DtDcm &dIn, DtVector &vOut, DtDcm &dOut) const
 Converts the specified vector and rotation matrix from database to geocentric coordinates. More...
 
virtual void databaseToGeocentric (const DtExtent &in, DtExtent &out) const
 Converts the specified extent from database to geocentric coordinates. More...
 
virtual void databaseToGeodetic (const DtVector &databasePosition, DtGeodeticCoord &geodeticPosition) const
 Converts the specified position from database to geodetic coordinates. More...
 
virtual void databaseToGeodetic (const DtVector &databasePosition, DtVector &geodeticPosition) const
 Converts the specified position from database to geodetic coordinates. More...
 
virtual void databaseToGeodetic (const DtExtent &extent, DtExtent &destExtent) const
 Converts the specified extent from database to geodetic coordinates. More...
 
virtual void geodeticToDatabase (const DtExtent &extent, DtExtent &destExtent) const
 Converts the specified position from geodetic to database coordinates. More...
 
virtual void geodeticToDatabase (const DtGeodeticCoord &geodeticPosition, DtVector &databasePosition) const
 Converts the specified position from geodetic to database coordinates. More...
 
virtual void geodeticToDatabase (const DtVector &geodeticPosition, DtVector &databasePosition) const
 Converts the specified position from geodetic to database coordinates. More...
 
virtual void topoToDatabase (const DtVector &databasePosition, DtDcm &topoToDatabase) const
 Creates a rotation matrix for going between topographic and database coordinates, at a given database position. More...
 
virtual void databaseToTopo (const DtVector &databasePosition, DtDcm &databaseToTopo) const
 Creates a rotation matrices for going between database and topographic coordinates, at a given database position. More...
 
virtual DtVector down (const DtVector &databasePosition) const
 Calculates and returns the down vector, representing gravity, at the specified database location. More...
 
virtual bool terrainHeightAndSurfaceBelow (const DtVector &databaseLocation, double &heightAtLocation, DtSurface &surfaceAtLocation, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 This function is the same as terrainHeightAndSurface, but it looks below the input point rather than finding the highest surface at the xy of the input point. More...
 
virtual bool closestTerrainLocation (const DtPoint &databaseLocation, DtPoint &intersectionPoint, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 Similar to the terrainHeight functions above. More...
 
virtual bool closestTerrainLocation (double lat, double lon, DtPoint &intersectionPoint, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 Same as above closestTerrainLocation, but accepts location in lat/lon. More...
 
virtual bool closestTerrainLocation (const DtVector &databaseLocation, DtPoint &intersectionPoint, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 Same as above closestTerrainLocation, but accepts location as a vector. More...
 
virtual bool closestTerrainLocation (const DtPoint &databaseLocation, DtVrfChordIntersectionRecord &record, DtIntersectionRecord::DtIntersectionType irtFlag=DtIntersectionRecord::INT_ALL_DATA, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 Same as above closestTerrainLocation, but returns the entire intersection record, and not just the intersection point. More...
 
virtual bool closestTerrainLocation (const DtPoint &databaseLocation, DtVrfChordIntersectionRecord &record, const DtString &vectorFeatureLookup, DtIntersectionRecord::DtIntersectionType irtFlag=DtIntersectionRecord::INT_ALL_DATA, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 Temp call as test until all surface calls are turned over to use vector features. More...
 
virtual bool closestTerrainLocation (double lat, double lon, DtVrfChordIntersectionRecord &record, DtIntersectionRecord::DtIntersectionType irtFlag=DtIntersectionRecord::INT_ALL_DATA, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 Same as above closestTerrainLocation, but accepts location in lat/lon. More...
 
virtual bool closestTerrainLocation (const DtVector &databaseLocation, DtVrfChordIntersectionRecord &record, DtIntersectionRecord::DtIntersectionType irtFlag=DtIntersectionRecord::INT_ALL_DATA, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 Same as above closestTerrainLocation, but accepts location as a vector. More...
 
virtual bool closestTerrainLocation (const DtVector &curPosition, DtVector &intersection, bool ignoreWater, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 Returns true if a there is a terrain intersection at the given local position. More...
 
virtual bool intersect (const DtChord &chord, DtPoint &intersectionPoint, double &intersectionTime, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 Intersect calls which do not use down vector modification Calculates the first terrain intersection point along a chord given in Database Coordinates. More...
 
virtual bool intersect (const DtChord &chord, DtVrfChordIntersectionRecord &record, DtIntersectionRecord::DtIntersectionType irtFlag=DtIntersectionRecord::INT_ALL_DATA, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 Returns complete intersection information about the first terrain intersection point along a chord given in Database Coordinates. More...
 
virtual bool allIntersectsAlongChord (const DtChord &chord, DtVrfChordIntersectRecordList &intList, DtIntersectionRecord::DtIntersectionType irtFlag=DtIntersectionRecord::INT_ALL_DATA, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 Computes the list of all intersections of a chord (in Database Coordinates) with the terrain database. More...
 
virtual void groundClamp (DtPoint &databaseCoord, float const offset=0, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 Put the passed point "offset" meters from the ground. More...
 
virtual void groundClamp (DtVector &databaseCoord, float const offset=0, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 put the passed point "offset" meters from the ground. More...
 
virtual void getVrfObjectsAlongChord (const DtVector &databaseStart, const DtVector &databaseEnd, std::list< const DtVrfObject * > &orderedList) const
 
virtual DtManagedObjectListConstPtr getSpatiallyManagedVrfObjectList ()
 Gets the list of DtVrfObjects managed, using the spatial organization predicate to select the DtVrfObjects. More...
 
virtual bool initializeSpatialVrfObjectOrganization ()
 
virtual void calcSpatialMgrResolution (const DtManagedObjectListConstPtr &vrfObjList)
 Analyzes the objects to be spatially sorted, and determines appropriate numbers of subdivisions in each dimension. More...
 
virtual DtFilterFunctionPredicate getSpatialOrganizationPredicate ()
 
virtual bool processSpatialOrganizationObjectFilterFcn (const DtVrfObject *obj)
 
virtual void sendSensorDomains ()
 
virtual void processQuerySpatialSubdivisionConfiguration (DtSimMessage *msg)
 Process requests to determine and requests to set the terrain databases spatial subdivision settings. More...
 
virtual void processSetSpatialSubdivisionConfiguration (DtSimMessage *msg)
 
virtual bool useVrfObjectSpatialSub () const
 
virtual void setUseVrfObjectSpatialSub (bool yesOrNo)
 
virtual bool isSpatialMgrResolutionUserSpecified () const
 Specifies whether or not the user has specified the spatial manager resolution. More...
 
virtual void setSpatialMgrResolutionUserSpecified (bool yesOrNo)
 
virtual DtTerrainInterfaceterrainInterface ()
 
virtual const DtTerrainInterfaceterrainInterface () const
 
virtual void setTerrainInterface (DtTerrainInterface *newTerrainDatabase)
 Sets the terrain database. More...
 
virtual DtSimManagersimManager ()
 
virtual const DtSimManagersimManager () const
 
virtual void setSimManager (DtSimManager *newSimManager)
 
virtual DtVrfObjectManagerobjectManager ()
 
virtual const DtVrfObjectManagerobjectManager () const
 
virtual void setVrfObjectManager (DtVrfObjectManager *newObjectMgr)
 
virtual
DtEnvironmentalStateManager
environmentalStateManager ()
 
virtual const
DtEnvironmentalStateManager
environmentalStateManager () const
 
virtual void setEnvironmentalStateManager (DtEnvironmentalStateManager *manager)
 
virtual DtDynamicTerrainManagerdynamicTerrainManager ()
 Accessors for the Dynamic Terrain Manager. More...
 
virtual const
DtDynamicTerrainManager
dynamicTerrainManager () const
 
virtual void setDynamicTerrainManager (DtDynamicTerrainManager *manager)
 
virtual
MAKVRinTerra::DtDynamicFeatureSet
dynamicObjectFeatures () const
 Returns the feature set which contains features maintained by the dynamic features controller. More...
 
virtual DtPhysicalWorldParamsparameters ()
 
virtual const
DtPhysicalWorldParams
parameters () const
 
virtual DtSensorSignatureManagersensorSignatureManager ()
 
virtual const
DtSensorSignatureManager
sensorSignatureManager () const
 
virtual bool checkLineOfSight (const DtVrfObject &viewingObject, const DtVector &databaseViewingPoint, const DtVrfObject &targetObject, bool *terrainDataAvailable=0, const DtString &featureQueryName="default", DtVector *intersectionPoint=0) const
 Determines if targetObject is visible from the databaseViewingPoint (without allowing the viewingObject to block the LOS). More...
 
virtual bool checkLineOfSight (const DtVrfObject &viewingObject, const DtVector &databaseViewingPoint, const DtVector &databaseTargetPoint, bool *terrainDataAvailable=0, const DtString &featureQueryName="default", DtVector *intersectionPoint=0) const
 Determines if target location is visible from the viewingObject (specifically, from the databaseViewingPoint). More...
 
virtual bool checkLineOfSight (const DtVector &databaseViewingPoint, const DtVrfObject &targetObject, bool *terrainDataAvailable=0, const DtString &featureQueryName="default", DtVector *intersectionPoint=0) const
 Determines if targetObject is visible from the databaseViewingPoint. More...
 
virtual bool checkLineOfSightWithoutObjects (const DtVector &databaseViewingPoint, const DtVector &databaseTargetPoint, bool *terrainDataAvailable=0, const DtString &featureQueryName="default", DtVector *intersectionPoint=0) const
 Determines if the given target point can be seen from the viewing point. More...
 
virtual bool checkLineOfFire (const DtVrfObject &viewingObject, const DtVector &databaseViewingPoint, const DtVrfObject &targetObject, const DtVector &databaseTargetPoint, bool *terrainDataAvailable=0, double *normIntersectDistance=0, DtVrfObject **intersectObject=0, DtVector *intersectingPoint=0, int *ignoredForceType=0) const
 Similar to the checkLineOfSight functions except uses MAK_LOF_OBSTACLE for the feature query, and the function returns intersection information if there is an intersection. More...
 
virtual bool checkLineOfFire (const DtVrfObject &viewingObject, const DtVector &databaseViewingPoint, const DtVector &databaseTargetPoint, bool *terrainDataAvailable=0, double *normIntersectDistance=0, DtVrfObject **intersectionObject=0, DtVector *intersectingPoint=0, int *ignoredForceType=0) const
 See other checkLineOfFire(). This version omits the target object. More...
 
virtual bool checkLineOfFire (const DtVector &databaseViewingPoint, const DtVector &databaseTargetPoint, bool *terrainDataAvailable=0, double *normIntersectDistance=0, DtVrfObject **intersectionObject=0, DtVector *intersectingPoint=0, int *ignoredForceType=0) const
 See other checkLineOfFire(). This version omits the object parameters. More...
 
virtual bool checkLineOfFireWithoutObjects (const DtVector &databaseViewingPoint, const DtVector &databaseTargetPoint, bool *terrainDataAvailable=0, double *normIntersectDistance=0, DtVrfObject **intersectionObject=0, DtVector *intersectingPoint=0) const
 Similar to the checkLineOfSightWithoutObjects function above except uses MAK_LOF_OBSTACLE for the feature query, and returns intersection information if there is an intersection. More...
 
virtual void expireDataLoadRequestsBeforeTime (const double &time)
 
virtual double thermoclinePermeability (const DtPoint &startPoint, const DtPoint &endPoint) const
 Returns the a factor representing the distortion caused by crossing thermocline layers from local locations startPoint and endPoint. More...
 
virtual bool checkLineOfSight (const DtLineOfSightTestContainer &losTests, DtVrfLineOfSightCheckParams &losCheckParams) const
 Runs all the tests in the specified list. More...
 
const DtLineOfSightTestContainerlineOfSightTestsToPerform () const
 
const DtChord createWorldIntersectionChord (const DtVector &databaseLocation) const
 Creates a very large chord in the up/down direction (of gravity) at the specified database location. More...
 
virtual void addLineOfSightTest (const DtLosTestKey &, DtVrfLineOfSightFunctorSP losTest)
 Adds a particular test to the master container of all LOS tests. More...
 
virtual DtVrfLineOfSightFunctorSP lineOfSightTest (const DtLosTestKey &) const
 Returns the line of sight test for the given key. More...
 
virtual void removeLineOfSightTest (const DtLosTestKey &testKey)
 Removes a particular key/test pair from the master container of all LOS tests. More...
 
virtual bool intersectVrfObjects (const DtVrfObject *const primaryVrfObject, const DtVector &databaseStartPoint, const DtVrfObject *const secondaryVrfObject, const DtVector &databaseEndPoint, double &interxTime, DtVrfObject **intersectedObject=0, DtVector *intersectNormal=0, const std::list< DtUUID > &ignoreList=std::list< DtUUID >(), int *ignoredForceType=0) const
 Creates a chord from the start point to the end point and uses the spatialVrfObjectManager to visitVrfObjects that are in spatial divisions along the chord, checking each object found using intersectsVrfObject(). More...
 
virtual bool intersectVrfObjects (const DtVrfObject *const primaryVrfObject, const DtVector &databaseStartPoint, const DtVector &databaseEndPoint, double &interxTime, DtVrfObject **intersectedObject=0, DtVector *intersectNormal=0, const std::list< DtUUID > &ignoreList=std::list< DtUUID >(), int *ignoredForceType=0) const
 Creates a chord from the points and uses the spatialVrfObjectManager to visitVrfObjects that are in spatial divisions along the chord, checking each object found using intersectsVrfObject(). More...
 
virtual bool intersectsVrfObject (const DtVrfObject &vrfObjectToTest, const DtVector &databaseStartPoint, const DtVector &databaseEndPoint, double &distToIntersect, DtVector *surfaceNormal=0) const
 
virtual bool embarkedOnSameLowFidelityObject (const DtVrfObject &primaryVrfObject, const DtVrfObject &secondaryVrfObject) const
 
virtual void addPreLoadParametersCallback (DtNoArgumentCallbackList::DtCallbackFunctionType fcn, void *usrData)
 Callbacks invoked just before new parameters are loaded. More...
 
virtual void removePreLoadParametersCallback (DtNoArgumentCallbackList::DtCallbackFunctionType fcn, void *usrData)
 
virtual void addPostLoadParametersCallback (DtNoArgumentCallbackList::DtCallbackFunctionType fcn, void *usrData)
 Callbacks invoked just after new parameters are loaded. More...
 
virtual void removePostLoadParametersCallback (DtNoArgumentCallbackList::DtCallbackFunctionType fcn, void *usrData)
 
virtual double terrainHeight (const DtPoint &databaseLocation, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 These physical world queries only interact with the terrain elements, Functions for finding the height of the terrain at a specified location. More...
 
virtual double terrainHeight (double lat, double lon, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 
virtual double terrainHeight (const DtVector &databaseLocation, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 
virtual bool terrainHeight (const DtPoint &databaseLocation, double &height, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 Similar to above functions, but return a boolean signifying whether or not an intersection with the terrain was found or not. More...
 
virtual bool terrainHeight (double lat, double lon, double &height, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 
virtual bool terrainHeight (const DtVector &databaseLocation, double &height, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 
virtual bool terrainHeightAndSurface (const DtPoint &databaseLocation, double &height, DtSurface &surface, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 Functions for determining the height of the terrain at a specified location, AND the soil type of the terrain polygon intersected at that location. More...
 
virtual bool terrainHeightAndSurface (double lat, double lon, double &height, DtSurface &surface, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 
virtual bool terrainHeightAndSurface (const DtVector &databaseLocation, double &height, DtSurface &surface, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 
virtual bool terrainHeightAndSurface (const DtVector &databaseLocation, double &heightAtLocation, DtVrfChordIntersectionRecord &intersectionRec, DtIntersectionRecord::DtIntersectionType irtFlag=DtIntersectionRecord::INT_ALL_DATA, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 
virtual bool terrainHeightUnderWater (const DtVector &databaseLocation, double &groundHeight, DtSurface &groundSurface, DtVector &groundNormal, double &waterHeight, DtSurface::DtMedium &topSurfaceMedium, bool *dataAvailable=0, bool overrideBlockingAssert=false)
 This function gets the ground surface underneath the water at the given location. More...
 
virtual bool terrainSurface (const DtPoint &databaseLocation, DtSurface &surface, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 Functions for determining the surface of the terrain at a specified location. More...
 
virtual bool terrainSurface (double lat, double lon, DtSurface &surface, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 
virtual bool terrainSurface (const DtVector &databaseLocation, DtSurface &surface, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 
virtual DtSurface terrainSurface (const DtPoint &databaseLocation, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 
virtual DtSurface terrainSurface (double lat, double lon, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 
virtual DtSurface terrainSurface (const DtVector &databaseLocation, bool *dataAvailable=0, bool overrideBlockingAssert=false) const
 
void visitVrfObjects (const DtExtent &extent, class DtSpatialSelectionFunctor &callback) const
 Functions that call the specified functor for every object intersecting the requested region (whether chord or extent). More...
 
void visitVrfObjects (const DtChord &chord, class DtSpatialSelectionFunctor &callback) const
 
virtual unsigned int vrfObjectSpatialSubXResolution () const
 
virtual unsigned int vrfObjectSpatialSubYResolution () const
 
virtual unsigned int vrfObjectSpatialSubZResolution () const
 
virtual void setVrfObjectSpatialSubXResolution (unsigned int newXResolution)
 
virtual void setVrfObjectSpatialSubYResolution (unsigned int newYResolution)
 
virtual void setVrfObjectSpatialSubZResolution (unsigned int newZResolution)
 

Static Public Member Functions

static bool spatialOrganizationObjectFilterFcn (const DtVrfObject *obj, void *usr)
 Calls the virtual processSpatialOrganizationObjectFilterFcn() on the instance pointed to by usr. More...
 
static void querySpatialSubdivisionConfigurationCallback (DtSimMessage *msg, void *usr)
 SpatialSubdivision configuration message callback functions. More...
 
static void setSpatialSubdivisionConfigurationCallback (DtSimMessage *msg, void *usr)
 
static void requestSensorDomainsCallback (DtSimMessage *msg, void *usr)
 Request/return sensor domains. More...
 
static void objectAboutToBeRemovedCb (const DtVrfObject *vrfObject, void *usr)
 Callback registered with DtVrfObjectManager for notification when objects are removed. More...
 

Protected Types

typedef std::map< DtLosTestKey,
DtVrfLineOfSightFunctorSP
DtKeyedLineOfSightTestContainer
 
typedef
DtKeyedLineOfSightTestContainer::iterator 
DtMasterLosTestIter
 
typedef
DtKeyedLineOfSightTestContainer::const_iterator 
DtMasterLosTestConstIter
 
typedef
DtLineOfSightTestContainer::iterator 
DtLosTestIter
 
typedef
DtLineOfSightTestContainer::const_iterator 
DtLosTestConstIter
 

Protected Member Functions

virtual void addInitialLosChecks ()
 
virtual void setDefaultLineOfSightTestOrder (const DtRwNLengthStringVector &lineOfSightTestsAndOrder)
 Routines for setting line of sight test order. More...
 
virtual void setLineOfSightTestOrder (const DtRwNLengthStringVector &lineOfSightTestsAndOrder)
 
virtual void performTest (const DtLosTestKey &testToRun)
 Adds the test to the container of tests to perform, at the end. More...
 
virtual void doNotPerformTest (DtLineOfSightTestContainer &testContainer, const DtLosTestKey &testToRun) const
 Removes the test from the container of tests to perform. More...
 
virtual void doNotPerformTest (DtLineOfSightTestContainer &testContainer, DtVrfLineOfSightFunctorSP losTest) const
 Removes the test from the container of tests to perform. More...
 
virtual DtVector localLineOfSightTestLocation (const DtVrfObject &object) const
 
bool testInvariant () const
 
virtual
DtSpatialVrfObjectManagerInterface
spatialVrfObjectManager ()
 Accessors for the spatial DtVrfObject manager. More...
 
virtual const
DtSpatialVrfObjectManagerInterface
spatialVrfObjectManager () const
 
virtual void setSpatialVrfObjectManager (DtSpatialVrfObjectManagerInterface *newSpatialVrfObjectMgr)
 
virtual DtPhysicalWorldParamscreateParameters ()
 
virtual DtSensorSignatureManagercreateSensorSignatureManager ()
 
virtual void processObjectAboutToBeRemoved (const DtVrfObject *vrfObject)
 Tells mySpatialVrfObjectManager to remove given object. More...
 
virtual void performTerrainPreload ()
 Queries local DtVrfObject instances for their desired terrain preload and passes the information to the DtTerrainInterface. More...
 
virtual bool checkVrfObjectsForLOS (const DtVrfLineOfSightCheckParams &losCheckParams) const
 LOS test functions that can be used in checkLOS, referenced by test keys (see performTest() ). More...
 
virtual bool checkFeaturesForLOS (const DtVrfLineOfSightCheckParams &losCheckParams) const
 
virtual bool checkTerrainForLOS (const DtVrfLineOfSightCheckParams &losCheckParams) const
 

Static Protected Member Functions

static bool canBlockLineOfSight (const DtVrfObject *object, void *usr)
 Used by checkLineOfSight to determine which physical elements can block visibility. More...
 

Protected Attributes

DtKeyedLineOfSightTestContainer myMasterLineOfSightTestContainer
 
DtLineOfSightTestContainer myLineOfSightTestsToPerform
 
DtTerrainInterfacemyTerrainInterface
 
boost::shared_ptr
< MAKVRinTerra::DtDynamicFeatureSet
myDynamicObjectFeatures
 
bool myUseVrfObjectSpatialManager
 
bool mySpatialMgrResolutionUserSpecified
 
unsigned int myVrfObjectSpatialSubXResolution
 
unsigned int myVrfObjectSpatialSubYResolution
 
unsigned int myVrfObjectSpatialSubZResolution
 
DtSpatialVrfObjectManagerInterfacemySpatialVrfObjectManager
 
DtManagedObjectListConstPtr mySpatiallyManagedVrfObjectList
 
DtSimManagermySimManager
 Not owned, just used for reference. More...
 
DtVrfObjectManagermyVrfObjectManager
 Not owned, just used for reference. More...
 
DtPhysicalWorldParamsmyParameters
 Parameters for this physical world. More...
 
DtSensorSignatureManagermySensorSignatureManager
 
DtEnvironmentalStateManagermyEnvironmentalStateManager
 
DtDynamicTerrainManagermyDynamicTerrainManager
 
DtFilename myPhysicalWorldFile
 
DtTime myLastPreloadTerrainTime
 
DtExpireOlderThanCommandmyExpireOlderThanCommand
 
boost::shared_ptr
< DtVrfCallbackQueue
mySoilTypeLookupQueue
 
DtNoArgumentCallbackList myPreLoadParametersCallbacks
 
DtNoArgumentCallbackList myPostLoadParametersCallbacks
 

Private Member Functions

 DtPhysicalWorld (const DtPhysicalWorld &orig)
 Copy constructor - not implemented. More...
 
DtPhysicalWorldoperator= (const DtPhysicalWorld &orig)
 Assignment operator - not implemented. More...
 

Friends

class IntersectVrfObjectFunctor
 
typedef boost::unordered_set
< const DtVrfObject * > 
DtVrfConstObjectUniqueContainer
 Set of functions used to get the relevant DtVrfObjects from the object manager. More...
 
bool getVrfObjects (DtExtent &extent, DtVrfConstObjectUniqueContainer &objects) const
 
bool getVrfObjects (DtVrfObjectPredicate &predicate, DtExtent &extent, DtVrfConstObjectUniqueContainer &objects) const
 
bool getVrfObjects (DtChord &chord, std::list< const DtVrfObject * > &objects) const
 
bool getVrfObjects (DtVrfObjectPredicate &predicate, DtChord &chord, std::list< const DtVrfObject * > &objects) const
 

Detailed Description

The DtPhysicalWorld is the primary interface to and manager of all of the "physical" aspects of the simulated world.

The DtPhysicalWorld is the primary interface to and manager of all of the "physical" aspects of the simulated world. The primary purpose is to provide a singular interface for models to access all of the physical objects, including terrain, DtVrfObjects, and any other element in the simulated environment that could be considered a physical object in any way.

The primary interfaces to this class provide information about the simulation that take into account all or a specific subset of the physical elements. In general, models should use the queries that account for all elements of the physical world, or a combination of the specific element categories instead of only querying one or a small subset. This will help to ensure proper results and compatibility with future changes.

Additionally, in order to ensure consistency, the physical world can be configured itself, which subsequently affects all related queries. For a specific example, look at the Line of Sight functions and related functionality.

See Also
LineOfSight
Note
Application developers will want to ensure that any additions or subtractions to the physical elements in the environment, at a structural level, are accounted for in this classes interface. For instance, if a new type of terrain element, is added to the simulation, such as an implicit surface instead of a polygon, the queries of this class must be updated.

Member Typedef Documentation

typedef boost::unordered_set<const DtVrfObject*> DtPhysicalWorld::DtVrfConstObjectUniqueContainer

Set of functions used to get the relevant DtVrfObjects from the object manager.

If a primitive is specified, the function returns a container of DtVrfObjects that is guaranteed to contain at least all the DtVrfObjects that intersect the specified geometric primitive.

Note
The containers may, and probably will, contain additional DtVrfObjects when a primitive is supplied. They are only guaranteed to not be missing any that do intersect. This is because the contents of all the intersected cells, as well as any non-spatially indexed objects are returned.

The following typedefs, functions, and other code are all related to the Line Of Sight calculations.

Methods to add new visibility methods. Default are added in constructor

typedef DtKeyedLineOfSightTestContainer::iterator DtPhysicalWorld::DtMasterLosTestIter
protected
typedef DtKeyedLineOfSightTestContainer::const_iterator DtPhysicalWorld::DtMasterLosTestConstIter
protected
typedef DtLineOfSightTestContainer::iterator DtPhysicalWorld::DtLosTestIter
protected
typedef DtLineOfSightTestContainer::const_iterator DtPhysicalWorld::DtLosTestConstIter
protected

Constructor & Destructor Documentation

DtPhysicalWorld::DtPhysicalWorld ( DtSimManager simManager)

Constructor.

virtual DtPhysicalWorld::~DtPhysicalWorld ( )
virtual

Destructor.

DtPhysicalWorld::DtPhysicalWorld ( const DtPhysicalWorld orig)
private

Copy constructor - not implemented.

Member Function Documentation

DtPhysicalWorld& DtPhysicalWorld::operator= ( const DtPhysicalWorld orig)
private

Assignment operator - not implemented.

virtual bool DtPhysicalWorld::initialize ( )
virtual

Initializes the physical world for use.

This includes the following:

  • Registering for the spatial subdivision configuration message callbacks with the SimManager, so that users can specify the spatial subdivision settings through messages.
  • Creating the sensor signature manager.
  • If specified, extruding the vector obstructions as a temporary simplification for intersection testing (essentially turning the problem into a 2D intersection issue).
virtual bool DtPhysicalWorld::reinitialize ( )
virtual

Reinitializes the physical world, and all it contains, to an initial state.

This mainly affects the DtVrfObject spatial sorting, vector obstruction manager, and the sensor signature manager, as they are all reset to initial state. This is intended to be called when a scenario is closed. Note that this function currently leaves the physical world in an inconsistent state, which is restored when a new terrain is loaded (new scenario is loaded or started).

Note
The reinitialize function is very different from the initialize function.
virtual bool DtPhysicalWorld::reset ( )
virtual

Resets system to initial state. Calls reinitialize() and deletes myParameters.

virtual bool DtPhysicalWorld::loadParametersFromFile ( const DtFilename &  filename)
virtual

Calls createParameters() to get a new instance of the parameter object, and calls getSelf() on the parameters to load them from the file.

Assigns the newly loaded parameters to myParameters and processes parameters specified.

Returns
True on success.
virtual bool DtPhysicalWorld::loadPhysicalWorldFile ( const DtFilename &  filename)
virtual

Called from loadParametersFromFile, will create a parameters list and merge any contents from the supplied file into it.

Use this routine to load multiple physical world files. Called from loadParametersFromFile. If this routine is used, and not loadParametersFromFile, make sure to call processParameters() after all files are loaded

virtual void DtPhysicalWorld::processParameters ( )
virtual

Initializes managers with parameters loaded from files.

const DtFilename & DtPhysicalWorld::physicalWorldFile ( ) const
inline

Returns the value of the last file loaded.

Returns
Last parameter file loaded

References myPhysicalWorldFile.

virtual bool DtPhysicalWorld::parametersLoaded ( ) const
virtual
Returns
true if a parameter set has been loaded.
virtual void DtPhysicalWorld::addPreLoadParametersCallback ( DtNoArgumentCallbackList::DtCallbackFunctionType  fcn,
void *  usrData 
)
virtual

Callbacks invoked just before new parameters are loaded.

The callback function signature is callback(void* usr)

virtual void DtPhysicalWorld::removePreLoadParametersCallback ( DtNoArgumentCallbackList::DtCallbackFunctionType  fcn,
void *  usrData 
)
virtual
virtual void DtPhysicalWorld::addPostLoadParametersCallback ( DtNoArgumentCallbackList::DtCallbackFunctionType  fcn,
void *  usrData 
)
virtual

Callbacks invoked just after new parameters are loaded.

The callback function signature is callback(void* usr)

virtual void DtPhysicalWorld::removePostLoadParametersCallback ( DtNoArgumentCallbackList::DtCallbackFunctionType  fcn,
void *  usrData 
)
virtual
virtual bool DtPhysicalWorld::isValidState ( ) const
virtual

This function returns whether or not the physical world instance is in a valid state to perform its operations or not.

It should be called before all non-initialization or core-state change functions, unless you are sure its state is valid and unchanged or are changing the state explicitly yourself. (For instance setting the terrain database or object manager)

Currently, the physical world is in a valid state when it can perform all of its operations. This primarily means that:

  • It has a valid way to get the entities in the scenario (the object manager pointer is valid)
  • It has a working model of the terrain (for now, the terrain database and its associated coordinate system are loaded and created properly.)
Returns
A boolean indicating whether or not the physical world instance is in a valid state to perform operations or not.
Note
This is not the same as the testInvariant function, which is solely responsible for ensuring that the classes invariant is maintained.
virtual void DtPhysicalWorld::tick ( )
virtual

The tick function is responsible for updating the state of the physical world to account for anything that changed in the last tick.

For instance, if spatial DtVrfObjects are spatially sorted, this will update the sorting to account for any changes to the spatial DtVrfObjects - removals or additions - in addition to general location/state changes.

virtual Coordinate_System* DtPhysicalWorld::coordinateSystem ( )
virtual

! COORDINATE SYSTEM OPERATIONS

The following functions provide general coordinate system functionality. This includes conversions between the specified coordinate systems, providing access to the current coordinate system object, and providing utility functionality, such as the down vector at a specified location.

virtual const Coordinate_System* DtPhysicalWorld::coordinateSystem ( ) const
virtual
virtual void DtPhysicalWorld::geocentricToDatabase ( const DtVector in,
DtVector out 
) const
virtual

Converts the specified vector from geocentric to database coordinates.

virtual void DtPhysicalWorld::geocentricToDatabase ( const DtDcm &  in,
DtDcm &  out 
) const
virtual

Converts the specified rotation matrix from geocentric to database coordinates.

virtual void DtPhysicalWorld::geocentricToDatabase ( const DtVector vIn,
const DtDcm &  dIn,
DtVector vOut,
DtDcm &  dOut 
) const
virtual

Converts the specified vector and rotation matrix from geocentric to database coordinates.

virtual void DtPhysicalWorld::geocentricToDatabase ( const DtExtent in,
DtExtent out 
) const
virtual

Converts the specified extent from geocentric to database coordinates.

virtual void DtPhysicalWorld::databaseToGeocentric ( const DtVector in,
DtVector out 
) const
virtual

Converts the specified vector from database to geocentric coordinates.

virtual void DtPhysicalWorld::databaseToGeocentric ( const DtDcm &  in,
DtDcm &  out 
) const
virtual

Converts the specified rotation matrix from database to geocentric coordinates.

virtual void DtPhysicalWorld::databaseToGeocentric ( const DtVector vIn,
const DtDcm &  dIn,
DtVector vOut,
DtDcm &  dOut 
) const
virtual

Converts the specified vector and rotation matrix from database to geocentric coordinates.

virtual void DtPhysicalWorld::databaseToGeocentric ( const DtExtent in,
DtExtent out 
) const
virtual

Converts the specified extent from database to geocentric coordinates.

virtual void DtPhysicalWorld::databaseToGeodetic ( const DtVector databasePosition,
DtGeodeticCoord &  geodeticPosition 
) const
virtual

Converts the specified position from database to geodetic coordinates.

virtual void DtPhysicalWorld::databaseToGeodetic ( const DtVector databasePosition,
DtVector geodeticPosition 
) const
virtual

Converts the specified position from database to geodetic coordinates.

The component order in the output vector is (lon, lat, alt)

virtual void DtPhysicalWorld::databaseToGeodetic ( const DtExtent extent,
DtExtent destExtent 
) const
virtual

Converts the specified extent from database to geodetic coordinates.

virtual void DtPhysicalWorld::geodeticToDatabase ( const DtExtent extent,
DtExtent destExtent 
) const
virtual

Converts the specified position from geodetic to database coordinates.

virtual void DtPhysicalWorld::geodeticToDatabase ( const DtGeodeticCoord &  geodeticPosition,
DtVector databasePosition 
) const
virtual

Converts the specified position from geodetic to database coordinates.

virtual void DtPhysicalWorld::geodeticToDatabase ( const DtVector geodeticPosition,
DtVector databasePosition 
) const
virtual

Converts the specified position from geodetic to database coordinates.

The component order in the input vector must be (lon, lat, alt)

virtual void DtPhysicalWorld::topoToDatabase ( const DtVector databasePosition,
DtDcm &  topoToDatabase 
) const
virtual

Creates a rotation matrix for going between topographic and database coordinates, at a given database position.

virtual void DtPhysicalWorld::databaseToTopo ( const DtVector databasePosition,
DtDcm &  databaseToTopo 
) const
virtual

Creates a rotation matrices for going between database and topographic coordinates, at a given database position.

virtual DtVector DtPhysicalWorld::down ( const DtVector databasePosition) const
virtual

Calculates and returns the down vector, representing gravity, at the specified database location.

Unlike the above version, this will version will return a default 0,0,-1 vector if there is no way to calculate the down vector (almost always no terrain database loaded)

Returns
The unit vector pointing down (along the direction of gravity) at a given database position.
virtual double DtPhysicalWorld::terrainHeight ( const DtPoint databaseLocation,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual

These physical world queries only interact with the terrain elements, Functions for finding the height of the terrain at a specified location.

Takes a location, in either database (DB) coordinates or a latitude and longitude, and the returns the altitude of the terrain at the specified location if possible. If no intersection with terrain was found at the specified location, 0 is returned.

Note
1 - These functions only intersect terrain polygons - no feature data.

2 - The intersection is defined to be the topmost intersection with the terrain. Thus if there are multiple levels of terrain polygons, the highest intersection will be returned as the height.

Parameters
Output
dataAvailablePlease see "Synchronous and asynchronous calls with paged terrains" in the class documentation for DtTerrainInterface for information on how to specify that this function be blocking or non-blocking. If the terrain data is not yet paged in, dataAvailable will be set to false.
overrideBlockingAssertwhen set to true this parameter will prevent an assertion from being thrown when the terrain implementation has myAssertOnBlockingTerrainCalls set to true. This should only be done when the call is being made from outside the main simulation thread and a blocking call would not cause a a problem.
Returns
terrainHeight (or zero if the terrain is not yet available)
virtual double DtPhysicalWorld::terrainHeight ( double  lat,
double  lon,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual
virtual double DtPhysicalWorld::terrainHeight ( const DtVector databaseLocation,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual
virtual bool DtPhysicalWorld::terrainHeight ( const DtPoint databaseLocation,
double height,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual

Similar to above functions, but return a boolean signifying whether or not an intersection with the terrain was found or not.

If not, the height is set to 0 and false is returned. If so, true is returned and the height parameter is set to the height of the terrain.

Parameters
Output
dataAvailablePlease see "Synchronous and asynchronous calls with paged terrains" in the class documentation for DtTerrainInterface for information on how to specify that this function be blocking or non-blocking. If the terrain data is not yet paged in, dataAvailable will be set to false.
overrideBlockingAssertwhen set to true this parameter will prevent an assertion from being thrown when the terrain implementation has myAssertOnBlockingTerrainCalls set to true. This should only be done when the call is being made from outside the main simulation thread and a blocking call would not cause a a problem.
Returns
result of the terrain intersection or data availability
Return values
truea terrain intersection was found
falseif there is no terrain instersection at the location; OR there is no data available at the location. The latter case is not relevant if dataAvailable was not provided.
virtual bool DtPhysicalWorld::terrainHeight ( double  lat,
double  lon,
double height,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual
virtual bool DtPhysicalWorld::terrainHeight ( const DtVector databaseLocation,
double height,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual
virtual bool DtPhysicalWorld::terrainHeightAndSurface ( const DtPoint databaseLocation,
double height,
DtSurface surface,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual

Functions for determining the height of the terrain at a specified location, AND the soil type of the terrain polygon intersected at that location.

Return Values: These functions return true if an intersection occurred, If so, they also set the height to be the height of the intersection point and the soilType to be the soilType associated with the intersected polygon.

They return false if no intersection occurred. If so, they also set the height to 0 and the soilType to "DtSurface::undefinedSoilType"

Note
1 - These functions to NOT intersect vector or geometric feature data - they are intended for finding the "ground" height. 2 - These functions determine the topmost intersection with the terrain. Thus if there are multiple levels of terrain, the highest intersection point will be returned as the height. In order to get the closest intersection points with terrain (and possibly features data, use the closestIntersection() functions below.
Parameters
Output
dataAvailablePlease see "Synchronous and asynchronous calls with paged terrains" in the class documentation for DtTerrainInterface for information on how to specify that this function be blocking or non-blocking. If the terrain data is not yet paged in, dataAvailable will be set to false.
overrideBlockingAssertwhen set to true this parameter will prevent an assertion from being thrown when the terrain implementation has myAssertOnBlockingTerrainCalls set to true. This should only be done when the call is being made from outside the main simulation thread and a blocking call would not cause a a problem.
Returns
result of the terrain intersection or data availability
Return values
truea terrain intersection was found
falseif there is no terrain instersection at the location; OR there is no data available at the location. The latter case is not relevant if dataAvailable was not provided.
virtual bool DtPhysicalWorld::terrainHeightAndSurface ( double  lat,
double  lon,
double height,
DtSurface surface,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual
virtual bool DtPhysicalWorld::terrainHeightAndSurface ( const DtVector databaseLocation,
double height,
DtSurface surface,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual
virtual bool DtPhysicalWorld::terrainHeightAndSurface ( const DtVector databaseLocation,
double heightAtLocation,
DtVrfChordIntersectionRecord intersectionRec,
DtIntersectionRecord::DtIntersectionType  irtFlag = DtIntersectionRecord::INT_ALL_DATA,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual
virtual bool DtPhysicalWorld::terrainHeightAndSurfaceBelow ( const DtVector databaseLocation,
double heightAtLocation,
DtSurface surfaceAtLocation,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual

This function is the same as terrainHeightAndSurface, but it looks below the input point rather than finding the highest surface at the xy of the input point.

virtual bool DtPhysicalWorld::terrainHeightUnderWater ( const DtVector databaseLocation,
double groundHeight,
DtSurface groundSurface,
DtVector groundNormal,
double waterHeight,
DtSurface::DtMedium topSurfaceMedium,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
)
virtual

This function gets the ground surface underneath the water at the given location.

It provides the elevation, the surface structure for the ground, the height of the water surface, and a flag indicating whether the surface is actually under water (vs. above water level).

Note
1 - These functions to NOT intersect vector or geometric feature data - they are intended for finding the "ground" height. 2 - These functions determine the topmost intersection with the terrain. Thus if there are multiple levels of terrain, the highest intersection point will be returned as the height. In order to get the closest intersection points with terrain (and possibly features data, use the closestIntersection() functions below.
Parameters
Output
groundHeightThe height of the [underwater] ground at the location. If no terrain intersection was found, but there is global water at the location, this is a made-up height using the water height and the default water depth.
groundSurfaceThe surface (structure) of the ground. If no ground was found, but there is global water, this is filled in as Ground/unspecified soil.
groundNormalThe normal vector of the ground surface, in local database coordinates.
waterHeightThe height of the water surface at the location. The water height could come from a water polygon, an unspecified polygon, or even a global sea level value for the database. If there is only ground found, or ground above water, topSurfaceMedium == Ground, and this parameter value is undefined.
topSurfaceMediumReturns the medium of the top surface, which will be either Ground, WaterSurface, or UnspecifiedMedium.
If it is Ground, then the ground surface data will be in the ground height, surface, and normal parameters, and waterHeight will be invalid.
If it is UnspecifiedMedium, it was the only surface found, and could be either water or ground; the calling code must determine what to do with it. The ground parameters will be set with a synthesized sea-floor surface as if the top surface was water, but waterHeight will be set to the height of the unspecified surface.
If it is WaterSurface, then waterHeight will be set to the water surface height, and the ground parameters will be set to the values for the sea floor (either another surface, or a synthesized sea floor).
dataAvailablePlease see "Synchronous and asynchronous calls with paged terrains" in the class documentation for DtTerrainInterface for information on how to specify that this function be blocking or non-blocking. If the terrain data is not yet paged in, dataAvailable will be set to false.
overrideBlockingAssertwhen set to true this parameter will prevent an assertion from being thrown when the terrain implementation has myAssertOnBlockingTerrainCalls set to true. This should only be done when the call is being made from outside the main simulation thread and a blocking call would not cause a a problem.
Returns
result of data availability:
Return values
trueData from the terrain database is available, i.e. paged in.
falseData from the database has not been paged in yet.
virtual bool DtPhysicalWorld::terrainSurface ( const DtPoint databaseLocation,
DtSurface surface,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual

Functions for determining the surface of the terrain at a specified location.

Returns
A boolean indicating whether or not the surface could be determined at the specified location. If false, likely no intersection occurred.
Note
These functions do not intersect any non-terrain elements, or even the vector or geometric feature data. The are intended for finding the "ground" surface only. They also find the topmost intersection with the terrain. Thus if there are multiple levels of terrain, the highest intersection point's surface will be returned. In order to get the closest intersection points with terrain (and possibly features data, use the closestIntersection() functions below.
See Also
closestIntersection
Parameters
Output
dataAvailablePlease see "Synchronous and asynchronous calls with paged terrains" in the class documentation for DtTerrainInterface for information on how to specify that this function be blocking or non-blocking. If the terrain data is not yet paged in, dataAvailable will be set to false.
overrideBlockingAssertwhen set to true this parameter will prevent an assertion from being thrown when the terrain implementation has myAssertOnBlockingTerrainCalls set to true. This should only be done when the call is being made from outside the main simulation thread and a blocking call would not cause a a problem.
Returns
result of the terrain intersection or data availability
Return values
truea terrain intersection was found
falseif there is no terrain instersection at the location; OR there is no data available at the location. The latter case is not relevant if dataAvailable was not provided.
virtual bool DtPhysicalWorld::terrainSurface ( double  lat,
double  lon,
DtSurface surface,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual
virtual bool DtPhysicalWorld::terrainSurface ( const DtVector databaseLocation,
DtSurface surface,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual
virtual DtSurface DtPhysicalWorld::terrainSurface ( const DtPoint databaseLocation,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual
virtual DtSurface DtPhysicalWorld::terrainSurface ( double  lat,
double  lon,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual
virtual DtSurface DtPhysicalWorld::terrainSurface ( const DtVector databaseLocation,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual
virtual bool DtPhysicalWorld::closestTerrainLocation ( const DtPoint databaseLocation,
DtPoint intersectionPoint,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual

Similar to the terrainHeight functions above.

Function to determine the closest intersection to a specified location, either in database (DB) coordinates or in lat/lon. The closest intersection is defined as the closest intersection in the down or up direction from location. Thus if there are multiple terrain levels, it will not necessarily return an intersection with the topmost as the terrainHeight functions do.

Return Values: True if any intersection, vector data or terrain, is found. If at least one terrain intersection is found, the intersectionPoint parameter is set to the closest intersection point.

Parameters
Output
dataAvailablePlease see "Synchronous and asynchronous calls with paged terrains" in the class documentation for DtTerrainInterface for information on how to specify that this function be blocking or non-blocking. If the terrain data is not yet paged in, dataAvailable will be set to false.
overrideBlockingAssertwhen set to true this parameter will prevent an assertion from being thrown when the terrain implementation has myAssertOnBlockingTerrainCalls set to true. This should only be done when the call is being made from outside the main simulation thread and a blocking call would not cause a a problem.
Returns
result of the terrain intersection or data availability
Return values
truea terrain intersection was found
falseif there is no terrain instersection at the location; OR there is no data available at the location. The latter case is not relevant if dataAvailable was not provided.
virtual bool DtPhysicalWorld::closestTerrainLocation ( double  lat,
double  lon,
DtPoint intersectionPoint,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual

Same as above closestTerrainLocation, but accepts location in lat/lon.

vectorDatarecord and vectorIntersectionRecord are ignored.

virtual bool DtPhysicalWorld::closestTerrainLocation ( const DtVector databaseLocation,
DtPoint intersectionPoint,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual

Same as above closestTerrainLocation, but accepts location as a vector.

virtual bool DtPhysicalWorld::closestTerrainLocation ( const DtPoint databaseLocation,
DtVrfChordIntersectionRecord record,
DtIntersectionRecord::DtIntersectionType  irtFlag = DtIntersectionRecord::INT_ALL_DATA,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual

Same as above closestTerrainLocation, but returns the entire intersection record, and not just the intersection point.

virtual bool DtPhysicalWorld::closestTerrainLocation ( const DtPoint databaseLocation,
DtVrfChordIntersectionRecord record,
const DtString vectorFeatureLookup,
DtIntersectionRecord::DtIntersectionType  irtFlag = DtIntersectionRecord::INT_ALL_DATA,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual

Temp call as test until all surface calls are turned over to use vector features.

virtual bool DtPhysicalWorld::closestTerrainLocation ( double  lat,
double  lon,
DtVrfChordIntersectionRecord record,
DtIntersectionRecord::DtIntersectionType  irtFlag = DtIntersectionRecord::INT_ALL_DATA,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual

Same as above closestTerrainLocation, but accepts location in lat/lon.

vectorDatarecord and vectorIntersectionRecord are ignored.

virtual bool DtPhysicalWorld::closestTerrainLocation ( const DtVector databaseLocation,
DtVrfChordIntersectionRecord record,
DtIntersectionRecord::DtIntersectionType  irtFlag = DtIntersectionRecord::INT_ALL_DATA,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual

Same as above closestTerrainLocation, but accepts location as a vector.

virtual bool DtPhysicalWorld::closestTerrainLocation ( const DtVector curPosition,
DtVector intersection,
bool  ignoreWater,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual

Returns true if a there is a terrain intersection at the given local position.

The algorithm checks for intersections along a chord in the direction of gravity at that location (from halfHeightOfChord above to halfHeightOfChord below localPosition).

Parameters
Input
curPostionposition to test
ignoreWaterif set to true, advances through list of intersection returned until first DtSurface that is not a water surface is found.
Output
intersectionthe point of intersection, left unchanged if dataAvailable is set to false.
dataAvailablePlease see "Synchronous and asynchronous calls with paged terrains" in the class documentation for DtTerrainInterface for information on how to specify that this function be blocking or non-blocking. If the terrain data is not yet paged in, dataAvailable will be set to false.
overrideBlockingAssertwhen set to true this parameter will prevent an assertion from being thrown when the terrain implementation has myAssertOnBlockingTerrainCalls set to true. This should only be done when the call is being made from outside the main simulation thread and a blocking call would not cause a a problem.
Returns
result of the terrain intersection or data availability
Return values
truea terrain intersection was found
falseif there is no terrain instersection at the location; OR there is no data available at the location. The latter case is not relevant if dataAvailable was not provided.
virtual bool DtPhysicalWorld::intersect ( const DtChord chord,
DtPoint intersectionPoint,
double intersectionTime,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual

Intersect calls which do not use down vector modification Calculates the first terrain intersection point along a chord given in Database Coordinates.

Parameters
Input
chordthe chord to test
Output
intersectionPointlocation of the intersection or left unchanged if there's no intersection or the data is not yet available (see dataAvailable).
intersectionTimetime of the intersection along the input chord or left unchanged if there's no intersection or the data is not yet available (see dataAvailable).
record
intersectionRecord
dataAvailablePlease see "Synchronous and asynchronous calls with paged terrains" in the class documentation for DtTerrainInterface for information on how to specify that this function be blocking or non-blocking. If the terrain data is not yet paged in, dataAvailable will be set to false.
overrideBlockingAssertwhen set to true this parameter will prevent an assertion from being thrown when the terrain implementation has myAssertOnBlockingTerrainCalls set to true. This should only be done when the call is being made from outside the main simulation thread and a blocking call would not cause a a problem.
Returns
result of the terrain intersection or data availability
Return values
truea terrain intersection was found
falseif there is no terrain instersection at the location; OR there is no data available at the location. The latter case is not relevant if dataAvailable was not provided.
virtual bool DtPhysicalWorld::intersect ( const DtChord chord,
DtVrfChordIntersectionRecord record,
DtIntersectionRecord::DtIntersectionType  irtFlag = DtIntersectionRecord::INT_ALL_DATA,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual

Returns complete intersection information about the first terrain intersection point along a chord given in Database Coordinates.

The irtFlag value specifies which data should be calculated and returned for each intersection point.

Parameters
Input
chordthe chord to test
irtFlagspecifies which data should be calculated and returned for each intersection point
Output
recordthe result of the terrain intersection
vectorDataRecord
vectorIntersectionRecord
dataAvailablePlease see "Synchronous and asynchronous calls with paged terrains" in the class documentation for DtTerrainInterface for information on how to specify that this function be blocking or non-blocking. If the terrain data is not yet paged in, dataAvailable will be set to false.
overrideBlockingAssertwhen set to true this parameter will prevent an assertion from being thrown when the terrain implementation has myAssertOnBlockingTerrainCalls set to true. This should only be done when the call is being made from outside the main simulation thread and a blocking call would not cause a a problem.
Returns
result of the terrain intersection or data availability
Return values
truea terrain intersection was found
falseif there is no terrain instersection at the location; OR there is no data available at the location. The latter case is not relevant if dataAvailable was not provided.
virtual bool DtPhysicalWorld::allIntersectsAlongChord ( const DtChord chord,
DtVrfChordIntersectRecordList intList,
DtIntersectionRecord::DtIntersectionType  irtFlag = DtIntersectionRecord::INT_ALL_DATA,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual

Computes the list of all intersections of a chord (in Database Coordinates) with the terrain database.

Parameters
Input
chordthe chord to test
irtFlagspecifies which data should be calculated and returned for each intersection point
Note
that passing an irtFlag value of INT_EXISTS will probably never return more than one intersection.
Parameters
Output
intListthe result of the terrain intersection
dataAvailablePlease see Synchronous and Asynchronous Calls with Paged Terrains for information on how to specify that this function be blocking or non-blocking. If the data is not yet paged in, dataAvailable will be set to false and intList will not reflect any terrain intersections
overrideBlockingAssertwhen set to true this parameter will prevent an assertion from being thrown when the terrain implementation has myAssertOnBlockingTerrainCalls set to true. This should only be done when the call is being made from outside the main simulation thread and a blocking call would not cause a a problem.
Returns
result of the terrain intersection or data availability
Return values
trueif the chord intersects the terrain
falseif dataAvailable was specified and returns true, then the chord does not intersect the terrain. Otherwise false indicates that the data is not yet available.
bool DtPhysicalWorld::getVrfObjects ( DtExtent extent,
DtVrfConstObjectUniqueContainer objects 
) const
bool DtPhysicalWorld::getVrfObjects ( DtVrfObjectPredicate predicate,
DtExtent extent,
DtVrfConstObjectUniqueContainer objects 
) const
bool DtPhysicalWorld::getVrfObjects ( DtChord chord,
std::list< const DtVrfObject * > &  objects 
) const
bool DtPhysicalWorld::getVrfObjects ( DtVrfObjectPredicate predicate,
DtChord chord,
std::list< const DtVrfObject * > &  objects 
) const
void DtPhysicalWorld::visitVrfObjects ( const DtExtent extent,
class DtSpatialSelectionFunctor callback 
) const

Functions that call the specified functor for every object intersecting the requested region (whether chord or extent).

The functor should return false while additional processing should be done, and true if processing is complete and visitVrfObjects() should return. Note that processing is not guaranteed to stop immediately when the functor returns true; it is only a recommendation that processing can stop at any time.

Note
The functor may, and probably will, be called for additional DtVrfObjects when a primitive is supplied. We are only guaranteed not to miss any that do intersect.
void DtPhysicalWorld::visitVrfObjects ( const DtChord chord,
class DtSpatialSelectionFunctor callback 
) const
virtual void DtPhysicalWorld::groundClamp ( DtPoint databaseCoord,
float const  offset = 0,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual

Put the passed point "offset" meters from the ground.

Passes DtPoint.

Parameters
Input
databaseCoordlocation to ground clamp
offsetheight above the ground
Output
databaseCoordground clamped output
dataAvailableIf specified, this parameter prevents the terrain intersection call from blocking if the terrain data is not yet available. In that case, dataAvailable will be set to false and offset will be added to databaseCoord without checking the terrain.
overrideBlockingAssertwhen set to true this parameter will prevent an assertion from being thrown when the terrain implementation has myAssertOnBlockingTerrainCalls set to true. This should only be done when the call is being made from outside the main simulation thread and a blocking call would not cause a a problem.
virtual void DtPhysicalWorld::groundClamp ( DtVector databaseCoord,
float const  offset = 0,
bool dataAvailable = 0,
bool  overrideBlockingAssert = false 
) const
virtual

put the passed point "offset" meters from the ground.

Passes a DtVector.

Parameters
Input
databaseCoordlocation to ground clamp
offsetheight above the ground
Output
databaseCoordground clamped output
dataAvailableIf specified, this parameter prevents the terrain intersection call from blocking if the terrain data is not yet available. In that case, dataAvailable will be set to false and offset will be added to databaseCoord without checking the terrain.
overrideBlockingAssertwhen set to true this parameter will prevent an assertion from being thrown when the terrain implementation has myAssertOnBlockingTerrainCalls set to true. This should only be done when the call is being made from outside the main simulation thread and a blocking call would not cause a a problem.
virtual void DtPhysicalWorld::getVrfObjectsAlongChord ( const DtVector databaseStart,
const DtVector databaseEnd,
std::list< const DtVrfObject * > &  orderedList 
) const
virtual
Returns
An ordered list of all DtVrfObjects that the specified chord intersects. This includes only objects which the chord intersects. The chord is specified in database (local) coordinates. The returned list will be ordered starting with closest to the chord start.
virtual DtManagedObjectListConstPtr DtPhysicalWorld::getSpatiallyManagedVrfObjectList ( )
virtual

Gets the list of DtVrfObjects managed, using the spatial organization predicate to select the DtVrfObjects.

Used when initializing the spatial organization of DtVrfObjects.

See Also
getList
getSpatialOrganizationPredicate
initializeSpatialVrfObjectOrganization;
virtual bool DtPhysicalWorld::initializeSpatialVrfObjectOrganization ( )
virtual
Returns
A boolean indicating success or failure in spatially organizing the DtVrfObjects.
Note
Only DtVrfObjects specified by the spatial organization predicate are organized.
virtual void DtPhysicalWorld::calcSpatialMgrResolution ( const DtManagedObjectListConstPtr vrfObjList)
virtual

Analyzes the objects to be spatially sorted, and determines appropriate numbers of subdivisions in each dimension.

If the user has specified the resolution to use, then make a note of it so that the specified settings are not overwritten by calculated values.

Note
Currently calculates the number of subdivisions so that, given evenly distributed vrfObjects, the cells would have a relatively constant fill rate of about DtMaxVrfObjectsPerCell (currently 10). The calculation is the sq. root. of the the number of objects divided by 10 (DtMaxVrfObjectsPerCell).
virtual DtFilterFunctionPredicate DtPhysicalWorld::getSpatialOrganizationPredicate ( )
virtual
Returns
a DtFilterFunctionPredicate based on spatialOrganizationObjectFilterFcn that is used to select the DtVrfObjects, from all managed, to be spatially organized.

This function should be overridden to allow for a more selective spatial organization if desired.

static bool DtPhysicalWorld::spatialOrganizationObjectFilterFcn ( const DtVrfObject obj,
void *  usr 
)
static

Calls the virtual processSpatialOrganizationObjectFilterFcn() on the instance pointed to by usr.

virtual bool DtPhysicalWorld::processSpatialOrganizationObjectFilterFcn ( const DtVrfObject obj)
virtual
Returns
A boolean indicating whether or not the specified object should be part of the spatial subdivision. This is done based on the object type. If the physical world parameters have been loaded, then the type is compared against the list of types in the params file. Otherwise it is compared against the default list of types: DtObjectType::individualPlatformType() DtObjectType::individualLifeformType() DtArealObjectKind DtLinearObjectKind DtPointObjectKind
static void DtPhysicalWorld::querySpatialSubdivisionConfigurationCallback ( DtSimMessage msg,
void *  usr 
)
static

SpatialSubdivision configuration message callback functions.

static void DtPhysicalWorld::setSpatialSubdivisionConfigurationCallback ( DtSimMessage msg,
void *  usr 
)
static
static void DtPhysicalWorld::requestSensorDomainsCallback ( DtSimMessage msg,
void *  usr 
)
static

Request/return sensor domains.

virtual void DtPhysicalWorld::sendSensorDomains ( )
virtual
virtual void DtPhysicalWorld::processQuerySpatialSubdivisionConfiguration ( DtSimMessage msg)
virtual

Process requests to determine and requests to set the terrain databases spatial subdivision settings.

virtual void DtPhysicalWorld::processSetSpatialSubdivisionConfiguration ( DtSimMessage msg)
virtual
virtual bool DtPhysicalWorld::useVrfObjectSpatialSub ( ) const
virtual
Returns
A boolean indicating whether or not to spatially organize the DtVrfObjects.
virtual void DtPhysicalWorld::setUseVrfObjectSpatialSub ( bool  yesOrNo)
virtual
virtual bool DtPhysicalWorld::isSpatialMgrResolutionUserSpecified ( ) const
virtual

Specifies whether or not the user has specified the spatial manager resolution.

If not, the default calculation values are used.

virtual void DtPhysicalWorld::setSpatialMgrResolutionUserSpecified ( bool  yesOrNo)
virtual
virtual unsigned int DtPhysicalWorld::vrfObjectSpatialSubXResolution ( ) const
virtual

Accesses the spatial subdivision resolution

virtual unsigned int DtPhysicalWorld::vrfObjectSpatialSubYResolution ( ) const
virtual
virtual unsigned int DtPhysicalWorld::vrfObjectSpatialSubZResolution ( ) const
virtual
virtual void DtPhysicalWorld::setVrfObjectSpatialSubXResolution ( unsigned int  newXResolution)
virtual

Sets the spatial subdivision resolution. Note that this value will be overridden each tick by calcSpatialMgrResolution unless setSpatialMgrResolutionUserSpecified(true) is called

virtual void DtPhysicalWorld::setVrfObjectSpatialSubYResolution ( unsigned int  newYResolution)
virtual
virtual void DtPhysicalWorld::setVrfObjectSpatialSubZResolution ( unsigned int  newZResolution)
virtual
virtual DtTerrainInterface* DtPhysicalWorld::terrainInterface ( )
virtual
Returns
Pointer to the currently loaded terrain interface, if it exists.
virtual const DtTerrainInterface* DtPhysicalWorld::terrainInterface ( ) const
virtual
Returns
Pointer to the currently loaded terrain interface, if it exists.
virtual void DtPhysicalWorld::setTerrainInterface ( DtTerrainInterface newTerrainDatabase)
virtual

Sets the terrain database.

Note
Does not delete it first.
virtual DtSimManager* DtPhysicalWorld::simManager ( )
virtual
virtual const DtSimManager* DtPhysicalWorld::simManager ( ) const
virtual
virtual void DtPhysicalWorld::setSimManager ( DtSimManager newSimManager)
virtual
virtual DtVrfObjectManager* DtPhysicalWorld::objectManager ( )
virtual
virtual const DtVrfObjectManager* DtPhysicalWorld::objectManager ( ) const
virtual
virtual void DtPhysicalWorld::setVrfObjectManager ( DtVrfObjectManager newObjectMgr)
virtual
virtual DtEnvironmentalStateManager* DtPhysicalWorld::environmentalStateManager ( )
virtual
virtual const DtEnvironmentalStateManager* DtPhysicalWorld::environmentalStateManager ( ) const
virtual
virtual void DtPhysicalWorld::setEnvironmentalStateManager ( DtEnvironmentalStateManager manager)
virtual
virtual DtDynamicTerrainManager* DtPhysicalWorld::dynamicTerrainManager ( )
virtual

Accessors for the Dynamic Terrain Manager.

virtual const DtDynamicTerrainManager* DtPhysicalWorld::dynamicTerrainManager ( ) const
virtual
virtual void DtPhysicalWorld::setDynamicTerrainManager ( DtDynamicTerrainManager manager)
virtual
virtual MAKVRinTerra::DtDynamicFeatureSet* DtPhysicalWorld::dynamicObjectFeatures ( ) const
virtual

Returns the feature set which contains features maintained by the dynamic features controller.

virtual DtPhysicalWorldParams* DtPhysicalWorld::parameters ( )
virtual
Returns
The parameters for this DtPhysicalWorld.
virtual const DtPhysicalWorldParams* DtPhysicalWorld::parameters ( ) const
virtual
virtual DtSensorSignatureManager* DtPhysicalWorld::sensorSignatureManager ( )
virtual
Returns
The DtSensorSignatureManager owned by this physical world. This provides access to querying apparent signatures of objects in the world.
virtual const DtSensorSignatureManager* DtPhysicalWorld::sensorSignatureManager ( ) const
virtual
virtual bool DtPhysicalWorld::checkLineOfSight ( const DtVrfObject viewingObject,
const DtVector databaseViewingPoint,
const DtVrfObject targetObject,
bool terrainDataAvailable = 0,
const DtString featureQueryName = "default",
DtVector intersectionPoint = 0 
) const
virtual

Determines if targetObject is visible from the databaseViewingPoint (without allowing the viewingObject to block the LOS).

The specific target location is determined by localLineOfSightTestLocation().
Uses any LOS tests configured in myLineOfSightTestsToPerform. The default is to check terrain, entities, and features (see data/simulationModelSets/default/physicalWorldParams.mtl, line-of-sight-tests).
Entities that can block LOS are defined in canBlockLineOfSight().
ViewingObject and targetObject will not block line of sight. (i.e. the viewer should not be in his own way). Assuming a terrain LOS test is performed, terrainDataAvailable will be set to false if the terrain is still being paged in. If it is not specified, this will be a blocking call (which should usually not be done from a tick function). If terrain is not available, the function will return false, but really the result is undefined.
The featureQueryName parameter determines which named query in featureconfig.txt to use. The default value will use whatever query name is defined in terrainInterfaceConfig.mtl. If an empty string is passed in, no features will be tested.

Returns
True if data is available and there is a clear line of sight.
virtual bool DtPhysicalWorld::checkLineOfSight ( const DtVrfObject viewingObject,
const DtVector databaseViewingPoint,
const DtVector databaseTargetPoint,
bool terrainDataAvailable = 0,
const DtString featureQueryName = "default",
DtVector intersectionPoint = 0 
) const
virtual

Determines if target location is visible from the viewingObject (specifically, from the databaseViewingPoint).


Uses any LOS tests configured in myLineOfSightTestsToPerform. The default is to check terrain, features, and entities (see data/simulationModelSets/default/physicalWorldParams.mtl, line-of-sight-tests).
Entities that can block LOS are defined in canBlockLineOfSight().
ViewingObject and targetObject will not block line of sight. (i.e. the viewer should not be in his own way). Assuming a terrain LOS test is performed, terrainDataAvailable will be set to false if the terrain is still being paged in. If it is not specified, this will be a blocking call (which should usually not be done from a tick function).

Returns
True if data is available and there is a clear line of sight.
virtual bool DtPhysicalWorld::checkLineOfSight ( const DtVector databaseViewingPoint,
const DtVrfObject targetObject,
bool terrainDataAvailable = 0,
const DtString featureQueryName = "default",
DtVector intersectionPoint = 0 
) const
virtual

Determines if targetObject is visible from the databaseViewingPoint.

The specific target location is determined by localLineOfSightTestLocation().
Uses any LOS tests configured in myLineOfSightTestsToPerform. The default is to check terrain, features, and entities (see data/simulationModelSets/default/physicalWorldParams.mtl, line-of-sight-tests).
Entities that can block LOS are defined in canBlockLineOfSight(). TargetObject will not block line of sight.
Assuming a terrain LOS test is performed, terrainDataAvailable will be set to false if the terrain is still being paged in. If it is not specified, this will be a blocking call (which should generally not be done from a tick function).

Returns
True if data is available and there is a clear line of sight.
virtual bool DtPhysicalWorld::checkLineOfSightWithoutObjects ( const DtVector databaseViewingPoint,
const DtVector databaseTargetPoint,
bool terrainDataAvailable = 0,
const DtString featureQueryName = "default",
DtVector intersectionPoint = 0 
) const
virtual

Determines if the given target point can be seen from the viewing point.

This test checks terrain and features, but not entities: It removes the "Entity" LOS test from the set to test before making the check, then restores "Entity" to the set afterwards so that the other checkLineOfSight function work normally.
Assuming a terrain LOS test is performed, terrainDataAvailable will be set to false if the terrain is still being paged in. If it is not specified, this will be a blocking call (which should generally not be done from a tick function).

Returns
True if data is available and there is a clear line of sight.
virtual bool DtPhysicalWorld::checkLineOfFire ( const DtVrfObject viewingObject,
const DtVector databaseViewingPoint,
const DtVrfObject targetObject,
const DtVector databaseTargetPoint,
bool terrainDataAvailable = 0,
double normIntersectDistance = 0,
DtVrfObject **  intersectObject = 0,
DtVector intersectingPoint = 0,
int ignoredForceType = 0 
) const
virtual

Similar to the checkLineOfSight functions except uses MAK_LOF_OBSTACLE for the feature query, and the function returns intersection information if there is an intersection.

This combination of parameters is useful when tracing the flight of a munition to its maximum range to see what it hits, but the firing and target entities are ignored. Ignoring the target entity is useful if other P(hit) calculations have already determined that the round missed its intended target.
The return values are in the last two parameters. If these are both null, then the function is more efficient because it stops checking for blockage when it finds an obstruction, even if it is not the first thing hit.

Parameters
normIntersectDistanceA number from 0-1 indicating where along the chord from viewing point to target point the intersection occurs.
intersectObjectA pointer to the object that is intersected, if an object blocks line of fire.
ignoredForceTypeA pointer to a DtForceType value which the LOS check should ignore entities with this type.
Returns
True if there is a clear line of fire. False if there is something blocking line of fire, or if the terrain data is not available.
virtual bool DtPhysicalWorld::checkLineOfFire ( const DtVrfObject viewingObject,
const DtVector databaseViewingPoint,
const DtVector databaseTargetPoint,
bool terrainDataAvailable = 0,
double normIntersectDistance = 0,
DtVrfObject **  intersectionObject = 0,
DtVector intersectingPoint = 0,
int ignoredForceType = 0 
) const
virtual

See other checkLineOfFire(). This version omits the target object.

virtual bool DtPhysicalWorld::checkLineOfFire ( const DtVector databaseViewingPoint,
const DtVector databaseTargetPoint,
bool terrainDataAvailable = 0,
double normIntersectDistance = 0,
DtVrfObject **  intersectionObject = 0,
DtVector intersectingPoint = 0,
int ignoredForceType = 0 
) const
virtual

See other checkLineOfFire(). This version omits the object parameters.

virtual bool DtPhysicalWorld::checkLineOfFireWithoutObjects ( const DtVector databaseViewingPoint,
const DtVector databaseTargetPoint,
bool terrainDataAvailable = 0,
double normIntersectDistance = 0,
DtVrfObject **  intersectionObject = 0,
DtVector intersectingPoint = 0 
) const
virtual

Similar to the checkLineOfSightWithoutObjects function above except uses MAK_LOF_OBSTACLE for the feature query, and returns intersection information if there is an intersection.


The return values are in the last two parameters. If these are both null, then the function is more efficient because it stops checking for blockage when it finds an obstruction, even if it is not the first thing hit.

Parameters
normIntersectDistanceA number from 0-1 indicating where along the chord from viewing point to target point the intersection occurs.
intersectObjectA pointer to the object that is intersected, if an object blocks line of fire.
Returns
True if there is a clear line of fire. False if there is something blocking line of fire, or if the terrain data is not available.
static void DtPhysicalWorld::objectAboutToBeRemovedCb ( const DtVrfObject vrfObject,
void *  usr 
)
static

Callback registered with DtVrfObjectManager for notification when objects are removed.

Calls processObjectAboutToBeRemoved().

Parameters
vrfObjectPointer to object representing the route we're following.
usrPointer to instance of this class.
virtual void DtPhysicalWorld::expireDataLoadRequestsBeforeTime ( const double time)
virtual
virtual double DtPhysicalWorld::thermoclinePermeability ( const DtPoint startPoint,
const DtPoint endPoint 
) const
virtual

Returns the a factor representing the distortion caused by crossing thermocline layers from local locations startPoint and endPoint.

virtual bool DtPhysicalWorld::checkLineOfSight ( const DtLineOfSightTestContainer losTests,
DtVrfLineOfSightCheckParams losCheckParams 
) const
virtual

Runs all the tests in the specified list.

Returns
True only if all tests return true.
const DtLineOfSightTestContainer& DtPhysicalWorld::lineOfSightTestsToPerform ( ) const
inline
const DtChord DtPhysicalWorld::createWorldIntersectionChord ( const DtVector databaseLocation) const

Creates a very large chord in the up/down direction (of gravity) at the specified database location.

Returns
A chord in the up/down direction at the specified database location.
Note
The length of the chord is defined to be 100000 meters (hard coded) for now.
virtual void DtPhysicalWorld::addLineOfSightTest ( const DtLosTestKey ,
DtVrfLineOfSightFunctorSP  losTest 
)
virtual

Adds a particular test to the master container of all LOS tests.

Does NOT add the test to the container of tests to run.

Note
If a particular test already exists with the specified test key, it will be replaced by the new test
virtual DtVrfLineOfSightFunctorSP DtPhysicalWorld::lineOfSightTest ( const DtLosTestKey ) const
virtual

Returns the line of sight test for the given key.

virtual void DtPhysicalWorld::removeLineOfSightTest ( const DtLosTestKey testKey)
virtual

Removes a particular key/test pair from the master container of all LOS tests.

Also removes the test from the container of tests to perform.

virtual void DtPhysicalWorld::addInitialLosChecks ( )
protectedvirtual
virtual void DtPhysicalWorld::setDefaultLineOfSightTestOrder ( const DtRwNLengthStringVector lineOfSightTestsAndOrder)
protectedvirtual

Routines for setting line of sight test order.

The default call will set the order to be Polygon, Entity, Feature. The setLineOfSightTestOrder() call will order the tests according to the supplied string. In order to add more tests, call the addLineOfSightTest method (with the appropriate test function as defined above as DtLineOfSightTest)

virtual void DtPhysicalWorld::setLineOfSightTestOrder ( const DtRwNLengthStringVector lineOfSightTestsAndOrder)
protectedvirtual
virtual void DtPhysicalWorld::performTest ( const DtLosTestKey testToRun)
protectedvirtual

Adds the test to the container of tests to perform, at the end.

The test is only added once, so if it is added again, it is moved to the end of the container. This only adds a test that is associated with the specified LOS test key in the master test container.

virtual void DtPhysicalWorld::doNotPerformTest ( DtLineOfSightTestContainer testContainer,
const DtLosTestKey testToRun 
) const
protectedvirtual

Removes the test from the container of tests to perform.

This does not remove the test from the master container of all LOS tests that can be run.

virtual void DtPhysicalWorld::doNotPerformTest ( DtLineOfSightTestContainer testContainer,
DtVrfLineOfSightFunctorSP  losTest 
) const
protectedvirtual

Removes the test from the container of tests to perform.

This does not remove the test from the master container of all LOS tests that can be run.

static bool DtPhysicalWorld::canBlockLineOfSight ( const DtVrfObject object,
void *  usr 
)
staticprotected

Used by checkLineOfSight to determine which physical elements can block visibility.

Default implementation includes individual platforms, munitions, lifeforms, and cultural features.

Parameters
usrIs not currently used.
virtual DtVector DtPhysicalWorld::localLineOfSightTestLocation ( const DtVrfObject object) const
protectedvirtual
Returns
the local coordinate which is the line of sight test location for the specified object. This is the point which must be viewable in order for the object to be considered viewable. This implementation returns the center of the bounding volume of the object.
virtual bool DtPhysicalWorld::checkVrfObjectsForLOS ( const DtVrfLineOfSightCheckParams losCheckParams) const
protectedvirtual

LOS test functions that can be used in checkLOS, referenced by test keys (see performTest() ).

Update intersectionTime, intersectionPoint, intersectingObject in LOS Check Params if those members are non-NULL. If data is not available, return false (LOS blocked) and set terrainDataAvailable to false. Provide reasonable defaults for intersectionTime and intersectionPoint (if pointers to them are valid in losCheckParams) when data is not available, e.g. 1.0 for time.

Returns
True if no VRF Objects block the sight line specified in losCheckParams.
virtual bool DtPhysicalWorld::checkFeaturesForLOS ( const DtVrfLineOfSightCheckParams losCheckParams) const
protectedvirtual
Returns
True if no terrain vector features block the sight line specified in losCheckParams.
virtual bool DtPhysicalWorld::checkTerrainForLOS ( const DtVrfLineOfSightCheckParams losCheckParams) const
protectedvirtual
Returns
True if no terrain polygons block the sight line specified in losCheckParams.
virtual bool DtPhysicalWorld::intersectVrfObjects ( const DtVrfObject *const  primaryVrfObject,
const DtVector databaseStartPoint,
const DtVrfObject *const  secondaryVrfObject,
const DtVector databaseEndPoint,
double interxTime,
DtVrfObject **  intersectedObject = 0,
DtVector intersectNormal = 0,
const std::list< DtUUID > &  ignoreList = std::list< DtUUID >(),
int ignoredForceType = 0 
) const
virtual

Creates a chord from the start point to the end point and uses the spatialVrfObjectManager to visitVrfObjects that are in spatial divisions along the chord, checking each object found using intersectsVrfObject().

If the end point is supplied (non-zero) then that will be used, else the secondary vrf object's current location is used. If an object intersects and the intersectedObject is specified returns the position along the chord and the intersecting object.

virtual bool DtPhysicalWorld::intersectVrfObjects ( const DtVrfObject *const  primaryVrfObject,
const DtVector databaseStartPoint,
const DtVector databaseEndPoint,
double interxTime,
DtVrfObject **  intersectedObject = 0,
DtVector intersectNormal = 0,
const std::list< DtUUID > &  ignoreList = std::list< DtUUID >(),
int ignoredForceType = 0 
) const
virtual

Creates a chord from the points and uses the spatialVrfObjectManager to visitVrfObjects that are in spatial divisions along the chord, checking each object found using intersectsVrfObject().

If an object intersects and the intersectedObject is specified returns the intersecting object in the given pointer.

virtual bool DtPhysicalWorld::intersectsVrfObject ( const DtVrfObject vrfObjectToTest,
const DtVector databaseStartPoint,
const DtVector databaseEndPoint,
double distToIntersect,
DtVector surfaceNormal = 0 
) const
virtual
Returns
True if vrfObjectToTest is blocking the specified line of sight (chord) If True is returned, distToIntersect will be set to the distance in chord length (0 to 1) of the first intersection point.
virtual bool DtPhysicalWorld::embarkedOnSameLowFidelityObject ( const DtVrfObject primaryVrfObject,
const DtVrfObject secondaryVrfObject 
) const
virtual
Returns
True if the two objects are embarked on the same low fidelity object model
bool DtPhysicalWorld::testInvariant ( ) const
protected
virtual DtSpatialVrfObjectManagerInterface* DtPhysicalWorld::spatialVrfObjectManager ( )
protectedvirtual

Accessors for the spatial DtVrfObject manager.

virtual const DtSpatialVrfObjectManagerInterface* DtPhysicalWorld::spatialVrfObjectManager ( ) const
protectedvirtual
virtual void DtPhysicalWorld::setSpatialVrfObjectManager ( DtSpatialVrfObjectManagerInterface newSpatialVrfObjectMgr)
protectedvirtual
virtual DtPhysicalWorldParams* DtPhysicalWorld::createParameters ( )
protectedvirtual
Returns
A new instance of DtPhysicalWorldParams. If new parameters are used in a derived version of this class, override this method to return a derived version of DtPhysicalWorldParams.
virtual DtSensorSignatureManager* DtPhysicalWorld::createSensorSignatureManager ( )
protectedvirtual
Returns
A new instance of DtSensorSignatureManager, ready to be used by this DtPhysicalWorld.
virtual void DtPhysicalWorld::processObjectAboutToBeRemoved ( const DtVrfObject vrfObject)
protectedvirtual

Tells mySpatialVrfObjectManager to remove given object.

Parameters
vrfObjectPointer to the object about to be removed from the object manager. May be any type of DtVrfObject (entity, aggregate, control object).
virtual void DtPhysicalWorld::performTerrainPreload ( )
protectedvirtual

Queries local DtVrfObject instances for their desired terrain preload and passes the information to the DtTerrainInterface.

Friends And Related Function Documentation

friend class IntersectVrfObjectFunctor
friend

Member Data Documentation

DtKeyedLineOfSightTestContainer DtPhysicalWorld::myMasterLineOfSightTestContainer
protected
DtLineOfSightTestContainer DtPhysicalWorld::myLineOfSightTestsToPerform
protected
DtTerrainInterface* DtPhysicalWorld::myTerrainInterface
protected
boost::shared_ptr<MAKVRinTerra::DtDynamicFeatureSet> DtPhysicalWorld::myDynamicObjectFeatures
protected
bool DtPhysicalWorld::myUseVrfObjectSpatialManager
protected
bool DtPhysicalWorld::mySpatialMgrResolutionUserSpecified
protected
unsigned int DtPhysicalWorld::myVrfObjectSpatialSubXResolution
protected
unsigned int DtPhysicalWorld::myVrfObjectSpatialSubYResolution
protected
unsigned int DtPhysicalWorld::myVrfObjectSpatialSubZResolution
protected
DtSpatialVrfObjectManagerInterface* DtPhysicalWorld::mySpatialVrfObjectManager
protected
DtManagedObjectListConstPtr DtPhysicalWorld::mySpatiallyManagedVrfObjectList
protected
DtSimManager* DtPhysicalWorld::mySimManager
protected

Not owned, just used for reference.

DtVrfObjectManager* DtPhysicalWorld::myVrfObjectManager
protected

Not owned, just used for reference.

DtPhysicalWorldParams* DtPhysicalWorld::myParameters
protected

Parameters for this physical world.

DtSensorSignatureManager* DtPhysicalWorld::mySensorSignatureManager
protected
DtEnvironmentalStateManager* DtPhysicalWorld::myEnvironmentalStateManager
protected
DtDynamicTerrainManager* DtPhysicalWorld::myDynamicTerrainManager
protected
DtFilename DtPhysicalWorld::myPhysicalWorldFile
protected

Referenced by physicalWorldFile().

DtTime DtPhysicalWorld::myLastPreloadTerrainTime
protected
DtExpireOlderThanCommand* DtPhysicalWorld::myExpireOlderThanCommand
protected
boost::shared_ptr<DtVrfCallbackQueue> DtPhysicalWorld::mySoilTypeLookupQueue
protected
DtNoArgumentCallbackList DtPhysicalWorld::myPreLoadParametersCallbacks
protected
DtNoArgumentCallbackList DtPhysicalWorld::myPostLoadParametersCallbacks
protected

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

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)