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

GLXFInfo Class

Modifiers: final
GLXFInfo is a class that represents a GLXF file. Refer to readme for detailed specification.
A GLXFInfo is made whenever you use GLXFManager to inflate a glXF file. Here is an example of creating a GLXFInfo:
val myGLXFInfo = glXFManager.inflateGLXF(Uri.parse("apk:///scenes/Composition.glxf"))

Signature

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)

Constructors

GLXFInfo ( glxfManager , version , experience , assets , nodes , rootEntity , uri , context , nodeMap , nodesByName , keyName , entityIdToEntityMap , overrideCreateEntity )
Signature
constructor(glxfManager: GLXFManager, version: String, experience: Boolean, assets: MutableList<GLXFAsset>, nodes: MutableList<GLXFNode>, rootEntity: Entity, uri: Uri, context: Context, 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)
Parameters
glxfManager: GLXFManager
version: String
: the version of the GLXF file, e.g., "2.0"
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.
assets: MutableList
: a list of assets in the GLXF file
nodes: MutableList
: a list of nodes in the GLXF file
rootEntity: Entity
: the root entity of the GLXF file
uri: Uri
: the URI of the GLXF file
context: Context
: the context of the GLXF file, a.k.a. the Spatial Activity object.
nodeMap: NodeMap
: a map of entities to GLXFNodes
nodesByName: MutableMap
: a map of node names to GLXFNodes
keyName: String?
: the key name of the GLXF file. This optional value is used to uniquely identify the GLXF file.
entityIdToEntityMap: MutableMap
overrideCreateEntity: Function1
Returns

Properties

experience : Boolean
[Get]
: 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.
Signature
val experience: Boolean
glxfManager : GLXFManager
[Get]
Signature
val glxfManager: GLXFManager
keyName : String?
[Get]
: the key name of the GLXF file. This optional value is used to uniquely identify the GLXF file.
Signature
val keyName: String? = null
nodes : MutableList
[Get][Set]
: a list of nodes in the GLXF file
Signature
var nodes: MutableList<GLXFNode>
rootEntity : Entity
[Get]
: the root entity of the GLXF file
Signature
val rootEntity: Entity
uri : Uri
[Get]
: the URI of the GLXF file
Signature
val uri: Uri
version : String
[Get]
: the version of the GLXF file, e.g., "2.0"
Signature
val version: String

Functions

destroy ()
Immediately destroys GLXFInfo and all its child resources including all entities inflated as part of the GLXFInfo.
Signature
fun destroy()
getNestedGLXFInfo ( childName )
Gets the nested GLXFInfo for a given child name.
Example:
val myNestedGLXFInfo = myGLXFInfo.getNestedGLXFInfo("childWithNestedGLXFName")

Signature
fun getNestedGLXFInfo(childName: String): GLXFInfo?
Parameters
childName: String
The name of the child node.
Returns
The nested GLXFInfo object, or null if not found.
getNestedGLXFInfo ( childNamePathList )
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
Example:
val myNestedGLXFInfo = myGLXFInfo.getNestedGLXFInfo(listOf("childOfMyGLXFInfo", "childOf_childOfMyGLXFInfo"))

Signature
fun getNestedGLXFInfo(childNamePathList: List<String>): GLXFInfo?
Parameters
childNamePathList: List
The list of child names.
Returns
The nested GLXFInfo object, or null if not found.
getNodeByName ( name )
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
Example:
val myPanelEntity = myGLXFInfo.getNodeByName("panel").entity

Signature
fun getNodeByName(name: String): GLXFNode
Parameters
name: String
The name of the node to retrieve.
Returns
The GLXFNode object associated with the given name.
getNodeByName ( resId )
Returns the GLXFNode object for the string value represented by the resource ID.
Example:
val myPanelEntity = myGLXFInfo.getNodeByName(R.string.panel).entity

Signature
fun getNodeByName(resId: Int): GLXFNode
Parameters
resId: Int
The resource ID of the node to retrieve.
Returns
The GLXFNode object associated with the given resource ID.
tryGetNodeByName ( name )
Returns the GLXFNode object for the given name, or null if it doesn't exist.
Example:
val myPanelEntity = myGLXFInfo.tryGetNodeByName("panel").entity ?: return

Signature
fun tryGetNodeByName(name: String): GLXFNode?
Parameters
name: String
The name of the node to retrieve.
Returns
The GLXFNode object associated with the given name, or null if it doesn't exist.
tryGetNodeByName ( resId )
Returns the GLXFNode object for the given resource ID, or null if it doesn't exist.
Example:
val myPanelEntity = myGLXFInfo.tryGetNodeByName(R.string.panel).entity ?: return

Signature
fun tryGetNodeByName(resId: Int): GLXFNode?
Parameters
resId: Int
The resource ID of the node to retrieve.
Returns
The GLXFNode object associated with the given resource ID, or null if it doesn't exist.
Did you find this page helpful?