HoloLens 2 Gait Training
The purpose of this project is to create gait training application.
Loading...
Searching...
No Matches
AvatarAnimationState Class Reference

This class is used to control the avartar animation state. More...

Inheritance diagram for AvatarAnimationState:
Inheritance graph
Collaboration diagram for AvatarAnimationState:
Collaboration graph

Public Member Functions

void ResetAnimationLengthList ()
 Called after user click cancel pattern button in Noise UI. More...
 

Properties

List< float > AnimationLength [get]
 Property to get the Animation length (Read-Only) More...
 

Private Member Functions

void Awake ()
 Gets called first when script is invoked Cached the references to Animator, SetNoise and NoiseDataPanelTitle More...
 
void Start ()
 Cached a reference to ScaledNoisePatterns class. More...
 
void Update ()
 Gets called per each frame The CamMovementTracker singleton instance has speed and IsMoving Flags. When we are moving, we checked the noise pattern. By default it use pink noise. If user didn't add SD or mean, it use 1 as the default time to complete the animation( one gait cycle). Otherwise, it shrinks or expands the time to complete the gait animation cycle. More...
 
void ApplyCorrectNoisePattern ()
 Get the calculated noise pattern and apply that to animation speed. This noise will shrink or expand the time to complete the gait animation cycle. More...
 
void ResetNoiseAfterEnd (int noiseLength, string lbl)
 When we reached to the end of the colred noise list, we looped back to the beginning. More...
 
void OpenConfirmationDialogMedium ()
 Opens confirmation dialog example More...
 
void RunGaitCycle ()
 Expand and Shrink gait cycle animation The completion time of animation is the value of pink or white noise. More...
 
void StoreAnimationClipsLength ()
 Store the original animation clips values in a dictionary. More...
 
void LockdownAnimation ()
 Lockdown the animation until it played out. Animation will unlock after it complete the current loop. This event is mapped to animation event. More...
 
void UnlockAnimation ()
 Unlock the animation after it played out. Mapped to animation event. More...
 

Private Attributes

Animator m_Animator
 Reference to the animator
More...
 
SetNoise m_SetNoise
 Reference to the SetNoise Script. More...
 
NoiseController m_NoiseController
 Reference to NoiseController class. More...
 
int m_NoiseIndex
 Noise index for traveling the noise list. At the end of the travel, it will be reset to 0. More...
 
TextMeshPro m_NoiseDataPanelTitle
 This is also use as an error message display and current noise display. More...
 
string m_NoisePatternLbl = "Pink"
 To identify the current noise pattern. More...
 
bool m_IsAnimationLocked = false
 This flag is used to lock down the animation till it played out. More...
 
GameObject m_DialogPrefabMedium = null
 UI confirmation pop-up panel. More...
 
bool m_IdleElementFlag = false
 When Avatar goes to Idle, m_NoiseIndex will increment by 1. This will omit the next noise value from applying. We use this flag to prevent values being ommitted without applying. More...
 
int m_Counter = 1
 Use to apply previous noise after changing idle to moving. More...
 
List< float > m_AnimationLength = null
 This list stores timestamps of the animation length of the gait cycle. More...
 
Dictionary< string, float > m_OriginalAnimationLength
 This stores the length of the original gait cycle animations.
More...
 

Static Private Attributes

const float m_DefaultAnimationSpeed = 1.0f
 Default value of animation speed. More...
 

Detailed Description

This class is used to control the avartar animation state.

Definition at line 11 of file AvatarAnimationState.cs.

Member Function Documentation

◆ ApplyCorrectNoisePattern()

void AvatarAnimationState.ApplyCorrectNoisePattern ( )
inlineprivate

Get the calculated noise pattern and apply that to animation speed. This noise will shrink or expand the time to complete the gait animation cycle.

Definition at line 117 of file AvatarAnimationState.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Awake()

void AvatarAnimationState.Awake ( )
inlineprivate

Gets called first when script is invoked Cached the references to Animator, SetNoise and NoiseDataPanelTitle

Definition at line 65 of file AvatarAnimationState.cs.

◆ LockdownAnimation()

void AvatarAnimationState.LockdownAnimation ( )
inlineprivate

Lockdown the animation until it played out. Animation will unlock after it complete the current loop. This event is mapped to animation event.

Definition at line 245 of file AvatarAnimationState.cs.

Here is the call graph for this function:

◆ OpenConfirmationDialogMedium()

void AvatarAnimationState.OpenConfirmationDialogMedium ( )
inlineprivate

Opens confirmation dialog example

Definition at line 160 of file AvatarAnimationState.cs.

Here is the caller graph for this function:

◆ ResetAnimationLengthList()

void AvatarAnimationState.ResetAnimationLengthList ( )
inline

Called after user click cancel pattern button in Noise UI.

Definition at line 288 of file AvatarAnimationState.cs.

