ISkeletonViewer.d.ts 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import type { Skeleton } from "../Bones/skeleton";
  2. import type { Color3 } from "../Maths/math.color";
  3. /**
  4. * Defines the options associated with the creation of a SkeletonViewer.
  5. */
  6. export interface ISkeletonViewerOptions {
  7. /** Should the system pause animations before building the Viewer? */
  8. pauseAnimations: boolean;
  9. /** Should the system return the skeleton to rest before building? */
  10. returnToRest: boolean;
  11. /** public Display Mode of the Viewer */
  12. displayMode: number;
  13. /** Flag to toggle if the Viewer should use the CPU for animations or not? */
  14. displayOptions: ISkeletonViewerDisplayOptions;
  15. /** Flag to toggle if the Viewer should use the CPU for animations or not? */
  16. computeBonesUsingShaders: boolean;
  17. /** Flag ignore non weighted bones */
  18. useAllBones: boolean;
  19. }
  20. /**
  21. * Defines how to display the various bone meshes for the viewer.
  22. */
  23. export interface ISkeletonViewerDisplayOptions {
  24. /** How far down to start tapering the bone spurs */
  25. midStep?: number;
  26. /** How big is the midStep? */
  27. midStepFactor?: number;
  28. /** Base for the Sphere Size */
  29. sphereBaseSize?: number;
  30. /** The ratio of the sphere to the longest bone in units */
  31. sphereScaleUnit?: number;
  32. /** Ratio for the Sphere Size */
  33. sphereFactor?: number;
  34. /** Whether a spur should attach its far end to the child bone position */
  35. spurFollowsChild?: boolean;
  36. /** Whether to show local axes or not */
  37. showLocalAxes?: boolean;
  38. /** Length of each local axis */
  39. localAxesSize?: number;
  40. }
  41. /**
  42. * Defines the constructor options for the BoneWeight Shader.
  43. */
  44. export interface IBoneWeightShaderOptions {
  45. /** Skeleton to Map */
  46. skeleton: Skeleton;
  47. /** Colors for Uninfluenced bones */
  48. colorBase?: Color3;
  49. /** Colors for 0.0-0.25 Weight bones */
  50. colorZero?: Color3;
  51. /** Color for 0.25-0.5 Weight Influence */
  52. colorQuarter?: Color3;
  53. /** Color for 0.5-0.75 Weight Influence */
  54. colorHalf?: Color3;
  55. /** Color for 0.75-1 Weight Influence */
  56. colorFull?: Color3;
  57. /** Color for Zero Weight Influence */
  58. targetBoneIndex?: number;
  59. }
  60. /**
  61. * Simple structure of the gradient steps for the Color Map.
  62. */
  63. export interface ISkeletonMapShaderColorMapKnot {
  64. /** Color of the Knot */
  65. color: Color3;
  66. /** Location of the Knot */
  67. location: number;
  68. }
  69. /**
  70. * Defines the constructor options for the SkeletonMap Shader.
  71. */
  72. export interface ISkeletonMapShaderOptions {
  73. /** Skeleton to Map */
  74. skeleton: Skeleton;
  75. /** Array of ColorMapKnots that make the gradient must be ordered with knot[i].location < knot[i+1].location*/
  76. colorMap?: ISkeletonMapShaderColorMapKnot[];
  77. }