![]() |
VR-Forces Developer's Guide
|
Go to the source code of this file.
Functions | |
| DT_DLL_vrfutil bool | generateOffsetRoute (const std::vector< DtVector > &routeVertices, const DtVector &bodyOffset, const DtVector &downDirection, bool createConnectingArc, double distanceBetweenPointsAlongArc, std::vector< DtVector > &offsetRoute) |
| DT_DLL_vrfutil std::vector < DtVector > | simplifyRoute (const std::vector< DtVector > &route, const Coordinate_System *localCS, double nearDistance=1.0) |
| DT_DLL_vrfutil bool | generateRelaxedOffsetRoute (const std::vector< DtVector > &routeVertices, const DtVector &bodyOffset, const Coordinate_System *cs, std::vector< DtVector > &offsetRoute, const double minTurnRadius=0.0, const bool useVariableRadius=false, const double angleForMinRadius=M_PI_2, bool createConnectingArc=true, double minArcPointSpacing=10.0, const bool debug=false) |
| DT_DLL_vrfutil bool generateOffsetRoute | ( | const std::vector< DtVector > & | routeVertices, |
| const DtVector & | bodyOffset, | ||
| const DtVector & | downDirection, | ||
| bool | createConnectingArc, | ||
| double | distanceBetweenPointsAlongArc, | ||
| std::vector< DtVector > & | offsetRoute | ||
| ) |
Deprecated. Use generateRelaxedOffsetRoute().
| DT_DLL_vrfutil std::vector<DtVector> simplifyRoute | ( | const std::vector< DtVector > & | route, |
| const Coordinate_System * | localCS, | ||
| double | nearDistance = 1.0 |
||
| ) |
Generate a new route vector that has close vertices removed. That is, if vertex i+1 is within nearDistance meters of vertex i, then i+1 is omitted. The first and last points of the original route are always in the new route.
| DT_DLL_vrfutil bool generateRelaxedOffsetRoute | ( | const std::vector< DtVector > & | routeVertices, |
| const DtVector & | bodyOffset, | ||
| const Coordinate_System * | cs, | ||
| std::vector< DtVector > & | offsetRoute, | ||
| const double | minTurnRadius = 0.0, |
||
| const bool | useVariableRadius = false, |
||
| const double | angleForMinRadius = M_PI_2, |
||
| bool | createConnectingArc = true, |
||
| double | minArcPointSpacing = 10.0, |
||
| const bool | debug = false |
||
| ) |
Generate a path that is offset from the given path (vector of points) by a given offset. The offset is a "body" offset that is relative to the direction of each segment. No z offset is used.
| routeVertices | The input path in local coordinates. |
| bodyOffset | A vector x,y,z in body coordinates, so x-forward and y-right. Z is ignored. |
| cs | The coordinate system of the routeVertice and offsetRoute. |
| offsetRoute | The output path. This path will be offset horizontally from the input path, at an elevation corresponding to the first point in the input path. No clamping to terrain is performed. |
| minTurnRadius | The output path is assumed to be for the purpose of moving, and in many cases the entity following this path will have a minimum turn radius (or choose to use one). Setting this value will allow the route generator to smooth out sharp corners and sometimes flow around short, jagged path segments altogether. (On the other hand, entities such as lifeforms that are traveling slowly may want to use a small value or zero.) The default value is zero. |
| useVariableRadius | If true, then when the bends in the path are small, the radius will be allowed to grow so that the path reflects the use of higher speeds at these bends. Default value is false. |
| angleForMinRadius | If useVariableRadius is true, then this angle will indicate the path bend angle at which the minTurnRadius must be used. Bends of higher angle will also use minTurnRadius. Bends of lower radius will use minTurnRadius/sin(theta). (Note that no smoothing curve between segments is used for very small bend angles.) If useVariableRadius is false, this parameter is ignored. |
| createConnectingArc | If true, then extra path points will be introduced to approximate a circular arc between path segments, as described above. If false, no arc is created, but single extra segment will still be created between segments at the place an arc would have been created (i.e., a chord of the arc). Also, the path on the outside of a bend will always use arc points. |
| minArcPointSpacing | If createConnectingArc is true, then this parameter determines the minimum spacing between points on the arc. |
| debug | If true, information is dumped onto the simulation console at Info level. |