Interface PathAnimateModuleOptions

interface PathAnimateModuleOptions {
    animation?: {
        autoPlay?: boolean;
        delay?: number;
        duration: number;
        easing?: Easing;
        id?: string;
        onComplete?: ((target, isEnd, isStop) => void);
        onProgress?: ((target, key, start, end, alpha, reversed) => boolean | void);
        onStart?: ((target) => void);
        onUpdate?: ((target) => void);
        repeatForever?: boolean;
        repeatTimes?: number;
        tag?: string;
        yoyoForever?: boolean;
        yoyoTimes?: number;
    };
    animatorIndex?: number;
    autoCompleteWhenExit?: boolean;
    cameraFollow?: boolean;
    discretePointsNum?: number;
    euler?: Euler;
    followAngle?: number;
    followDist?: number;
    isAutoChangeDir?: boolean;
    offsetAngle?: number;
    paths: [number, number, number][] | Vector3[];
    quatLerpT?: number;
    startAimatorClipName?: string;
    stopAimatorClipName?: string;
    target?: Object3D<Object3DEventMap>;
}

Properties

animation?: {
    autoPlay?: boolean;
    delay?: number;
    duration: number;
    easing?: Easing;
    id?: string;
    onComplete?: ((target, isEnd, isStop) => void);
    onProgress?: ((target, key, start, end, alpha, reversed) => boolean | void);
    onStart?: ((target) => void);
    onUpdate?: ((target) => void);
    repeatForever?: boolean;
    repeatTimes?: number;
    tag?: string;
    yoyoForever?: boolean;
    yoyoTimes?: number;
}

动画属性

Type declaration

  • Optional autoPlay?: boolean

    自动播放动画,默认是

  • Optional delay?: number

    延迟时长

  • duration: number

    持续时长 默认5000 五秒

  • Optional easing?: Easing

    easing 默认 linear

  • Optional id?: string

    id

  • Optional onComplete?: ((target, isEnd, isStop) => void)

    动画完成回调.

    Param: target

    对象.

    Param: isEnd

    是否整个动画都结束了

    Param: isStop

    是否强制终止了

      • (target, isEnd, isStop): void
      • 动画完成回调.

        Parameters

        • target: any

          对象.

        • isEnd: boolean

          是否整个动画都结束了

        • isStop: boolean

          是否强制终止了

        Returns void

  • Optional onProgress?: ((target, key, start, end, alpha, reversed) => boolean | void)
      • (target, key, start, end, alpha, reversed): boolean | void
      • Parameters

        Returns boolean | void

  • Optional onStart?: ((target) => void)
      • (target): void
      • Parameters

        • target: any

        Returns void

  • Optional onUpdate?: ((target) => void)
      • (target): void
      • Parameters

        • target: any

        Returns void

  • Optional repeatForever?: boolean

    重复循环

  • Optional repeatTimes?: number

    重复次数

  • Optional tag?: string

    分类

  • Optional yoyoForever?: boolean

    是否往返循环

  • Optional yoyoTimes?: number

    往返次数

animatorIndex?: number

动画模块索引 如果有动画模块时,默认为0

autoCompleteWhenExit?: boolean

退出模块时自动完成动画 默认false

cameraFollow?: boolean

是否相机跟随

discretePointsNum?: number

路径离散的点数 默认 300

euler?: Euler

模型朝向偏移欧拉角,如果上面的 offsetAngle 不能满足时,可用这个

followAngle?: number

相机跟随时距离模型角度 默认 35

followDist?: number

相机跟随时距离模型距离 默认模型高度的5倍

isAutoChangeDir?: boolean

动画往返运行时模型是否自动改变方向 默认true

offsetAngle?: number

模型朝向偏移角度 默认0

paths: [number, number, number][] | Vector3[]

路径点坐标

quatLerpT?: number

模型转弯时方向平滑值 0-1 默认1

startAimatorClipName?: string

运行时动画名称 为空时停止所有动作

stopAimatorClipName?: string

停止时动画名称 为空时停止所有动作

target?: Object3D<Object3DEventMap>

运行的目标对象,默认当前实体