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"
Defined in
webgi/src/plugins/CustomAnimationHelperPlugin.ts:12
enabled
• enabled: boolean
Overrides
Defined in
webgi/src/plugins/CustomAnimationHelperPlugin.ts:11
helperIdentities
• helperIdentities: Map
<any
, any
>
It stores all the helpers as the value with its appropriate names as the key
Defined in
webgi/src/plugins/CustomAnimationHelperPlugin.ts:17
_dirty
• Protected
_dirty: boolean
= false
Inherited from
Defined in
webgi/src/core/AViewerPlugin.ts:23
_viewer
• Protected
Optional
_viewer: ViewerApp
Inherited from
Defined in
webgi/src/core/AViewerPlugin.ts:27
Accessors
dirty
• get
dirty(): boolean
Returns
boolean
Inherited from
AViewerPlugin.dirty
Defined in
webgi/src/core/AViewerPlugin.ts:16
• set
dirty(value
): void
Parameters
Name | Type |
---|---|
value | boolean |
Returns
void
Inherited from
AViewerPlugin.dirty
Defined in
webgi/src/core/AViewerPlugin.ts:20
viewer
• get
viewer(): undefined
| TViewer
Returns
undefined
| TViewer
Inherited from
AViewerPlugin.viewer
Defined in
webgi/src/core/AViewerPlugin.ts:29
Methods
onDispose
▸ onDispose(viewer
): Promise
<void
>
Parameters
Name | Type |
---|---|
viewer | ViewerApp |
Returns
Promise
<void
>
Inherited from
Defined in
webgi/src/core/AViewerPlugin.ts:40
onRemove
▸ onRemove(viewer
): Promise
<void
>
Parameters
Name | Type |
---|---|
viewer | ViewerApp |
Returns
Promise
<void
>
Inherited from
Defined in
webgi/src/core/AViewerPlugin.ts:44
toJSON
▸ toJSON(meta?
): any
Parameters
Name | Type |
---|---|
meta? | any |
Returns
any
Inherited from
Defined in
webgi/src/core/AViewerPlugin.ts:49
fromJSON
▸ fromJSON(data
, meta?
): null
| CustomAnimationHelperPlugin
| Promise
<null
| CustomAnimationHelperPlugin
>
Parameters
Name | Type |
---|---|
data | any |
meta? | any |
Returns
null
| CustomAnimationHelperPlugin
| Promise
<null
| CustomAnimationHelperPlugin
>
Inherited from
Defined in
webgi/src/core/AViewerPlugin.ts:56
exportState
▸ exportState(): any
Returns
any
Inherited from
Defined in
webgi/src/core/AViewerPlugin.ts:68
importState
▸ importState(state
): Promise
<void
>
Parameters
Name | Type |
---|---|
state | any |
Returns
Promise
<void
>
Inherited from
Defined in
webgi/src/core/AViewerPlugin.ts:71
storeState
▸ storeState(prefix?
, storage?
, data?
): void
Parameters
Name | Type |
---|---|
prefix? | string |
storage? | Storage |
data? | any |
Returns
void
Inherited from
Defined in
webgi/src/core/AViewerPlugin.ts:78
loadState
▸ loadState(prefix?
, storage?
): Promise
<void
>
Parameters
Name | Type |
---|---|
prefix? | string |
storage? | Storage |
Returns
Promise
<void
>
Inherited from
Defined in
webgi/src/core/AViewerPlugin.ts:88
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
Defined in
webgi/src/plugins/CustomAnimationHelperPlugin.ts:27
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 <Event , string > | 3d model to pass on |
Returns
void
Defined in
webgi/src/plugins/CustomAnimationHelperPlugin.ts:45
getAnimationClips
▸ getAnimationClips(id
): any
returns the animationClips of the 3D model
Parameters
Name | Type | Description |
---|---|---|
id | string | helper name of the model |
Returns
any
Defined in
webgi/src/plugins/CustomAnimationHelperPlugin.ts:61
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
>
Defined in
webgi/src/plugins/CustomAnimationHelperPlugin.ts:77
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
>
Defined in
webgi/src/plugins/CustomAnimationHelperPlugin.ts:89
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
>
Defined in
webgi/src/plugins/CustomAnimationHelperPlugin.ts:101
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
>
Defined in
webgi/src/plugins/CustomAnimationHelperPlugin.ts:116
_storeKey
▸ Protected
_storeKey(prefix?
): string
Parameters
Name | Type |
---|---|
prefix? | string |
Returns
string
Inherited from
Defined in
webgi/src/core/AViewerPlugin.ts:64
Constructors
constructor
• new CustomAnimationHelperPlugin()