API reference
API reference
Select your platform
No SDKs available
No versions available

GLXFInfo

GLXFInfo

class GLXFInfo(val glxfManager: GLXFManager, val version: String, val experience: Boolean, assets: MutableList<GLXFAsset>, var nodes: MutableList<GLXFNode>, val rootEntity: Entity, val uri: <Error class: unknown class>, context: <Error class: unknown class>, nodeMap: NodeMap = mutableMapOf<Entity, GLXFNode>(), nodesByName: MutableMap<String, GLXFNode> = mutableMapOf<String, GLXFNode>(), val keyName: String? = null, entityIdToEntityMap: MutableMap<String, Entity>, overrideCreateEntity: (<Error class: unknown class>?) -> Entity)
GLXFInfo is a class that represents a GLXF file. Refer to https://github.com/KhronosGroup/glTF-External-Reference/blob/main/specification/2.0/README.md for detailed specification.
A GLXFInfo is made whenever you use com.meta.spatial.toolkit.GLXFManager to inflate a glXF file. Here is an example of creating a GLXFInfo:
val myGLXFInfo = glXFManager.inflateGLXF(Uri.parse("apk:///scenes/Composition.glxf"))

Constructors

NameSummary
GLXFInfo
constructor(glxfManager: GLXFManager, version: String, experience: Boolean, assets: MutableList<GLXFAsset>, nodes: MutableList<GLXFNode>, rootEntity: Entity, uri: <Error class: unknown class>, context: <Error class: unknown class>, nodeMap: NodeMap = mutableMapOf<Entity, GLXFNode>(), nodesByName: MutableMap<String, GLXFNode> = mutableMapOf<String, GLXFNode>(), keyName: String? = null, entityIdToEntityMap: MutableMap<String, Entity>, overrideCreateEntity: (<Error class: unknown class>?) -> Entity)

Properties

NameSummary
experience
val experience: Boolean

: The experience property set to true indicates that this file is intended to be directly viewed as an experience and MUST NOT be imported into other scenes.
glxfManager
val glxfManager: GLXFManager
keyName
val keyName: String? = null

: the key name of the GLXF file. This optional value is used to uniquely identify the GLXF file.
nodes
var nodes: MutableList<GLXFNode>

: a list of nodes in the GLXF file
rootEntity
val rootEntity: Entity

: the root entity of the GLXF file
uri
val uri: <Error class: unknown class>

: the URI of the GLXF file
version
val version: String

: the version of the GLXF file, e.g., "2.0"

Functions

NameSummary
destroy
fun destroy()

Immediately destroys GLXFInfo and all its child resources including all entities inflated as part of the GLXFInfo.
getNestedGLXFInfo
fun getNestedGLXFInfo(childName: String): GLXFInfo?

Gets the nested GLXFInfo for a given child name.



fun getNestedGLXFInfo(childNamePathList: List<String>): GLXFInfo?

Gets the nested GLXFInfo for a given list of child names. The first name should be the highest level child name, with each subsequent name being a child of that nested GLXFInfo
getNodeByName
fun getNodeByName(resId: Int): GLXFNode

Returns the GLXFNode object for the string value represented by the resource ID.



fun getNodeByName(name: String): GLXFNode

Returns the GLXFNode object for the given name. This gives you access to the node’s properties, including the entity inf;ated to represent this node
tryGetNodeByName
fun tryGetNodeByName(resId: Int): GLXFNode?

Returns the GLXFNode object for the given resource ID, or null if it doesn’t exist.



fun tryGetNodeByName(name: String): GLXFNode?

Returns the GLXFNode object for the given name, or null if it doesn’t exist.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon