PathEngine home | previous: | next: |
To avoid the need for platform specific code inside PathEngine file system access for things like loading and saving are abstracted out, and must be performed by the client application.
We're going to load a ground mesh file.
The first step for this will be to load the file into memory, with the resulting memory buffer then passed into
PathEngine's loadMeshFromBuffer() method (
unique_ptr<iMesh> mesh; { std::vector<char> buffer; LoadBinary("../resource/meshes/mesh1.xml", buffer); mesh = pathengine->loadMeshFromBuffer("xml", VectorBuffer(buffer), SizeUL(buffer), 0); } |
(The LoadBinary function is defined in the sampleShared directory, outside of the PathEngine API.)
The first argument to loadMeshFromBuffer() specifies how PathEngine should interpret
the buffer.
See
The last argument to loadMeshFromBuffer() enables a set of arbitrary attributes to be passed in to control
aspects of the mesh loading process.
(Refer to
In this case we simply pass a null pointer to indicate no attributes, since we just want the default mesh loading behaviour.
Note that the pointer to the newly created API object (pointing to an
The following code sets the testbed current mesh to the mesh we have just loaded.
testbed->setMesh(mesh.get()); testbed->zoomExtents(); |
Documentation for PathEngine release 6.04 - Copyright © 2002-2024 PathEngine | next: |