glTFLoaderAnimation.d.ts 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import { Animation } from "@babylonjs/core/Animations/animation.js";
  2. import { Quaternion, Vector3 } from "@babylonjs/core/Maths/math.vector.js";
  3. import type { INode } from "./glTFLoaderInterfaces";
  4. import type { IAnimatable } from "@babylonjs/core/Animations/animatable.interface.js";
  5. /** @internal */
  6. export type GetValueFn = (target: any, source: Float32Array, offset: number, scale: number) => any;
  7. /** @internal */
  8. export declare function getVector3(_target: any, source: Float32Array, offset: number, scale: number): Vector3;
  9. /** @internal */
  10. export declare function getQuaternion(_target: any, source: Float32Array, offset: number, scale: number): Quaternion;
  11. /** @internal */
  12. export declare function getWeights(target: INode, source: Float32Array, offset: number, scale: number): Array<number>;
  13. /** @internal */
  14. export declare abstract class AnimationPropertyInfo {
  15. readonly type: number;
  16. readonly name: string;
  17. readonly getValue: GetValueFn;
  18. readonly getStride: (target: any) => number;
  19. /** @internal */
  20. constructor(type: number, name: string, getValue: GetValueFn, getStride: (target: any) => number);
  21. protected _buildAnimation(name: string, fps: number, keys: any[]): Animation;
  22. /** @internal */
  23. abstract buildAnimations(target: any, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
  24. }
  25. /** @internal */
  26. export declare class TransformNodeAnimationPropertyInfo extends AnimationPropertyInfo {
  27. /** @internal */
  28. buildAnimations(target: INode, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
  29. }
  30. /** @internal */
  31. export declare class WeightAnimationPropertyInfo extends AnimationPropertyInfo {
  32. buildAnimations(target: INode, name: string, fps: number, keys: any[], callback: (babylonAnimatable: IAnimatable, babylonAnimation: Animation) => void): void;
  33. }
  34. /** @internal */
  35. export declare const nodeAnimationData: {
  36. translation: TransformNodeAnimationPropertyInfo[];
  37. rotation: TransformNodeAnimationPropertyInfo[];
  38. scale: TransformNodeAnimationPropertyInfo[];
  39. weights: WeightAnimationPropertyInfo[];
  40. };