◆ ResetNoiseAfterEnd()

void AvatarAnimationState.ResetNoiseAfterEnd ( int  noiseLength,
string  lbl 
)
inlineprivate

When we reached to the end of the colred noise list, we looped back to the beginning.

Definition at line 146 of file AvatarAnimationState.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RunGaitCycle()

void AvatarAnimationState.RunGaitCycle ( )
inlineprivate

Expand and Shrink gait cycle animation The completion time of animation is the value of pink or white noise.

Returns

Definition at line 171 of file AvatarAnimationState.cs.

Here is the caller graph for this function:

◆ Start()

void AvatarAnimationState.Start ( )
inlineprivate

Cached a reference to ScaledNoisePatterns class.

Definition at line 77 of file AvatarAnimationState.cs.

Here is the call graph for this function:

◆ StoreAnimationClipsLength()

void AvatarAnimationState.StoreAnimationClipsLength ( )
inlineprivate

Store the original animation clips values in a dictionary.

Definition at line 214 of file AvatarAnimationState.cs.

Here is the caller graph for this function:

◆ UnlockAnimation()

void AvatarAnimationState.UnlockAnimation ( )
inlineprivate

Unlock the animation after it played out. Mapped to animation event.

Definition at line 257 of file AvatarAnimationState.cs.

◆ Update()

void AvatarAnimationState.Update ( )
inlineprivate

Gets called per each frame The CamMovementTracker singleton instance has speed and IsMoving Flags. When we are moving, we checked the noise pattern. By default it use pink noise. If user didn't add SD or mean, it use 1 as the default time to complete the animation( one gait cycle). Otherwise, it shrinks or expands the time to complete the gait animation cycle.

Definition at line 91 of file AvatarAnimationState.cs.

Here is the call graph for this function:

Field Documentation

◆ m_AnimationLength

List<float> AvatarAnimationState.m_AnimationLength = null
private

This list stores timestamps of the animation length of the gait cycle.

Definition at line 53 of file AvatarAnimationState.cs.

◆ m_Animator

Animator AvatarAnimationState.m_Animator
private

Reference to the animator

Definition at line 15 of file AvatarAnimationState.cs.

◆ m_Counter

int AvatarAnimationState.m_Counter = 1
private

Use to apply previous noise after changing idle to moving.

Definition at line 50 of file AvatarAnimationState.cs.

◆ m_DefaultAnimationSpeed

const float AvatarAnimationState.m_DefaultAnimationSpeed = 1.0f
staticprivate

Default value of animation speed.

Definition at line 38 of file AvatarAnimationState.cs.

◆ m_DialogPrefabMedium

GameObject AvatarAnimationState.m_DialogPrefabMedium = null
private

UI confirmation pop-up panel.

Definition at line 41 of file AvatarAnimationState.cs.

◆ m_IdleElementFlag

bool AvatarAnimationState.m_IdleElementFlag = false
private

When Avatar goes to Idle, m_NoiseIndex will increment by 1. This will omit the next noise value from applying. We use this flag to prevent values being ommitted without applying.

Definition at line 47 of file AvatarAnimationState.cs.

◆ m_IsAnimationLocked

bool AvatarAnimationState.m_IsAnimationLocked = false
private

This flag is used to lock down the animation till it played out.

Definition at line 35 of file AvatarAnimationState.cs.

◆ m_NoiseController

NoiseController AvatarAnimationState.m_NoiseController
private

Reference to NoiseController class.

Definition at line 21 of file AvatarAnimationState.cs.

◆ m_NoiseDataPanelTitle

TextMeshPro AvatarAnimationState.m_NoiseDataPanelTitle
private

This is also use as an error message display and current noise display.

Definition at line 29 of file AvatarAnimationState.cs.

◆ m_NoiseIndex

int AvatarAnimationState.m_NoiseIndex
private

Noise index for traveling the noise list. At the end of the travel, it will be reset to 0.

Definition at line 25 of file AvatarAnimationState.cs.

◆ m_NoisePatternLbl

string AvatarAnimationState.m_NoisePatternLbl = "Pink"
private

To identify the current noise pattern.

Definition at line 32 of file AvatarAnimationState.cs.

◆ m_OriginalAnimationLength

Dictionary<string, float> AvatarAnimationState.m_OriginalAnimationLength
private

This stores the length of the original gait cycle animations.

Definition at line 56 of file AvatarAnimationState.cs.

◆ m_SetNoise

SetNoise AvatarAnimationState.m_SetNoise
private

Reference to the SetNoise Script.

Definition at line 18 of file AvatarAnimationState.cs.

Property Documentation

◆ AnimationLength

List<float> AvatarAnimationState.AnimationLength
get

Property to get the Animation length (Read-Only)

Definition at line 59 of file AvatarAnimationState.cs.


The documentation for this class was generated from the following file: