Class: CustomAnimationHelperPlugin
Plugins.CustomAnimationHelperPlugin
AnimationHelperPlugin is used internally by plugins to keep track of all helpers and allows to animate its clips For internal use only at the moment.
Hierarchy
AViewerPlugin<"">↳
CustomAnimationHelperPlugin
Properties
PluginType
▪ Static Readonly PluginType: "AnimationHelperPlugin"
enabled
• enabled: boolean
Overrides
helperIdentities
• helperIdentities: Map<any, any>
It stores all the helpers as the value with its appropriate names as the key
_dirty
• Protected _dirty: boolean = false
Inherited from
_viewer
• Protected Optional _viewer: ViewerApp
Inherited from
Accessors
dirty
• get dirty(): boolean
Returns
boolean
Inherited from
AViewerPlugin.dirty
• set dirty(value): void
Parameters
| Name | Type |
|---|---|
value | boolean |
Returns
void
Inherited from
AViewerPlugin.dirty
viewer
• get viewer(): undefined | ViewerApp
Returns
undefined | ViewerApp
Inherited from
AViewerPlugin.viewer
Methods
onDispose
▸ onDispose(viewer): Promise<void>
Parameters
| Name | Type |
|---|---|
viewer | ViewerApp |
Returns
Promise<void>
Inherited from
onRemove
▸ onRemove(viewer): Promise<void>
Parameters
| Name | Type |
|---|---|
viewer | ViewerApp |
Returns
Promise<void>
Inherited from
toJSON
▸ toJSON(meta?): any
Parameters
| Name | Type |
|---|---|
meta? | any |
Returns
any
Inherited from
fromJSON
▸ fromJSON(data, meta?): null | CustomAnimationHelperPlugin | Promise<null | CustomAnimationHelperPlugin>
Parameters
| Name | Type |
|---|---|
data | any |
meta? | any |
Returns
null | CustomAnimationHelperPlugin | Promise<null | CustomAnimationHelperPlugin>
Inherited from
exportState
▸ exportState(): any
Returns
any
Inherited from
importState
▸ importState(state): Promise<void>
Parameters
| Name | Type |
|---|---|
state | any |
Returns
Promise<void>
Inherited from
storeState
▸ storeState(prefix?, storage?, data?): void
Parameters
| Name | Type |
|---|---|
prefix? | string |
storage? | Storage |
data? | any |
Returns
void
Inherited from
loadState
▸ loadState(prefix?, storage?): Promise<void>
Parameters
| Name | Type |
|---|---|
prefix? | string |
storage? | Storage |
Returns
Promise<void>
Inherited from
onAdded
▸ onAdded(viewer): Promise<void>
It is used by Parent Class(no need to change the parameter)
Parameters
| Name | Type | Description |
|---|---|---|
viewer | ViewerApp | default viewer that is maintained through out the api(no need to change the parameter) |
Returns
Promise<void>
Overrides
createHelper
▸ createHelper(id, model): void
Creates a new AnimationHelper that manages its own state
Parameters
| Name | Type | Description |
|---|---|---|
id | string | helper name of the model |
model | Object3D<Object3DEventMap> | 3d model to pass on |
Returns
void
getAnimationClips
▸ getAnimationClips(id): any
returns the animationClips of the 3D model
Parameters
| Name | Type | Description |
|---|---|---|
id | string | helper name of the model |
Returns
any
playClip
▸ playClip(id, clip, loop, timescale?, reverse?, resetTime?): Promise<void>
Plays the single clip from the Helper of a 3D model
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
id | string | undefined | helper name of 3D model |
clip | AnimationClip | undefined | Animation Clip of the 3D model that needs to be played |
loop | boolean | undefined | default is 'false', if the clip needs to be looped continously then set it to 'true' |
timescale | number | 1 | timescale of the animation clip that will played. Default is 1 |
reverse | boolean | false | to reverse the clip set it to true. Default is false |
resetTime | boolean | false | resets the mixer time. Default is false |
Returns
Promise<void>
playAllAnimations
▸ playAllAnimations(id, loop): Promise<void>
Plays all the animation clips that are present in the 3D model
Parameters
| Name | Type | Description |
|---|---|---|
id | string | helper name of 3D model |
loop | boolean | default is 'false', if the clip needs to be looped continously then set it to 'true' |
Returns
Promise<void>
playAllAnimationsInReverse
▸ playAllAnimationsInReverse(id, loop): Promise<void>
Reverses all the animation clips that are present in the 3D model
Parameters
| Name | Type | Description |
|---|---|---|
id | string | helper name of 3D model |
loop | boolean | default is 'false', if the clip needs to be looped continously then set it to 'true' |
Returns
Promise<void>
playAnimationByName
▸ playAnimationByName(id, name, loop, timescale?, reverse?): Promise<void>
Plays the clip by its name from the Helper of a 3D model
Parameters
| Name | Type | Default value | Description |
|---|---|---|---|
id | string | undefined | helper name of 3D model |
name | string | undefined | name of the animation clip that is present in 3D model |
loop | false | undefined | default is 'false', if the clip needs to be looped continously then set it to 'true' |
timescale | number | 1 | timescale of the animation clip that will played. Default is 1 |
reverse | boolean | false | to reverse the clip set it to true. Default is false |
Returns
Promise<void>
_storeKey
▸ Protected _storeKey(prefix?): string
Parameters
| Name | Type |
|---|---|
prefix? | string |
Returns
string
Inherited from
Constructors
constructor
• new CustomAnimationHelperPlugin()