public final class GltfAssetReader
extends java.lang.Object
read(URI) method allows reading the asset from a URI. The
external references of the asset will be resolved against the parent
of the given URI, and loaded automatically. The respective data may
then be obtained with GltfAsset.getReferenceData(String).readWithoutReferences(URI) and
readWithoutReferences(InputStream) methods allow reading an
asset from a URI or an input stream, without resolving external
references. This is mainly intended for binary- or embedded glTF assets
that do not have external references, or for cases where the external
references should be resolved manually.GltfAsset may then be processed further, for example,
by creating a GltfModel using GltfModels.create(GltfAsset).| Constructor and Description |
|---|
GltfAssetReader()
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
GltfAsset |
read(java.nio.file.Path path)
Read the
GltfAsset from the given path |
GltfAsset |
read(java.net.URI uri)
Read the
GltfAsset from the given URI |
GltfAsset |
readWithoutReferences(java.io.InputStream inputStream)
Read the glTF asset from the given input stream.
|
GltfAsset |
readWithoutReferences(java.net.URI uri)
Read the
GltfAsset from the given URI. |
void |
setJsonErrorConsumer(java.util.function.Consumer<? super JsonError> jsonErrorConsumer)
Set the given consumer to receive
JsonErrors that may
occur when a glTF is read |
public void setJsonErrorConsumer(java.util.function.Consumer<? super JsonError> jsonErrorConsumer)
JsonErrors that may
occur when a glTF is readjsonErrorConsumer - The JsonError consumerpublic GltfAsset read(java.net.URI uri) throws java.io.IOException
GltfAsset from the given URIuri - The URIGltfAssetjava.io.IOException - If an IO error occurspublic GltfAsset read(java.nio.file.Path path) throws java.io.IOException
GltfAsset from the given pathpath - The pathGltfAssetjava.io.IOException - If an IO error occurspublic GltfAsset readWithoutReferences(java.net.URI uri) throws java.io.IOException
GltfAsset from the given URI.read(URI) method, this method will
not resolve any external references.uri - The URIGltfAssetjava.io.IOException - If an IO error occurspublic GltfAsset readWithoutReferences(java.io.InputStream inputStream) throws java.io.IOException
read(URI) method, this method will
not resolve any external references.inputStream - The input streamGltfAssetjava.io.IOException - If an IO error occurredCopyright © 2022. All Rights Reserved.