Class: AvatarAnimation

AvatarAnimation(avatar)

Helper to figure out which animation to use, based on names of animation groups. Most important ones are idle and walk. Used by AvatarController and BotController.

Constructor

new AvatarAnimation(avatar)

Parameters:
Name Type Description
avatar Avatar
Source:

Classes

AvatarAnimation

Members

animationNames

Names of all animations availalbe
Source:

animations

Animation metadata, TODO extract to its own class, document all fields
Source:

avatar :Avatar

Type:
Source:

improvise

If this is true, processText() may trigger animations
Source:

otherAnimations

Animations other than idle/walk/run
Source:

Methods

canWalk()

Do we know walk animation?
Source:

idle()

Source:
Returns:
animation metadata object for idle, object.group is actual AnimationGroup

processAnimations()

Called from constructor to find walk and idle animations.
Source:

processText(text)

Process what user/bot said and see if there's any meaningful avatar animation to trigger.
Parameters:
Name Type Description
text string
Source:
Returns:
babylon AnimationGroup or null

walk()

Source:
Returns:
animation metadata object for walk, object.group is actual AnimationGroup