VR-Forces 4.0.4 Class Documentation
Public Member Functions | Static Public Member Functions | Protected Attributes
DtGroundVehicleSlopeSoilPathMetric Class Reference

This path metric requires an entity with a DtGroundVehicleStateRepository and checks the slope and the soil type of the terrain being passed over, compares them to the capabilities of the entity, and returns a cost based on those values. More...

Inheritance diagram for DtGroundVehicleSlopeSoilPathMetric:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 DtGroundVehicleSlopeSoilPathMetric (DtVrfObject *entity)
virtual ~DtGroundVehicleSlopeSoilPathMetric ()
virtual bool init ()
 Call immediately after constructor.
virtual double transitionCost (const DtPoint &startPoint, const DtPoint &endPoint) const
 Calculates the cost of moving directly from startPoint to endPoint based on what slope is between the points, and what soil types are along the path.
virtual double turningCost (double cosAngle) const
 Returns a cost based on the turning radius of the vehicle.
virtual double multiplierForPoint (const DtPoint &point) const
 Override this function to add your own cost calculations to the path.
virtual void setTerrainSampleDistance (double distance)
 Sets the distance between terrain sample points used when calculating the cost of moving between two points.
virtual double terrainSampleDistance () const
 Returns the current terrain sample distance.

Static Public Member Functions

static DtPathMetriccreator (DtVrfObject *entity)

Protected Attributes

DtPhysicalWorldmyPhysicalWorld
double myTerrainSampleDistance

Detailed Description

This path metric requires an entity with a DtGroundVehicleStateRepository and checks the slope and the soil type of the terrain being passed over, compares them to the capabilities of the entity, and returns a cost based on those values.

The returned cost is equivalent to the distance across a flat paved surface the vehicle would need to travel to cross the segment.

For example: If the vehicle has soil factor of 1.0 for pavement, and 0.5 for mud and the segment passed to transitionCost() consists totally 10 meters of flat mud, the returned cost would be 20.


Constructor & Destructor Documentation


Member Function Documentation

Call immediately after constructor.

Reimplemented from DtPathMetric.

virtual double DtGroundVehicleSlopeSoilPathMetric::transitionCost ( const DtPoint startPoint,
const DtPoint endPoint 
) const [virtual]

Calculates the cost of moving directly from startPoint to endPoint based on what slope is between the points, and what soil types are along the path.

Takes samples of the terrain along the segment at terrainSampleDistance apart and calls multiplierForPoint() for each point checked along the segment. Note: this function makes a blocking terrain call to insure the required data is paged in. It also sets overrideBlockingAssert on its call to DtPhysicalWorld::terrainHeightAndSurface to prevent an assertion. This is safe because this function is not called from the main simulation thread.

Implements DtPathMetric.

virtual double DtGroundVehicleSlopeSoilPathMetric::turningCost ( double  cosAngle) const [virtual]

Returns a cost based on the turning radius of the vehicle.

Implements DtPathMetric.

virtual double DtGroundVehicleSlopeSoilPathMetric::multiplierForPoint ( const DtPoint point) const [virtual]

Override this function to add your own cost calculations to the path.

Default implementation return 1.0. To further customize this metric, override this method and return a multiplier for each point. Do not return less than 1.0 in order to keep the optimistic heuristic rule.

virtual void DtGroundVehicleSlopeSoilPathMetric::setTerrainSampleDistance ( double  distance) [virtual]

Sets the distance between terrain sample points used when calculating the cost of moving between two points.

This distance will be the average used.

Returns the current terrain sample distance.


Member Data Documentation


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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)