forked from Jibo-Revival-Group/JiboOs
126 lines
4.0 KiB
JavaScript
126 lines
4.0 KiB
JavaScript
|
|
/**
|
||
|
|
* Class used by Animation Utilities to provide playback
|
||
|
|
* of keys files.
|
||
|
|
* @class KeysData
|
||
|
|
* @memberof jibo.rendering.animation
|
||
|
|
* @extends EventEmitter
|
||
|
|
* @param {String} id The name of the keys file.
|
||
|
|
* @param {String} src The absolute path of the keys file.
|
||
|
|
* @param {String} cache The name of the cache the data was originally loaded into.
|
||
|
|
*/
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Asset Pack name.
|
||
|
|
* @name jibo.rendering.animation.KeysData#assetPack
|
||
|
|
* @type {String}
|
||
|
|
*/
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Resource root for animation (defaults to root of skill).
|
||
|
|
* @name jibo.rendering.animation.KeysData#root
|
||
|
|
* @type {String}
|
||
|
|
*/
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Source path of animation data
|
||
|
|
* @name jibo.rendering.animation.KeysData#src
|
||
|
|
* @type {String}
|
||
|
|
*/
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Source path of corresponding `.anim`, if present/valid.
|
||
|
|
* @name jibo.rendering.animation.KeysData#dotAnimSrc
|
||
|
|
* @type {String}
|
||
|
|
*/
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Name of the initial cache this data was loaded into. Used when determining animation options.
|
||
|
|
* @name jibo.rendering.animation.KeysData#cache
|
||
|
|
* @type {String}
|
||
|
|
*/
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Map of Timeline objects.
|
||
|
|
* @name jibo.rendering.animation.KeysData#timelines
|
||
|
|
* @type {Object}
|
||
|
|
*/
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Map of PIXI.Texture objects.
|
||
|
|
* @name jibo.rendering.animation.KeysData#textures
|
||
|
|
* @type {Object}
|
||
|
|
*/
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Map of Sound objects.
|
||
|
|
* @name jibo.rendering.animation.KeysData#sounds
|
||
|
|
* @type {Object}
|
||
|
|
*/
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Name of the keys file.
|
||
|
|
* @name jibo.rendering.animation.KeysData#id
|
||
|
|
* @type {String}
|
||
|
|
*/
|
||
|
|
|
||
|
|
/**
|
||
|
|
* The keys animation data.
|
||
|
|
* @name jibo.rendering.animation.KeysData#data
|
||
|
|
* @type {Object}
|
||
|
|
* @private
|
||
|
|
*/
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Add a sound to the animation for playing.
|
||
|
|
* @method jibo.rendering.animation.KeysData#addSound
|
||
|
|
* @param {String} id The ID of the sound
|
||
|
|
* @param {jibo.sound.Sound} sound Instance of sound.
|
||
|
|
*/
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Add a timeline to the animation for playing.
|
||
|
|
* @method jibo.rendering.animation.KeysData#addTimeline
|
||
|
|
* @param {String} id The ID of the timeline
|
||
|
|
* @param {jibo.rendering.animation.Timeline} timeline Instance of timeline.
|
||
|
|
*/
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Add a PIXI texture to the animation for playback.
|
||
|
|
* @method jibo.rendering.animation.KeysData#addTexture
|
||
|
|
* @param {String} id The ID of the texture
|
||
|
|
* @param {PIXI.Texture} texture Instance of texture.
|
||
|
|
*/
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Create a shallow clean copy of this KeysAnimation object resetting all state.
|
||
|
|
* This should be used when retrieving a keys animation object from cache
|
||
|
|
* Note: Any clean copy should always be destroyed after use
|
||
|
|
* @param {CloneOptions<DOFSet>} options Options for animation instantiation/playback.
|
||
|
|
* @method jibo.rendering.animation.KeysData#getCleanCopy
|
||
|
|
* @return {Promise<jibo.rendering.animation.KeysData>}
|
||
|
|
*/
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Create and immediately play a KeysAnimation from this KeysData.
|
||
|
|
* Event handlers for `stopped`, `cancelled`, `rejected`, and other animation events must be registered to the
|
||
|
|
* animation instance immediately (in-stack) upon promise resolution, or else they may be missed.
|
||
|
|
* @param {CloneOptions<DOFSet>} [options] Options for animation instantiation/playback.
|
||
|
|
* @param {string} [requestor] The system making the animation playback request.
|
||
|
|
* @method jibo.rendering.animation.KeysData#getAndPlayAnim
|
||
|
|
* @return {Promise<jibo.rendering.animation.KeysAnimation>}
|
||
|
|
*/
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Destroy the keys data completely.
|
||
|
|
* @method jibo.rendering.animation.KeysData#destroy
|
||
|
|
*/
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Create an animation options from keyframes data or a keyframes file.
|
||
|
|
* In the case of keyframes data, DOF values are computed and passed to the expression service.
|
||
|
|
* In the case of a keyframes file, the path to a file of DOF values computed from the keyframes file is passed
|
||
|
|
* to the expression service.
|
||
|
|
* @method jibo.rendering.animation.KeysData#createAnimOptions
|
||
|
|
* @return {AnimationOptions<DOFSet>}
|
||
|
|
* @private
|
||
|
|
*/
|