Oxygen Engine
Modern C++ 3D Engine using OpenGL
Loading...
Searching...
No Matches
oe::scene::gltf::Extension Class Reference

Base class to handle glTF extensions. More...

#include <OxygenEngine/scene/loader/gltf_extensions.h>

Public Member Functions

void applyOnAssetPreload (scene::Node &root_node, const nlohmann::json &extension_data)
 Apply the extension on the asset (preload)
 
void applyOnAssetPostload (scene::Node &root_node, const nlohmann::json &extension_data)
 Apply the extension on the asset (postload)
 
void applyOnNode (scene::Node &node, const nlohmann::json &extension_data)
 Apply the extension on a node.
 
void applyOnMaterial (scene::Material &material, const nlohmann::json &extension_data)
 Apply the extension on a material.
 

Detailed Description

Base class to handle glTF extensions.

To use, you should first inherit from it then use an ExtensionManager to bind your extension class to its name

See also
scene::loader::GltfWithExtensions for an example of usage

Member Function Documentation

◆ applyOnAssetPostload()

void oe::scene::gltf::Extension::applyOnAssetPostload ( scene::Node root_node,
const nlohmann::json &  extension_data 
)
inline

Apply the extension on the asset (postload)

Note
When the function is called, all scene hierarchy is imported and ready
See also
applyOnAssetPreload() If you need to run the extension before scene load
Parameters
root_nodeRoot node that will contain the glTF asset
extension_datajson object containing extension data
Note
You can apply/modify components on the scene by using root_node.getSceneManager()

◆ applyOnAssetPreload()

void oe::scene::gltf::Extension::applyOnAssetPreload ( scene::Node root_node,
const nlohmann::json &  extension_data 
)
inline

Apply the extension on the asset (preload)

Note
When the function is called, only the root node is imported. The rest of the asset has not been imported yet
See also
applyOnAssetPostload() If you need to run the extension after scene is loaded and ready
Parameters
root_nodeRoot node that will contain the glTF asset
extension_datajson object containing extension data
Note
You can apply/modify components on the scene by using root_node.getSceneManager()

◆ applyOnMaterial()

void oe::scene::gltf::Extension::applyOnMaterial ( scene::Material material,
const nlohmann::json &  extension_data 
)
inline

Apply the extension on a material.

Note
When the function is called, the material is fully imported but not yet applied to a mesh
Parameters
materialReference to material to apply the extension
extension_datajson object containing extension data

◆ applyOnNode()

void oe::scene::gltf::Extension::applyOnNode ( scene::Node node,
const nlohmann::json &  extension_data 
)
inline

Apply the extension on a node.

Note
When the function is called, all scene hierarchy has been imported
Parameters
nodeReference to node to apply the extension
extension_datajson object containing extension data

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