PathEngine home previous: iQueryCallBack::desiredCallBackFrequency()next: iRender3DLinesCallBack::startVertex()
Contents, API Reference, Interfaces, iRender3DLinesCallBack

Interface iRender3DLinesCallBack

Description

The client application creates objects deriving from this interface to pass into visualisation helper functions such as iPath::renderOnGround().

PathEngine will call back to startVertex() for the first vertex of each sequence of connected line segments to be drawn, and then to vertex() for each subsequent vertex in that sequence.

Defined in SDKRoot/code/externalAPI/i_pathengine.h.

class iRender3DLinesCallBack
{
public:
    virtual ~iRender3DLinesCallBack() {};
    virtual void startVertex(int32_t terrainLayer, float x, float y, float z)=0;
    virtual void vertex(float x, float y, float z)=0;
};
        

The virtual destructor is included just for good general programming practice.
Destruction remains the responsibility of the client application - PathEngine will not call this virtual destructor.

Methods:

startVertex

This method is called by PathEngine at the start of each set of connected line segments to be rendered.

vertex

This method is called by PathEngine to continue a connected line sequence.

Usage

Vertices are passed back to the callback object for start and end points of each line segment, and also for points at which line segments cross changes in mesh slope.

A floating point representation is used by the callback and points are approximated at intersection, but each rendering method takes originX and originY arguments, and setting these values to a point close to the line can then reduce the amount of approximation, and improve rendering precision.

This origin could then be set, for example, to the current camera X and Y.

(To benefit from this mechanism, note that your rendering code needs to actually work with coordinates relative to the specified origin. If your engine works purely in terms of floating point world coordinates then there is no point setting an origin. Just set the origin arguments for rendering calls to [0, 0], in this case.)

Terrain height

Note that point heights are always set based on the surface of the 3D base mesh, even if terrain detail has been stripped out, and terrain callbacks are supplied.
The terrain layer argument passed in to the rendering callback's startVertex method can then be used to override the supplied Z values with height values calculated from the terrain, if this is desired.


Documentation for PathEngine release 6.04 - Copyright © 2002-2024 PathEnginenext: iRender3DLinesCallBack::startVertex()