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

#include <OgreSceneFormatImporter.h>

+ Inheritance diagram for Ogre::SceneFormatImporter:

Public Member Functions

 SceneFormatImporter (Root *root, SceneManager *sceneManager, const String &defaultPccWorkspaceName)
 
 ~SceneFormatImporter ()
 
void getInstantRadiosity (bool releaseOwnership, InstantRadiosity **outInstantRadiosity, IrradianceVolume **outIrradianceVolume)
 Retrieve the InstantRadiosity pointer that may have been created while importing a scene. More...
 
ParallaxCorrectedCubemapgetParallaxCorrectedCubemap (bool releaseOwnership)
 
void importScene (const String &filename, const char *jsonString, uint32 importFlags=static_cast< uint32 >(~SceneFlags::LightsVpl))
 
void importSceneFromFile (const String &filename, uint32 importFlags=static_cast< uint32 >(~SceneFlags::LightsVpl))
 
void setParentlessRootNodes (SceneNode *dynamicRoot, SceneNode *staticRoot)
 Similar to setRootNodes. More...
 
void setRootNodes (SceneNode *dynamicRoot, SceneNode *staticRoot)
 Set the nodes that act as the root nodes for the scene to import. More...
 
void setSceneComponentTransform (const Matrix4 &transform)
 Set a 4x4 matrix to apply a transformation to all the PCC probes during import process. 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

◆ SceneFormatImporter()

Ogre::SceneFormatImporter::SceneFormatImporter ( Root root,
SceneManager sceneManager,
const String defaultPccWorkspaceName 
)
Parameters
root
sceneManager
defaultPccWorkspaceNameWhen importing PCC, the original workspace definition may not be available. In such case, this allows you to use a fallback instead. If left blank, we won't import PCC if the original workspace def couldn't be found.

◆ ~SceneFormatImporter()

Ogre::SceneFormatImporter::~SceneFormatImporter ( )

Member Function Documentation

◆ getInstantRadiosity()

void Ogre::SceneFormatImporter::getInstantRadiosity ( bool  releaseOwnership,
InstantRadiosity **  outInstantRadiosity,
IrradianceVolume **  outIrradianceVolume 
)

Retrieve the InstantRadiosity pointer that may have been created while importing a scene.

Parameters
releaseOwnershipIf true, we will return the InstantRadiosity & IrradianceVolume pointers and release ownership. Meaning further calls to this function will return null and you will be responsible for deleting it (otherwise it will leak).

If false, we will return the InstantRadiosity & IrradianceVolume pointers but retain ownership. Meaning further calls to this function will still return the pointer, and we will delete the pointer when 'this' is destroyed, or if a new scene is imported.

Parameters
outInstantRadiosity[out] InstantRadiosity pointer. Input cannot be null. Output *outInstantRadiosity may be null May be null if the imported scene didn't have IR enabled, or if the ownership has already been released.
outIrradianceVolume[out] IrradianceVolume pointer. Input cannot be null. Output *outIrradianceVolume may be null. May be null if the imported scene didn't have IR/IV enabled, or if the ownership has already been released.

◆ getParallaxCorrectedCubemap()

ParallaxCorrectedCubemap* Ogre::SceneFormatImporter::getParallaxCorrectedCubemap ( bool  releaseOwnership)

◆ importScene()

void Ogre::SceneFormatImporter::importScene ( const String filename,
const char *  jsonString,
uint32  importFlags = static_cast< uint32 >(~SceneFlags::LightsVpl) 
)
Parameters
outJson
exportFlagsCombination of SceneFlags::SceneFlags, to know what to export and what to exclude. Defaults to importing everything. Note that some combinations can cause issues:
  • Excluding scene nodes
  • Excluding meshes without excluding Items and Entities.
  • etc

By default LightsVpl is not set so that InstantRadiosity is regenerated. By setting LightsVpl and unsetting SceneFlags::BuildInstantRadiosity, you can speed up import time because the cached results will be loaded instead.

◆ importSceneFromFile()

void Ogre::SceneFormatImporter::importSceneFromFile ( const String filename,
uint32  importFlags = static_cast< uint32 >(~SceneFlags::LightsVpl) 
)

◆ setParentlessRootNodes()

void Ogre::SceneFormatImporter::setParentlessRootNodes ( SceneNode dynamicRoot,
SceneNode staticRoot 
)

Similar to setRootNodes.

During export, it's possible some nodes were not attached to anything; thus they were exported like that. They're parentless. By default, importing the scene with such nodes means these nodes will b created without a parent, like in the original.

This behavior may not always be desired, which is why you can control it via this function, and have these nodes be attached to a parent node of your choosing instead.

Remarks
Unlike setRootNodes, these nodes won't be modified during the import process.
Parameters
dynamicRootSceneNode to use as parent for SCENE_DYNAMIC parentless nodes. Leave nullptr for none.
staticRootSceneNode to use as parent for SCENE_STATIC parentless nodes. Leave nullptr for none.

◆ setRootNodes()

void Ogre::SceneFormatImporter::setRootNodes ( SceneNode dynamicRoot,
SceneNode staticRoot 
)

Set the nodes that act as the root nodes for the scene to import.

By default these are nullptrs, which means we'll be using the real root scenenodes from SceneManager (see SceneManager::getRootSceneNode)

This function allows you to define your own root nodes; which gives you the power to easily transform the whole scene (e.g. globally displace the scene, rotate it, scale it, etc)

Remarks
The scene root nodes may be modified during the import process. Any transform set to these nodes before import may be lost. Make sure to apply them after importing.
See also
setParentlessRootNodes
Parameters
dynamicRootSceneNode to use as Root for SCENE_DYNAMIC nodes. Leave nullptr for the default one.
staticRootSceneNode to use as Root for SCENE_STATIC nodes. Leave nullptr for the default one.

◆ setSceneComponentTransform()

void Ogre::SceneFormatImporter::setSceneComponentTransform ( const Matrix4 transform)

Set a 4x4 matrix to apply a transformation to all the PCC probes during import process.

Also affects Areas of Interest for Instant Radiosity. This is useful if you need to rotate or translate a scene.

Remarks
While any affine matrix will work; the best results are achieved if the matrix is orthogonal (e.g. +- 90° and +- 180° changes)
Parameters
transformMust be affine. Default is identity matrix.

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