OGRE-Next  4.0.0unstable
Object-Oriented Graphics Rendering Engine
Ogre::SceneFormatExporter Class Reference

#include <OgreSceneFormatExporter.h>

+ Inheritance diagram for Ogre::SceneFormatExporter:

Public Member Functions

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

Additional Inherited Members

- Public Types inherited from Ogre::SceneFormatBase
enum  Version { VERSION_0 = 0 , VERSION_1 , LATEST_VERSION = VERSION_1 }
 

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 = static_cast< uint32 >(~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 = static_cast< uint32 >(~SceneFlags::TexturesOriginal) 
)

◆ getUseBinaryFloatingPoint()

bool Ogre::SceneFormatExporter::getUseBinaryFloatingPoint ( )

◆ 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: