import type { Material } from "@babylonjs/core/Materials/material"; import type { Nullable } from "@babylonjs/core/types"; import { MmdAnimationBase } from "../../Loader/Animation/mmdAnimationBase"; import type { ILogger } from "../../Loader/Parser/ILogger"; import type { IMmdModel } from "../IMmdModel"; import type { IMmdRuntimeLinkedBone } from "../IMmdRuntimeLinkedBone"; import type { MmdMorphControllerBase } from "../mmdMorphControllerBase"; import type { IMmdBindableModelAnimation } from "./IMmdBindableAnimation"; import type { BodyIndices, IMmdRuntimeModelAnimationWithBindingInfo, MorphIndices } from "./IMmdRuntimeAnimation"; import { MmdRuntimeAnimation } from "./mmdRuntimeAnimation"; /** * Mmd runtime model animation * * An object with mmd animation and model binding information */ export declare class MmdRuntimeModelAnimation extends MmdRuntimeAnimation implements IMmdRuntimeModelAnimationWithBindingInfo { /** * The animation data */ readonly animation: MmdAnimationBase; /** * Bone bind index map */ readonly boneBindIndexMap: readonly Nullable[]; /** * Movable bone bind index map */ readonly movableBoneBindIndexMap: readonly Nullable[]; private readonly _morphController; /** * Morph bind index map */ readonly morphBindIndexMap: readonly Nullable[]; private readonly _meshes; /** * IK solver bind index map */ readonly ikSolverBindIndexMap: Int32Array; private readonly _ikSolverStates; /** * Bone to body bind index map * * the length of the array is `boneBindIndexMap.length + movableBoneBindIndexMap.length` * * first `boneBindIndexMap.length` elements are for bone tracks, and the rest are for movable bone tracks */ readonly boneToBodyBindIndexMap: readonly Nullable[]; private readonly _rigidBodyStates; private _materialRecompileInduceInfo; private constructor(); private static readonly _BonePositionA; private static readonly _BonePositionB; private static readonly _BonePosition; private static readonly _BoneRotationA; private static readonly _BoneRotationB; /** * Update animation * @param frameTime Frame time in 30fps */ animate(frameTime: number): void; /** * Induce material recompile * * This method must run once before the animation runs * * This method prevents frame drop during animation by inducing properties to be recompiled that are used in morph animation * @param updateMorphTarget Whether to update morph target manager numMaxInfluencers * @param logger logger */ induceMaterialRecompile(updateMorphTarget: boolean, logger?: ILogger): void; /** * Bind animation to model and prepare material for morph animation * @param animation Animation to bind * @param model Bind target * @param retargetingMap Animation bone name to model bone name map * @param logger Logger * @return MmdRuntimeModelAnimation instance */ static Create(animation: MmdAnimationBase, model: IMmdModel, retargetingMap?: { [key: string]: string; }, logger?: ILogger): MmdRuntimeModelAnimation; /** * Induce material recompile * * This method prevents frame drop during animation by inducing properties to be recompiled that are used in morph animation * * This method is exposed as public because it must be overrideable * * If you are using a material other than `MmdStandardMaterial`, you must implement this method yourself * @param materials Materials * @param morphController Morph controller * @param morphIndices Morph indices to induce recompile * @param logger logger */ static InduceMaterialRecompile: (materials: readonly Material[], morphController: MmdMorphControllerBase, morphIndices: readonly Nullable[], logger?: ILogger) => void; } declare module "../../Loader/Animation/mmdAnimationBase" { interface MmdAnimationBase extends IMmdBindableModelAnimation { } }