OGRE-Next: Ogre::v1::MeshSerializer Class Reference

| OGRE-Next 3.0.0 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
Public Member Functions | List of all members
Ogre::v1::MeshSerializer Class Reference
Core » Resources

Class for serialising mesh data to/from an OGRE .mesh file. More...

`#include <OgreMeshSerializer.h>`

Inheritance diagram for Ogre::v1::MeshSerializer:
[legend]

## Public Member Functions
| MeshSerializer ()
virtual | ~MeshSerializer ()
void | exportMesh (const Mesh *pMesh, const String &filename, Endian endianMode=ENDIAN_NATIVE)
| Exports a mesh to the file specified, in the latest format.
void | exportMesh (const Mesh *pMesh, const String &filename, MeshVersion version, Endian endianMode=ENDIAN_NATIVE)
| Exports a mesh to the file specified, in a specific version format.
void | exportMesh (const Mesh *pMesh, DataStreamPtr stream, Endian endianMode=ENDIAN_NATIVE)
| Exports a mesh to the stream specified, in the latest format.
void | exportMesh (const Mesh *pMesh, DataStreamPtr stream, MeshVersion version, Endian endianMode=ENDIAN_NATIVE)
| Exports a mesh to the stream specified, in a specific version format.
MeshSerializerListener * | getListener ()
| Returns the current listener.
void | importMesh (DataStreamPtr &stream, Mesh *pDest)
| Imports Mesh and (optionally) Material data from a .mesh file DataStream.
void | setListener (MeshSerializerListener *listener)
| Sets the listener for this serializer.
Public Member Functions inherited from Ogre::Serializer
| Serializer ()
virtual | ~Serializer ()

## Additional Inherited Members
Public Types inherited from Ogre::Serializer
enum | Endian { ENDIAN_NATIVE , ENDIAN_BIG , ENDIAN_LITTLE }
| The endianness of written files. More...

## Detailed Description

Class for serialising mesh data to/from an OGRE .mesh file.

Remarks
  This class allows exporters to write OGRE .mesh files easily, and allows the OGRE engine to import .mesh files into instantiated OGRE Meshes. Note that a .mesh file can include not only the Mesh, but also definitions of any Materials it uses (although this is optional, the .mesh can rely on the Material being loaded from another source, especially useful if you want to take advantage of OGRE's advanced Material properties which may not be available in your modeller).

  To export a Mesh:
  1. Use the MaterialManager methods to create any dependent Material objects, if you want to export them with the Mesh.
  2. Create a Mesh object and populate it using it's methods.
  3. Call the exportMesh method

  It's important to realise that this exporter uses OGRE terminology. In this context, 'Mesh' means a top-level mesh structure which can actually contain many SubMeshes, each of which has only one Material. Modelling packages may refer to these differently, for example in Milkshape, it says 'Model' instead of 'Mesh' and 'Mesh' instead of 'SubMesh', but the theory is the same.

## Constructor & Destructor Documentation

## ◆ MeshSerializer()

Ogre::v1::MeshSerializer::MeshSerializer | ( |  | ) |

## ◆ ~MeshSerializer()

virtual Ogre::v1::MeshSerializer::~MeshSerializer | ( |  | ) |
| virtual

## Member Function Documentation

## ◆ exportMesh() [1/4]

void Ogre::v1::MeshSerializer::exportMesh | ( | const Mesh * | pMesh,
|  | const String & | filename,
|  | Endian | endianMode = ENDIAN_NATIVE )

Exports a mesh to the file specified, in the latest format.

Remarks
  This method takes an externally created Mesh object, and exports it to a .mesh file in the latest format version available.

Parameters

  pMesh | Pointer to the Mesh to export
  filename | The destination filename
  endianMode | The endian mode of the written file

References Ogre::Serializer::ENDIAN_NATIVE.

## ◆ exportMesh() [2/4]

void Ogre::v1::MeshSerializer::exportMesh | ( | const Mesh * | pMesh,
|  | const String & | filename,
|  | MeshVersion | version,
|  | Endian | endianMode = ENDIAN_NATIVE )

Exports a mesh to the file specified, in a specific version format.

Remarks
  This method takes an externally created Mesh object, and exports it to a .mesh file in the specified format version. Note that picking a format version other that the latest will cause some information to be lost.

Parameters

  pMesh | Pointer to the Mesh to export
  filename | The destination filename
  version | Mesh version to write
  endianMode | The endian mode of the written file

References Ogre::Serializer::ENDIAN_NATIVE.

## ◆ exportMesh() [3/4]

void Ogre::v1::MeshSerializer::exportMesh | ( | const Mesh * | pMesh,
|  | DataStreamPtr | stream,
|  | Endian | endianMode = ENDIAN_NATIVE )

Exports a mesh to the stream specified, in the latest format.

Remarks
  This method takes an externally created Mesh object, and exports it to a .mesh file in the latest format version.

Parameters

  pMesh | Pointer to the Mesh to export
  stream | Writeable stream
  endianMode | The endian mode of the written file

References Ogre::Serializer::ENDIAN_NATIVE.

## ◆ exportMesh() [4/4]

void Ogre::v1::MeshSerializer::exportMesh | ( | const Mesh * | pMesh,
|  | DataStreamPtr | stream,
|  | MeshVersion | version,
|  | Endian | endianMode = ENDIAN_NATIVE )

Exports a mesh to the stream specified, in a specific version format.

Remarks
  This method takes an externally created Mesh object, and exports it to a .mesh file in the specified format version. Note that picking a format version other that the latest will cause some information to be lost.

Parameters

  pMesh | Pointer to the Mesh to export
  stream | Writeable stream
  version | Mesh version to write
  endianMode | The endian mode of the written file

References Ogre::Serializer::ENDIAN_NATIVE.

## ◆ getListener()

MeshSerializerListener * Ogre::v1::MeshSerializer::getListener | ( |  | ) |

Returns the current listener.

## ◆ importMesh()

void Ogre::v1::MeshSerializer::importMesh | ( | DataStreamPtr & | stream,
|  | Mesh * | pDest )

Imports Mesh and (optionally) Material data from a .mesh file DataStream.

Remarks
  This method imports data from a DataStream opened from a .mesh file and places it's contents into the Mesh object which is passed in.

Parameters

  stream | The DataStream holding the .mesh data. Must be initialised (pos at the start of the buffer).
  pDest | Pointer to the Mesh object which will receive the data. Should be blank already.

## ◆ setListener()

void Ogre::v1::MeshSerializer::setListener | ( | MeshSerializerListener * | listener | ) |

Sets the listener for this serializer.

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

- OgreMeshSerializer.h