Emergency 2017 Dokumentation  v3.0.1
qsf::MeshVertexFormatConverter Class Reference

OGRE mesh serializer listener. More...

#include <MeshVertexFormatConverter.h>

Public Member Functions

virtual void processMaterialName (Ogre::v1::Mesh *mesh, Ogre::String *name) override
 
virtual void processSkeletonName (Ogre::v1::Mesh *mesh, Ogre::String *name) override
 
virtual void processMeshCompleted (Ogre::v1::Mesh *mesh) override
 

Public Attributes

boost::signals2::signal< void(const Ogre::v1::Mesh &)> OgreMeshConverted
 This Boost signal is emitted when an OGRE mesh has been converted; parameter: OGRE mesh instance. More...
 

Detailed Description

OGRE mesh serializer listener.

Remarks
The OGRE default vertex format is fat:
  • OGRE vertex format
    • FLOAT3 position from source 0
    • FLOAT3 normal from source 0
    • FLOAT2 texture coordinate from source 0
    • FLOAT4 tangent from source 0
    • Nasty renderer API dependent "Ogre::VET_COLOUR" from source 0
  • OGRE vertex format for skinned meshes
    • FLOAT3 position from source 0
    • FLOAT3 normal from source 0
      • UBYTE4 blend indices from source 2
      • FLOAT4 blend weights from source 2
    • FLOAT2 texture coordinate from source 1
    • FLOAT4 tangent from source 1
    • Nasty renderer API dependent "Ogre::VET_COLOUR" from source 0

It's easily possible to slim down the vertex format by using

Sadly, we can't use 16 bit precision texture coordinates, noticed issues in some EMERGENCY 5 assets like "Global asset ID 1031 - Local asset name "em5/prefab/street/street_crossing_x_01" - Local asset ID 234239163".

This OGRE mesh serializer listener can be considered a hack. The shipped EMERGENCY 5 has meshes with the fat default OGRE vertex format, but we need something slimmer to reduce the memory requirements. So, we convert meshes after loading them if required.

Todo:
  • TODO(co) We should really remove this content-compatibility hack as soon as the last EMERGENCY 5 patch is done (this is tool, not runtime functionality)

Definition at line 70 of file MeshVertexFormatConverter.h.

Member Function Documentation

virtual void qsf::MeshVertexFormatConverter::processMaterialName ( Ogre::v1::Mesh *  mesh,
Ogre::String *  name 
)
overridevirtual
virtual void qsf::MeshVertexFormatConverter::processMeshCompleted ( Ogre::v1::Mesh *  mesh)
overridevirtual
virtual void qsf::MeshVertexFormatConverter::processSkeletonName ( Ogre::v1::Mesh *  mesh,
Ogre::String *  name 
)
overridevirtual

Member Data Documentation

boost::signals2::signal<void (const Ogre::v1::Mesh&)> qsf::MeshVertexFormatConverter::OgreMeshConverted

This Boost signal is emitted when an OGRE mesh has been converted; parameter: OGRE mesh instance.

Definition at line 78 of file MeshVertexFormatConverter.h.


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