soonspacejs
Version:
soonspacejs 2.x
62 lines (61 loc) • 2.92 kB
TypeScript
import { CreateCurveAnimationClipOptions, BonePathAnimationOptions, AnimationOperate, BonePathAnimationInfo as CreateBonePathAnimationResult, CreateChainSkeletalModelOptions, CreateCurveAnimationClipForBonesOptions } from '@three3d/animation';
import type { Camera, Curve, Object3D, Skeleton } from 'three';
import { Vector3 } from 'three';
import type { IVector3 } from '../Interface';
import { Topology } from '../Library';
import { VectorMembersToIVectors } from '@three3d/tools';
import SoonSpace from '../index';
/**
* 动画的路径
* @remarks
* 可以是一组点,或者一个曲线 Curve,或者拓扑路径 Topology
*/
export type AnimationPath = IVector3[] | Curve<Vector3> | Topology;
/**
* 格式化动画路径信息
* @param path
* @returns
*/
export declare function formatAnimationPath(path: AnimationPath): {
curve?: Curve<Vector3> | undefined;
points?: Vector3[] | undefined;
};
export type CreatePathAnimationOptions = VectorMembersToIVectors<Omit<CreateCurveAnimationClipOptions, 'target' | 'curve' | 'points'>>;
export declare function createPathAnimation(target: Object3D, path: AnimationPath, ssp: SoonSpace, options?: CreatePathAnimationOptions): AnimationOperate;
export interface CreatePathAnimationActionForCameraOptions_Base {
/**
* 眼睛高度
*/
eyeHeight?: number;
}
export type CreatePathAnimationActionForCameraOptions = CreatePathAnimationActionForCameraOptions_Base & CreatePathAnimationOptions;
export declare function createPathAnimationActionForCamera(camera: Camera, path: IVector3[] | Curve<Vector3> | Topology, ssp: SoonSpace, options?: CreatePathAnimationActionForCameraOptions): AnimationOperate;
export type CreateBonePathAnimationOptions = VectorMembersToIVectors<Omit<BonePathAnimationOptions, 'mixer' | 'model'>>;
export type BonePathAnimationInfo = Omit<CreateBonePathAnimationResult, 'action'> & {
action: AnimationOperate;
};
/**
* 创建骨骼路径动画
* @param options
* @returns
*/
export declare function createBonePathAnimation(model: Object3D, path: AnimationPath, ssp: SoonSpace, options: CreateBonePathAnimationOptions): BonePathAnimationInfo;
/**
* 为指定的 模型 创建其对应的链式骨骼模型
* @param model
* @param options
* @returns
*/
export declare function createChainSkeletalModel(model: Object3D, options: Omit<CreateChainSkeletalModelOptions, 'target'>): {
skeletalModel: Object3D<import("three").Event<string, unknown>>;
skeleton: Skeleton;
};
/**
* 创建骨骼沿曲线路径运动的动画
* @remarks
* 纯 Bone 动画方案,不会在 target 上生成动画数据
*
* @param options
* @returns
*/
export declare function createPathAnimationForBones(model: Object3D, skeleton: Skeleton, ssp: SoonSpace, options: Omit<CreateCurveAnimationClipForBonesOptions, 'target'>): AnimationOperate | undefined;