Interface IGltfReadable
Provides read-only access to a glTF (glTF objects and imported Unity resources)
Inherited Members
Namespace: Unity.Cloud.Gltfast
Assembly: Unity.Cloud.Gltfast.dll
Syntax
[MovedFrom(true, "GLTFast", "glTFast", null)]
public interface IGltfReadable : IMaterialProvider, IMaterialsVariantsProvider
Properties
MaterialCount
Number of materials
Declaration
int MaterialCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
Root
De-serialized glTF JSON object. This is intended for read-only access. Changes might corrupt data and break subsequent scene instantiation.
Declaration
Root Root { get; }
Property Value
| Type | Description |
|---|---|
| Root |
TextureCount
Number of textures
Declaration
int TextureCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
See Also
Methods
GetBindPoses(int)
Returns an array of inverse bone matrices representing a skin's bind pose suitable for use with UnityEngine.Mesh.bindposes by glTF skin index.
Declaration
Matrix4x4[] GetBindPoses(int skinId)
Parameters
| Type | Name | Description |
|---|---|---|
| int | skinId | glTF skin index |
Returns
| Type | Description |
|---|---|
| Matrix4x4[] | Corresponding bind poses |
GetDefaultMaterial()
Returns a fallback material to be used when no material was assigned (provided by the IMaterialGenerator)
Declaration
Material GetDefaultMaterial()
Returns
| Type | Description |
|---|---|
| Material | Default material |
GetMaterial(int)
Get a Unity Material by its glTF material index
Declaration
Material GetMaterial(int index = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | glTF material index |
Returns
| Type | Description |
|---|---|
| Material | Corresponding Unity Material |
GetSourceCamera(uint)
Get source (de-serialized glTF) camera
Declaration
Camera GetSourceCamera(uint index)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | index | glTF camera index |
Returns
| Type | Description |
|---|---|
| Camera | De-serialized glTF camera |
GetSourceImage(int)
Get source (de-serialized glTF) image
Declaration
Image GetSourceImage(int index = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | glTF image index |
Returns
| Type | Description |
|---|---|
| Image | De-serialized glTF image |
GetSourceLightPunctual(uint)
Get source (de-serialized glTF) light
Declaration
LightPunctual GetSourceLightPunctual(uint index)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | index | glTF light index |
Returns
| Type | Description |
|---|---|
| LightPunctual | De-serialized glTF light |
GetSourceMaterial(int)
Get source (de-serialized glTF) material
Declaration
Material GetSourceMaterial(int index = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | glTF material index |
Returns
| Type | Description |
|---|---|
| Material | De-serialized glTF material |
GetSourceMesh(int)
Get source (de-serialized glTF) mesh.
Declaration
Mesh GetSourceMesh(int meshIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| int | meshIndex | glTF mesh index. |
Returns
| Type | Description |
|---|---|
| Mesh | De-serialized glTF mesh. |
GetSourceMeshPrimitive(int, int)
Get source (de-serialized glTF) mesh primitive
Declaration
MeshPrimitive GetSourceMeshPrimitive(int meshIndex, int primitiveIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| int | meshIndex | glTF mesh index. |
| int | primitiveIndex | glTF primitive index within mesh. |
Returns
| Type | Description |
|---|---|
| MeshPrimitive | De-serialized glTF mesh primitive |
GetSourceNode(int)
Get source (de-serialized glTF) node
Declaration
Node GetSourceNode(int index = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | glTF node index |
Returns
| Type | Description |
|---|---|
| Node | De-serialized glTF node |
GetSourceScene(int)
Get source (de-serialized glTF) scene
Declaration
Scene GetSourceScene(int index = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | glTF scene index |
Returns
| Type | Description |
|---|---|
| Scene | De-serialized glTF scene |
GetSourceTexture(int)
Get source (de-serialized glTF) texture
Declaration
Texture GetSourceTexture(int index = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | glTF texture index |
Returns
| Type | Description |
|---|---|
| Texture | De-serialized glTF texture |
GetTexture(int)
Get imported glTF texture by index.
Declaration
Texture2D GetTexture(int index = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | glTF texture index |
Returns
| Type | Description |
|---|---|
| Texture2D | Loaded Unity texture |
IsTextureYFlipped(int)
Evaluates if the texture's vertical orientation conforms to Unity's default. If it's not aligned (=true; =flipped), the texture has to be applied mirrored vertically.
Declaration
bool IsTextureYFlipped(int index = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | glTF texture index |
Returns
| Type | Description |
|---|---|
| bool | True if the vertical orientation is flipped, false otherwise |