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

GLXFManager

GLXFManager

class GLXFManager(val context: <Error class: unknown class>)
GLXFManager is a class that manages GLXF files.

Constructors

NameSummary
GLXFManager
constructor(context: <Error class: unknown class>)

Types

NameSummary
Companion
object Companion

Properties

NameSummary
context
val context: <Error class: unknown class>
: the context of the GLXFManager, a.k.a. the Spatial activity object.

Functions

NameSummary
addReloadedGLXFUris
fun addReloadedGLXFUris(toReloadUris: Set<<Error class: unknown class>>, basePath: File)
Adds URIs that should be loaded using the local file system instead of the APK file system. This is used when hot reloading to reload GLXFs so that future GLXFs use the reloaded files
deleteGLXF
fun deleteGLXF(entity: Entity)
fun deleteGLXF(glxfInfo: GLXFInfo)
Deletes root entity and all children. Removes references to the deleted GLXFInfo from the maps.
deleteGLXFEntityAndGetDeletedChildren
fun deleteGLXFEntityAndGetDeletedChildren(entity: Entity): Set<Entity>
Deletes a GLXF entity and get the deleted children.
getGLXFInfo
fun getGLXFInfo(keyName: String): GLXFInfo
Returns the GLXFInfo object for the given keyName.
getNestedGLXFInfo
fun getNestedGLXFInfo(parentInfo: GLXFInfo, childName: String): GLXFInfo?
Gets the nested GLXFInfo for a given child name.
fun getNestedGLXFInfo(parentInfo: GLXFInfo, childNamePathList: List<String>): GLXFInfo?
Gets the nested GLXFInfo for a given list of child names.
hasGLXFInfoForUri
fun hasGLXFInfoForUri(uri: <Error class: unknown class>): Boolean
Checks if there is a GLXFInfo object for a given URI.
inflateComposition
suspend fun inflateComposition(compositionName: String, assetFolderPath: String = "scenes", rootEntity: Entity = Entity.createGlobal(), keyName: String? = null, onLoaded: (GLXFInfo) -> Unit = {}): GLXFInfo?
Parses the Composition glxf file and calls inflateGLXF, inflates a GLXF file into a GLXFInfo object, adds it to the map of GLXFInfo objects, and sets the GLXF component on the root entity of the GLXF file.
inflateGLXF
suspend fun inflateGLXF(uri: <Error class: unknown class>, rootEntity: Entity = defaultCreateEntity(null), keyName: String? = null, onLoaded: (GLXFInfo) -> Unit = {}): GLXFInfo?
suspend fun inflateGLXF(uri: <Error class: unknown class>, overrideCreateEntity: (<Error class: unknown class>?) -> Entity = defaultCreateEntity, rootEntity: Entity = overrideCreateEntity(null), keyName: String? = null, onLoaded: (GLXFInfo) -> Unit = {}): GLXFInfo?
Inflates a GLXF file into a GLXFInfo object, adds it to the map of GLXFInfo objects, and sets the GLXF component on the root entity of the GLXF file.
reloadGLXFsFromFile
suspend fun reloadGLXFsFromFile(oldFileName: <Error class: unknown class>, newFileName: <Error class: unknown class>, meshManager: MeshManager): <Error class: unknown class>
Reloads GLXFs from a file.
setDefaultCreateEntity
fun setDefaultCreateEntity(overrideCreateEntity: (<Error class: unknown class>?) -> Entity)
Developer can override the default entity creation function
setReloadType
fun setReloadType(reloadType: GLXFReloadType)
Developer can pick how GLXFs reload
tryGetGLXFInfo
fun tryGetGLXFInfo(keyName: String): GLXFInfo?
Returns the GLXFInfo object for the given keyName, or null if it doesn’t exist.

Companion

object Companion

Functions

NameSummary
isSupportedGLXFExtension
fun isSupportedGLXFExtension(fileName: String): Boolean
Did you find this page helpful?
Thumbs up icon
Thumbs down icon