import * as THREE from 'three' ; import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader' ; import { VRMBlendShapeProxy } from './blendshape' ; import { VRMFirstPerson } from './firstperson' ; import { VRMHumanoid } from './humanoid' ; import { VRMLookAtHead } from './lookat' ; import { VRMMeta } from './meta/VRMMeta' ; import { VRMSpringBoneManager } from './springbone' ; import { deepDispose } from './utils/disposer' ; import { VRMImporter , VRMImporterOptions } from './VRMImporter' ; /**
 * Parameters for a [[VRM]] class.
 */ export interface VRMParameters { scene : THREE . Scene | THREE . Group ; humanoid ? : VRMHumanoid ; blendShapeProxy ? : VRMBlendShapeProxy ; firstPerson ? : VRMFirstPerson ; lookAt ? : VRMLookAtHead ; materials ? : THREE . Material [ ] ; springBoneManager ? : VRMSpringBoneManager ; meta ? : VRMMeta ; } /**
 * A class that represents a single VRM model.
 * See the documentation of [[VRM.from]] for the most basic use of VRM.
 */ export class VRM { example param gltf param options public static async from ( gltf , options = { } ) { const importer = new VRMImporter ( options ) ; return await importer . import ( gltf ) ; } /**
     * `THREE.Scene` or `THREE.Group` (depends on your three.js revision) that contains the entire VRM.
     */ public readonly scene : THREE . Scene | THREE . Group ; TODO public readonly humanoid ? : VRMHumanoid ; /**
     * Contains [[VRMBlendShapeProxy]] of the VRM.
     * You might want to control these facial expressions via [[VRMBlendShapeProxy.setValue]].
     */ public readonly blendShapeProxy ? : VRMBlendShapeProxy ; /**
     * Contains [[VRMFirstPerson]] of the VRM.
     * You can use various feature of the firstPerson field.
     */ public readonly firstPerson ? : VRMFirstPerson ; /**
     * Contains [[VRMLookAtHead]] of the VRM.
     * You might want to use [[VRMLookAtHead.target]] to control the eye direction of your VRMs.
     */ public readonly lookAt ? : VRMLookAtHead ; /**
     * Contains materials of the VRM.
     * `updateVRMMaterials` method of these materials will be called via its [[VRM.update]] method.
     */ public readonly materials ? : THREE . Material [ ] ; /**
     * Contains meta fields of the VRM.
     * You might want to refer these license fields before use your VRMs.
     */ public readonly meta ? : VRMMeta ; /**
     * A [[VRMSpringBoneManager]] manipulates all spring bones attached on the VRM.
     * Usually you don't have to care about this property.
     */ public readonly springBoneManager ? : VRMSpringBoneManager ; param params public constructor ( params ) { this . scene = params . scene ; this . humanoid = params . humanoid ; this . blendShapeProxy = params . blendShapeProxy ; this . firstPerson = params . firstPerson ; this . lookAt = params . lookAt ; this . materials = params . materials ; this . springBoneManager = params . springBoneManager ; this . meta = params . meta ; } param delta public update ( delta ) { if ( this . lookAt ) { this . lookAt . update ( delta ) ; } if ( this . blendShapeProxy ) { this . blendShapeProxy . update ( ) ; } if ( this . springBoneManager ) { this . springBoneManager . lateUpdate ( delta ) ; } if ( this . materials ) { this . materials . forEach ( ( material ) => { if ( material . updateVRMMaterials ) { material . updateVRMMaterials ( delta ) ; } } ) ; } } /**
     * Dispose everything about the VRM instance.
     */ public dispose ( ) { const scene = this . scene ; if ( scene ) { deepDispose ( scene ) ; } this . meta ?. texture ?. dispose ( ) ; } }