import Joint from './Joint'; import Texture2D from './Texture2D'; import BoundingBox from './math/BoundingBox'; import type ClayNode from './Node'; import type Geometry from './Geometry'; import TrackAnimator from './animation/TrackAnimator'; /** * @constructor clay.Skeleton */ declare class Skeleton { /** * Relative root node that not affect transform of joint. */ relativeRootNode?: ClayNode; /** * Name */ name: string; /** * joints */ joints: Joint[]; /** * bounding box with bound geometry. */ boundingBox?: BoundingBox; private _animations; private _invBindPoseMatricesArray?; private _jointMatricesSubArrays?; private _skinMatricesArray?; private _skinMatricesSubArrays?; private _subSkinMatricesArray?; private _jointsBoundingBoxes?; private _skinMatricesTexture?; constructor(name?: string); /** * Add a skinning clip and create a map between clip and skeleton * @param animator * @param mapRule Map between joint name in skeleton and joint name in clip */ addAnimator(animator: TrackAnimator, mapRule?: Record): number | undefined; /** * @param animator */ removeAnimator(animator: TrackAnimator): void; /** * Remove all clips */ removeAnimatorsAll(): void; /** * Get animator by index * @param index */ getAnimator(index: number): TrackAnimator | undefined; /** * Return clips number */ getAnimatorsCount(): number; /** * Calculate joint matrices from node transform * @function */ updateJointMatrices(): void; /** * Update boundingBox of each joint bound to geometry. * ASSUME skeleton and geometry joints are matched. * @param {clay.Geometry} geometry */ updateJointsBoundingBoxes(geometry: Geometry): void; setJointMatricesArray(arr: Float32Array): void; updateMatricesSubArrays(): void; /** * Update skinning matrices */ update(): void; getSubSkinMatrices(meshId: number, joints: number[]): Float32Array; getSubSkinMatricesTexture(meshId: number, joints: number[]): Texture2D; getSkinMatricesTexture(): Texture2D | undefined; _setPose(): void; clone(clonedNodesMap: Record): Skeleton; } export default Skeleton;