-
Notifications
You must be signed in to change notification settings - Fork 0
GltfBridge
GltfBridge
is the transition point between the internal library and the outside world. See the interface itself for exact typing, what follows is the reason why and where comes into play
The typical pipeline is loadFile -> loadAssets -> start
. These are separated to allow for use-cases where we might already have some gltf data in memory, and to keep the code separated by concern.
There is a convenience method to call all 3 via gltf_load()
which is not part of GltfBridge
, and rather returns a new GltfBridge
after everything is loaded.
Loads a GLTF
File, but not all the associated data in that file
Loads all the associated data in the loaded GLTF (i.e. result of loadFile), but does not initialize it
Initializes all the loaded assets/file and creates the internal GltfData
etc.
The main workhorse for output - this renders the given GltfScene
, using the bridges internal GltfData
etc.
Will recursively step through each primitive and update its shader config by calling both the core method and each extensions runtimeShaderConfig
method. This is usually super fast so it can be called every tick but it's not always needed, therefore it's up to the caller to either skip it or call it every tick.
Note that there is a helper gltf_updatePrimitiveShaderConfig()
which can be used for updating a single primitive as a standalone
This is usually called to kick off a render cycle. Retrieves a Pure3D scene based on the original loaded data
Same as above but just the cameras
Typically not called (rather get nodes via scene) but can be used externally to get the original loaded nodes without differentiating by node type etc.
Convenience method to inspect the GltfData
from the outside caller.
Convenience to get the renderer that was used to create the bridge.