A wrapper that manages the states of a Live2D core model, and delegates all operations to it.

Emits

InternalModelEvents

Hierarchy

Constructors

Properties

breath: CubismBreath = ...
centeringTransform: Matrix = ...

Matrix that scales by pixelsPerUnit, and moves the origin from top-left to center.

FIXME: This shouldn't be named as "centering"...

coreModel: CubismModel

The managed Live2D core model.

destroyed: boolean = false

Flags this instance has been destroyed.

drawingMatrix: Matrix = ...

The final matrix to draw the model.

eyeBlink?: CubismEyeBlink
focusController: FocusController = ...
height: number = 0

Canvas height of the model, scaled by the height of the model's layout.

hitAreas: Record<string, CommonHitArea> = {}

The hit area definitions, keyed by their names.

idParamAngleX: string = ParamAngleX
idParamAngleY: string = ParamAngleY
idParamAngleZ: string = ParamAngleZ
idParamBodyAngleX: string = ParamBodyAngleX
idParamBreath: string = ParamBreath
idParamEyeBallX: string = ParamEyeBallX
idParamEyeBallY: string = ParamEyeBallY
lipSync: boolean = true
localTransform: Matrix = ...

Local transformation, calculated from the model's layout.

motionManager: Cubism4MotionManager
originalHeight: number = 0

Original canvas height of the model. Note this doesn't represent the model's real size, as the model can overflow from its canvas.

originalWidth: number = 0

Original canvas width of the model. Note this doesn't represent the model's real size, as the model can overflow from its canvas.

physics?: CubismPhysics
pixelsPerUnit: number = 1

The model's internal scale, defined in the moc3 file.

pose?: CubismPose
renderer: CubismRenderer_WebGL = ...
textureFlipY: boolean = false

Flags whether gl.UNPACK_FLIP_Y_WEBGL should be enabled when binding the textures.

viewport: [number, number, number, number] = ...

WebGL viewport when drawing the model. The format is [x, y, width, height].

width: number = 0

Canvas width of the model, scaled by the width of the model's layout.

prefixed: string | boolean

Methods

  • Calls each of the listeners registered for a given event.

    Parameters

    • event: string | symbol
    • Rest ...args: any[]

    Returns boolean

  • Return an array listing the events for which the emitter has registered listeners.

    Returns (string | symbol)[]

  • Hit-test on the model.

    Returns

    The names of the hit hit areas. Can be empty if none is hit.

    Parameters

    • x: number

      Position in model canvas.

    • y: number

      Position in model canvas.

    Returns string[]

  • Hit-test for a single hit area.

    Returns

    True if hit.

    Parameters

    • hitAreaName: string

      The hit area's name.

    • x: number

      Position in model canvas.

    • y: number

      Position in model canvas.

    Returns boolean

  • Return the number of listeners listening to a given event.

    Parameters

    • event: string | symbol

    Returns number

  • Return the listeners registered for a given event.

    Parameters

    • event: string | symbol

    Returns ListenerFn[]

  • Parameters

    • event: string | symbol
    • Optional fn: ListenerFn
    • Optional context: any
    • Optional once: boolean

    Returns Cubism4InternalModel

  • Add a listener for a given event.

    Parameters

    • event: string | symbol
    • fn: ListenerFn
    • Optional context: any

    Returns Cubism4InternalModel

  • Add a one-time listener for a given event.

    Parameters

    • event: string | symbol
    • fn: ListenerFn
    • Optional context: any

    Returns Cubism4InternalModel

  • Remove the listeners of a given event.

    Parameters

    • event: string | symbol
    • Optional fn: ListenerFn
    • Optional context: any
    • Optional once: boolean

    Returns Cubism4InternalModel

Generated using TypeDoc