Oxygen Engine
Modern C++ 3D Engine using OpenGL
Loading...
Searching...
No Matches
oe::scene::gltf::ExtensionManager< ExtensionTypes > Class Template Reference

glTF custom extension manager More...

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

Public Member Functions

template<typename T , typename... Args>
void addExtension (const std::string &name, Args &&... args)
 Add a new extension.
 
void applyOnAsset (const std::string &name, Node &root_node, const nlohmann::json &extension_data, const bool pre_load)
 Apply a specific extension on an asset with the provided data.
 
void applyOnNode (const std::string &name, Node &node, const nlohmann::json &extension_data)
 Apply a specific extension on a node with the provided data.
 
void applyOnMaterial (const std::string &name, Material &material, const nlohmann::json &extension_data)
 Apply a specific extension on a material with the provided data.
 

Detailed Description

template<typename ... ExtensionTypes>
class oe::scene::gltf::ExtensionManager< ExtensionTypes >

glTF custom extension manager

This class dispatches calls to the approriate Extension

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

Member Function Documentation

◆ addExtension()

template<typename ... ExtensionTypes>
template<typename T , typename... Args>
void oe::scene::gltf::ExtensionManager< ExtensionTypes >::addExtension ( const std::string &  name,
Args &&...  args 
)
inline

Add a new extension.

Bind an extension of type T to name

Parameters
nameExtension name
argsAdditional arguments (if any) to send to the extension constructor

◆ applyOnAsset()

template<typename ... ExtensionTypes>
void oe::scene::gltf::ExtensionManager< ExtensionTypes >::applyOnAsset ( const std::string &  name,
Node root_node,
const nlohmann::json &  extension_data,
const bool  pre_load 
)
inline

Apply a specific extension on an asset with the provided data.

Parameters
nameName of the extension that were previously registered using addExtension()
root_nodeTarget node to apply the extension
extension_dataJSON containing the extension properties
pre_loadDoes the call happen before the asset has been fully loaded

◆ applyOnMaterial()

template<typename ... ExtensionTypes>
void oe::scene::gltf::ExtensionManager< ExtensionTypes >::applyOnMaterial ( const std::string &  name,
Material material,
const nlohmann::json &  extension_data 
)
inline

Apply a specific extension on a material with the provided data.

Parameters
nameName of the extension that were previously registered using addExtension()
materialTarget material to apply the extension
extension_dataJSON containing the extension properties

◆ applyOnNode()

template<typename ... ExtensionTypes>
void oe::scene::gltf::ExtensionManager< ExtensionTypes >::applyOnNode ( const std::string &  name,
Node node,
const nlohmann::json &  extension_data 
)
inline

Apply a specific extension on a node with the provided data.

Parameters
nameName of the extension that were previously registered using addExtension()
nodeTarget node to apply the extension
extension_dataJSON containing the extension properties

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