PathEngine home previous: iProgressCallBack::updateProgress()next: iConnectionTestCallBack::testDropCandidatePair()
Contents, API Reference, Interfaces, iConnectionTestCallBack

Interface iConnectionTestCallBack

Description

Objects derived from this interface are passed in to iMesh::autoGenerateConnections() to enable candidate endpoint pairs to be validated against client side world data and movement constraints.

This interface is defined in SDKRoot/code/externalAPI/i_pathengine.h.

Methods:

testDropCandidatePair

PathEngine calls back to this method for application-side validation of drop type connection candidates.

testJumpCandidatePair

PathEngine calls back to this method for application-side validation of jump type connection candidates.

Types of connections

iMesh::autoGenerateConnections() generates two types of connection candidates, jump type candidates and drop type candidates, with a different method on the callback object called for each type of connection.

Jump type connections are generated between pairs of endpoints at the mesh edge.
Drop type connections are generated where one piece of ground mesh overhangs another.

The call-back methods return two penalty values, corresponding to the two possible directions for off-mesh connection between the given endpoints.
Pass -1 for a penalty to indicate that it is not possible to move 'off mesh' between the given endpoints, otherwise an off-mesh connection will be created with the given penalty value.

A 'null' connection test call-back

The following code snippet shows how a 'null' connection test call-back can be implemented.
This simply permits all connection candidates.

This can be useful for debugging, as it can help with visualising the set of candidate connections generated by the auto connection generation framework.

class cNullConnectionTestCallBack : public iConnectionTestCallBack
{
public:
    void
    testJumpCandidatePair(const int32_t* fromPoint3D, const int32_t* toPoint3D, int32_t& penaltyOut, int32_t& penaltyBack)
    {
        penaltyOut = 0;
        penaltyBack = 0;
    }
    void
    testDropCandidatePair(const int32_t* fromPoint3D, const int32_t* toPoint3D, int32_t& penaltyOut, int32_t& penaltyBack)
    {
        penaltyOut = 0;
        penaltyBack = 0;
    }
};

Documentation for PathEngine release 6.04 - Copyright © 2002-2024 PathEnginenext: iConnectionTestCallBack::testDropCandidatePair()