![]() |
OGRE-Next 3.0.0
Object-Oriented Graphics Rendering Engine
|
#include <OgreSceneFormatImporter.h>
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. | |
ParallaxCorrectedCubemap * | getParallaxCorrectedCubemap (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. | |
void | setRootNodes (SceneNode *dynamicRoot, SceneNode *staticRoot) |
Set the nodes that act as the root nodes for the scene to import. | |
void | setSceneComponentTransform (const Matrix4 &transform) |
Set a 4x4 matrix to apply a transformation to all the PCC probes during import process. | |
![]() | |
SceneFormatBase (Root *root, SceneManager *sceneManager) | |
~SceneFormatBase () | |
HlmsPbs * | getPbs () const |
void | setListener (SceneFormatListener *listener) |
Caller must delete the pointer. We won't do it for you. | |
Additional Inherited Members | |
![]() | |
enum | Version { VERSION_0 = 0 , VERSION_1 , LATEST_VERSION = VERSION_1 } |
Ogre::SceneFormatImporter::SceneFormatImporter | ( | Root * | root, |
SceneManager * | sceneManager, | ||
const String & | defaultPccWorkspaceName ) |
root | |
sceneManager | |
defaultPccWorkspaceName | When 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. |
Ogre::SceneFormatImporter::~SceneFormatImporter | ( | ) |
void Ogre::SceneFormatImporter::getInstantRadiosity | ( | bool | releaseOwnership, |
InstantRadiosity ** | outInstantRadiosity, | ||
IrradianceVolume ** | outIrradianceVolume ) |
Retrieve the InstantRadiosity pointer that may have been created while importing a scene.
releaseOwnership | If 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.
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. |
ParallaxCorrectedCubemap * Ogre::SceneFormatImporter::getParallaxCorrectedCubemap | ( | bool | releaseOwnership | ) |
void Ogre::SceneFormatImporter::importScene | ( | const String & | filename, |
const char * | jsonString, | ||
uint32 | importFlags = static_cast< uint32 >(~SceneFlags::LightsVpl) ) |
outJson | |
exportFlags | Combination of SceneFlags::SceneFlags, to know what to export and what to exclude. Defaults to importing everything. Note that some combinations can cause issues:
|
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.
References Ogre::SceneFlags::LightsVpl.
void Ogre::SceneFormatImporter::importSceneFromFile | ( | const String & | filename, |
uint32 | importFlags = static_cast< uint32 >(~SceneFlags::LightsVpl) ) |
References Ogre::SceneFlags::LightsVpl.
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.
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)
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.
transform | Must be affine. Default is identity matrix. |