OGRE 2.1
Object-Oriented Graphics Rendering Engine
Loading...
Searching...
No Matches
Ogre::SceneFormatExporter Class Reference

#include <OgreSceneFormatExporter.h>

+ Inheritance diagram for Ogre::SceneFormatExporter:

Public Types

enum  Version { VERSION_0 = 0 , VERSION_1 , LATEST_VERSION = VERSION_1 }
 

Public Member Functions

 SceneFormatExporter (Root *root, SceneManager *sceneManager, InstantRadiosity *instantRadiosity)
 
 ~SceneFormatExporter ()
 
void exportScene (String &outJson, uint32 exportFlags=~SceneFlags::TexturesOriginal)
 
void exportSceneToFile (const String &folderPath, uint32 exportFlags=~SceneFlags::TexturesOriginal)
 
HlmsPbsgetPbs (void) const
 
bool getUseBinaryFloatingPoint (void)
 
void setListener (SceneFormatListener *listener)
 Caller must delete the pointer. We won't do it for you.
 
void setUseBinaryFloatingPoint (bool useBinaryFp)
 By default we export floating point values as uint32 using their binary encoding.
 

Member Enumeration Documentation

◆ Version

Enumerator
VERSION_0 
VERSION_1 
LATEST_VERSION 

Constructor & Destructor Documentation

◆ SceneFormatExporter()

Ogre::SceneFormatExporter::SceneFormatExporter ( Root root,
SceneManager sceneManager,
InstantRadiosity instantRadiosity 
)

◆ ~SceneFormatExporter()

Ogre::SceneFormatExporter::~SceneFormatExporter ( )

Member Function Documentation

◆ exportScene()

void Ogre::SceneFormatExporter::exportScene ( String outJson,
uint32  exportFlags = ~SceneFlags::TexturesOriginal 
)
Parameters
outJson
exportFlagsCombination of SceneFlags::SceneFlags, to know what to export and what to exclude. Defaults to exporting everything. Note that excluding scene nodes can cause issues later during import.

◆ exportSceneToFile()

void Ogre::SceneFormatExporter::exportSceneToFile ( const String folderPath,
uint32  exportFlags = ~SceneFlags::TexturesOriginal 
)

◆ getPbs()

HlmsPbs * Ogre::SceneFormatBase::getPbs ( void  ) const
inherited

◆ getUseBinaryFloatingPoint()

bool Ogre::SceneFormatExporter::getUseBinaryFloatingPoint ( void  )

◆ setListener()

void Ogre::SceneFormatBase::setListener ( SceneFormatListener listener)
inherited

Caller must delete the pointer. We won't do it for you.

◆ setUseBinaryFloatingPoint()

void Ogre::SceneFormatExporter::setUseBinaryFloatingPoint ( bool  useBinaryFp)

By default we export floating point values as uint32 using their binary encoding.

This allows us to preserve the identical value as text when importing. Otherwise very small errors could causes inconsistencies between the imported and the original scene. For example the number "1.0f" gets exported as 1065353216 (0x3f800000) The only problem with this is that the value we generate is not really user readable or editable (unless you aid yourself with some binary converter tool)

In many cases this exact bit preservation isn't needed, and you can opt instead for us to export floating point as literal numbers, thus we'll just write "1.0" which is easy to read and easy to edit. Note however, not all floating point numbers can be accurately be represented as strings and then back as floats, there can be small rounding errors (i.e. NaNs, irrational numbers & numbers with repeating decimals)

Parameters
useBinaryFpTrue to export preserving exact binary representation. False to export as a user-friendly number Default: true.

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